bot: ignore decoding line buffer exceptions

This commit is contained in:
dece 2024-05-21 22:28:28 +02:00
parent e7c2be4a62
commit be2f2751a0

View file

@ -11,6 +11,7 @@ from typing import Any, Iterable, Optional
import irc.client import irc.client
import irc.client_aio import irc.client_aio
import jaraco.stream.buffer
from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.schedulers.asyncio import AsyncIOScheduler
from irc.client import Connection, Event, NickMask from irc.client import Connection, Event, NickMask
@ -18,6 +19,12 @@ from edmond.log import Logger
from edmond.plugin import Plugin from edmond.plugin import Plugin
class IgnoreErrorsBuffer(jaraco.stream.buffer.DecodingLineBuffer):
def handle_exception(self):
pass
irc.client.ServerConnection.buffer_class = IgnoreErrorsBuffer
class Bot(irc.client_aio.AioSimpleIRCClient, Logger): class Bot(irc.client_aio.AioSimpleIRCClient, Logger):
"""Main class for the IRC bot: handles connection and manages plugins.""" """Main class for the IRC bot: handles connection and manages plugins."""