Jabber/XMPP conference bot & framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
brathuhn/modules/active/notify_all.py

31 lines
682 B

#!/usr/bin/python
# -*- coding: utf-8 -*-
import brathuhn
##############################################
def notify_all(msg, args):
message = "";
userJID = brathuhn.getUsers().items()
for a in userJID:
message += "{0}, ".format(a[0].getResource());
message = message[:-2];
if len(args)>=2 and args[1] != "":
message += ": ";
for a in args[1:]:
message += "{0} ".format(a);
brathuhn.sendMsg(brathuhn.ROOM, message,'groupchat')
##############################################
brathuhn.addCommand("all","Usage: !all [msg]; Notify everyone in Channel", notify_all)
##############################################