GochoMugo / tgfancy

A Fancy, Higher-Level Wrapper for Telegram Bot API
MIT License
184 stars 16 forks source link

Add fanciness: delete multiple messages #13

Open GochoMugo opened 7 years ago

GochoMugo commented 7 years ago
bot.deleteMessages(chatID, [msgID1, msgID2, msgID3,  /* ... msgIDN */]);
References:
milad145 commented 7 years ago

@GochoMugo hi, i use node-telegram-bot-api i used deleteMessage in my bot but the deleteMessage only can delete bot's message, not message that user sent to bot, is it possible to delete user message from bot

GochoMugo commented 7 years ago

@milad145 Please look at the documentation at https://core.telegram.org/bots/api#deletemessage.

milad145 commented 7 years ago

@GochoMugo documentation say :

Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- Bots can delete outgoing messages in groups and supergroups.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
Returns True on success.

but i means the message that user send to bot directly not in channel or group users work with bot directly, when i try to delete that message, i get error

Error: ETELEGRAM: 400 Bad Request: message can't be deleted

wojpawlik commented 7 years ago

@milad145 private chats and groups are special. There is no one total history. Instead, each member has his own copy of history, and he can remove whatever he wants from it without other parties noticing.

milad145 commented 7 years ago

@GingerPlusPlus thanks

GochoMugo commented 7 years ago

Thanks @GingerPlusPlus :+1: