def disconnect(self, quitmsg = "Client quit", callLogout = True):
"""
Disconnects this client from the IRC server
:param quitmsg: IRC quit message. Default: 'Client quit'
:param callLogout: if True, call logoutEvent on bancho
:return:
"""
# Send error to client and close socket
self.message("ERROR :{}".format(quitmsg))
self.socket.close()
log.info("[IRC] Disconnected connection from {}:{} ({})".format(self.ip, self.port, quitmsg))
# Remove socket from server
self.server.removeClient(self, quitmsg)
# Bancho logout
if callLogout and self.banchoUsername != "":
chat.IRCDisconnect(self.IRCUsername)
评论列表
文章目录