-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (39 loc) · 1.07 KB
/
Copy pathmain.py
File metadata and controls
56 lines (39 loc) · 1.07 KB
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
import discord
from discord.ext import commands
from config import BOT_PREFIX, TOKEN
class Zelma(commands.Bot):
async def setup_hook(self):
initial_extensions = [
'funcs.postgresql',
'owner',
'pulls',
'cogs.keywords',
'cogs.edit_config',
'cogs.utility'
]
for extension in initial_extensions:
await bot.load_extension(extension)
intents = discord.Intents.default()
description = "Weekly Comics"
bot = Zelma(
command_prefix=commands.when_mentioned_or(BOT_PREFIX),
description=description,
intents=intents,
max_messages=None)
bot.recent_cog = None
bot.tasks = {}
@bot.event
async def on_connect():
print('Loaded Discord')
@bot.event
async def on_ready():
print('------')
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print(discord.utils.utcnow().strftime("%d/%m/%Y %I:%M:%S:%f"))
print('------')
@bot.check
async def globally_block_dms(ctx):
return ctx.guild is not None
bot.run(TOKEN, reconnect=True)