(name: keyof typeof modules, countingChannel: CountingChannelSchema, uniqueId: string)
| 105 | } |
| 106 | |
| 107 | function generateModuleMenuReply(name: keyof typeof modules, countingChannel: CountingChannelSchema, uniqueId: string): InteractionReplyOptions & InteractionUpdateOptions { |
| 108 | const { description, image, incompatible } = modules[name]; |
| 109 | return { |
| 110 | embeds: [ |
| 111 | { |
| 112 | title: `Module Information • ${name}`, |
| 113 | description: description + (incompatible ? `\n\n*Incompatible with modules ${incompatible.map(module => `\`${module}\``).join(", ")}*` : ""), |
| 114 | ...image && { image: { url: image } }, |
| 115 | color: config.colors.primary, |
| 116 | }, |
| 117 | ], |
| 118 | components: [ |
| 119 | { |
| 120 | type: ComponentType.ActionRow, |
| 121 | components: [ |
| 122 | countingChannel.modules.includes(name) ? |
| 123 | { |
| 124 | type: ComponentType.Button, |
| 125 | label: "Module is enabled (click to disable)", |
| 126 | customId: `${uniqueId}:disable`, |
| 127 | style: ButtonStyle.Primary, |
| 128 | } : |
| 129 | { |
| 130 | type: ComponentType.Button, |
| 131 | label: "Module is disabled (click to enable)", |
| 132 | customId: `${uniqueId}:enable`, |
| 133 | style: ButtonStyle.Secondary, |
| 134 | }, |
| 135 | { |
| 136 | type: ComponentType.Button, |
| 137 | label: "Go back", |
| 138 | customId: `${uniqueId}:back`, |
| 139 | style: ButtonStyle.Secondary, |
| 140 | }, |
| 141 | ], |
| 142 | }, |
| 143 | ], |
| 144 | }; |
| 145 | } |
no outgoing calls
no test coverage detected