Closed ks129 closed 4 years ago
It seems achievable by doing onmessage event and check the message type https://discordpy.readthedocs.io/en/latest/api.html#discord.MessageType.premium_guild_subscription
Discord doesn't provide such event. Instead, you should check count of boosters in guild update event or, if there's a system channel with boost messages enabled, check these messages as @skyblockz suggested
Generally speaking I don't like implementing events like these. An event generally corresponds to an actual Discord event. If you want to handle this then it's simple:
async def on_member_update(before, after):
if before.premium_since is None and after.premium_since is not None:
await on_nitro_boost(after)
The Problem
Currently there is hard (or in some cases, impossible) to make Nitro Boosters auto responses, and because this would add on_nitro_boost With this is possible to make auto responses to DMs or some chat, when member boost server and make possible Nitro Rewards.
The Ideal Solution
Like is showed in code, this code would run each time, when someone boost server. booster variable would storage user information, Nitro information and Guild information.
The Current Solution
You may create currently background task, what check list of nitro boosters after every some time, and compare them, but this is much harder to do than would on_nitro_boost.
Summary
New event would added: on_nitro_boost, what start each time, when someone boost server.