mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Only send welcome messages once per user, until plugin reload
This commit is contained in:
parent
902be16ae8
commit
1787ec707c
3 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,13 @@ export const SendWelcomeMessageEvt = welcomeEvent({
|
|||
if (!config.message) return;
|
||||
if (!config.send_dm && !config.send_to_channel) return;
|
||||
|
||||
// Only send welcome messages once per user (even if they rejoin) until the plugin is reloaded
|
||||
if (pluginData.state.sentWelcomeMessages.has(member.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
pluginData.state.sentWelcomeMessages.add(member.id);
|
||||
|
||||
const formatted = await renderTemplate(config.message, {
|
||||
member: stripObjectToScalars(member, ["user"]),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue