From 636a9b111f3e538e7e2edf60b067023144c5fc35 Mon Sep 17 00:00:00 2001 From: Shigeru Date: Mon, 28 Apr 2025 11:30:21 +0200 Subject: [PATCH] First commit --- .idea/.gitignore | 4 ++ .idea/Diamond_Dogs_bot.iml | 12 +++++ .idea/ddog_bot.iml | 10 ++++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ bot.py | 47 +++++++++++++++++++ 8 files changed, 97 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/Diamond_Dogs_bot.iml create mode 100644 .idea/ddog_bot.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 bot.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..351c96d --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,4 @@ +# Default ignored files +/shelf/ +/workspace.xml + diff --git a/.idea/Diamond_Dogs_bot.iml b/.idea/Diamond_Dogs_bot.iml new file mode 100644 index 0000000..fa7a615 --- /dev/null +++ b/.idea/Diamond_Dogs_bot.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/ddog_bot.iml b/.idea/ddog_bot.iml new file mode 100644 index 0000000..ed78d07 --- /dev/null +++ b/.idea/ddog_bot.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..dc9ea49 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..795f18d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bot.py b/bot.py new file mode 100644 index 0000000..cdc3c67 --- /dev/null +++ b/bot.py @@ -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) \ No newline at end of file