nonogamer9

GembleBOT (a unique bot for bonziworld)

Nov 21st, 2025 (edited)
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.91 KB | Source Code | 0 0
  1. const prefix = "gem!";
  2. const botname = "GembleBOT " + prefix + "help";
  3. const version = "1.0.0";
  4. var help = `__GembleBOT Commands__
  5. • gem!help — Shows this help message.
  6. • gem!gamble — Play the gemble game.
  7.  
  8. __Rules of Gemble:__
  9. The rules of gemble are simple: you just try your luck with gem!gamble
  10. If you see a not-so-friendly image, you lose the game.
  11. However, there is a slight chance you will win!
  12. Try your luck and see if fortune smiles upon you.
  13. `;
  14.  
  15. var botinfo = "GembleBOT " + version + ". Developed for gamble image rolls.";
  16.  
  17. const incrediblerollPics = [
  18.   "https://files.catbox.moe/eb7dpw.png",
  19.   "https://files.catbox.moe/ua1659.jpeg",
  20.   "https://files.catbox.moe/86tuil.jpeg",
  21.   "https://files.catbox.moe/jtnvby.png",
  22.   "https://files.catbox.moe/mtmb1h.png",
  23.   "https://files.catbox.moe/o9no9b.png",
  24.   "https://files.catbox.moe/3mnyrz.png",
  25.   "https://files.catbox.moe/sngqgz.jpeg",
  26.   "https://files.catbox.moe/evnmg6.png"
  27. ];
  28.  
  29. function getRandomPic(picsArray) {
  30.   const randomIndex = Math.floor(Math.random() * picsArray.length);
  31.   return picsArray[randomIndex];
  32. }
  33.  
  34. function sendMsg(msg) {
  35.   setTimeout(() => {
  36.     socket.emit("talk", { text: msg });
  37.   }, 1100);
  38. }
  39.  
  40. setTimeout(() => {
  41.   socket.emit("command", { list: ["name", botname] });
  42. }, 1000);
  43.  
  44. setTimeout(() => {
  45.   sendMsg("GembleBOT is online. Type " + prefix + "help to see available commands.");
  46.   setInterval(() => {
  47.     sendMsg("GembleBOT is online. Type " + prefix + "help to see available commands.");
  48.   }, 60000);
  49. }, 3200);
  50.  
  51. socket.on("talk", function (message) {
  52.   if (message.text === prefix + "help") {
  53.     sendMsg(help);
  54.   } else if (message.text === prefix + "gamble") {
  55.     const randomPic = getRandomPic(incrediblerollPics);
  56.     setTimeout(() => {
  57.       socket.emit("command", { list: ["image", randomPic] });
  58.     }, 1100);
  59.   } else if (message.text === prefix + "version") {
  60.     sendMsg(botinfo);
  61.   }
  62. });
  63.  
Add Comment
Please, Sign In to add comment