Browse Source

Fixed some bug

master
Darks 4 months ago
parent
commit
8ca3e79327
Signed by: Darks GPG Key ID: 7515644268BE1433
2 changed files with 5 additions and 5 deletions
  1. +5
    -4
      bot.py
  2. +0
    -1
      main.py

+ 5
- 4
bot.py View File

@ -8,15 +8,16 @@ from secrets import USER, PASSWORD
class Bot(object):
def __init__(self, irc, v5, channels):
self.irc = IRC(*irc)
self.sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
self.channels = channels
self._sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
self._v5_handler = Thread(target=self._handle_v5)
self._sock.bind(v5)
def start(self):
# Start IRC
self.irc.start(USER, PASSWORD)
# Join channels
for c in self.channels:
self.irc.join(c)
@ -29,7 +30,7 @@ class Bot(object):
def _handle_v5(self):
while True:
data, addr = self.v5_sock.recvfrom(4096)
data, addr = self._sock.recvfrom(4096)
data = data.decode()
print(f"v5: Received <{data}>")
self.irc.msg(data, "#glados")
self.irc.send("#glados", data)

+ 0
- 1
main.py View File

@ -19,4 +19,3 @@ def say_hello(msg):
glados.start()
glados.run()

Loading…
Cancel
Save