@ -5,6 +5,7 @@ export default function poll(bot) {
|
||||
}
|
||||
bot.emit('update', response.result);
|
||||
|
||||
if (bot._stop) return null;
|
||||
return poll(bot);
|
||||
});
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ export default function webhook(options = {}, bot) {
|
||||
|
||||
return bot.api.setWebhook(options.url).then(() => {
|
||||
|
||||
https.createServer(options.server, (req, res) => {
|
||||
bot._webhookServer = https.createServer(options.server, (req, res) => {
|
||||
return getBody(req).then(data => {
|
||||
bot.emit('update', qs.parse(data).result);
|
||||
|
||||
|
Reference in New Issue
Block a user