Advertisement
IAMNEW322432

catbot tms

Aug 13th, 2023 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. const prefix = "c!";
  2. const botname = "catBOT (" + prefix + "help)";
  3. const version = "0.4.3"
  4. var help = "__catBOT Commands__\nb!help, b!say {TEXT}, b!joke, b!fact, b!botinfo, b!roominfo, b!image {IMAGE}";
  5. var botinfo = "catBOT Version " + version + ". Find catBOT at: https://pastebin.com/HjhR2ycP";
  6.  
  7. function sendMsg(msg){
  8. setTimeout(() => {
  9. socket.emit("talk",{text: msg});
  10. },1100);
  11. }
  12.  
  13. setTimeout(() => {socket.emit("command",{list:["name",botname]})},1000);
  14. setTimeout(() => {socket.emit("command",{list:["name",botname]})},2100);
  15. setTimeout(() => {socket.emit("command",{list:["color","https://cdn.discordapp.com/attachments/1093836050234880020/1139236503529193512/image44.png"]})},3200);
  16. setTimeout(() => {
  17. sendMsg("catBOT is online. Type " + prefix + "help to see commands.");
  18. setInterval( () => {sendMsg("catBOT is online. Type " + prefix + "help to see commands.");},60000);
  19. },4300);
  20.  
  21. socket.on("talk", (message) => {
  22. if(message.text == prefix + "roominfo"){
  23. sendMsg("Amount of users in the room: " + window.usersAmt);
  24. }
  25. if(message.text == prefix + "help"){
  26. sendMsg(help);
  27. }
  28. if(message.text == prefix + "botinfo"){
  29. sendMsg(botinfo);
  30. }
  31. if(message.text.startsWith(prefix + "say")){
  32. sendMsg(message.text.substring(prefix.length + 3));
  33. }
  34. if(message.text.startsWith(prefix + "image")){
  35. let imgUrl = message.text.substring(prefix.length + 6);
  36. setTimeout(() => {socket.emit("command",{list:["image",imgUrl]});},1100);
  37. }
  38. if(message.text == prefix + "joke"){
  39. setTimeout(() => {socket.emit("command",{list:["joke"]});},1100);
  40. }
  41. if(message.text == prefix + "fact"){
  42. setTimeout(() => {socket.emit("command",{list:["fact"]});},1100);
  43. }
  44. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement