mirror of
git://git.acid.vegas/archive.git
synced 2024-11-21 23:56:40 +00:00
added flood control
This commit is contained in:
parent
4e3b67ca87
commit
76cad6e9e0
@ -66,15 +66,18 @@ class Bot():
|
|||||||
while True:
|
while True:
|
||||||
async with aiofiles.open(FIFO_PATH) as fifo:
|
async with aiofiles.open(FIFO_PATH) as fifo:
|
||||||
while True:
|
while True:
|
||||||
# try:
|
try:
|
||||||
await self.sendmsg(connection.channel, FIFO_PATH.read_text())
|
log_line = FIFO_PATH.read_text()
|
||||||
# except Exception as ex:
|
for line in log_line.splitlines():
|
||||||
# try:
|
await self.sendmsg(connection.channel, log_line)
|
||||||
# await self.irc_error(connection.channel, 'Error occured in the loop_tail function!', ex)
|
await asyncio.sleep(0.1)
|
||||||
# break
|
except Exception as ex:
|
||||||
# except:
|
try:
|
||||||
# error('Fatal error occured in the loop_tail functions!', ex)
|
await self.irc_error(connection.channel, 'Error occured in the loop_tail function!', ex)
|
||||||
# break
|
break
|
||||||
|
except:
|
||||||
|
error('Fatal error occured in the loop_tail functions!', ex)
|
||||||
|
break
|
||||||
|
|
||||||
async def connect(self):
|
async def connect(self):
|
||||||
while True:
|
while True:
|
||||||
@ -123,9 +126,9 @@ class Bot():
|
|||||||
error('The bot is already running or nick is in use.')
|
error('The bot is already running or nick is in use.')
|
||||||
except (UnicodeDecodeError, UnicodeEncodeError):
|
except (UnicodeDecodeError, UnicodeEncodeError):
|
||||||
pass
|
pass
|
||||||
# except Exception as ex:
|
except Exception as ex:
|
||||||
# error('fatal error occured', ex)
|
error('fatal error occured', ex)
|
||||||
# break
|
break
|
||||||
finally:
|
finally:
|
||||||
self.last = time.time()
|
self.last = time.time()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user