Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added copyMessage method #220

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ Use this method to send text messages.

Use this method to forward messages of any kind.

##### `copyMessage(<chat_id>, <from_chat_id>, <message_id>, {notification})`

Use this method to copy messages of any kind.

##### `deleteMessage(<chat_id>, <from_message_id>)`

Use this method to delete a message. A message can only be deleted if it was sent less than 48 hours ago. Any such sent outgoing message may be deleted. Additionally, if the bot is an administrator in a group chat, it can delete any message. If the bot is an administrator of a supergroup or channel, it can delete ordinary messages from any other user, including service messages about people added or removed from the chat. Returns *True* on success.
Expand Down
5 changes: 5 additions & 0 deletions lib/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const methods = {
if (opt.resize === true) markup['resize_keyboard'] = true;
if (opt.once === true) markup['one_time_keyboard'] = true;
if (opt.remove === true) markup['remove_keyboard'] = true;
if (opt.persistent === true) markup['is_persistent'] = true;
if (opt.selective) markup['selective'] = opt.selective;
return markup;
},
Expand Down Expand Up @@ -72,6 +73,10 @@ const methods = {
arguments: ['chat_id', 'from_chat_id', 'message_id']
},

copyMessage: {
arguments: ['chat_id', 'from_chat_id', 'message_id']
},

sendPhoto(chat_id, photo, opt) {
return sendFile.call(this, 'photo', photo, opt, {chat_id});
},
Expand Down