babili-bot/app.py

25 lines
757 B
Python
Raw Normal View History

2018-09-04 22:46:42 +00:00
#!/usr/bin/env python3
from bot import Bot
bot = Bot("127.0.0.1", 6667, "BabiliBot|py", ["#bots"])
def handle_pm(name, response):
print("PM: {} - {}".format(name, response))
def handle_message(name, source, response):
2018-09-05 02:08:00 +00:00
#bot.send_message(source, "Got response")
print("MSG: {} {} - {}".format(name, source, response))
def handle_mode(channel, mode):
if mode == "-r":
bot.send_message("ChanServ", "REGISTER {}", channel)
bot.send_message("ChanServ", "SET Successor {} {}", chan, bot.botnick)
bot.send_message("ChanServ", "SET Founder {} {}", chan, bot.author)
2018-09-04 22:46:42 +00:00
if __name__ == "__main__":
bot.start("settings.json", {
"pm": handle_pm,
"message": handle_message,
"mode": handle_mode
})