@@ -55,8 +55,10 @@ const howToGiveHelp = listify(`
55
55
**How To Give *Better* Help**
56
56
- Get yourself the <@&${ trustedRoleId } > role at <#${ rolesChannelId } >
57
57
- (If you don't like the pings, you can disable role mentions for the server.)
58
- - As a <@&${ trustedRoleId } >, if a thread appears to be resolved, run \`!resolved\` to mark it as such.
59
- - *Only do this if the asker has indicated that their question has been resolved.*
58
+ - As a <@&${ trustedRoleId } >, you can:
59
+ - React to a help post to add tags.
60
+ - If a post appears to be resolved, run \`!resolved\` to mark it as such.
61
+ - *Only do this if the asker has indicated that their question has been resolved.*
60
62
- Conversely, you can run \`!reopen\` if the asker has follow-up questions.
61
63
62
64
**Useful Snippets**
@@ -202,6 +204,28 @@ export async function helpForumModule(bot: Bot) {
202
204
} ,
203
205
} ) ;
204
206
207
+ bot . client . on ( 'messageReactionAdd' , async reaction => {
208
+ const message = reaction . message ;
209
+ const thread = await message . channel . fetch ( ) ;
210
+ if ( ! isHelpThread ( thread ) ) {
211
+ return ;
212
+ }
213
+ const initial = await thread . fetchStarterMessage ( ) ;
214
+ if ( initial ?. id !== message . id ) return ;
215
+ const tag = forumChannel . availableTags . find (
216
+ t =>
217
+ t . emoji &&
218
+ ! t . moderated &&
219
+ t . emoji . id === reaction . emoji . id &&
220
+ t . emoji . name === reaction . emoji . name ,
221
+ ) ;
222
+ if ( ! tag ) return ;
223
+ if ( thread . appliedTags . length < MAX_TAG_COUNT ) {
224
+ await thread . setAppliedTags ( [ ...thread . appliedTags , tag . id ] ) ;
225
+ }
226
+ await reaction . remove ( ) ;
227
+ } ) ;
228
+
205
229
async function changeStatus ( msg : Message , resolved : boolean ) {
206
230
const thread = msg . channel ;
207
231
if ( thread ?. type !== ChannelType . PublicThread ) {
0 commit comments