-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
35 lines (25 loc) · 828 Bytes
/
bot.py
File metadata and controls
35 lines (25 loc) · 828 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
# bot.py from https://realpython.com/how-to-make-a-discord-bot-python/
import os
import random
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
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})'
)
responses = ["🤬!?tRiGGerEd?!🤬", "pO👏dE👏fI👏nI👏cI👏jI", "💥😩💥😩💥😩", "🏃🎓🔥"]
@client.event
async def on_message(message):
lower = message.content.lower()
if "defacto" in lower or "de facto" in lower:
await message.channel.send(random.choice(responses))
client.run(TOKEN)