--- Creates an alias command

function Util.MakeAliasCommand(name, commandString)
	return {
		Name = name,
		Aliases = {},
		Description = commandString,
		Group = "UserAlias",
		Args = {
			{
				Type = "string",
				Name = "Argument 1",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 2",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 3",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 4",
				Description = "",
				Default = ""
			},
			{
				Type = "string",
				Name = "Argument 5",
				Description = "",
				Default = ""
			}
		},
		Run = function(context, ...)
			local args = {...}
			local commands = Util.SplitStringSimple(commandString, "&&")

			for i, command in ipairs(commands) do
				local output = context.Dispatcher:EvaluateAndRun(
					Util.RunEmbeddedCommands(
						context.Dispatcher,
						Util.SubstituteArgs(command, args)
					)
				)
				if i == #commands then
					return output -- return last command's output
				else
					context:Reply(output)
				end
			end

			return ""
		end
	}
end
