-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
38 lines (27 loc) · 728 Bytes
/
bot.py
File metadata and controls
38 lines (27 loc) · 728 Bytes
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
import os
import discord
from dotenv import load_dotenv
import random
from messages import BROKLYN_99_QUOTES
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
client = discord.Client()
@client.event
async def on_ready():
guild = None
for g in client.guilds:
if g.name == GUILD:
guild = g
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:
return
if message.content == '99!':
response = random.choice(BROKLYN_99_QUOTES)
await message.channel.send(response)
client.run(TOKEN)