-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (25 loc) · 796 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
import os
import discord
from dotenv import load_dotenv
from bartender import Bartender
load_dotenv()
TOKEN = os.getenv("DISCORD_TOKEN")
GUILD = os.getenv("DISCORD_GUILD")
KEYWORDS = ("$bt", "bartender", "god")
client = discord.Client()
@client.event
async def on_ready():
for guild in client.guilds:
if guild.name == GUILD:
break
print(
f"{client.user} is connected to the following guild:\n"
f"{guild.name}(id: {guild.id})"
)
@client.event
async def on_message(message):
if message.author != client.user and message.content.lower().startswith(KEYWORDS):
for prefix in KEYWORDS:
message.content = message.content.removeprefix(prefix)
await message.channel.send(Bartender().handle(message))
client.run(TOKEN)