1

I am trying to create my own admin bot that can handle a lot of the admin stuff, such as muting users... Currently I can mute users by tagging/replying to their message, but I also want to be able to mute a user by @mentioning (such as @Netsu) them, but how do I get a users ID via their username? I don't see any way to get it from the API, or did I just miss it?

If you are interested, I'm using Nim + Telebot.

Netsu
  • 1,399
  • 1
  • 7
  • 18
  • I've been playing a bit, and only found that sometimes "getChat?chat_id=12345" returns the ID with the field "username" (sometimes it doesn't). I guess you need to store "id->username" and then use that data to act (e.g. "ban @username" -> find stored "username" ID -> ban ID). – xbello Dec 13 '21 at 13:16

0 Answers0