-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
51 lines (44 loc) · 1.58 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
# Bobby Bot code
import discord
from discord.ext import commands
import os
import datetime
import time
client = discord.Client()
e = ""
class BobbyBot(commands.Bot):
def __init__(self, token: str):
self.token = token
super().__init__(command_prefix=commands.when_mentioned_or(""),
owner_id=528982743623925781,
case_insensitive=True,
intents=discord.Intents.all())
def init_cogs(self):
e = ""
counter = 0
files = os.listdir("cogs")
cogs = []
now = datetime.datetime.now()
dt = now.strftime("%d/%m/%Y %H:%M:%S")
for f in files:
if not f.startswith("__"):
if f.endswith(".py"):
cogs.append(f[:-3])
if not cogs:
print("Couldn´t find any cogs to load")
else:
for cog in cogs:
print("Loading Module: " + cog + "")
try:
self.load_extension("cogs." + cog)
except Exception as e:
print("Loading Module: '{}' failed\n{}: {}".format(cog, type(e).__name__, e))
print(f"\n----------------------------------------------------------\nLoading complete")
print("----------------------------------------------------------")
time.sleep(0.5)
print(f"\nAll Basic Systems are running")
time.sleep(0.1)
print(f"\nBobbyBot was successfully logged in at {dt}\n\n")
def run(self):
self.remove_command("help")
super().run(self.token)