Telegram Bot

/newbot
  • Enable join bot to a group
/setjoingroups
  • Add command menu list to bot (command name is lowercase)
/setcommands
  • Enable access to all message in group (seletect DISABLE)
/setprivacy
  • Add the bot to a group
- Create new group
- Add bot to group
- Set bot as admin
- Set member permission to disable dont send
  • Get userid, chat info
- Send message to bot
- Request https://api.telegram.org/botXXX:YYYY/getUpdates
{"ok":true,"result":[{"update_id":xxxxxxxxx,
"message":{"message_id":aaa,"from":{"id":yyyyyyyyy,"is_bot":false,"first_name":"Nhan","last_name":"Cao","username":"nhancv","language_code":"en"},"chat":{"id":zzzzzzzzz,"title”:"XXXXXGroup","type":"group","all_members_are_administrators":true},"date":1567181681,"text":"Test"}}]}

- Look at 
"chat": { "id": zzzzzzzzz, ….
+ chat.id is channel id

"from": { "id": yyyyyyyyy,….
+ from.id is user id

*In case Bot send direct to user chat.id = from.id = userid

Leave a Reply

Your email address will not be published.Required fields are marked *