Add an easy way to ignore users for the misskey preview

This commit is contained in:
Nexus 2024-08-12 15:51:58 +01:00
parent a090e780f2
commit 9b37aedf30
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -19,8 +19,11 @@ class MisskeyPreviewModule(niobot.Module):
async def on_message(self, room: niobot.MatrixRoom, event: niobot.RoomMessage):
supported_prefixes = self.bot.cfg.get("misskey_preview", {})
supported_prefixes = supported_prefixes.get("urls", ["https://fedi.transgender.ing"])
ignore = self.bot.cfg.get("misskey_preview", {}).get("ignore", [])
if not isinstance(event, niobot.RoomMessageText):
return
if event.sender in ignore or room.room_id in ignore:
return
sent = []
async with httpx.AsyncClient(