mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
fix interface
This commit is contained in:
@@ -1022,14 +1022,14 @@ def set_status(argv, **args):
|
||||
return {
|
||||
'presence': {
|
||||
'status': 'xa',
|
||||
'message': 'I\'m muted now. You can unmute me with "%s: set_status unmute"' % conf("bot_user")
|
||||
'msg': 'I\'m muted now. You can unmute me with "%s: set_status unmute"' % conf("bot_user")
|
||||
}
|
||||
}
|
||||
elif argv[1] == 'unmute' and args['reply_user'] == conf('bot_owner'):
|
||||
return {
|
||||
'presence': {
|
||||
'status': None,
|
||||
'message': ''
|
||||
'msg': ''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
10
urlbot.py
10
urlbot.py
@@ -118,6 +118,10 @@ class UrlBot(IdleBot):
|
||||
"""
|
||||
Send a reply to a message
|
||||
"""
|
||||
if self.status is not None:
|
||||
self.logger.warn("I'm muted!")
|
||||
return
|
||||
|
||||
set_conf('request_counter', conf('request_counter') + 1)
|
||||
|
||||
if str is not type(message):
|
||||
@@ -352,10 +356,10 @@ class UrlBot(IdleBot):
|
||||
presence = action['presence']
|
||||
conf_set('presence', presence)
|
||||
|
||||
self.status = presence['msg']
|
||||
self.show = presence['status']
|
||||
self.status = presence.get('msg')
|
||||
self.show = presence.get('status')
|
||||
|
||||
self.send_presence(pstatus=presence['msg'], pshow=presence['status'])
|
||||
self.send_presence(pstatus=self.status, pshow=self.show)
|
||||
# self.reconnect(wait=True)
|
||||
|
||||
if '__main__' == __name__:
|
||||
|
||||
Reference in New Issue
Block a user