Advertisement
IAMNEW322432

Untitled

Aug 11th, 2023
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. const prefix = "un:";
  2. const botname = "unbojih2020 bot (" + prefix + "help)";
  3. const version = "0.5.0"
  4. var help = "__unbojih2020 bot Commands__\ngv:help, un:say {TEXT}, un:joke, un:fact, un:botinfo, un:roominfo, un:image {IMAGE}";
  5. var botinfo = "unbojih2020 bot Version " + version + ". Find bot at: https://pastebin.com/jCXcEgeY";
  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/1088703405976977439/1120841485290574004/unbojih2020.webp"]})},3200);
  16. setTimeout(() => {
  17. sendMsg("unbojih2020 bot is online. Type " + prefix + "help to see commands.");
  18. setInterval( () => {sendMsg("unbojih2020 bot 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