32 lines
662 B
Python
32 lines
662 B
Python
#!/usr/bin/env python3
|
|
import argparse
|
|
import yaml
|
|
from pinhook import plugin, bot
|
|
|
|
|
|
class BreadBot(bot.Bot):
|
|
|
|
def on_welcome(self, c, e):
|
|
super().on_welcome(c, e)
|
|
for channel in self.chanlist:
|
|
self.process_output(c, channel, plugin.message('bread'))
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(
|
|
description='Breadpunk Bread Bot',
|
|
)
|
|
parser.add_argument(
|
|
'config',
|
|
type=argparse.FileType('r'),
|
|
help='Configuration file',
|
|
)
|
|
args = parser.parse_args()
|
|
config = yaml.safe_load(args.config)
|
|
bot = BreadBot(**config)
|
|
bot.start()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|