forked from replit-discord/all-seeing-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
59 lines (48 loc) · 1.03 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import discord
import asyncio
from keep_alive import keep_alive
from discord.ext import commands
from background_tasks import bg_tasks
bot = commands.Bot(
command_prefix='?',
case_insensitive=True
)
# regex to find all print statements \n\s*print\([^()]*\)
class initialized:
def __init__(self):
self.started = False
def __call__(self):
if not self.started:
self.started = True
return False
else:
return True
started = initialized()
extensions = [
'Commands.dev_cmds',
'Commands.data_tweaking',
'Starboard.main',
'Commands.moderation',
'Moderation.main',
'Commands.fun',
'Commands.help',
'Mail.main',
'Other.logger'
]
if __name__ == '__main__':
for extension in extensions:
bot.load_extension(extension)
@bot.event
async def on_ready():
await bot.change_presence(
activity=discord.Activity(
name='everything', type=discord.ActivityType(3)
)
)
if not started():
await asyncio.create_task(bg_tasks(bot))
print('ready')
keep_alive()
token = os.environ.get("DISCORD_BOT_SECRET")
bot.run(token)