Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const prefix = "c!";
- const botname = "catBOT (" + prefix + "help)";
- const version = "0.4.3"
- var help = "__catBOT Commands__\nb!help, b!say {TEXT}, b!joke, b!fact, b!botinfo, b!roominfo, b!image {IMAGE}";
- var botinfo = "catBOT Version " + version + ". Find catBOT at: ";
- function sendMsg(msg){
- setTimeout(() => {
- socket.emit("talk",{text: msg});
- },1100);
- }
- setTimeout(() => {socket.emit("command",{list:["name",botname]})},1000);
- setTimeout(() => {socket.emit("command",{list:["name",botname]})},2100);
- setTimeout(() => {socket.emit("command",{list:["color","https://cdn.discordapp.com/attachments/1093836050234880020/1139236503529193512/image44.png"]})},3200);
- setTimeout(() => {
- sendMsg("catBOT is online. Type " + prefix + "help to see commands.");
- setInterval( () => {sendMsg("catBOT is online. Type " + prefix + "help to see commands.");},60000);
- },4300);
- socket.on("talk", (message) => {
- if(message.text == prefix + "roominfo"){
- sendMsg("Amount of users in the room: " + window.usersAmt);
- }
- if(message.text == prefix + "help"){
- sendMsg(help);
- }
- if(message.text == prefix + "botinfo"){
- sendMsg(botinfo);
- }
- if(message.text.startsWith(prefix + "say")){
- sendMsg(message.text.substring(prefix.length + 3));
- }
- if(message.text.startsWith(prefix + "image")){
- let imgUrl = message.text.substring(prefix.length + 6);
- setTimeout(() => {socket.emit("command",{list:["image",imgUrl]});},1100);
- }
- if(message.text == prefix + "joke"){
- setTimeout(() => {socket.emit("command",{list:["joke"]});},1100);
- }
- if(message.text == prefix + "fact"){
- setTimeout(() => {socket.emit("command",{list:["fact"]});},1100);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement