Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Stem.privilege returns wrong privilege level #35

alolis opened this Issue · 5 comments

1 participant


I have implemented on my leaf the someone_did_join_channel event and I have noticed the following:

  1. Channel Founder (+q) or Channel Admin (+a) joins the channel and gets the user mode from chanserv.
  2. someone_did_join_channel() is called and the first method i am calling inside the event is stem.privilege(channel, nick) which i would expect to return :channel_owner or :admin symbol but instead i am getting :unvoiced

I really do not understand at what point the users get updated with their proper channel levels. This is very confusing


Some further info. If the user is a channel operator (+o) the whole thing works as expected. I can see the problem with admins and channel owners only. Here is the difference when a channel operator joins and when owner/admin joins:


  • THEBOT gives channel operator status to arekanderu


  • THEBOT sets mode +q #somechannel arekanderu
  • THEBOT gives channel operator status to arekanderu

I have some further info regarding this issue. I was able to reproduce the problem with channel operators as well. If the channel operator has a greet message then I can see the problem. Example of channel operator with greet message joining channel:

  • THEBOT [arekanderu] This is a test message
  • THEBOT gives channel operator status to arekanderu

In addition, i have set type: op for one of my leafs in leaves.yml and implemented a method which uses authentication as follows:

def test_command(stem, sender, reply_to, message)
    # do stuff
ann :test_command, :protected => true

The bot will return "Only an op can do that" if one of the cases i described occur. It will work normal if the user is a channel operator without a greet message.


I have some more info. I though that if it's a channel operator without a greet message it will work properly but it seems that I didn't took under consideration that I had a sleep(2) before I make the call to stem.privilege. If i remove the sleep the problem is 100% reproducible. Looks like that the users are not refreshed on time/properly but if I add the sleep the users refresh completes on time.

This is the code which I have and it only works properly with chan ops without greet message:

def someone_did_join_channel(stem, sender, channel)
   privilege = stem.privilege(channel, sender[:nick])

Waiting for your comments Tim and hopefully for a solution. This is causing way too much headache for me at the moment.


Any updates on the issue? =/


Over a month and still no reply...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.