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