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"])
|
|
|
|
|
2018-09-10 22:32:21 +00:00
|
|
|
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")
|
2018-09-10 22:32:21 +00:00
|
|
|
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__":
|
2018-09-10 22:32:21 +00:00
|
|
|
bot.start("settings.json", {
|
|
|
|
"pm": handle_pm,
|
|
|
|
"message": handle_message,
|
|
|
|
"mode": handle_mode
|
|
|
|
})
|