فهرست منبع

changes in say cog

BaumSplitter41 4 ماه پیش
والد
کامیت
feba189e71
2فایلهای تغییر یافته به همراه26 افزوده شده و 6 حذف شده
  1. 26 1
      VPD_BOT/cogs/say.py
  2. 0 5
      VPD_BOT/main.py

+ 26 - 1
VPD_BOT/cogs/say.py

@@ -2,12 +2,37 @@ 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 Say(commands.Cog):
     def __init__(self, bot: discord.Bot):
         self.bot = bot
 
+    intents = discord.Intents.default()
+    intents.message_content = True
+    intents.members = True
+    intents.guilds = True
+    intents.reactions = True
+
+    client = discord.Client(intents=intents)
+    debug_guilds_up = []
+    server_token = os.getenv("SERVER").split(",")
+    for i in range(len(server_token)):
+        debug_guilds_up.append(int(server_token[i]))
+    
+    bot = commands.Bot(
+    command_prefix=commands.when_mentioned_or("!"),
+    description="VicePD Bot",
+    intents=intents,
+    debug_guilds=debug_guilds_up if debug_guilds_up else None
+    )
+
+
+
+
+
+#Command initialization
     @slash_command(description="Let the bot send a message")
     async def say(
             ctx,

+ 0 - 5
VPD_BOT/main.py

@@ -179,11 +179,6 @@ async def greet(ctx, user: str = Option(discord.User, "The user, you want to gre
     await ctx.respond(f"Hello {user.mention}")
 #---------------------------------#
 
-#---------------------------------#
-## Say
-
-#---------------------------------#
-
 #---------------------------------#
 ## Userinfo
 @bot.slash_command(name="userinfo", description="Show informations of a user from this server")