Fixed a bug in AIR
This commit is contained in:
parent
b4d0f9ea54
commit
07501e7fa0
|
@ -1,6 +1,7 @@
|
||||||
--rewrite this lib (P.S: done)
|
--rewrite this lib (P.S: done)
|
||||||
--P.S: air stands for Advanced Input Recognition, although technically it's not all that advanced
|
--P.S: air stands for Advanced Input Recognition, although technically it's not all that advanced
|
||||||
local parse_string = require("string_parse")
|
local parse_string = require("string_parse")
|
||||||
|
local table_utils = require("table-utils")
|
||||||
air = {}
|
air = {}
|
||||||
object_types = {
|
object_types = {
|
||||||
["voiceChannel"] = function(id,client,guild_id)
|
["voiceChannel"] = function(id,client,guild_id)
|
||||||
|
@ -105,7 +106,7 @@ object_types = {
|
||||||
|
|
||||||
air.parse = function(string,argmatch,client,guild_id)
|
air.parse = function(string,argmatch,client,guild_id)
|
||||||
local strings = parse_string(string,"[\"']")
|
local strings = parse_string(string,"[\"']")
|
||||||
local argmatch = argmatch or {}
|
local argmatch = table_utils.shallowcopy(argmatch or {})
|
||||||
local tokens,args,opts = {},{},{}
|
local tokens,args,opts = {},{},{}
|
||||||
-- Tokenize
|
-- Tokenize
|
||||||
for k,v in pairs(strings) do
|
for k,v in pairs(strings) do
|
||||||
|
|
|
@ -305,6 +305,24 @@ local c_adminSpeak = command("adminSpeak", {
|
||||||
})
|
})
|
||||||
plugin:add_command(c_adminSpeak)
|
plugin:add_command(c_adminSpeak)
|
||||||
|
|
||||||
|
local c_adminSendToChannel = command("adminSendToChannel", {
|
||||||
|
category = "Utilities",
|
||||||
|
args = {
|
||||||
|
"textChannel",
|
||||||
|
"string"
|
||||||
|
},
|
||||||
|
exec = function(msg,args,opts)
|
||||||
|
local channel = args[1]
|
||||||
|
table.remove(args,1)
|
||||||
|
local text = table.concat(args," ")
|
||||||
|
channel:send(text)
|
||||||
|
end,
|
||||||
|
perms = {
|
||||||
|
"mentionEveryone"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
plugin:add_command(c_adminSendToChannel)
|
||||||
|
|
||||||
local c_echo = command("echo",{
|
local c_echo = command("echo",{
|
||||||
category = "Utilities",
|
category = "Utilities",
|
||||||
args = {
|
args = {
|
||||||
|
@ -317,6 +335,21 @@ local c_echo = command("echo",{
|
||||||
})
|
})
|
||||||
plugin:add_command(c_echo)
|
plugin:add_command(c_echo)
|
||||||
|
|
||||||
|
local c_sendToChannel = command("sendToChannel",{
|
||||||
|
category = "Utilities",
|
||||||
|
args = {
|
||||||
|
"textChannel",
|
||||||
|
"string"
|
||||||
|
},
|
||||||
|
exec = function(msg,args,opts)
|
||||||
|
local channel = args[1]
|
||||||
|
table.remove(args,1)
|
||||||
|
local text = purify.purify_pings(msg, table.concat(args," "))
|
||||||
|
channel:send(text)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
plugin:add_command(c_sendToChannel)
|
||||||
|
|
||||||
local c_pingself = command("pingself",{
|
local c_pingself = command("pingself",{
|
||||||
category = "Utilities",
|
category = "Utilities",
|
||||||
args = {
|
args = {
|
||||||
|
|
Loading…
Reference in New Issue