Skip to content

Instantly share code, notes, and snippets.

@butlerx
Created November 2, 2020 20:19
Show Gist options
  • Save butlerx/5ad73c74ef45918220ce0ca985ae779e to your computer and use it in GitHub Desktop.
Save butlerx/5ad73c74ef45918220ce0ca985ae779e to your computer and use it in GitHub Desktop.
diff --git a/src/bot.py b/src/bot.py
index 6027a6a..5a4857e 100644
--- a/src/bot.py
+++ b/src/bot.py
@@ -1,7 +1,7 @@
import argparse
from twisted.words.protocols import irc
-from twisted.internet import reactor, protocol
+from twisted.internet import reactor, protocol, ssl
import config
from request_handler import RequestHandler
@@ -52,8 +52,12 @@ if __name__ == "__main__":
argparser.add_argument("port")
argparser.add_argument("channel")
argparser.add_argument("source_dir")
+ argparser.add_argument("--ssl", action='store_true' )
args = argparser.parse_args()
factory = PasadoirBotFactory(args.channel, args.source_dir)
- reactor.connectTCP(args.host, int(args.port), factory)
+ if args.ssl:
+ reactor.connectSSL(args.host, int(args.port), factory, ssl.ClientContextFactory())
+ else:
+ reactor.connectTCP(args.host, int(args.port), factory)
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment