The KISS Twitch bot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
897 B

  1. #!/usr/bin/env python3
  2. import argparse
  3. import irc3
  4. from _twitchbot.config import get_config
  5. from _twitchbot import twitchbot
  6. TWITCH_IRC_SERVER = "irc.chat.twitch.tv"
  7. TWITCH_IRC_PORT = 6697
  8. def main() -> int:
  9. args = get_arguments()
  10. twitchbot.config = get_config(args.config)
  11. print(twitchbot.config.timer.messages)
  12. bot = irc3.IrcBot.from_config({
  13. 'nick': twitchbot.config.nickname,
  14. 'password': twitchbot.config.token,
  15. 'autojoins': [twitchbot.config.channel],
  16. 'host': TWITCH_IRC_SERVER,
  17. 'port': TWITCH_IRC_PORT,
  18. 'ssl': True,
  19. 'includes': [twitchbot.__name__]
  20. })
  21. bot.run(forever=True)
  22. return 0
  23. def get_arguments():
  24. parser = argparse.ArgumentParser()
  25. parser.add_argument('--config', '-c', type=str, default='config.json')
  26. return parser.parse_args()
  27. if __name__ == '__main__':
  28. exit(main())