-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
63 lines (44 loc) · 1.54 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
60
61
62
63
import os
import sys
import aiohttp
import discord
from discord.ext import commands
from cogwatch import watch
from config import Config as cfg
import dotenv
dotenv.load_dotenv()
token = str(os.getenv("TOKEN"))
intents = discord.Intents.all()
class Zephyr(commands.Bot):
def __init__(self):
super().__init__(
command_prefix=cfg.PREFIX,
intents=intents,
allowed_mentions=discord.AllowedMentions(everyone=False),
)
async def setup_hook(self):
cogs = ["fun", "info", "moderation", "utility"]
for cog in cogs:
await self.load_extension(f"src.{cog}")
print(f"\n+ Loaded {cog}")
await self.load_extension("jishaku")
print("\n+ Loaded jishaku\n")
self.aiohttp_session = aiohttp.ClientSession()
@watch(path="src", preload=True)
async def on_ready(self):
print("\n________________________________________________")
print(f"\n{bot.user} is ready!")
print(f"Zephyr v{cfg.VERSION}")
print(
f"\nUsing Discord.py {discord.__version__} on Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
)
print(f"\nRunning on {sys.platform.title()}\n")
print("________________________________________________\n\n")
await self.change_presence(
status=discord.Status.idle,
activity=discord.Activity(
type=discord.ActivityType.watching, name="using it"
),
)
bot = Zephyr()
bot.run(token)