Who asked 2.0

not replying to messages without content, with attachments or embeds
This commit is contained in:
ZyLacx 2022-09-08 20:39:50 +02:00
parent 45affbf744
commit 96e00b5b85
3 changed files with 22 additions and 8 deletions

15
kokocina.js Normal file
View file

@ -0,0 +1,15 @@
h(1)
h(2)
h(3)
h(0)
function h(n) {
console.log(7*(5**n)+9+g(n))
}
function g(n) {
if (n == 0) {
return 0
}
return 9*7*(5**(n-1))+g(n-1)
}

View file

@ -98,13 +98,10 @@ function gotMessage(message) {
debugger_.debug(message);
}
/**
* kokot v piči
const chance = help.RNG(50000);
if (chance == 420) {
resp.whoAsked(message);
}
*/
const msg = message.content.toLowerCase();

View file

@ -19,9 +19,11 @@ function mood(message) {
}
async function whoAsked(message) {
if (message.embeds.length == 0 && message.attachments.size == 0 && message.content != '') {
const searchKey = 'who-asked';
const gifAmount = 20;
const gifs = `https://g.tenor.com/v1/search?q=${searchKey}&key=${process.env.TENOR}&limit=${gifAmount}`;
message.reply({ embeds: [await help.getGifEmbed(gifs, gifAmount)] });
}
}