Artboxbonzu

Untitled

Nov 19th, 2025
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. const prefix = "-";
  2. const botname = "Russian AI -help";
  3. const version = "1.3 Rev 2";
  4. var help = "__CannyBOT Plus! Commands__\n -help, -joke, -fact, -image {IMAGE_URL}, -ideo {VIDEO_URL};
  5. var botinfo = "CannyBOT Plus! " + version + ". Find CannyBOT at: https://pastebin.com/Sc5Cmbgt";
  6.  
  7. const incrediblerollPics = [
  8. "https://files.catbox.moe/v0mxbg.webp",
  9. "https://files.catbox.moe/izfkxh.webp",
  10. "https://files.catbox.moe/5q07go.webp",
  11. "https://files.catbox.moe/665r5b.webp",
  12. "https://files.catbox.moe/2wz8ad.webp",
  13. "https://files.catbox.moe/zvzle8.webp",
  14. "https://files.catbox.moe/aa4d80.webp",
  15. "https://files.catbox.moe/7gozo2.webp",
  16. "https://files.catbox.moe/n5l39h.webp",
  17. "https://files.catbox.moe/qd0afv.webp",
  18. "https://files.catbox.moe/a16k2j.webp",
  19. "https://files.catbox.moe/fbxd4k.webp",
  20. "https://files.catbox.moe/2cww78.webp",
  21. "https://files.catbox.moe/kjn9uw.webp",
  22. "https://files.catbox.moe/r3av42.webp", // Phase8fallen.webp
  23. "https://files.catbox.moe/oifvls.webp", // Phase7fallen.webp
  24. "https://files.catbox.moe/s49aj4.webp", // Phase6fallen.webp
  25. "https://files.catbox.moe/quv090.webp", // gMr_Incredible_29.webp
  26. "https://files.catbox.moe/3jamvh.webp",
  27. "https://files.catbox.moe/eb7dpw.png"
  28. ];
  29.  
  30. function getRandomPic(picsArray) {
  31. const randomIndex = Math.floor(Math.random() * picsArray.length);
  32. return picsArray[randomIndex];
  33. }
  34.  
  35. function sendMsg(msg) {
  36. setTimeout(() => {
  37. socket.emit("talk", { text: msg });
  38. }, 1100);
  39. }
  40.  
  41. setTimeout(() => {
  42. socket.emit("command", { list: ["name", "CannyBOT Plus! playing: ca!help"] });
  43. }, 1000);
  44. setTimeout(() => {
  45. socket.emit("command", { list: ["color", "https://media.discordapp.net/attachments/1079083903433846836/1127298039825059970/i-tools.png"] });
  46. }, 2100);
  47. setTimeout(() => {
  48. sendMsg("CannyBOT Plus! is online. Type " + prefix + "help to see commands.");
  49. setInterval(() => {
  50. sendMsg("CannyBOT Plus! is online. Type " + prefix + "help to see commands.");
  51. }, 60000);
  52. }, 3200);
  53.  
  54. socket.on("talk", function (message) {
  55. if (message.text === prefix + "help") {
  56. sendMsg(help);
  57. } else if (message.text === prefix + "joke") {
  58. setTimeout(() => {
  59. socket.emit("command", { list: ["joke"] });
  60. }, 1100);
  61. } else if (message.text === prefix + "fact") {
  62. setTimeout(() => {
  63. socket.emit("command", { list: ["fact"] });
  64. }, 1100);
  65. } else if (message.text.startsWith(prefix + "image")) {
  66. const imageUrl = message.text.substring(prefix.length + 6);
  67. setTimeout(() => {
  68. socket.emit("command", { list: ["image", imageUrl] });
  69. }, 1100);
  70. } else if (message.text === prefix + "incredibleroll") {
  71. const randomPic = getRandomPic(incrediblerollPics);
  72. setTimeout(() => {
  73. socket.emit("command", { list: ["image", randomPic] });
  74. }, 1100);
  75. } else if (message.text.startsWith(prefix + "weather")) {
  76. const location = message.text.substring(prefix.length + 8);
  77. getWeather(location);
  78. } else if (message.text === prefix + "roominfo") {
  79. sendMsg("Amount of users in the room: " + window.usersAmt);
  80. } else if (message.text === prefix + "version") {
  81. sendMsg(botinfo);
  82. } else if (message.text.startsWith(prefix + "video")) {
  83. const videoUrl = message.text.substring(prefix.length + 6);
  84. setTimeout(() => {
  85. socket.emit("command", { list: ["video", videoUrl] });
  86. }, 1100);
  87. } else if (message.text.startsWith(prefix + "crosscolor")) {
  88. const crosscolorUrl = message.text.substring(prefix.length + 11);
  89. setTimeout(() => {
  90. socket.emit("command", { list: ["crosscolor", crosscolorUrl] });
  91. }, 1100);
  92. } else if (message.text === prefix + "default") {
  93. setTimeout(() => {
  94. socket.emit("command", { list: ["crosscolor", "https://media.discordapp.net/attachments/1079083903433846836/1127298039825059970/i-tools.png"] });
  95. }, 1100);
  96. }
  97. });
  98.  
  99. function getWeather(location) {
  100. const apiKey = "dcc6b2a3fa3d4fe58d9193316232905";
  101. const apiUrl = `https://api.weatherapi.com/v1/current.json?key=${apiKey}&q=${encodeURIComponent(location)}`;
  102.  
  103. fetch(apiUrl)
  104. .then((response) => response.json())
  105. .then((data) => {
  106. if (data.error) {
  107. sendMsg("Unable to retrieve weather information. Please check the location.");
  108. } else {
  109. const weather = data.current;
  110. const weatherInfo = `Weather in ${data.location.name}, ${data.location.country}:\nCondition: ${weather.condition.text}\nTemperature: ${weather.temp_c}°C\nHumidity: ${weather.humidity}%\nWind Speed: ${weather.wind_kph} km/h\n`;
  111. sendMsg(weatherInfo);
  112. }
  113. })
  114. .catch((error) => {
  115. console.error("Error:", error);
  116. sendMsg("An error occurred while retrieving weather information.");
  117. });
  118. }
  119.  
Add Comment
Please, Sign In to add comment