-
Notifications
You must be signed in to change notification settings - Fork 2
/
bot.py
40 lines (31 loc) · 956 Bytes
/
bot.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 discord
import os
from dotenv import load_dotenv
from discord.ext import commands
load_dotenv()
activity = discord.Activity(type=discord.ActivityType.watching, name="Avatars")
bot = commands.Bot(command_prefix="!", activity=activity)
@bot.event
async def on_ready() -> None:
print(
f"Bot is ready, invite link: https://discord.com/api/oauth2/authorize?client_id={bot.user.id}&permissions=8&scope=bot\n\n"
)
@bot.event
async def on_message(message: discord.Message) -> None:
if message.author.bot:
return
if message.content == "hello":
await message.channel.send("hi")
await bot.process_commands(message)
cogs_list = [
"misc",
"psn",
"psprices"
]
if __name__ == "__main__":
for cog in cogs_list:
print(f"Loading cog: {cog}...")
bot.load_extension(f"cogs.{cog}")
print(f"Loaded cog: {cog}.")
print("\nStarting bot...")
bot.run(os.getenv("TOKEN"))