radiobot/bot.py

16 lines
458 B
Python

import teambot, sys
import os.path as fs
class RadioBot(teambot.Handler):
def on_pubmsg(self,channel,nick,text):
pass # change this
if __name__=="__main__":
if not fs.exists("channels.txt"):
print("ERROR: No channels.txt. Use channels.txt.example as an example.")
sys.exit(1)
with open("channels.txt") as f:
channels = [l.rstrip() for l in f if l.rstrip()]
bot = teambot.TeamBot(channels,"radiobot2","localhost",chandler=RadioBot)
bot.start()