Переглянути джерело

Outsourced the help_cache into cogs file

BaumSplitter41 4 місяців тому
батько
коміт
1febaf8776
3 змінених файлів з 44 додано та 34 видалено
  1. 42 0
      VPD_BOT/cogs/help_cache.py
  2. 2 2
      VPD_BOT/cogs/how_to_team.py
  3. 0 32
      VPD_BOT/main.py

+ 42 - 0
VPD_BOT/cogs/help_cache.py

@@ -0,0 +1,42 @@
+import discord
+from discord.ext import commands
+from discord.commands import Option
+from discord.commands import slash_command
+import os
+from dotenv import load_dotenv
+
+class helpcache(commands.Cog):
+    def __init__(self, bot: discord.Bot):
+        self.bot = bot
+
+
+#Command initialization
+    @slash_command(name="help_cache", description= "Get Infos")
+    async def help_cache(
+        self,
+        ctx,
+    ):
+        server = ctx.guild
+        embed = discord.Embed(
+            title=f"__How to clear your game cache__",
+            description=f"Follow the follwing steps to clear your game cache:",
+            color=discord.Color.yellow()
+        )
+
+        embed.add_field(name="Close Game", value="Close FiveM completely", inline=False)
+        embed.add_field(name="Press keys", value="Win + R", inline=False)
+        embed.add_field(name="Go to the folder", value="\Local\FiveM\FiveM.app\data", inline=False)
+        embed.add_field(name="Delete the folders", value="cache, server-cache, server-cache-priv", inline=False)
+        embed.add_field(name="Restart Game", value="Restart the game and download the resources again.", inline=False)
+
+
+        embed.set_thumbnail(url=server.icon)
+        embed.set_author(name="VicePD", icon_url="https://i.imgur.com/6QteFrg.png")
+        embed.set_footer(text="VicePD - Bot | Made by BaumSplitter41")
+
+        await ctx.respond(embed=embed)
+
+
+
+def setup(bot: discord.Bot):
+    bot.add_cog(helpcache(bot))

+ 2 - 2
VPD_BOT/cogs/how_to_team.py

@@ -2,7 +2,7 @@ import discord
 from discord.ext import commands
 from discord.commands import slash_command
 
-class HowToTeam(commands.Cog):
+class howtoteam(commands.Cog):
     def __init__(self, bot: discord.Bot):
         self.bot = bot
 
@@ -25,4 +25,4 @@ class HowToTeam(commands.Cog):
         await ctx.respond(embed=embed)
 
 def setup(bot: discord.Bot):
-    bot.add_cog(HowToTeam(bot))
+    bot.add_cog(howtoteam(bot))

+ 0 - 32
VPD_BOT/main.py

@@ -548,38 +548,6 @@ async def setup_rr(
 #_________________________________#
 
 
-#_________________________________#
-## Help System
-
-#---------------------------------#
-#Help_cache
-@bot.slash_command(name="help_cache", description= "Get Infos")
-async def help_cache(
-    ctx,
-):
-    server = ctx.guild
-    embed = discord.Embed(
-        title=f"__How to clear your game cache__",
-        description=f"Follow the follwing steps to clear your game cache:",
-        color=discord.Color.yellow()
-    )
-
-    embed.add_field(name="Close Game", value="Close FiveM completely", inline=False)
-    embed.add_field(name="Press keys", value="Win + R", inline=False)
-    embed.add_field(name="Go to the folder", value="\Local\FiveM\FiveM.app\data", inline=False)
-    embed.add_field(name="Delete the folders", value="cache, server-cache, server-cache-priv", inline=False)
-    embed.add_field(name="Restart Game", value="Restart the game and download the resources again.", inline=False)
-
-
-    embed.set_thumbnail(url=server.icon)
-    embed.set_author(name="VicePD", icon_url="https://i.imgur.com/6QteFrg.png")
-    embed.set_footer(text="VicePD - Bot | Made by BaumSplitter41")
-
-    await ctx.respond(embed=embed)
-#---------------------------------#
-#_________________________________#
-
-
 #---------------------------------#
 #Run function
 load_extensions()