-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (31 loc) · 1.2 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
import os, nextcord
from dotenv import load_dotenv
from nextcord.ext import commands
# -------------------------> Intents <-------------------------- #
intents = nextcord.Intents.default()
intents.message_content = True
# ------------------------------------------------------------ #
# -------------------------> Activity <-------------------------- #
activity = nextcord.Activity(type=nextcord.ActivityType.listening, name="chiunque abbia bisognoi")
# ------------------------------------------------------------ #
# ------------------------> Main loop <------------------------- #
def main():
bot = commands.Bot(
command_prefix='-',
activity=activity,
intents=intents
)
bot.remove_command('help')
load_dotenv()
# On ready event
@bot.event
async def on_ready():
print(f"{bot.user.name} is ready and connected to Discord.")
# Load all cogs
for folder in os.listdir("modules"):
if os.path.exists(os.path.join("modules", folder, "cog.py")):
bot.load_extension(f"modules.{folder}.cog")
bot.run(os.getenv("DISCORD_TOKEN"))
# ------------------------------------------------------------ #
if __name__ == '__main__':
main()