@@ -82,9 +82,9 @@ export const processButton = async (interaction: ButtonInteraction<"cached">) =>
82
82
83
83
await ticket . updateOne ( { $set : { originalMessage : originalMessage . id } } ) ;
84
84
85
- await interaction . editReply ( "Готово!" ) ;
85
+ return await interaction . editReply ( "Готово!" ) ;
86
86
} else
87
- await interaction . reply ( {
87
+ return await interaction . reply ( {
88
88
content : "У вас уже есть заявка" ,
89
89
ephemeral : true ,
90
90
} ) ;
@@ -97,7 +97,7 @@ export const processButton = async (interaction: ButtonInteraction<"cached">) =>
97
97
await interaction . message . delete ( ) . catch ( ( ) => null ) ;
98
98
await interaction . channel ! . permissionOverwrites . create ( ticket . user , { ViewChannel : true } ) ;
99
99
100
- await ticket . updateOne ( { $set : { closed : false } } ) ;
100
+ return await ticket . updateOne ( { $set : { closed : false } } ) ;
101
101
} else if ( buttonId === "tickets:close" ) {
102
102
if ( userDocument . permissions < 2 )
103
103
return await interaction . reply ( { content : "❌ У вас недостаточно прав." , ephemeral : true } ) ;
@@ -121,7 +121,7 @@ export const processButton = async (interaction: ButtonInteraction<"cached">) =>
121
121
] ,
122
122
} ) ;
123
123
124
- await ticket . updateOne ( { $set : { closed : true } } ) ;
124
+ return await ticket . updateOne ( { $set : { closed : true } } ) ;
125
125
} else if ( buttonId === "tickets:accept" ) {
126
126
if ( userDocument . permissions < 2 )
127
127
return await interaction . reply ( { content : "❌ У вас недостаточно прав." , ephemeral : true } ) ;
@@ -158,14 +158,16 @@ export const processButton = async (interaction: ButtonInteraction<"cached">) =>
158
158
] ,
159
159
} ) ;
160
160
161
- await interaction . guild . members . addRole ( { user : ticket . user , role : "791657594228965377" } ) . catch ( ( ) => null ) ;
161
+ return await interaction . guild . members
162
+ . addRole ( { user : ticket . user , role : "791657594228965377" } )
163
+ . catch ( ( ) => null ) ;
162
164
} else if ( buttonId === "tickets:delete" ) {
163
165
if ( userDocument . permissions < 2 )
164
166
return await interaction . reply ( { content : "❌ У вас недостаточно прав." , ephemeral : true } ) ;
165
167
166
168
await Ticket . deleteOne ( { channel : interaction . channel ! . id } ) ;
167
169
168
- await interaction . channel ! . delete ( ) ;
170
+ return await interaction . channel ! . delete ( ) ;
169
171
} else if ( buttonId === "tickets:1" ) {
170
172
await interaction . reply ( "У вас есть **30 секунд**, чтобы написать свой желаемый никнейм в этом канале." ) ;
171
173
let timeout = setTimeout (
0 commit comments