Quartessa/commands.py
Dan 0fa15014d8 Main.py - Functional source of the bot, handles all the discord bot functionality
Commands.py - Allows the commands to be offloaded into another file for easy of edit/registering without overloading the main core.
2025-01-13 21:32:31 -05:00

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.")