Files
Syntrel/cogs/fun/eightball.py
neoarz 5d893a8a84 feat: (check description). 8ball, botinfo, context menu, feedback
Moved eightball cog from general to fun category and updated help command mapping accordingly. Added support for disabling cogs via the DISABLED_COGS environment variable in bot.py. Updated embed styles and author fields for botinfo, feedback, and eightball commands. Commented out context_menus cog code.
2025-09-15 08:44:54 -04:00

57 lines
1.8 KiB
Python

import random
import discord
from discord import app_commands
from discord.ext import commands
from discord.ext.commands import Context
class EightBall(commands.Cog, name="8ball"):
def __init__(self, bot) -> None:
self.bot = bot
@commands.hybrid_command(
name="8ball",
description="Ask any question to the bot.",
)
@app_commands.describe(question="The question you want to ask.")
async def eight_ball(self, context: Context, *, question: str) -> None:
"""
Ask any question to the bot.
:param context: The hybrid command context.
:param question: The question that should be asked by the user.
"""
answers = [
"It is certain.",
"It is decidedly so.",
"You may rely on it.",
"Without a doubt.",
"Yes - definitely.",
"As I see, yes.",
"Most likely.",
"Outlook good.",
"Yes.",
"Signs point to yes.",
"Reply hazy, try again.",
"Ask again later.",
"Better not tell you now.",
"Cannot predict now.",
"Concentrate and ask again later.",
"Don't count on it.",
"My reply is no.",
"My sources say no.",
"Outlook not so good.",
"Very doubtful.",
]
embed = discord.Embed(
title="8 Ball",
description=f"{random.choice(answers)}",
color=0x7289DA,
)
embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp")
embed.set_footer(text=f"The question was: {question}")
await context.send(embed=embed)
async def setup(bot) -> None:
await bot.add_cog(EightBall(bot))