discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.2k stars 3.96k forks source link

client.guildBoosted event #3359

Closed Jenipherr closed 5 years ago

Jenipherr commented 5 years ago

Currently it's impossible to check when a guild is boosted via nitro; it would be pretty neat to write custom notifications or do certain things whenever a user boosts a guild.

devsnek commented 5 years ago

boosts notifications are a type of message. you can check message.type.

Jenipherr commented 5 years ago

boosts notifications are a type of message. you can check message.type.

If the boost notifications are disabled, it's impossible to tell when a server is boosted via discord.js.

devsnek commented 5 years ago

if boost notifications are disabled then they're disabled, nothing a library can do about it.

Jenipherr commented 5 years ago

if boost notifications are disabled then they're disabled, nothing a library can do about it.

That's essentially saying that if member notifications are disabled, then there shouldn't be a way to detect when a member joins. My point still stands; we need an event for when a user boosts a server.

Tylertron1998 commented 5 years ago

You could listen to guildMemberUpdate and check for a role with managed: true and Nitro Booster as the name.

devsnek commented 5 years ago

you can also listen for member updates with the previous premium since being null and the new one being not null

monbrey commented 5 years ago

if boost notifications are disabled then they're disabled, nothing a library can do about it.

That's essentially saying that if member notifications are disabled, then there shouldn't be a way to detect when a member joins. My point still stands; we need an event for when a user boosts a server.

So tell Discord that. There's nothing any library can do about it unless the Discord gateway sends an event.

SpaceEEC commented 5 years ago

I think @devsnek's suggestion with listening to guildMemberUpdate and checking whether GuildMember#premiumSince was, but not is, null, is the way to go.