Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const prefix = "-";
- const botname = "Russian AI -help";
- const version = "1.3 Rev 2";
- var help = "__CannyBOT Plus! Commands__\n -help, -joke, -fact, -image {IMAGE_URL}, -ideo {VIDEO_URL};
- var botinfo = "CannyBOT Plus! " + version + ". Find CannyBOT at: https://pastebin.com/Sc5Cmbgt";
- const incrediblerollPics = [
- "https://files.catbox.moe/v0mxbg.webp",
- "https://files.catbox.moe/izfkxh.webp",
- "https://files.catbox.moe/5q07go.webp",
- "https://files.catbox.moe/665r5b.webp",
- "https://files.catbox.moe/2wz8ad.webp",
- "https://files.catbox.moe/zvzle8.webp",
- "https://files.catbox.moe/aa4d80.webp",
- "https://files.catbox.moe/7gozo2.webp",
- "https://files.catbox.moe/n5l39h.webp",
- "https://files.catbox.moe/qd0afv.webp",
- "https://files.catbox.moe/a16k2j.webp",
- "https://files.catbox.moe/fbxd4k.webp",
- "https://files.catbox.moe/2cww78.webp",
- "https://files.catbox.moe/kjn9uw.webp",
- "https://files.catbox.moe/r3av42.webp", // Phase8fallen.webp
- "https://files.catbox.moe/oifvls.webp", // Phase7fallen.webp
- "https://files.catbox.moe/s49aj4.webp", // Phase6fallen.webp
- "https://files.catbox.moe/quv090.webp", // gMr_Incredible_29.webp
- "https://files.catbox.moe/3jamvh.webp",
- "https://files.catbox.moe/eb7dpw.png"
- ];
- function getRandomPic(picsArray) {
- const randomIndex = Math.floor(Math.random() * picsArray.length);
- return picsArray[randomIndex];
- }
- function sendMsg(msg) {
- setTimeout(() => {
- socket.emit("talk", { text: msg });
- }, 1100);
- }
- setTimeout(() => {
- socket.emit("command", { list: ["name", "CannyBOT Plus! playing: ca!help"] });
- }, 1000);
- setTimeout(() => {
- socket.emit("command", { list: ["color", "https://media.discordapp.net/attachments/1079083903433846836/1127298039825059970/i-tools.png"] });
- }, 2100);
- setTimeout(() => {
- sendMsg("CannyBOT Plus! is online. Type " + prefix + "help to see commands.");
- setInterval(() => {
- sendMsg("CannyBOT Plus! is online. Type " + prefix + "help to see commands.");
- }, 60000);
- }, 3200);
- socket.on("talk", function (message) {
- if (message.text === prefix + "help") {
- sendMsg(help);
- } else if (message.text === prefix + "joke") {
- setTimeout(() => {
- socket.emit("command", { list: ["joke"] });
- }, 1100);
- } else if (message.text === prefix + "fact") {
- setTimeout(() => {
- socket.emit("command", { list: ["fact"] });
- }, 1100);
- } else if (message.text.startsWith(prefix + "image")) {
- const imageUrl = message.text.substring(prefix.length + 6);
- setTimeout(() => {
- socket.emit("command", { list: ["image", imageUrl] });
- }, 1100);
- } else if (message.text === prefix + "incredibleroll") {
- const randomPic = getRandomPic(incrediblerollPics);
- setTimeout(() => {
- socket.emit("command", { list: ["image", randomPic] });
- }, 1100);
- } else if (message.text.startsWith(prefix + "weather")) {
- const location = message.text.substring(prefix.length + 8);
- getWeather(location);
- } else if (message.text === prefix + "roominfo") {
- sendMsg("Amount of users in the room: " + window.usersAmt);
- } else if (message.text === prefix + "version") {
- sendMsg(botinfo);
- } else if (message.text.startsWith(prefix + "video")) {
- const videoUrl = message.text.substring(prefix.length + 6);
- setTimeout(() => {
- socket.emit("command", { list: ["video", videoUrl] });
- }, 1100);
- } else if (message.text.startsWith(prefix + "crosscolor")) {
- const crosscolorUrl = message.text.substring(prefix.length + 11);
- setTimeout(() => {
- socket.emit("command", { list: ["crosscolor", crosscolorUrl] });
- }, 1100);
- } else if (message.text === prefix + "default") {
- setTimeout(() => {
- socket.emit("command", { list: ["crosscolor", "https://media.discordapp.net/attachments/1079083903433846836/1127298039825059970/i-tools.png"] });
- }, 1100);
- }
- });
- function getWeather(location) {
- const apiKey = "dcc6b2a3fa3d4fe58d9193316232905";
- const apiUrl = `https://api.weatherapi.com/v1/current.json?key=${apiKey}&q=${encodeURIComponent(location)}`;
- fetch(apiUrl)
- .then((response) => response.json())
- .then((data) => {
- if (data.error) {
- sendMsg("Unable to retrieve weather information. Please check the location.");
- } else {
- const weather = data.current;
- 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`;
- sendMsg(weatherInfo);
- }
- })
- .catch((error) => {
- console.error("Error:", error);
- sendMsg("An error occurred while retrieving weather information.");
- });
- }
Add Comment
Please, Sign In to add comment