mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Properly order reaction roles
This commit is contained in:
parent
7124898568
commit
43c23263f0
7 changed files with 41 additions and 9 deletions
|
@ -24,6 +24,9 @@ export class GuildReactionRoles extends BaseGuildRepository {
|
|||
guild_id: this.guildId,
|
||||
message_id: messageId,
|
||||
},
|
||||
order: {
|
||||
order: "ASC",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -50,7 +53,14 @@ export class GuildReactionRoles extends BaseGuildRepository {
|
|||
await this.reactionRoles.delete(criteria);
|
||||
}
|
||||
|
||||
async add(channelId: string, messageId: string, emoji: string, roleId: string, exclusive?: boolean) {
|
||||
async add(
|
||||
channelId: string,
|
||||
messageId: string,
|
||||
emoji: string,
|
||||
roleId: string,
|
||||
exclusive?: boolean,
|
||||
position?: number,
|
||||
) {
|
||||
await this.reactionRoles.insert({
|
||||
guild_id: this.guildId,
|
||||
channel_id: channelId,
|
||||
|
@ -58,6 +68,7 @@ export class GuildReactionRoles extends BaseGuildRepository {
|
|||
emoji,
|
||||
role_id: roleId,
|
||||
is_exclusive: Boolean(exclusive),
|
||||
order: position,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,6 @@ export class ReactionRole {
|
|||
@Column() role_id: string;
|
||||
|
||||
@Column() is_exclusive: boolean;
|
||||
|
||||
@Column() order: number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue