#Get the author of who bumped the server

5 messages · Page 1 of 1 (latest)

granite tapir
#

Hi! So when someone uses /bump, Disboard sends a embed with "Bump done" and mentions the slash command which has the user.
Now i wanna get with MessageCreate when someone and who bumped the server. Is that possible?

surreal gustBOT
granite tapir
#

[email protected]
Atm got:

    if (message.author.bot && message.author.id === "302050872383242240") {
      const embed = message.embeds[0];
      if (!embed) return;

      if (embed.description && embed.description.includes('Bump done!')) {

        const mentionMatch = embed.description.match(/<@!?(\d+)>/);

        if (mentionMatch) {
          const userId = mentionMatch[1];
          // @ts-ignore
          const user = message.guild.members.cache.get(userId);
          console.log(`${user ? user.user.tag : userId} successfully bumped the server!`);
        } else {
          console.log('Bump done, but could not find who did it.');
        }
      }
    }

It does detect when someone bumps the server but not who did it.

granite tapir
#

Thanks that solved it!