handle mentions in collage

This commit is contained in:
yuki 2025-10-08 06:56:24 -03:00
parent 7ff4463963
commit 2200f4a3cd

View file

@ -33,6 +33,18 @@ def setup(bot: bot.Bot):
print("returned")
return
if username.startswith("[@:"):
mentioned = bot.get_user(username[3:-1])
try: username = await bot.get_lastfm(mentioned.id)
except Exception as e:
print(e)
await ctx.send(u.error_msg(f"Unknown database error:\n{e}"))
if not username:
await ctx.send(u.error_msg(f"[@:{mentioned.id}] doesn't seem to have an account set. Do so with `/setfm`."))
print("returned")
return
match timeframe:
case "a" | "all" | "alltime" | "o" | "overall": timeframe = "overall"
case "y" | "year" | "yearly": timeframe = "12month"