mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
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:
@@ -32,6 +32,9 @@ 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,
|
||||||
)
|
)
|
||||||
|
if context.interaction:
|
||||||
|
await context.interaction.response.send_message(embed=embed, ephemeral=True)
|
||||||
|
else:
|
||||||
await context.send(embed=embed)
|
await context.send(embed=embed)
|
||||||
|
|
||||||
async def setup(bot) -> None:
|
async def setup(bot) -> None:
|
||||||
|
|||||||
@@ -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!")
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user