feat: (description) botinfo, invite, ping

Botinfo now sends ephemeral responses for interactions. Invite command generates invite links dynamically using environment permissions and adds an author icon. Ping command embeds now include an author icon for consistency.
This commit is contained in:
neoarz
2025-09-15 09:00:02 -04:00
parent 5d893a8a84
commit ae5e828869
3 changed files with 17 additions and 4 deletions

View File

@@ -32,7 +32,10 @@ class BotInfo(commands.Cog, name="botinfo"):
value=f"/ (Slash Commands) or {self.bot.bot_prefix} for normal commands", value=f"/ (Slash Commands) or {self.bot.bot_prefix} for normal commands",
inline=False, inline=False,
) )
await context.send(embed=embed) if context.interaction:
await context.interaction.response.send_message(embed=embed, ephemeral=True)
else:
await context.send(embed=embed)
async def setup(bot) -> None: async def setup(bot) -> None:
await bot.add_cog(BotInfo(bot)) await bot.add_cog(BotInfo(bot))

View File

@@ -6,6 +6,7 @@ Description:
Version: 6.4.0 Version: 6.4.0
""" """
import os
import discord import discord
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import Context from discord.ext.commands import Context
@@ -25,10 +26,18 @@ class Invite(commands.Cog, name="invite"):
:param context: The hybrid command context. :param context: The hybrid command context.
""" """
embed = discord.Embed( client = self.bot.user
description=f"Invite me by clicking [here]({self.bot.invite_link}).", if client is None:
color=0xD75BF4, await context.send("Bot is not ready. Try again shortly.")
return
permissions = os.getenv("INVITE_PERMISSIONS", "0")
invite_url = (
f"https://discord.com/api/oauth2/authorize?client_id={client.id}"
f"&scope=bot%20applications.commands&permissions={permissions}"
) )
embed = discord.Embed(description=f"Invite me by clicking [here]({invite_url}).", color=0x7289DA)
embed.set_author(name="Invite Me", icon_url="https://yes.nighty.works/raw/y5SEZ9.webp")
try: try:
await context.author.send(embed=embed) await context.author.send(embed=embed)
await context.send("I sent you a private message!") await context.send("I sent you a private message!")

View File

@@ -30,6 +30,7 @@ class Ping(commands.Cog, name="ping"):
description=f"The bot latency is {round(self.bot.latency * 1000)}ms.", description=f"The bot latency is {round(self.bot.latency * 1000)}ms.",
color=0xBEBEFE, color=0xBEBEFE,
) )
embed.set_author(name="Ping", icon_url="https://yes.nighty.works/raw/y5SEZ9.webp")
await context.send(embed=embed) await context.send(embed=embed)