Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __module_name__ = "Rhythmbox Irc Announcer Trigger"
- __module_description__ = "/me Current song of rhythmbox when !rbox is said in any channel joined."
- __module_version__ = "0.1"
- import xchat
- import subprocess
- import time
- def message_cb(word, word_eol, userdata):
- message=word[1]
- song = subprocess.Popen('rhythmbox-client --print-playing',shell=True,stdout=subprocess.PIPE)
- stdout_value = song.communicate()[0]
- #If channel message is !rbox
- if message == "!rbox":
- #xchat command /say (output of rhythmbox-client --print-playing)
- xchat.command("say Radio is now playing "+str(stdout_value).strip('\n'))
- else:
- True
- xchat.hook_print("Your Message", message_cb)
- xchat.hook_print("Channel Message", message_cb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement