Compare commits
2 Commits
d1aacbb3d3
...
ef39c6315d
Author | SHA1 | Date | |
---|---|---|---|
ef39c6315d | |||
1f372b0aac |
@ -41,7 +41,7 @@ export default class RoleController {
|
|||||||
.catch(error => { logger.error(`Could not find announcement_role with id ${config.bot.announcement_role}. Error: ${error}`, { requestId, guildId: guild.id }) })
|
.catch(error => { logger.error(`Could not find announcement_role with id ${config.bot.announcement_role}. Error: ${error}`, { requestId, guildId: guild.id }) })
|
||||||
}
|
}
|
||||||
|
|
||||||
public async assignAnnouncementRolesFromReactions(guild: Guild, reaction: MessageReaction, requestId: string) {
|
public async assignAnnouncementRolesFromReaction(guild: Guild, reaction: MessageReaction, requestId: string) {
|
||||||
const guildId = guild.id
|
const guildId = guild.id
|
||||||
logger.info("Managing roles", { guildId, requestId })
|
logger.info("Managing roles", { guildId, requestId })
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { getMembersWithRoleFromGuild } from "./roleFilter"
|
|||||||
import { config } from "../configuration"
|
import { config } from "../configuration"
|
||||||
import { VoteMessage, isVoteEndedMessage, isVoteMessage } from "./messageIdentifiers"
|
import { VoteMessage, isVoteEndedMessage, isVoteMessage } from "./messageIdentifiers"
|
||||||
import { createDateStringFromEvent } from "./dateHelper"
|
import { createDateStringFromEvent } from "./dateHelper"
|
||||||
import { Maybe, voteMessageInputInformation as prepareVoteMessageInput } from "../interfaces"
|
import { Maybe, prepareVoteMessageInput } from "../interfaces"
|
||||||
import format from "date-fns/format"
|
import format from "date-fns/format"
|
||||||
import toDate from "date-fns/toDate"
|
import toDate from "date-fns/toDate"
|
||||||
import differenceInDays from "date-fns/differenceInDays"
|
import differenceInDays from "date-fns/differenceInDays"
|
||||||
|
@ -39,7 +39,7 @@ export interface JellyfinConfig {
|
|||||||
collectionUser: string
|
collectionUser: string
|
||||||
}
|
}
|
||||||
export type PermissionLevel = "VIEWER" | "ADMIN" | "TEMPORARY"
|
export type PermissionLevel = "VIEWER" | "ADMIN" | "TEMPORARY"
|
||||||
export interface voteMessageInputInformation {
|
export interface prepareVoteMessageInput {
|
||||||
movies: string[],
|
movies: string[],
|
||||||
startDate: Date,
|
startDate: Date,
|
||||||
event: GuildScheduledEvent,
|
event: GuildScheduledEvent,
|
||||||
|
@ -173,10 +173,10 @@ export class ExtendedClient extends Client {
|
|||||||
}
|
}
|
||||||
//logger.debug(`Message: ${JSON.stringify(message, null, 2)}`, { guildId: guild.id, requestId })
|
//logger.debug(`Message: ${JSON.stringify(message, null, 2)}`, { guildId: guild.id, requestId })
|
||||||
|
|
||||||
const reactions = message.reactions.resolve("🎫")
|
const ticketReaction = message.reactions.resolve("🎫")
|
||||||
//logger.debug(`reactions: ${JSON.stringify(reactions, null, 2)}`, { guildId: guild.id, requestId })
|
//logger.debug(`reactions: ${JSON.stringify(reactions, null, 2)}`, { guildId: guild.id, requestId })
|
||||||
if (reactions) {
|
if (ticketReaction) {
|
||||||
this.roleController.assignAnnouncementRolesFromReactions(message.guild, reactions, requestId)
|
this.roleController.assignAnnouncementRolesFromReaction(message.guild, ticketReaction, requestId)
|
||||||
} else {
|
} else {
|
||||||
logger.error("Did not get reactions! Aborting!", { guildId: guild.id, requestId })
|
logger.error("Did not get reactions! Aborting!", { guildId: guild.id, requestId })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user