OokamiPupV2/cmd_discord.py

33 lines
964 B
Python

# cmd_discord.py
from discord.ext import commands
from cmd_common import common_commands as cc
def setup(bot):
@bot.command()
async def greet(ctx):
result = cc.greet(ctx.author.display_name, "Discord")
await ctx.send(result)
@bot.command()
async def ping(ctx):
result = cc.ping()
await ctx.send(result)
@bot.command()
async def howl(ctx):
"""Calls the shared !howl logic."""
result = cc.generate_howl_message(ctx.author.display_name)
await ctx.send(result)
@bot.command()
async def reload(ctx):
""" Dynamically reloads Discord commands. """
try:
import cmd_discord
import importlib
importlib.reload(cmd_discord)
cmd_discord.setup(bot)
await ctx.send("Commands reloaded!")
except Exception as e:
await ctx.send(f"Error reloading commands: {e}")