Add invite

This commit is contained in:
Henry Hiles 2025-08-03 09:43:33 -04:00
commit 7f7dc33229
No known key found for this signature in database
5 changed files with 33 additions and 15 deletions

View file

@ -25,7 +25,8 @@ void main(List<String> argsRaw) async {
..addOption("mailName", mandatory: true)
..addOption("mailDomain", mandatory: true)
..addOption("smtpPasswordFile", mandatory: true)
..addOption("botPasswordFile", mandatory: true);
..addOption("botPasswordFile", mandatory: true)
..addOption("inviteTo");
final container = ProviderContainer();
container
@ -103,6 +104,15 @@ If you have any issues, reply to this email.""",
);
await event.room.redactEvent(reactionEvent!);
await event.room.sendReaction(event.eventId, "✉️ Sent!");
if (settings.inviteTo != null) {
client
.getRoomByAlias(settings.inviteTo!)!
.invite(
RegExp(
r"(?<userid>@[a-zA-Z0-9._-]+:[^\s]+)",
).firstMatch(event.body)!.namedGroup("userid")!,
);
}
}
});