Search code examples
perlbotsirc

Check if user is operator using Bot::BasicBot


I'm using Bot::BasicBot to make a simple irc bot in perl. How do I check if a given user is a channel operator when receiving a message? The user that sent the message is $message->{who}, but how can I check the operator status of that user?


Solution

  • https://metacpan.org/pod/Bot::BasicBot#channel_data

    channel_data
    

    Takes a channel names as a parameter, and returns a hash of hashes. The keys are the nicknames in the channel, the values are hashes containing the keys "voice" and "op", indicating whether these users are voiced or opped in the channel.