feat: add Delete type #35
@ -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
19
src/types/Delete.js
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user