mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +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
|
# 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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user