Add invite
This commit is contained in:
parent
3eb61e3107
commit
7f7dc33229
5 changed files with 33 additions and 15 deletions
|
@ -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")!,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue