|
|
@@ -3,6 +3,8 @@ from discord.ext import commands
|
|
|
from discord.commands import Option
|
|
|
from discord.commands import slash_command
|
|
|
import configparser
|
|
|
+import os
|
|
|
+from dotenv import load_dotenv
|
|
|
|
|
|
|
|
|
class Matesearch(commands.Cog):
|
|
|
@@ -25,6 +27,12 @@ class Matesearch(commands.Cog):
|
|
|
configFilePath = r'config.cfg'
|
|
|
config.read(configFilePath)
|
|
|
return config
|
|
|
+ def _get_guild(self):
|
|
|
+ load_dotenv()
|
|
|
+ debug_guilds_up = []
|
|
|
+ server_token = os.getenv("SERVER").split(",")
|
|
|
+ for i in range(len(server_token)):
|
|
|
+ debug_guilds_up.append(int(server_token[i]))
|
|
|
def _get_channel(self):
|
|
|
config = self._load_config()
|
|
|
search_channel_id = int(config["Matesearch"]["search_channel_id"])
|
|
|
@@ -35,7 +43,7 @@ class Matesearch(commands.Cog):
|
|
|
return search_channel
|
|
|
def _get_role(self):
|
|
|
config = self._load_config()
|
|
|
- guild = discord.Guild
|
|
|
+ guild = self._get_guild()
|
|
|
search_role_id = int(config["Matesearch"]["search_role_id"])
|
|
|
search_role = guild.get_role(search_role_id)
|
|
|
if search_role is None:
|