Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
f1delius committed Apr 30, 2024
1 parent d6422df commit 510b37c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async def close(self, task: asyncio.Task) -> None:
async def periodic_task(self,interval=None):
# while self.scheduler:
# await asyncio.sleep(interval)
self.msg_limit = {}
self.msg_limit = DefaultDict()

# message_callback RoomMessageText event
async def message_callback(self, room: MatrixRoom, event: RoomMessageText) -> None:
Expand Down Expand Up @@ -174,9 +174,9 @@ async def message_callback(self, room: MatrixRoom, event: RoomMessageText) -> No
thread_event_id = thread_id
else:
thread_event_id = reply_to_event_id

if self.user_id != event.sender and (tagged or room.is_group):
if self.owner_id != sender_id and self.msg_limit[sender_id] > 10:
dm_tag = room.is_group and not self.workflow
if self.user_id != event.sender and (tagged or dm_tag):
if self.owner_id != sender_id and self.msg_limit[sender_id] >= 10:
await send_room_message(
self.client,
room_id,
Expand Down

0 comments on commit 510b37c

Please sign in to comment.