Skip to content

Commit

Permalink
[Add] Stickers replies
Browse files Browse the repository at this point in the history
  • Loading branch information
the-AjK committed Apr 4, 2018
1 parent 6a9f1d9 commit 1d3f2a6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/telegram/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,27 @@ function textManager(ctx) {
msg = bender.getRandomTagQuote(["hi", "fuck", "ass"]);
//reset session counter to start answer politely again
ctx.session.mainCounter = 0;
replyDiscussion(ctx, msg)
ctx.replyWithSticker({
source: require('fs').createReadStream(__dirname + "/../../img/11.webp")
}).then(() => {
replyDiscussion(ctx, msg);
});
} else {
replyDiscussion(ctx, msg, keyboards.btb(ctx).opts)
ctx.replyWithSticker({
source: require('fs').createReadStream(__dirname + "/../../img/0" + getRandomInt(1, 10) +".webp")
}).then(() => {
replyDiscussion(ctx, msg, keyboards.btb(ctx).opts)
});
}
}
};

function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min; //Il max è escluso e il min è incluso
}

function parseMention(ctx) {
//ctx.message.entities = [ { offset: 0, length: 7, type: 'mention' } ]
let mentions = [];
Expand Down

0 comments on commit 1d3f2a6

Please sign in to comment.