2026-06-06 03:29:21 +07:00
|
|
|
import { logger } from "../../logger";
|
|
|
|
|
|
2026-06-06 03:39:25 +07:00
|
|
|
const greetings = [
|
|
|
|
|
(userId: string) =>
|
|
|
|
|
`🎉 Makasih udah ngeboost <@${userId}>! Sekarang kamu bisa claim custom role pake \`/booster-role claim\` di sini.`,
|
|
|
|
|
(userId: string) =>
|
|
|
|
|
`🔥 <@${userId}> baru aja ngeboost! Langsung aja claim custom role kamu pake \`/booster-role claim\` di sini.`,
|
|
|
|
|
(userId: string) =>
|
|
|
|
|
`✨ Thank you <@${userId}> for the boost! Claim custom role kamu pake \`/booster-role claim\` di sini ya.`,
|
|
|
|
|
(userId: string) =>
|
|
|
|
|
`👑 <@${userId}> ngeboost server! Yuk langsung claim custom role pake \`/booster-role claim\` di sini.`,
|
|
|
|
|
(userId: string) =>
|
|
|
|
|
`🎊 Ada booster baru nih, <@${userId}>! Jangan lupa claim custom role kamu pake \`/booster-role claim\` di sini.`,
|
|
|
|
|
];
|
|
|
|
|
|
2026-06-06 03:29:21 +07:00
|
|
|
/**
|
2026-06-06 03:39:25 +07:00
|
|
|
* Sends a random welcome message via the given channel when a member newly
|
2026-06-06 03:31:36 +07:00
|
|
|
* acquires the booster eligibility role (i.e. just boosted the server).
|
2026-06-06 03:29:21 +07:00
|
|
|
*/
|
|
|
|
|
export async function sendBoostGreeting(
|
2026-06-06 03:31:36 +07:00
|
|
|
channel: { send(input: { content: string }): Promise<unknown> },
|
|
|
|
|
userId: string,
|
2026-06-06 03:29:21 +07:00
|
|
|
greetingChannelId: string,
|
|
|
|
|
): Promise<void> {
|
2026-06-06 03:39:25 +07:00
|
|
|
const pick = Math.floor(Math.random() * greetings.length);
|
|
|
|
|
const message = greetings[pick](userId);
|
2026-06-06 03:30:16 +07:00
|
|
|
|
|
|
|
|
await channel.send({ content: message });
|
2026-06-06 03:29:21 +07:00
|
|
|
|
2026-06-06 03:39:25 +07:00
|
|
|
logger.info("Boost greeting sent", { userId, channelId: greetingChannelId, variant: pick });
|
2026-06-06 03:29:21 +07:00
|
|
|
}
|