add new module: irc-bridge

This commit is contained in:
2023-02-25 15:53:35 +02:00
parent 43b5984517
commit 147a7f5da2
4 changed files with 144 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
if self.MESSAGE["chat"]["id"] == -1001570221452:
l = min( len(self.MESSAGE["text"]), 300 )
new_msg = "{} {}: {}".format(self.MESSAGE.from_user.first_name,\
self.MESSAGE.from_user.last_name,\
self.MESSAGE.text.replace("\n", " | ")[:l])
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(f"PRIVMSG #io23-bridge :{new_msg}\n".encode("utf-8"), ("127.0.0.1", 5001))
del s