mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-29 13:27:44 +00:00
Implement 'leaveChat'
Notes: Merge branch 'feature/leaveChat' of https://github.com/GochoMugo/node-telegram-bot-api into pr/186 References: * PR #186: https://github.com/yagop/node-telegram-bot-api/pull/186
This commit is contained in:
parent
dcc3d481e4
commit
394f363465
@ -796,6 +796,19 @@ class TelegramBot extends EventEmitter {
|
|||||||
};
|
};
|
||||||
return this._request('getChatMember', { form });
|
return this._request('getChatMember', { form });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leave a group, supergroup or channel.
|
||||||
|
* @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
|
||||||
|
* @return {Promise}
|
||||||
|
* @see https://core.telegram.org/bots/api#leavechat
|
||||||
|
*/
|
||||||
|
leaveChat(chatId) {
|
||||||
|
const form = {
|
||||||
|
chat_id: chatId
|
||||||
|
};
|
||||||
|
return this._request('leaveChat', { form });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = TelegramBot;
|
module.exports = TelegramBot;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user