mirror of
https://github.com/nikdoof/mumblepy.git
synced 2025-12-13 06:22:17 +00:00
Add registered user information.
This commit is contained in:
@@ -55,7 +55,7 @@ class Group(object):
|
||||
|
||||
@property
|
||||
def inherited(self):
|
||||
"""Indiciates if the group is herited from a parent channel."""
|
||||
"""Indiciates if the group is inherited from a parent channel."""
|
||||
return bool(self.__group.inherited)
|
||||
|
||||
@property
|
||||
|
||||
@@ -108,6 +108,12 @@ class Server(object):
|
||||
def set_user_state(self, state):
|
||||
return self.__server.setState(state)
|
||||
|
||||
def get_registrations(self, filter=''):
|
||||
return self.__server.getRegistedUsers(filter)
|
||||
|
||||
def get_registration(self, user_id):
|
||||
return self.__server.getRegistration(user_id)
|
||||
|
||||
# Bans
|
||||
|
||||
def get_bans(self):
|
||||
|
||||
@@ -2,6 +2,8 @@ class User(object):
|
||||
def __init__(self, server, user):
|
||||
self.__server = server
|
||||
self.__user = user
|
||||
if self.__user.userid:
|
||||
self.__registration = self.__server.get_registration(self.__user.userid)
|
||||
|
||||
@property
|
||||
def session(self):
|
||||
@@ -113,6 +115,17 @@ class User(object):
|
||||
"""Returns the number of seconds the user has been idle."""
|
||||
return self.__user.idlesecs
|
||||
|
||||
@property
|
||||
def registered(self):
|
||||
"""Indiciates if the user is registered"""
|
||||
return self.__user.userid > 0
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
"""If the user is registered, return the user's email address"""
|
||||
if self.__user.userid:
|
||||
return self.__registration.UserEmail
|
||||
|
||||
def update(self, **kwargs):
|
||||
"""Update a value of the user's state.kwargs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user