Type 'trick or treat' and a gif showing a trick or treat will be shown.
const trickGifs = [
'https://media.giphy.com/media/LQzSj08ZvIqONAmr2S/giphy-downsized-large.gif',
'https://media.giphy.com/media/RLJJ9GyPKLNE4/giphy-downsized-large.gif',
'https://media.giphy.com/media/l378esZto4nQdhXeE/giphy.gif',
'https://media.giphy.com/media/9Z26sZp6MiQfu/giphy.gif',
'https://media.giphy.com/media/JVqeFxl3Qo8/giphy.gif',
'https://media.giphy.com/media/srD8JByP9u3zW/giphy.gif',
'https://media.giphy.com/media/jv3grJRzoftBK/giphy.gif',
'https://media.giphy.com/media/zK1bE53ewn1rAQv05L/giphy.gif',
'https://media.giphy.com/media/zK1bE53ewn1rAQv05L/giphy-downsized-large.gif',
'https://media.giphy.com/media/3oKIPwoeGErMmaI43S/giphy.gif',
'https://media.giphy.com/media/26gs861AqzP6w1DAQ/giphy.gif',
];
const treatGifs = [
'https://media.giphy.com/media/63D094RLUNExa/giphy.gif',
'https://media.giphy.com/media/LqgrRiLbCwrCcopc79/giphy.gif',
'https://media.giphy.com/media/68VbOiJLDUkYo/giphy.gif',
'https://media.giphy.com/media/U4LhzzpfTP7NZ4UlmH/giphy.gif',
'https://media.giphy.com/media/SsTcO55LJDBsI/giphy.gif',
'https://media.giphy.com/media/3fBRRVKceVngI/giphy.gif',
'https://media.giphy.com/media/3o7aD5lNmqChBB5yE0/giphy.gif',
'https://media.giphy.com/media/tKrsg0oflr6zC6xNVb/giphy.gif',
'https://media.giphy.com/media/xTiTnHiaGb6cZlyywo/giphy.gif',
'https://media.giphy.com/media/f9p9VjrLWO5ag/giphy.gif',
'https://media.giphy.com/media/JgUNowqwNo5FK/giphy.gif',
];
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const event = context.params.event;
const author = event.author.id;
const isTrick = Math.random() < 0.5;
const gifs = isTrick ? trickGifs : treatGifs;
const randomGif = gifs[Math.floor(Math.random() * gifs.length)];
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `π¦ Happy Halloween <@!${author}>! π¦`,
tts: false,
embed: {
type: 'rich',
image: {
url: randomGif,
},
},
});