-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (21 loc) · 718 Bytes
/
main.py
File metadata and controls
26 lines (21 loc) · 718 Bytes
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
import os
from nextcord.ext import commands
from dotenv import load_dotenv
from cogs.buttons.sr_view import SRView
import nextcord, datetime
load_dotenv()
client = commands.Bot(command_prefix='!')
client.persistent_views_added = False
@client.event
async def on_ready():
print("Bot is ready!")
client.load_extension("cogs.buttons.sr_message")
if not client.persistent_views_added:
client.add_view(SRView())
client.persistent_views_added = True
print('loading persistent views')
# for loop that loads all the commands
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
client.load_extension(f"cogs.{filename[:-3]}")
client.run(os.getenv("TOKEN"))