Check mark reactions in welcome channel approve user.
A check mark reaction emoji can be used to approve a user, if it is done in the Join/Leave message channel. It requires the one reacting to have the "Manage Roles" permission.
This commit is contained in:
parent
5cf3cdbb08
commit
847d5c8c89
|
@ -207,6 +207,30 @@ class Gatekeep(Extension):
|
|||
str(gk.gatekeep_approve_message).format(member=user, guild=ctx.guild)
|
||||
)
|
||||
|
||||
@listen(events.MessageReactionAdd)
|
||||
async def on_reaction_add(self, reaction: events.MessageReactionAdd):
|
||||
if not reaction.emoji.name in [
|
||||
"✅",
|
||||
"☑",
|
||||
"✔",
|
||||
] or not reaction.author.has_permission(Permissions.MANAGE_ROLES):
|
||||
return
|
||||
|
||||
gk: GatekeepModel
|
||||
gk, _ = GatekeepModel.get_or_create(guild_id=reaction.guild.id)
|
||||
jl: JoinLeaveModel
|
||||
jl, _ = JoinLeaveModel.get_or_create(guild_id=reaction.guild.id)
|
||||
|
||||
if reaction.message.channel.id != jl.message_channel:
|
||||
return
|
||||
|
||||
await reaction.message.author.add_role(int(gk.gatekeep_approve_role))
|
||||
await reaction.message.channel.send(
|
||||
str(gk.gatekeep_approve_message).format(
|
||||
member=reaction.message.author, guild=reaction.guild
|
||||
)
|
||||
)
|
||||
|
||||
@slash_command(
|
||||
name="captcha",
|
||||
description="Complete a captcha",
|
||||
|
|
Loading…
Reference in New Issue