mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 01:49:19 +00:00
Makes minibot listen on a configurable port
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Configuration for the minibot.py bot starts here
|
||||
server = "irc.rizon.net"
|
||||
port = 6667
|
||||
nudge_port = 45678
|
||||
|
||||
channels = ["#asdfgbus", "#botbus"]
|
||||
defaultchannel = "#asdfgbus"
|
||||
|
||||
@@ -73,7 +73,7 @@ def setup_irc_socket():
|
||||
|
||||
def setup_nudge_socket():
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.bind(("", 45678)) # localhost:45678
|
||||
s.bind(("", nudge_port)) # localhost:nudge_port
|
||||
s.listen(5)
|
||||
logger.info("Nudge socket up and listening")
|
||||
return s
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
from config import *
|
||||
import sys
|
||||
import pickle
|
||||
import socket
|
||||
@@ -16,7 +17,7 @@ def pack():
|
||||
|
||||
def nudge(data):
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect(("localhost", 45678))
|
||||
s.connect(("localhost", nudge_port))
|
||||
s.send(data)
|
||||
s.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user