Fix varaibles in fedi preview

This commit is contained in:
Nexus 2024-08-15 11:34:38 +01:00
parent 497a8dc2b7
commit 24d2ce2dcc

View file

@ -17,9 +17,9 @@ class FediversePreviewModule(niobot.Module):
@niobot.event("message")
async def on_message(self, room: niobot.MatrixRoom, event: niobot.RoomMessage):
supported_prefixes = self.bot.cfg.get("fediverse_preview")
supported_prefixes = supported_prefixes.get("urls", ["https://fedi.transgender.ing"])
ignore = supported_prefixes.get("ignore", [])
config = self.bot.cfg.get("fediverse_preview")
supported_prefixes = config.get("urls", ["https://fedi.transgender.ing"])
ignore = config.get("ignore", [])
if not isinstance(event, niobot.RoomMessageText):
return
if event.sender in ignore or room.room_id in ignore or event.sender == self.bot.user_id: