First commit

This commit is contained in:
2025-04-28 11:30:21 +02:00
parent 431ef5e1a5
commit 636a9b111f
8 changed files with 97 additions and 0 deletions

47
bot.py Normal file
View File

@@ -0,0 +1,47 @@
# bot.py
import os
import discord
import random
from dotenv import load_dotenv
intents = discord.Intents.default()
intents.message_content = True
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
client = discord.Client(intents=intents)
@client.event
async def on_ready():
guild = discord.utils.find(lambda g: g.name == GUILD, client.guilds)
print(
f'{client.user} is connected to the following guild:\n'
f'{guild.name}(id: {guild.id})'
)
members = '\n - '.join([member.name for member in guild.members])
print(f'Guild Members:\n - {members}')
@client.event
async def on_message(message):
if message.author == client.user:
return
brooklyn_99_quotes = [
'I\'m the human form of the 💯 emoji.',
'Bingpot!',
(
'Cool. Cool cool cool cool cool cool cool, '
'no doubt no doubt no doubt no doubt.'
),
]
if message.content == '99!':
response = random.choice(brooklyn_99_quotes)
await message.channel.send(response)
client.run(TOKEN)