-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (32 loc) · 988 Bytes
/
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
import discord
import motor.motor_asyncio
from dotenv import load_dotenv
import os
load_dotenv()
client = motor.motor_asyncio.AsyncIOMotorClient(os.getenv("MONGOSTRING"))
maindb = client.overhead
coll = maindb["applications"]
apdcoll = maindb["appdata"]
vcoll = maindb["verify"]
apucoll = maindb["appusers"]
vdcoll = maindb["vdata"]
vmcoll = maindb["verifymodal"]
vucoll = maindb["vusers"]
intents = discord.Intents.default()
intents.members = True
bot = discord.Bot(intents=intents, help_command=None)
for files in os.listdir("./cogs"):
if files.endswith(".py"):
cogf = files[:-3]
try:
bot.load_extension(f"cogs.{cogf}")
print(f"{cogf} initialized!")
except Exception as e:
print(e)
@bot.event
async def on_ready():
print(f"logged in as {bot.user}")
@bot.slash_command(name="ping", description="Pong")
async def ping(ctx):
await ctx.respond(f"Pong! {round(bot.latency) * 1000}")
bot.run(os.getenv("TOKEN"))