handle mentions in collage
This commit is contained in:
parent
7ff4463963
commit
2200f4a3cd
1 changed files with 12 additions and 0 deletions
|
|
@ -33,6 +33,18 @@ def setup(bot: bot.Bot):
|
||||||
print("returned")
|
print("returned")
|
||||||
return
|
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:
|
match timeframe:
|
||||||
case "a" | "all" | "alltime" | "o" | "overall": timeframe = "overall"
|
case "a" | "all" | "alltime" | "o" | "overall": timeframe = "overall"
|
||||||
case "y" | "year" | "yearly": timeframe = "12month"
|
case "y" | "year" | "yearly": timeframe = "12month"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue