Replacing IRC /ban and /unban with API

Hello! This is more of a request than a question.

I have been using the /ban and /unban commands via IRC to moderate chat at times but with the upcoming removal I am swapping to using the API calls instead; which is fine. I notice the ban user end point in the API requires the user_id which if for whatever reason i only have the username i have to make another call to the get users end point to get the id. My question/request would it be possible to have an end point that takes the login name for banning and unbanning a user so as not to have to make 2 calls.

You would need a uservoice.

But logically you should already have the userID’s since the userID’s for the target are in the IRCv3 tags of chat.

So you don’t need to do an API call to convert a username to a userID as it’s already presented in the chat messages “meta data”.

See user-id tag in Twitch IRC Tags | Twitch Developers

Yes, I know it exists in the tags, but say I wanted to ban a user who wasnt in the chat or wanted to unban a user i would still need to get the user_id.

Then in that scenario yes you would need to do a username to userID lookup first via get users yeah.

If a uservoice was created asking for a username query param I doubt that would be accepted or processed since that would be twitch doing the lookup instead of you doing the lookup, since the functionality already exists.

I was unfamiliar with the uservoice. I did find this suggestion on it though, not many votes but it does say under consideration.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.