File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 18721872 "TEMP_MEDIA_PERMS_MISSING_USER" : " you forgot to provide a user ya doofus" ,
18731873 "TEMP_MEDIA_PERMS_ALREADY_HAS" : " that user already has permission to attach files & embed links" ,
18741874 "TEMP_MEDIA_PERMS_REASON" : " Given temporary media permissions by {{author}}" ,
1875+ "TEMP_MEDIA_PERMS_SUCCESS" : " Successfully gave temporary media permissions to {{user}} and they'll be removed {{time}} (approximately)" ,
18751876 "THREADMEMBERUPDATELOG_AUTHOR" : " Thread Members Update | {{thread}}" ,
18761877 "TICKET_COMMAND_DESCRIPTION" : " Manage ticket configuration in the server" ,
18771878 "TICKET_MAIN_DESCRIPTION" : " Here are all the ticket configuration commands" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { FireMember } from "@fire/lib/extensions/guildmember";
33import { Command } from "@fire/lib/util/command" ;
44import { Language } from "@fire/lib/util/language" ;
55import { PermissionFlagsBits } from "discord-api-types/v9" ;
6+ import { Formatters } from "discord.js" ;
67
78export default class TempMediaPerms extends Command {
89 constructor ( ) {
@@ -23,6 +24,7 @@ export default class TempMediaPerms extends Command {
2324 enableSlashCommand : true ,
2425 restrictTo : "guild" ,
2526 moderatorOnly : true ,
27+ deferAnyways : true ,
2628 slashOnly : true ,
2729 ephemeral : true ,
2830 } ) ;
@@ -49,7 +51,8 @@ export default class TempMediaPerms extends Command {
4951 )
5052 . catch ( ( ) => { } ) ;
5153 if ( ! added ) return await command . error ( "COMMAND_ERROR_500" ) ;
52- else
54+ else {
55+ const timestamp = + new Date ( ) + 120_000 ;
5356 setTimeout ( ( ) => {
5457 args . user . roles . remove (
5558 role ,
@@ -58,5 +61,10 @@ export default class TempMediaPerms extends Command {
5861 } )
5962 ) ;
6063 } , 120_000 ) ;
64+ return await command . success ( "TEMP_MEDIA_PERMS_SUCCESS" , {
65+ user : args . user . toString ( ) ,
66+ time : Formatters . time ( new Date ( timestamp ) , "R" ) ,
67+ } ) ;
68+ }
6169 }
6270}
You can’t perform that action at this time.
0 commit comments