0

So pretty much I've been making a little python bot and I already added a command to make a "bank" and have money, and other identifiers.

What I wanted to do is add a command stats and then mention the user or just use their discord hashtag thing. So for example I'd want the stats from the user "Bob" and I'd write $stats @bob or $stats bob#0001 and the bot would write out the persons stats in a embed message.

Problem how to get the user's id from the mention since all stats are ofc saved in the user's ID in the json file.

Anyone have an idea how? Maybe i've missed something in the documentation but I am not too sure about that.

Jan
  • 45
  • 7
  • 1
    What have you done so far? Can you show [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)? – Nurqm Jan 30 '21 at 16:43
  • Well I haven't gotten far with this. I get the mention by the arg variable from the command: async def stats(ctx, arg) but I am not exactly sure what to do with this info. I'm guessing I have to compare it with something to ensure it's a real user but I don't know how to get the ID out of this mention and check if it's even a mention. @Nurqm – Jan Jan 30 '21 at 17:01
  • I did find it but I am not sure myself why I didn't try it. Mostly cause I didn't want to copy paste without knowing why it works. @ŁukaszKwieciński – Jan Jan 30 '21 at 17:04

0 Answers0