Help with mIRC chat BOT getting it's own badge info

This should be done when the bot connects to the server, not on channel join. You’ll get an initial GLOBALUSERSTATE and later on USERSTATEs whenever you join a channel or send a message.

Also note that badges are the way you are meant to parse for these infos via IRC and that they may not necessarily be in the order you expect them to be in - so badges=broadcaster/1 may not be a string that is there, but rather in a later position in the badges list. (For example it may be badges=premium/1,broadcaster/1 - though i have currently not seen anything come before broadcaster.)

Otherwise, you can execute the /mods (or .mods) command to get a list of mods.

Otherwise, it is recommended to use the Get Moderators API Endpoint instead, which requires authentication from the Broadcaster.

An example of incoming messages, prefixed with [CHAT] by my script:

[CHAT] :tmi.twitch.tv CAP * ACK :twitch.tv/membership twitch.tv/tags twitch.tv/commands
[CHAT]
[CHAT] :tmi.twitch.tv 001 redacted :Welcome, GLHF!
[CHAT] :tmi.twitch.tv 002 redacted :Your host is tmi.twitch.tv
[CHAT] :tmi.twitch.tv 003 redacted :This server is rather new
[CHAT] :tmi.twitch.tv 004 redacted :-
[CHAT] :tmi.twitch.tv 375 redacted :-
[CHAT] :tmi.twitch.tv 372 redacted :You are in a maze of twisty passages, all alike.
[CHAT] :tmi.twitch.tv 376 redacted :>
[CHAT] @badge-info=;badges=premium/1;color=#FF69B4;display-name=redacted;emote-sets=redactedforbrevity;user-id=redacted;user-type= :tmi.twitch.tv GLOBALUSERSTATE
[CHAT]
[CHAT] :redacted!redacted@redacted.tmi.twitch.tv JOIN #redacted
[CHAT]
[CHAT] :redacted.tmi.twitch.tv 353 redacted = #redacted :redacted
[CHAT] :redacted.tmi.twitch.tv 366 redacted #redacted :End of /NAMES list
[CHAT] @badge-info=subscriber/23;badges=broadcaster/1,subscriber/3018,premium/1;color=#FF69B4;display-name=redacted;emote-sets=redactedforbrevity;mod=0;subscriber=1;user-type= :tmi.twitch.tv USERSTATE #redacted
[CHAT]
[CHAT] @emote-only=0;followers-only=-1;r9k=0;rituals=0;room-id=redacted;slow=0;subs-only=0 :tmi.twitch.tv ROOMSTATE #redacted
[CHAT]