-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (23 loc) · 1.04 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
####################################################################################################
import aiohttp.client_exceptions
import os
import requests
import time
####################################################################################################
from lib.utilities import SomiBot
client = SomiBot()
####################################################################################################
for folder in os.listdir(f"./cogs/"):
if not os.path.isdir(f"./cogs/{folder}/"):
continue
for file in os.listdir(f"./cogs/{folder}/"):
if not file.endswith(".py"):
continue
client.load_extension(f"cogs.{folder}.{file[:-3]}")
####################################################################################################
try:
requests.get("https://www.google.com/")
client.run(client.Keychain.DISCORD_TOKEN)
except (requests.ConnectionError, aiohttp.client_exceptions.ClientConnectorError):
time.sleep(10)
client.restart()