Created
March 13, 2020 15:33
-
-
Save davidbegin/ed1e1f3202b89ab5953a8da13b9f2649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import sys | |
from bot import irc_handshake, send_msg, CONNECTION_DATA | |
# We add ! to these commands | |
NIGHTBOT_COMMANDS = [ | |
"discord", | |
"github", | |
"links", | |
"linux", | |
"marker", | |
"schedule", | |
"so", | |
"topic", | |
] | |
if __name__ == "__main__": | |
with socket.socket() as server: | |
server.connect(CONNECTION_DATA) | |
irc_handshake(server) | |
cmd, *args = sys.argv[1:] | |
if cmd in NIGHTBOT_COMMANDS: | |
cmd = f"!{cmd}" | |
send_msg(server, f"{cmd} {' '.join(args)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment