This snippet will automatically send out an emoji of the day. You can the list of emojis to be sent every day! See comments for further details. Note that emojis should be a standard emoji, not custom emoji.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const {EmojiAPI} = require('emoji-api');
const emoji = new EmojiAPI();
let index;
const CHANNEL_ID = `CHANNEL_ID_HERE`; // The channel ID where Emoji of the Day will be sent
// You can add more standard common emojis below. Don't forget to envelop them with quotes (ie. ``)!
const emojis = [
`π`,
`π`,
`π`,
`π€£`,
`π`,
`π`,
`π
`,
`π`,
`π`,
`π`,
`π`,
`π`,
`π`,
`π`,
`π₯°`,
`π`,
`π`,
`π`,
`π`,
`π€`,
`π€©`,
`π€`,
`π€¨`,
`π`,
`π`,
`πΆ`,
`π`,
`π`,
`π£`,
`π₯`,
`β¨`,
`π`,
];
try {
index = await lib.keyvalue.store['@0.1.16'].get({
key: `EMOJI_TODAY_${CHANNEL_ID}`,
defaultValue: 0,
});
let info = await emoji.get(emojis[index]).then(async function (emoji) {
return emoji;
});
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${CHANNEL_ID}`,
content: '',
embeds: [
{
type: 'rich',
title: `Emoji of the Day!`,
description: [
`**${info.name}**`,
`${info.description}`,
`Showcase how you can use this emoji! ${info.emoji}`,
].join('\n\n'),
color: 0xd400ff,
thumbnail: {
url: `${info.images[0]?.url || info.images[1]?.url}`,
height: 0,
width: 0,
},
footer: {
text: `Developed by fidilen#1432`,
},
},
],
});
index += 1;
await lib.keyvalue.store['@0.1.16'].set({
key: `EMOJI_TODAY_${CHANNEL_ID}`,
value: index,
});
} catch (e) {
console.error(`Emoji: ` + emojis[index], e.message);
}