15 lines
675 B
Python
15 lines
675 B
Python
|
import discord
|
||
|
|
||
|
|
||
|
# Function to register all commands to the CommandTree
|
||
|
def register_commands(tree: discord.app_commands.CommandTree, guild: discord.Object = None):
|
||
|
# Ping Command
|
||
|
@tree.command(name="ping", description="Check if Amber is responsive.", guild=guild)
|
||
|
async def ping(interaction: discord.Interaction):
|
||
|
await interaction.response.send_message(f"Pong! Latency: {round(interaction.client.latency * 1000)}ms")
|
||
|
|
||
|
# Example Command
|
||
|
@tree.command(name="hello", description="Say hello to Amber.", guild=guild)
|
||
|
async def hello(interaction: discord.Interaction):
|
||
|
await interaction.response.send_message("Hello! Amber here to help.")
|