Merge pull request #102 from adator85/asyncio

fix dktmb issues.
This commit is contained in:
adator
2025-12-14 21:23:10 +01:00
committed by GitHub
2 changed files with 16 additions and 3 deletions

View File

@@ -133,11 +133,20 @@ class Irc:
run_once=True, thread_flag=True
)
)
# print("start_heartbeat.................")
# await self.ctx.Base.create_thread_io(
# self.ctx.Utils.heartbeat,
# self.ctx, self.beat,
# run_once=True, thread_flag=True
# )
while self.signal:
data = await self.reader.readuntil(b'\r\n')
await self.send_response(data.splitlines())
async def send_response(self, responses:list[bytes]) -> None:
try:
for data in responses:
@@ -1125,7 +1134,7 @@ class Irc:
return None
case 'uptime':
uptime = self.ctx.Utils.get_defender_uptime()
uptime = self.ctx.Utils.get_defender_uptime(self.ctx)
await self.Protocol.send_notice(
nick_from=dnickname,
nick_to=fromuser,

View File

@@ -901,7 +901,7 @@ class Defender(IModule):
UserObject = self.ctx.User.get_user(nickoruid)
if UserObject is not None:
channels: list = [chan.name for chan in self.ctx.Channel.UID_CHANNEL_DB for uid_in_chan in chan.uids if self.ctx.mod_utils.clean_uid(uid_in_chan) == UserObject.uid]
channels: list = [chan.name for chan in self.ctx.Channel.UID_CHANNEL_DB for uid_in_chan in chan.uids if self.ctx.User.clean_uid(uid_in_chan) == UserObject.uid]
await self.ctx.Irc.Protocol.send_notice(nick_from=dnickname, nick_to=fromuser, msg=f' UID : {UserObject.uid}')
await self.ctx.Irc.Protocol.send_notice(nick_from=dnickname, nick_to=fromuser, msg=f' NICKNAME : {UserObject.nickname}')
@@ -925,6 +925,10 @@ class Defender(IModule):
case 'sentinel':
# .sentinel on
if len(cmd) < 2:
await self.ctx.Irc.Protocol.send_notice(nick_from=dnickname, nick_to=fromuser, msg=f"Syntax. /msg {dnickname} sentinel [ON | OFF]")
return None
activation = str(cmd[1]).lower()
channel_to_dont_quit = [self.ctx.Config.SALON_JAIL, self.ctx.Config.SERVICE_CHANLOG]