This commit is contained in:
2026-01-25 19:11:55 +05:00
parent 2ceed8c317
commit b6f914f07a
2 changed files with 8 additions and 3 deletions

10
main.py
View File

@@ -19,14 +19,17 @@ class getcfg:
print("Maybe you didn't setup your .env file")
sys.exit(0)
self.prefix = os.getenv('PREFIX')
self.proxy = os.getenv('PROXY')
def getprefix(self):
return self.prefix
def gettoken(self):
return self.token
def getproxy(self):
return self.proxy
class Bot(commands.Bot):
def __init__(self):
self.conwarn = sqlite3.connect("warn.db")
@@ -36,6 +39,7 @@ class Bot(commands.Bot):
super().__init__(
command_prefix=self.getcfg.getprefix(),
intents=discord.Intents.all(),
proxy=self.getcfg.getproxy(),
)
@@ -81,6 +85,6 @@ class Bot(commands.Bot):
self.confmsg.commit()
await self.load()
await self.start(token=self.getcfg.gettoken())
bot = Bot()
asyncio.run(bot.main())