A simple telegram feedback bot written in Typescript Deno using Grammy inspired from Livegram Bot.
This bot can forward private message to targeted group or supergroup after added as admin.
From
const dc = await ctx.forwardMessage(Env.group_id); //Forward message to SUDO group or supergroup.
await kv.set(
["messages", dc.message_id.toString()],
{
message_id: dc.message_id.toString(),
user_id: id.toString(),
name: first_name,
},
{ expireIn: 7 * 24 * 60 * 60 * 1000 }
); //Expires after 7 daysTo
const dc = await ctx.forwardMessage(Env.group_id); //Forward message to SUDO group or supergroup.
await kv.set(["messages", dc.message_id.toString()], {
message_id: dc.message_id.toString(),
user_id: id.toString(),
name: first_name,
}); //Not expire-
Only admin or SUDO users can reply back to forwarded message.
-
Supported replies
- animation 🪄
- audio 🔉
- contact 🤳
- document 📄
- location 🌍
- photo 🖼️
- text
🅰️ - sticker 🎨
- video 🎥
- video_note 🎥📝
- voice 🎤
- You can add more...
-
Using Deno KV for low latency.
Example of environment variables
| Name | Example | Required |
|---|---|---|
| BOT_TOKEN | 10030303:xuzissjsljsl | ✅ |
| ADMIN_IDS | 109091122,2982282982 | ✅ |
| GROUP_ID | -100388398398 | ✅ |
Commands avilable in bot
- ✅ => Available for both admins and users
- ❌ => Available for admins only
| Command | Description | Permission |
|---|---|---|
| start | Start the bot | ✅ |
| export | Export list of user_id or message_id as csv | ❌ |
-
Example usage of Export command
- Export user_ids
/export usersor/export - Export message_ids
/export messages
- Export user_ids
Must installed Deno in your system
deno task devdeno task startMake a GET request to API
https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://<DEPLOYMENT_URL>.deno.dev/<BOT_TOKEN>