"/HELP pridata", "/HELP swkop") for i in helps: weechat.command(i) return weechat.PLUGIN_RC_OK_IGNORE_ALL weechat.add_timer_handler(2, "hook_tmr_queue_cb") weechat.add_message_handler("privmsg", "hook_msg_cb") weechat.add_message_handler("mode", "hook_mode_cb") weechat.add_command_handler("addword", "hook_addword_cb","", "bestemmia -:- commento : Aggiunge una nuova" " bestemmia alla lista") weechat.add_command_handler("pripar", "hook_pripar_cb", "", ": stampa la lista delle parolacce monitorate") weechat.add_command_handler("prichan", "hook_prichan_cb","", ": stampa la lista dei network/canali monitorati") weechat.add_command_handler("prihelp", "hook_prihelp_cb", "", "Stampa l'help di tutti i comandi'") weechat.add_command_handler("pridata", "hook_pridata_cb", "", ": stampa i dati in archivio") weechat.add_command_handler("swkop", "hook_swkop_cb", "",
weechat.prnt(" ") return weechat.PLUGIN_RC_OK def no_hl_remove(serveur, args): """ allow a host to hl when he wants to """ if args in people_not_allowed_to_hl: people_not_allowed_to_hl.remove(args) weechat.prnt(" ") weechat.prnt("\x02%s\x02 peut a nouveau highlighter" % args) weechat.prnt(" ") return weechat.PLUGIN_RC_OK def vacuum(): to_be_removed = [] t = int(time()) for k,v in timer_dict.iteritems(): if v < t: to_be_removed.append(k) for key in to_be_removed: del timer_dict[key] return weechat.PLUGIN_RC_OK weechat.add_modifier("irc_in", "PRIVMSG", "highlight_checker") weechat.add_command_handler("no_hl_add", "no_hl_add") weechat.add_command_handler("no_hl_remove", "no_hl_remove") weechat.add_command_handler("no_hl_list", "no_hl_list") weechat.add_timer_handler(VACUUM_DELAY, 'vacuum')
weechat.prnt("-"*30) weechat.prnt(s.text.encode('utf-8')) weechat.prnt("-"*30) weechat.prnt("*** TWITTED ***") if cmd == "twits": weechat.prnt("Working...") statuses = api.GetFriendsTimeline(count=str(txt)) for s in statuses: weechat.prnt("Data: %s" % s.created_at) weechat.prnt("ID: %s, User: %s" % (s.id, s.user.name)) weechat.prnt("Text: %s" % (s.text.encode('utf-8'))) weechat.prnt("---") elif len(cmd) == 1: if cmd[0].lower() == "twits": weechat.prnt("Working...") statuses = api.GetFriendsTimeline(count=5) for s in statuses: weechat.prnt("Data: %s" % s.created_at) weechat.prnt("ID: %s, User: %s" % (s.id, s.user.name)) weechat.prnt("Text: %s" % (s.text.encode('utf-8'))) weechat.prnt("---") return weechat.PLUGIN_RC_OK weechat.add_command_handler("twit", "hook_commands_cb", "Send/Receive twitter messages", "") weechat.prnt("Plugin WeTwit loaded!")
Blank regexps ("") will trigger for any hostmask and/or channel. Examples: /response add "^!whoami" "/msg \\channel You are \\nick (\\mask) in \\channel!" /response add "^!make (.*)" "/msg \\channel No rule for \\1. Stop." /response add "somebody@somehost" "" "^!op" "/op \\nick" """ import weechat, sys, re, pickle weechat.register("Response", version, "", "Execute commands on specific triggers") weechat.add_message_handler("privmsg", "triggercheck") weechat.add_command_handler("response", "triggercontrol", " Allows you to view, add and delete responses:", "<operation>", helptext, "add|delete|list|toggle") debug = 0 t_enabled = 0 t_nick = 1 t_channel = 2 t_trigger = 3 t_reaction = 4 t_outstream = 5 def triggercheck(server, args): null, context, message = args.split(":", 2) mask, null, channel = context.strip().split(" ", 2)