-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
30 lines (21 loc) · 873 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
import os # library
import discord # library
from discord import client # library
import asyncpg # library
import os # library
# THIS IS THE TRIGGER PREFIX OF UR COMMANDS, LIKE ".BAN" "/BAN" "!BAN" "?BAN" "$BAN"
intents=discord.Intents.default()
intents.members=True
client = commands.Bot(command_prefix="PREFIX HERE", intents=intents)
#LOADING COGS
for filename in os.listdir("./cogs"):
if filename.endswith(".py") and not filename.startswith("_"):
client.load_extension(f"cogs.{filename[:-3]}")
#CONNECT TO THE POSTGRESQL DATABASE
async def create_db_pool():
client.pg_con = await asyncpg.create_pool(database="database", user="username", password="password")
# WARNING: HERE PUT THE TOKEN OF UR BOT!!
token="TOKEN HERE"
# RUN CLIENT -- IF U DELETE THIS, THE BOT DOESN'T WORK!!
client.loop.run_until_complete(create_db_pool())
client.run(token)