3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

Add --exclusive/-e to !reaction_roles

When reaction roles are set as exclusive, a user can only have 1
reaction role from that message. Others are removed automatically when
picking a role if needed.
This commit is contained in:
Dragory 2019-11-30 23:39:29 +02:00
parent 546835d421
commit d2a6cb1684
4 changed files with 42 additions and 4 deletions

View file

@ -50,13 +50,14 @@ export class GuildReactionRoles extends BaseGuildRepository {
await this.reactionRoles.delete(criteria);
}
async add(channelId: string, messageId: string, emoji: string, roleId: string) {
async add(channelId: string, messageId: string, emoji: string, roleId: string, exclusive?: boolean) {
await this.reactionRoles.insert({
guild_id: this.guildId,
channel_id: channelId,
message_id: messageId,
emoji,
role_id: roleId,
is_exclusive: Boolean(exclusive),
});
}
}

View file

@ -19,4 +19,6 @@ export class ReactionRole {
emoji: string;
@Column() role_id: string;
@Column() is_exclusive: boolean;
}