summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh <eeei3.joshua0307lol@gmail.com>2024-11-02 18:03:25 -0400
committerJosh <eeei3.joshua0307lol@gmail.com>2024-11-02 18:03:25 -0400
commit0ec8169d3ec6dc8a7e8dcdfe9353dcfb3dddcd4c (patch)
tree5b51049a8362b8c85b937d3bb1340abeb00ddd32
parent005af272481f43a9c075cc0278b949213fd1ee8e (diff)
feat: figured out how to get commands to work
-rw-r--r--bigresult.py11
-rw-r--r--main.py11
2 files changed, 17 insertions, 5 deletions
diff --git a/bigresult.py b/bigresult.py
index 6a11d1b..67abf33 100644
--- a/bigresult.py
+++ b/bigresult.py
@@ -1,16 +1,21 @@
import discord
from discord.ext import commands
-class BotClient(discord.ext.commands.Bot):
+class BotClient(commands.Bot):
async def on_ready(self):
print("The big result bot is ready!")
for guild in self.guilds:
break;
await self.send_msg("Hurlo")
+ async def on_message(self, message):
+ await self.process_commands(message)
+ if message.author == self.user:
+ return
+ if ("1984" in message.content):
+ await message.channel.send("kys")
+
async def send_msg(self, msg):
channel = self.get_channel(427176475406630914)
await channel.send(msg)
-
-
diff --git a/main.py b/main.py
index 771aa17..5c22de2 100644
--- a/main.py
+++ b/main.py
@@ -3,11 +3,18 @@ import os
import discord
from dotenv import load_dotenv
from bigresult import BotClient
+from discord.ext import commands
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
intents = discord.Intents.all()
-client = BotClient(intents=intents, command_prefix='!') # This represents our connection with Discord
-client.run(TOKEN) # This actually starts our bot \ No newline at end of file
+client = BotClient(intents=intents, command_prefix="!") # This represents our connection with Discord
+
+
+@client.command(name="bigresult")
+async def teach(ctx):
+ await ctx.send("https://cdn.discordapp.com/attachments/427176475406630914/1302392181448900649/image.png?ex=6727f2bd&is=6726a13d&hm=6092f4fba06412feac26a16a6900bf6e6122d66506f60bfcc0bc7101ecede4db&")
+
+client.run(TOKEN) # This actually starts our bot