@@ -85,9 +85,6 @@ See <#${howToGetHelpChannel}> for info on how to get better help.
85
85
// The rate limit for thread naming is 2 time / 10 mins, tracked per thread
86
86
const titleSetCooldown = 5 * 60 * 1000 ;
87
87
88
- // Delay before fully closing the thread, in case of hasty closing
89
- const threadCloseDelay = 60 * 1000 ;
90
-
91
88
export class HelpThreadModule extends Module {
92
89
@listener ( { event : 'messageCreate' } )
93
90
async onNewQuestion ( msg : Message ) {
@@ -117,7 +114,8 @@ export class HelpThreadModule extends Module {
117
114
)
118
115
return ;
119
116
await thread . send ( { embeds : [ threadExpireEmbed ] } ) ;
120
- await this . closeThread ( thread ) ;
117
+ this . manuallyArchivedThreads . add ( thread . id ) ;
118
+ await thread . setArchived ( true ) ;
121
119
}
122
120
123
121
@command ( {
@@ -141,21 +139,6 @@ export class HelpThreadModule extends Module {
141
139
await msg . react ( '✅' ) ;
142
140
this . manuallyArchivedThreads . add ( thread . id ) ;
143
141
await thread . setArchived ( true ) ;
144
- thread = ( await thread . fetch ( ) ) as ThreadChannel ;
145
- let archiveTimestamp = thread . archiveTimestamp ;
146
- setTimeout ( async ( ) => {
147
- thread = ( await thread . fetch ( ) ) as ThreadChannel ;
148
- console . log (
149
- thread . archived ,
150
- thread . archivedAt ,
151
- archiveTimestamp ,
152
- ) ;
153
- if (
154
- thread . archived &&
155
- thread . archiveTimestamp == archiveTimestamp
156
- )
157
- this . closeThread ( thread ) ;
158
- } , threadCloseDelay ) ;
159
142
} else {
160
143
return await sendWithMessageOwnership (
161
144
msg ,
@@ -164,13 +147,6 @@ export class HelpThreadModule extends Module {
164
147
}
165
148
}
166
149
167
- private async closeThread ( thread : ThreadChannel ) {
168
- if ( thread . archived ) await thread . setArchived ( false ) ;
169
- this . manuallyArchivedThreads . add ( thread . id ) ;
170
- await thread . edit ( { archived : true , locked : true } ) ;
171
- await HelpThread . delete ( thread . id ) ;
172
- }
173
-
174
150
private helpInfoLocks = new Map < string , Promise < void > > ( ) ;
175
151
private updateHelpInfo ( channel : TextChannel ) {
176
152
this . helpInfoLocks . set (
0 commit comments