feat: add Delete type

This commit is contained in:
Ali Movahedi 2017-09-12 11:10:13 +04:30
parent bf0e71854b
commit 65900e3252
2 changed files with 20 additions and 1 deletions

View File

@ -26,7 +26,7 @@ API.prototype.request = function request(method, data) {
const methods = ['getMe', 'sendMessage', 'forwardMessage', 'sendPhoto', const methods = ['getMe', 'sendMessage', 'forwardMessage', 'sendPhoto',
'sendAudio', 'sendDocument', 'sendSticker', 'sendVideo', 'sendAudio', 'sendDocument', 'sendSticker', 'sendVideo',
'sendLocation', 'sendChatAction', 'getUserProfilePhotos', 'sendLocation', 'sendChatAction', 'getUserProfilePhotos',
'getUpdates', 'setWebhook']; 'getUpdates', 'setWebhook', 'deleteMessage'];
methods.forEach(method => { methods.forEach(method => {
API.prototype[method] = function(data) { //eslint-disable-line API.prototype[method] = function(data) { //eslint-disable-line

19
src/types/Delete.js Normal file
View File

@ -0,0 +1,19 @@
import Base from './Base';
export default class Message extends Base {
constructor(properties = {}) {
super('deleteMessage');
this.properties = properties;
}
from(chat) {
this.properties.chat_id = chat;
return this;
}
id(id) {
this.properties.message_id = id;
return this;
}
}