This repository was archived by the owner on Oct 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,19 @@ export default class JoinRequestCommand extends BaseCommand {
170170
171171 @RegisterInteractionHandler ( 'joinReq' )
172172 async handleJoinRequest ( interaction : ButtonInteraction ) {
173+ if ( ! interaction . inCachedGuild ( ) ) return ;
174+
175+ if ( ! interaction . member . permissions . has ( 'ManageMessages' ) ) {
176+ await interaction . reply ( {
177+ content : t ( 'errors.missingPermissions' , await fetchUserLocale ( interaction . user . id ) , {
178+ emoji : getEmoji ( 'x_icon' , interaction . client ) ,
179+ permissions : 'Manage Messages' ,
180+ } ) ,
181+ flags : [ 'Ephemeral' ] ,
182+ } ) ;
183+ return ;
184+ }
185+
173186 const customId = CustomID . parseCustomId ( interaction . customId ) ;
174187 const action = customId . suffix as 'accept' | 'reject' ;
175188 const [ userId ] = customId . args ;
@@ -187,8 +200,6 @@ export default class JoinRequestCommand extends BaseCommand {
187200 }
188201
189202 if ( action === 'accept' ) {
190- if ( ! interaction . inCachedGuild ( ) ) return ;
191-
192203 const connection = await fetchConnection ( interaction . channelId ) ;
193204 if ( ! connection ) {
194205 await interaction . reply ( {
You can’t perform that action at this time.
0 commit comments