1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00
profanity/plugins/python-test.py

41 lines
1.3 KiB
Python
Raw Normal View History

2013-08-28 19:36:09 -04:00
import prof
def prof_init(version, status):
prof.cons_show("python-test: init, " + version + ", " + status)
prof.register_command("/python", 0, 1, "/python", "python-test", "python-test", cmd_python)
prof.register_timed(timer_test, 10)
def prof_on_start():
prof.cons_show("python-test: on_start")
def prof_on_connect(account_name, fulljid):
prof.cons_show("python-test: on_connect, " + account_name + ", " + fulljid)
2013-08-28 19:36:09 -04:00
def prof_on_message_received(jid, message):
prof.cons_show("python-test: on_message_received, " + jid + ", " + message)
2013-08-28 19:48:39 -04:00
prof.cons_alert()
return message + "[PYTHON]"
2013-08-28 19:36:09 -04:00
2013-08-31 16:11:28 -04:00
def prof_on_message_send(jid, message):
prof.cons_show("python-test: on_message_send, " + jid + ", " + message)
prof.cons_alert()
return message + "[PYTHON]"
2013-08-28 19:36:09 -04:00
def cmd_python(msg):
if msg:
prof.cons_show("python-test: /python command called, arg = " + msg)
else:
prof.cons_show("python-test: /python command called with no arg")
prof.cons_alert()
prof.notify("python-test: notify", 2000, "Plugins")
prof.send_line("/vercheck")
prof.cons_show("python-test: sent \"/vercheck\" command")
def timer_test():
prof.cons_show("python-test: timer fired.")
recipient = prof.get_current_recipient()
if recipient:
prof.cons_show(" current recipient = " + recipient)
prof.cons_alert()