yagop / telegram-bot

UNMAINTAINED - A Telegram Bot based on plugins
GNU General Public License v2.0
848 stars 502 forks source link

Send message when invited into a group #199

Closed dausruddin closed 9 years ago

dausruddin commented 9 years ago

It will be fun if the bot send message like "Thanks you for inviting me" or something like that when invited into a group.

rockneurotiko commented 9 years ago

Please see issue #169 and PR #178

dausruddin commented 9 years ago

@rockneurotiko my request is little bit different.. The issues you referred me is to welcome a new user. What I want is, the bot send a message when entered a new group. Example:

Group: Hola User: John Bot: TGBot

User John invite TGBot into group Hola. Then when TGBot entered the new group, TGBot automatically send a message "Thanks for inviting me into your wonderful group."

rockneurotiko commented 9 years ago

Oh, yeah, I readed bad (it's so early here and I'm sleepy XD)

dausruddin commented 9 years ago

hehe.. no problem :P

rockneurotiko commented 9 years ago

Can someone tell me the action name when this happens? Just have to uncomment this line (L17), invite the bot to a group and paste the json dumped in the terminal :smile: I can't do it (no other one to invite me to a group :'(

soend commented 9 years ago

Ok, i did what you asked and the only json what appears is this one:

{
  action = {
    type = "chat_add_user",
    user = {
      first_name = "FirstName",
      flags = 264,
      id = 53765452,
      phone = "**************",
      print_name = "PrintName",
      type = "user",
      username = "E******"
    }
  },
  date = 1432839108,
  flags = 8449,
  from = {
    access_hash = 1,
    first_name = "soend",
    flags = 257,
    id = 57467904,
    phone = "**********",
    print_name = "soend",
    type = "user",
    username = "soend"
  },
  id = "126586",
  out = false,
  service = true,
  to = {
    flags = 256,
    id = 12917376,
    members_num = 4,
    print_name = "Bot_test",
    title = "Bot test",
    type = "chat"
  },
  unread = true
}
dausruddin commented 9 years ago

@rockneurotiko the action is just like when other user added into a group. But instead, it will print the bot's username, print_name, id, and phone

dausruddin commented 9 years ago

Did some modifications to plugin service_entergroup and it works like a charm. Thanks 😁😁