Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- sqlite GetDB()
- void SetStartupScript(pastebintag)
- void SetEvent(key, func) : MSG, TICK
- ]]
- local UserType = {};
- UserType[0] = "Viewer";
- UserType[1] = "Moderator";
- UserType[2] = "GlobalModerator";
- UserType[3] = "Broadcaster";
- UserType[4] = "Admin";
- UserType[5] = "Staff";
- local commands = {};
- local msgdata={};
- function GetMessageData()
- return msgdata;
- end
- commands["!kitsunebot"] = function(rest,data)
- if data.DisplayName:lower() ~= "terrahkitsune" then
- print("HeyGuys "..data.DisplayName);
- return;
- end
- local func,error = load(rest);
- if type(func)=="function" then
- local ok, error = pcall(func);
- if not ok then
- Send(tostring(error));
- end
- elseif not func then
- Send(error);
- end
- end
- local function CMD(data)
- local cmd, cmddata = data.Message:match("^(.-) (.-)$");
- if not cmd then
- cmd = data.Message;
- end
- local exe = commands[cmd:lower()];
- if exe then
- exe(cmddata,data);
- return true;
- else
- return false;
- end
- end
- SetEvent("MSG", function(data)
- msgdata = data;
- CMD(data);
- print(data.DisplayName .." ("..UserType[data.UserType].."): "..data.Message);
- end);
- SetEvent("TICK", function()
- end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement