It gives you idea whenever you say sentence like : "i am bored", "we are bored" etc.
/* Import Modules */
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const axios = require('axios');
const triggers = [
'i am bored',
'i have nothing to do',
'we are bored',
'boring',
'how boring',
'boring asf',
];
const content = context.params.event.content;
for (let i of triggers) {
if (content.includes(i)) {
const idea = await axios('https://www.boredapi.com/api/activity').then(
(res) => res.data.activity
);
return lib.discord.channels['@0.3.0'].messages.create({
content: `${idea}`,
channel_id: context.params.event.channel_id,
});
break;
}
}