Added credits
This commit is contained in:
parent
323d31514f
commit
06e947d1a3
3 changed files with 35 additions and 2 deletions
|
@ -45,15 +45,23 @@ class MucHandler(MucRoomHandler):
|
||||||
if(not self.room_state.joined or user.same_as(self.room_state.me)):
|
if(not self.room_state.joined or user.same_as(self.room_state.me)):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
status = ''
|
||||||
|
if stanza.get_status() != None:
|
||||||
|
status = stanza.get_status()
|
||||||
|
|
||||||
for mod in self.client.module_manager.modules.itervalues():
|
for mod in self.client.module_manager.modules.itervalues():
|
||||||
mod.join(stanza.get_from().bare().as_unicode(), stanza.get_from().resource, stanza.get_show(), stanza.get_status(), self)
|
mod.join(stanza.get_from().bare().as_unicode(), stanza.get_from().resource, stanza.get_show(), status, self)
|
||||||
|
|
||||||
def user_left(self, user, stanza):
|
def user_left(self, user, stanza):
|
||||||
if(not self.room_state.joined or user.same_as(self.room_state.me)):
|
if(not self.room_state.joined or user.same_as(self.room_state.me)):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
status = ''
|
||||||
|
if stanza.get_status() != None:
|
||||||
|
status = stanza.get_status()
|
||||||
|
|
||||||
for mod in self.client.module_manager.modules.itervalues():
|
for mod in self.client.module_manager.modules.itervalues():
|
||||||
mod.leave(stanza.get_from().bare().as_unicode(), stanza.get_from().resource, stanza.get_show(), stanza.get_status(), self)
|
mod.leave(stanza.get_from().bare().as_unicode(), stanza.get_from().resource, stanza.get_show(), status, self)
|
||||||
|
|
||||||
def subject_changed(self, user, stanza):
|
def subject_changed(self, user, stanza):
|
||||||
topic = ''
|
topic = ''
|
||||||
|
|
|
@ -25,13 +25,18 @@ def exithandler(signum, frame):
|
||||||
global run
|
global run
|
||||||
run = False
|
run = False
|
||||||
|
|
||||||
|
print 'Starting Curunir 0.1'
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, exithandler)
|
signal.signal(signal.SIGINT, exithandler)
|
||||||
signal.signal(signal.SIGTERM, exithandler)
|
signal.signal(signal.SIGTERM, exithandler)
|
||||||
signal.signal(signal.SIGQUIT, exithandler)
|
signal.signal(signal.SIGQUIT, exithandler)
|
||||||
|
|
||||||
|
print 'Loading modules...'
|
||||||
|
|
||||||
modman = ModuleManager(config)
|
modman = ModuleManager(config)
|
||||||
|
|
||||||
connection = XMPPConnection(config, modman)
|
connection = XMPPConnection(config, modman)
|
||||||
|
print 'Connecting...'
|
||||||
connection.connect()
|
connection.connect()
|
||||||
|
|
||||||
while run:
|
while run:
|
||||||
|
|
20
modules/credits.py
Normal file
20
modules/credits.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from base import ModuleBase
|
||||||
|
import re
|
||||||
|
|
||||||
|
class Module(ModuleBase):
|
||||||
|
def __init__(self, manager):
|
||||||
|
ModuleBase.__init__(self, manager)
|
||||||
|
|
||||||
|
def commands(self):
|
||||||
|
return [('!credits', 'Wer hat\'s erfunden?')]
|
||||||
|
|
||||||
|
def groupchat(self, room, nick, text, handler):
|
||||||
|
if not re.match(r'!credits(?:\W|\Z)', text):
|
||||||
|
return
|
||||||
|
|
||||||
|
handler.reply(
|
||||||
|
'''Ich wurde von NeoRaider (matze) geschaffen,
|
||||||
|
geschmiedet aus reinem Python und der Magie von PyXMPP.
|
||||||
|
Nach langer Gefangenschaft in dunklen Verliesen aus fehlender
|
||||||
|
Dokumentation kam ich an Licht, um dem C3HL zu dienen...'''
|
||||||
|
)
|
Reference in a new issue