soumyadeep/ReactItBotPublic · Bot Template

A Telegram bot that automatically replies to keywords with text or media in groups. Easy to set up and perfect for FAQs, community management, and automated responses.

ProfileTelegram
8 commands0 envUpdated 15h agoCreated Jun 7, 2026
Back to folder

commands/_add.js

javascript · 118 lines · click line # to share

1/**#command2name: /add3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12if(chat.type == "private"){13  Api.sendMessage({14    text: "Group only command"15  });16  return;17}18if(!(await isAdmin())){19  Api.sendMessage({20    text: "❌ Admin only",21    reply_to_message_id: msg.message_id22  });23  return;24}25let keyword = params.split(" ")[0]?.toLowerCase();26 27if(!keyword){28  Api.sendMessage({29    text: "Usage:\n/add keyword\nor reply media and use /add keyword"30  });31  return;32}33 34let filters = Bot.get("filters_" + chat.id) || {};35 36if(request.reply_to_message){37 38  let r = request.reply_to_message;39 40  if(r.photo){41 42    filters[keyword] = {43      type: "photo",44      file_id: r.photo[r.photo.length - 1].file_id,45      caption: r.caption || ""46    };47 48  }else if(r.video){49 50    filters[keyword] = {51      type: "video",52      file_id: r.video.file_id,53      caption: r.caption || ""54    };55 56  }else if(r.document){57 58    filters[keyword] = {59      type: "document",60      file_id: r.document.file_id,61      caption: r.caption || ""62    };63 64  }else if(r.audio){65 66    filters[keyword] = {67      type: "audio",68      file_id: r.audio.file_id,69      caption: r.caption || ""70    };71 72  }else if(r.voice){73 74    filters[keyword] = {75      type: "voice",76      file_id: r.voice.file_id77    };78 79  }else if(r.sticker){80 81    filters[keyword] = {82      type: "sticker",83      file_id: r.sticker.file_id84    };85 86  }else{87 88    filters[keyword] = {89      type: "text",90      text: r.text || ""91    };92 93  }94 95}else{96 97  let text = params.substring(keyword.length).trim();98 99  if(!text){100    Api.sendMessage({101      text: "Reply text missing"102    });103    return;104  }105 106  filters[keyword] = {107    type: "text",108    text: text109  };110 111}112 113Bot.set("filters_" + chat.id, filters, "json");114 115Api.sendMessage({116  text: "✅ Filter saved: " + keyword,117  reply_to_message_id: msg.message_id118});