Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
murphylee10 committed Oct 22, 2024
2 parents 5fbaa58 + 9a35ffe commit 0445ffa
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions cog_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ async def cog_loader(bot):
"cogs.generic.ping",
"cogs.games.economy",
"cogs.memes.gifs",
"cogs.messages.message"
]
load_tasks = [bot.load_extension(cog) for cog in cogs]

Expand Down
1 change: 1 addition & 0 deletions cogs/generic/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from discord.ext import commands
from discord import app_commands


class Ping(commands.Cog):
def __init__(self, bot):
self.bot = bot
Expand Down
15 changes: 15 additions & 0 deletions cogs/messages/affirmations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
You have a unique light that brightens the world around you. ✨
Your smile has the power to uplift others. 😊
You are worthy of all the good things life has to offer. 🌈
Your kindness is a gift that makes a difference in the lives of others. 🎁
You are strong and capable of overcoming any challenge. 💪
Your creativity knows no bounds; you inspire those around you. 🎨
You bring joy and positivity into every situation. ☀️
You have a beautiful heart that cares deeply for others. ❤️
Your presence makes every place feel more welcoming. 🌍
You are a source of strength and inspiration to those who know you. 🌟
Your laughter is contagious and brings happiness to everyone. 😂
You are talented and have so much to offer the world. 🌟
Your unique perspective is invaluable and appreciated. 🔮
You have a wonderful ability to see the best in people. 🌷
Your determination and hard work will lead you to success. 🏆
33 changes: 33 additions & 0 deletions cogs/messages/message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# cogs/generic/ping.py
import discord
from discord.ext import commands
from discord import app_commands
import random
import os

class Message(commands.Cog):
def __init__(self, bot):
self.bot = bot

@commands.Cog.listener()
async def on_ready(self):
print('Message cog is ready')

# YOUR COMMAND(S) HERE
@app_commands.command(name='affirm', description='Get a positive affirmation')
async def affirm(self, interaction: discord.Interaction):
# Load affirmations from the text file
try:
file_path = os.path.join(os.path.dirname(__file__), 'affirmations.txt')
with open(file_path, 'r') as file:
affirmations = file.readlines()
# Strip newline characters + choose random affirmation
random_affirmation = random.choice([affirmation.strip() for affirmation in affirmations])
await interaction.response.send_message(random_affirmation)
except FileNotFoundError:
# Affirmation file not found :OO
await interaction.response.send_message("Try again later ¯\\_(ツ)_/¯")


async def setup(bot):
await bot.add_cog(Message(bot))

0 comments on commit 0445ffa

Please sign in to comment.