Przeglądaj źródła

Fixing errors in the demotion and promotion cogs.

BaumSplitter41 4 miesięcy temu
rodzic
commit
52c027cd6f
2 zmienionych plików z 12 dodań i 5 usunięć
  1. 8 4
      VPD_BOT/cogs/demotion.py
  2. 4 1
      VPD_BOT/cogs/promotion.py

+ 8 - 4
VPD_BOT/cogs/demotion.py

@@ -5,14 +5,14 @@ from discord.commands import slash_command
 import configparser
 
 
-class helpcache(commands.Cog):
+class demotion(commands.Cog):
     def __init__(self, bot: discord.Bot):
         self.bot = bot
 
 
 #Command initialization
-    @slash_command(name="promotion", description= "Promote a department member   to the next rank")
-    async def promotion(
+    @slash_command(name="demotion", description= "Demote a department member to the previous rank")
+    async def demotion(
         self,
         ctx,
         user: str = Option(discord.User, "Select User", required=True),
@@ -67,4 +67,8 @@ class helpcache(commands.Cog):
     new_rank = ranks[current_rank_index - 1]
     await user.remove_roles(user_rank)
     await user.add_roles(new_rank)
-    await ctx.respond(f"{user.mention} has been demoted to {new_rank.name}!", ephemeral=True)
+    await ctx.respond(f"{user.mention} has been demoted to {new_rank.name}!", ephemeral=True)
+
+
+def setup(bot: discord.Bot):
+    bot.add_cog(demotion(bot))

+ 4 - 1
VPD_BOT/cogs/promotion.py

@@ -5,7 +5,7 @@ from discord.commands import slash_command
 import configparser
 
 
-class helpcache(commands.Cog):
+class promotion(commands.Cog):
     def __init__(self, bot: discord.Bot):
         self.bot = bot
 
@@ -68,3 +68,6 @@ class helpcache(commands.Cog):
     await user.remove_roles(user_rank)
     await user.add_roles(new_rank)
     await ctx.respond(f"{user.mention} has been promoted to {new_rank.name}!", ephemeral=True)
+
+def setup(bot: discord.Bot):
+    bot.add_cog(promotion(bot))