feat: add Delete type #35

Merged
amovah merged 1 commits from master into master 2017-09-12 08:20:40 +00:00
2 changed files with 20 additions and 1 deletions
Showing only changes of commit 65900e3252 - Show all commits

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;
}
}