Yves/commands/config.py
2025-10-07 03:09:42 -03:00

18 lines
710 B
Python

import nerimity
import bot
import utils as u
def setup(bot: bot.Bot):
@bot.command(name="setfm", aliases=["setuser", "setlastfm"])
@bot.slash_command(name="setfm", description="Sets your Last.fm username.")
async def setfm(ctx: nerimity.Context, username: str = None):
if not username:
await ctx.send(u.error_msg("Please provide your Last.fm username."))
else:
try:
await bot.set_lastfm(ctx.author.id, username)
await ctx.send(u.good_msg(f"Your Last.fm user has been set to **{username}**!"))
except Exception as e:
print(e)
await ctx.send(u.error_msg("Unknown database error."))