@@ -65,17 +65,18 @@ configure();
6565
6666export const resumeResources = async ( bot : Client ) => {
6767 bot . on ( "interactionCreate" , async ( interaction ) => {
68+ const { channel } = interaction ;
6869 if (
6970 interaction . type !== InteractionType . MessageComponent ||
7071 interaction . componentType !== ComponentType . Button ||
71- ! interaction . channel ||
72- interaction . channel . type !== ChannelType . PublicThread ||
73- interaction . channel . parentId !== CHANNELS . resumeReview
72+ ! channel ||
73+ channel . type !== ChannelType . PublicThread ||
74+ channel . parentId !== CHANNELS . resumeReview
7475 ) {
7576 return ;
7677 }
7778
78- if ( interaction . user . id !== interaction . channel . ownerId ) {
79+ if ( interaction . user . id !== channel . ownerId ) {
7980 interaction . reply ( {
8081 ephemeral : true ,
8182 content :
@@ -92,8 +93,7 @@ export const resumeResources = async (bot: Client) => {
9293 if ( interaction . customId === REVIEW_COMMAND ) {
9394 const deferred = await interaction . deferReply ( { ephemeral : true } ) ;
9495 deferred . edit ( "Looking for a resume…" ) ;
95- const messages = await interaction . channel . messages . fetch ( ) ;
96- const channel = interaction . channel ;
96+ const messages = await channel . messages . fetch ( ) ;
9797
9898 let firstMessage : Message < true > | null = null ;
9999 try {
@@ -173,7 +173,7 @@ export const resumeResources = async (bot: Client) => {
173173 ) ;
174174
175175 run . on ( "textCreated" , ( ) => {
176- interaction . channel ?. sendTyping ( ) ;
176+ channel ?. sendTyping ( ) ;
177177 } ) ;
178178
179179 run . on ( "textDone" , ( content ) => {
@@ -189,7 +189,7 @@ export const resumeResources = async (bot: Client) => {
189189 content : "Done!" ,
190190 } ) ;
191191
192- interaction . channel ?. send ( content . value ) ;
192+ channel ?. send ( content . value ) ;
193193 } ) ;
194194 } catch ( e ) {
195195 // recover
0 commit comments