adityajat/GuessWordle_botPublic · Bot Template
AIWordle BOT appears to be a Telegram automation bot. Commands include /start, /*, /new, /help, /end. Observed in code: messaging, keyboards, games, payments.
Utilityutility
5 commands0 envUpdated 1mo agoCreated Sep 15, 2026
commands/_end.js
javascript · 87 lines
1/**#command2name: /end3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// Get User and Chat IDs safely13let uId = (typeof user !== "undefined" && user) ? (user.telegram_id || user.id) : null;14let cId = (typeof chat !== "undefined" && chat) ? chat.id : uId;15 16// Access session data using Bot properties17let activeWord = Bot.getProperty("wordle_word_" + cId);18 19if (!activeWord) {20 Bot.sendMessage({ text: "There is no active Wordle game to end!" });21 return;22}23 24// Clear Session Function25function clearGameSession() {26 Bot.setProperty("wordle_word_" + cId, null, "json");27 Bot.setProperty("wordle_guesses_" + cId, null, "json");28 Bot.setProperty("end_votes_" + cId, null, "json");29}30 31// Check if Private Chat32let isPrivate = (typeof chat !== "undefined" && chat) ? (chat.chat_type === "private" || chat.type === "private") : true;33 34if (isPrivate) {35 clearGameSession();36 Bot.sendMessage({37 text: "🛑 <b>Game Ended!</b>\n\nThe secret word was: <b>" + String(activeWord).toUpperCase() + "</b>\n\nYour stats are safe! Start a new game with /new.",38 parse_mode: "HTML"39 });40 return;41}42 43// Check Group Admin Status44let isAdmin = false;45if (typeof user !== "undefined" && user && user.status) {46 if (user.status === "administrator" || user.status === "creator") {47 isAdmin = true;48 }49}50 51if (isAdmin) {52 clearGameSession();53 Bot.sendMessage({54 text: "🛑 <b>Game Ended by Admin!</b>\n\nThe secret word was: <b>" + String(activeWord).toUpperCase() + "</b>",55 parse_mode: "HTML"56 });57 return;58}59 60// Non-Admin 3-Vote Quorum61let votes = Bot.getProperty("end_votes_" + cId) || [];62 63if (votes.indexOf(uId) !== -1) {64 Bot.sendMessage({65 text: "⚠️ You have already voted to end this game!\n\nCurrent votes: <b>" + votes.length + "/3</b>",66 parse_mode: "HTML"67 });68 return;69}70 71votes.push(uId);72Bot.setProperty("end_votes_" + cId, votes, "json");73 74if (votes.length >= 3) {75 clearGameSession();76 Bot.sendMessage({77 text: "🛑 <b>Game Ended by Community Vote (3/3)!</b>\n\nThe secret word was: <b>" + String(activeWord).toUpperCase() + "</b>",78 parse_mode: "HTML"79 });80} else {81 let userName = (user && user.first_name) ? user.first_name : "A member";82 let needed = 3 - votes.length;83 Bot.sendMessage({84 text: "🗳️ <b>" + userName + "</b> voted to end the game.\n\nCurrent Votes: <b>" + votes.length + "/3</b>\nNeed <b>" + needed + "</b> more vote(s) (or 1 admin vote) to end it!",85 parse_mode: "HTML"86 });87}