Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hexchat
- import random
- __module_name__ = "Escribe-Consejos"
- __module_author__ = "Raull77 Zcom"
- __module_version__ = "0.1"
- __module_description__ = "Responde con un consejos cunado se escribe la palabra .consejos"
- def frase_aleatoria(fichero):
- with open(fichero,'r',encoding='UTF-8') as f:
- todas_las_frases = f.read().splitlines()
- frase_elegida = random.choice(todas_las_frases)
- hexchat.command("SAY " + frase_elegida)
- def event_cb(word, word_eol, userdata):
- if word[1] == '.consejos':
- frase_aleatoria('/home/k/.config/hexchat/addons/frases.txt')
- return hexchat.EAT_NONE
- hexchat.hook_print("Channel Message", event_cb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement