Makes minibot listen on a configurable port

This commit is contained in:
CitadelStationBot
2017-04-27 17:00:24 -05:00
parent 1334608d23
commit 5818553173
3 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
# Configuration for the minibot.py bot starts here # Configuration for the minibot.py bot starts here
server = "irc.rizon.net" server = "irc.rizon.net"
port = 6667 port = 6667
nudge_port = 45678
channels = ["#asdfgbus", "#botbus"] channels = ["#asdfgbus", "#botbus"]
defaultchannel = "#asdfgbus" defaultchannel = "#asdfgbus"

View File

@@ -73,7 +73,7 @@ def setup_irc_socket():
def setup_nudge_socket(): def setup_nudge_socket():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("", 45678)) # localhost:45678 s.bind(("", nudge_port)) # localhost:nudge_port
s.listen(5) s.listen(5)
logger.info("Nudge socket up and listening") logger.info("Nudge socket up and listening")
return s return s

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from config import *
import sys import sys
import pickle import pickle
import socket import socket
@@ -16,7 +17,7 @@ def pack():
def nudge(data): def nudge(data):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 45678)) s.connect(("localhost", nudge_port))
s.send(data) s.send(data)
s.close() s.close()