Merge pull request #35 from amovah/master

feat: add Delete type
This commit is contained in:
Mahdi Dibaiee 2017-09-12 12:50:40 +04:30 committed by GitHub
commit c80ee4b938
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;
}
}