Gives one daily complement to a random member of a guild. Complete channelid and guildid fields at the top. Should be on a 24 hour scheduler.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let channelid = "CHANNEL_ID" //Channel ID the bot will post the complement in.
let guildid = "GUILD_ID" //Your Guild ID.
let messagePrompts = [
'You are a beautiful person.',
'You are worthy.',
'You are appreciated.',
'You look beautiful today.',
'You matter.',
'You are more important than you realize.',
'You are more fun than anyone or anything I know, including bubble wrap.',
'You are the most perfect you there is.',
'You are enough.',
'You are one of the strongest people I know.',
'You look great today.',
'You have the best smile.',
'You just light up the room.',
'You make a bigger impact than you realize.',
'You are always so helpful.',
'You have the best laugh.',
'I appreciate our friendship.',
'Your inside is even more beautiful than your outside.',
'You just glow.',
'I love the way you bring out the best in people.',
'Our community is better because you are part of it.',
'You bring out the best in the rest of us.',
'You inspire me.',
'Nothing can stop you.',
'You just made my day.',
'You make me float up like I’m on millions of bubbles.',
'You are an excellent friend.',
'I am a better person because of you.',
'You have taught me so much.',
'I like the way you are.',
'You have the best sense of style.',
'You make me want to be a better person.',
'You look so young!',
'I hope you are proud of yourself, because I am!',
'You are one of the bravest people I know.',
'That color looks perfect on you.',
'You are so trustworthy; I always believe what you say.',
'Everything seems brighter when you are around.',
'Even the things you don’t like about yourself make you interesting.',
'I know that you will always have my back, because that is the kind of person you are.',
'You have the best ideas.',
'You are a great example to others.',
'I know that if you ever make a mistake, you fix it.',
'You are stunning.',
'You are the reason I am smiling today.',
'You’re a gift to everyone you meet.',
'You have a gift for making people comfortable.',
'I enjoy spending time with you.',
'I am really glad we met.',
'I tell everyone how amazing you are.',
'Talking to you is like a breath of fresh air',
'Youre better than a triple-scoop ice cream cone... with sprinkles!',
'Your energy is infectious',
'I wish I were half of the human you are',
'Youre irreplaceable',
'I feel special calling someone like you my friend',
'Everyone needs a friend like you in their life.',
'Talking to you always puts me in a good mood.',
'You’re truly a gem—there’s nobody like you',
'You radiate from head to toe.',
];
let messageChoice = Math.floor(Math.random() * messagePrompts.length);
let message = messagePrompts[messageChoice];
async function getMembers(init, afterId) {
let getMembersParams = {
guild_id: guildid,
limit: 1000,
};
if (!init && afterId) {
getMembersParams['after'] = afterId;
}
const members = (
await lib.discord.guilds['@0.2.4'].members.list(getMembersParams)
).filter((member) => !member.user?.bot);
if (Math.random() > 0.5 && members.length === 1000) {
let indexSecondLast = members.length - 2;
let secondLastUser = members[indexSecondLast].user;
await getMembers(false, secondLastUser.id);
} else {
return members;
}
}
membersList = await getMembers(true, false);
let memberChoice =
membersList.length === 1 ? 0 : Math.floor(Math.random() * membersList.length);
let chosenMember = membersList[memberChoice];
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: channelid,
content: `<@${chosenMember.user.id}>, ${message} `,
});