Add UpdateUsernameVerify view to MessageManagementCog.

This commit is contained in:
alwayscompiling
2022-08-13 20:23:56 -04:00
parent cb71cbe1d5
commit 6147263647
5 changed files with 32 additions and 16 deletions
+15 -4
View File
@@ -6,17 +6,26 @@ from nextcord.ext import commands
import nextcord
from highscores import highscores_data # pylint: disable=import-error
from .views.update_username_verify import UpdateUsernameVerifyView
class DataManagement(commands.Cog, name="Table Management"):
class DataManagementCog(commands.Cog, name="Table Management"):
"""
Class holds commands for managing the data storage of the highscores.
"""
def __init__(self):
def __init__(self, bot: commands.Bot):
"""
Default constructor for DataManagement class. Does nothing.
Default constructor for DataManagement class. Sets internal bot variable.
"""
self._bot: commands.Bot = bot
@commands.Cog.listener()
async def on_ready(self):
"""
Called when cog is loaded. Adds views required for DataManagement commands.
"""
self._bot.add_view(UpdateUsernameVerifyView())
@nextcord.slash_command(
description="Deletes all scores for this guild. Used for testing.",
@@ -70,6 +79,8 @@ class DataManagement(commands.Cog, name="Table Management"):
embed.add_field(name="Old Username", value=old_username)
embed.add_field(name="New Username", value=new_username)
await verify_channel.send(
content=f"Username change request from <@{interaction.user.id}>.", embed=embed
content=f"Username change request from <@{interaction.user.id}>.",
embed=embed,
view=UpdateUsernameVerifyView(),
)
await interaction.send("Request sent to admins for verification.", ephemeral=True)