mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Add rebind command
This commit is contained in:
parent
a91311acd7
commit
c3a0d7dfe2
1 changed files with 12 additions and 1 deletions
|
@ -2,7 +2,7 @@ import discord
|
||||||
import orm
|
import orm
|
||||||
import re
|
import re
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from utils import VerifyCode, Student, VerifyView
|
from utils import VerifyCode, Student, VerifyView, get_or_none
|
||||||
import config
|
import config
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,6 +72,17 @@ class VerifyCog(commands.Cog):
|
||||||
allowed_mentions=discord.AllowedMentions.none()
|
allowed_mentions=discord.AllowedMentions.none()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@commands.command(name="rebind")
|
||||||
|
@commands.is_owner()
|
||||||
|
async def rebind_code(self, ctx: commands.Context, b_number: str, *, user: discord.Member):
|
||||||
|
# noinspection GrazieInspection
|
||||||
|
"""Changes which account a B number is bound to"""
|
||||||
|
student = await get_or_none(Student, id=b_number.upper())
|
||||||
|
if student:
|
||||||
|
await student.update(user_id=user.id)
|
||||||
|
return await ctx.message.add_reaction("\N{white heavy check mark}")
|
||||||
|
await ctx.message.add_reaction("\N{cross mark}")
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(VerifyCog(bot))
|
bot.add_cog(VerifyCog(bot))
|
||||||
|
|
Loading…
Reference in a new issue