2025-09-14 18:54:56 -04:00
|
|
|
import platform
|
|
|
|
|
import discord
|
2025-10-09 00:24:43 -04:00
|
|
|
from discord import app_commands
|
2025-09-14 18:54:56 -04:00
|
|
|
from discord.ext import commands
|
2025-10-09 00:24:43 -04:00
|
|
|
from discord.ext.commands import Context
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BotInfo(commands.Cog, name="botinfo"):
|
|
|
|
|
def __init__(self, bot) -> None:
|
|
|
|
|
self.bot = bot
|
2025-09-14 18:54:56 -04:00
|
|
|
|
|
|
|
|
@commands.hybrid_command(
|
|
|
|
|
name="botinfo",
|
|
|
|
|
description="Get some useful (or not) information about the bot.",
|
|
|
|
|
)
|
2025-10-09 00:24:43 -04:00
|
|
|
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
|
|
|
|
@app_commands.allowed_installs(guilds=True, users=True)
|
|
|
|
|
async def botinfo(self, context: Context) -> None:
|
2025-09-14 18:54:56 -04:00
|
|
|
embed = discord.Embed(
|
2025-09-16 10:21:36 -04:00
|
|
|
title="Syntrel Discord Bot",
|
2025-09-15 08:44:54 -04:00
|
|
|
color=0x7289DA,
|
2025-09-14 18:54:56 -04:00
|
|
|
)
|
2025-10-03 11:27:19 -04:00
|
|
|
embed.set_author(name="Bot Information", icon_url="https://yes.nighty.works/raw/gSxqzV.png")
|
2025-09-15 08:44:54 -04:00
|
|
|
embed.add_field(name="Owner:", value="[neoarz](https://discordapp.com/users/1015372540937502851)", inline=True)
|
2025-09-14 18:54:56 -04:00
|
|
|
embed.add_field(
|
|
|
|
|
name="Python Version:", value=f"{platform.python_version()}", inline=True
|
|
|
|
|
)
|
|
|
|
|
embed.add_field(
|
|
|
|
|
name="Prefix:",
|
|
|
|
|
value=f"/ (Slash Commands) or {self.bot.bot_prefix} for normal commands",
|
|
|
|
|
inline=False,
|
|
|
|
|
)
|
2025-10-09 00:24:43 -04:00
|
|
|
if context.interaction:
|
2025-09-15 09:00:02 -04:00
|
|
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
|
|
|
|
else:
|
|
|
|
|
await context.send(embed=embed)
|
2025-10-09 00:24:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
async def setup(bot) -> None:
|
|
|
|
|
await bot.add_cog(BotInfo(bot))
|