mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Give ferdi access to verify/deverify
This commit is contained in:
parent
5c4adca1c6
commit
87bb7d5883
1 changed files with 7 additions and 2 deletions
|
@ -37,9 +37,12 @@ class VerifyCog(commands.Cog):
|
||||||
return await ctx.respond(view=view, ephemeral=True)
|
return await ctx.respond(view=view, ephemeral=True)
|
||||||
|
|
||||||
@commands.command(name="de-verify")
|
@commands.command(name="de-verify")
|
||||||
@commands.is_owner()
|
@commands.guild_only()
|
||||||
async def verification_del(self, ctx: commands.Context, *, user: discord.Member):
|
async def verification_del(self, ctx: commands.Context, *, user: discord.Member):
|
||||||
"""Removes a user's verification status"""
|
"""Removes a user's verification status"""
|
||||||
|
if not await self.bot.is_owner(ctx.author):
|
||||||
|
if not ctx.author.guild_permissions.administrator:
|
||||||
|
return await ctx.reply(":x: Permission denied.")
|
||||||
await ctx.trigger_typing()
|
await ctx.trigger_typing()
|
||||||
for code in await VerifyCode.objects.all(bind=user.id):
|
for code in await VerifyCode.objects.all(bind=user.id):
|
||||||
await code.delete()
|
await code.delete()
|
||||||
|
@ -55,10 +58,12 @@ class VerifyCog(commands.Cog):
|
||||||
return await ctx.reply(f"\N{white heavy check mark} De-verified {user}.")
|
return await ctx.reply(f"\N{white heavy check mark} De-verified {user}.")
|
||||||
|
|
||||||
@commands.command(name="verify")
|
@commands.command(name="verify")
|
||||||
@commands.is_owner()
|
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def verification_force(self, ctx: commands.Context, user: discord.Member, _id: str, name: str):
|
async def verification_force(self, ctx: commands.Context, user: discord.Member, _id: str, name: str):
|
||||||
"""Manually verifies someone"""
|
"""Manually verifies someone"""
|
||||||
|
if not await self.bot.is_owner(ctx.author):
|
||||||
|
if not ctx.author.guild_permissions.administrator:
|
||||||
|
return await ctx.reply(":x: Permission denied.")
|
||||||
existing = await Student.objects.create(id=_id, user_id=user.id, name=name)
|
existing = await Student.objects.create(id=_id, user_id=user.id, name=name)
|
||||||
role = discord.utils.find(lambda r: r.name.lower() == "verified", ctx.guild.roles)
|
role = discord.utils.find(lambda r: r.name.lower() == "verified", ctx.guild.roles)
|
||||||
if role and role < ctx.guild.me.top_role:
|
if role and role < ctx.guild.me.top_role:
|
||||||
|
|
Loading…
Reference in a new issue