@@ -16,13 +16,29 @@ export const data = new SlashCommandBuilder()
1616 . setDescription ( "The transgressor to be silenced" )
1717 . setRequired ( true ) ,
1818 )
19+ . addIntegerOption ( ( option ) =>
20+ option
21+ . setName ( "days" )
22+ . setDescription ( "Days of silence" )
23+ . setRequired ( false )
24+ . setMinValue ( 0 )
25+ . setMaxValue ( 28 ) ,
26+ )
27+ . addIntegerOption ( ( option ) =>
28+ option
29+ . setName ( "hours" )
30+ . setDescription ( "Hours of silence" )
31+ . setRequired ( false )
32+ . setMinValue ( 0 )
33+ . setMaxValue ( 23 ) ,
34+ )
1935 . addIntegerOption ( ( option ) =>
2036 option
2137 . setName ( "minutes" )
22- . setDescription ( "Duration of silence in minutes " )
23- . setRequired ( true )
24- . setMinValue ( 1 )
25- . setMaxValue ( 40320 ) ,
38+ . setDescription ( "Minutes of silence" )
39+ . setRequired ( false )
40+ . setMinValue ( 0 )
41+ . setMaxValue ( 59 ) ,
2642 )
2743 . addStringOption ( ( option ) =>
2844 option
@@ -36,7 +52,12 @@ export async function execute(
3652 executor : GuildMember ,
3753) : Promise < void > {
3854 const targetUser = interaction . options . getUser ( "user" ) ! ;
39- const duration = interaction . options . getInteger ( "minutes" ) ! ;
55+ const days = interaction . options . getInteger ( "days" ) ?? 0 ;
56+ const hours = interaction . options . getInteger ( "hours" ) ?? 0 ;
57+ const minutes = interaction . options . getInteger ( "minutes" ) ?? 0 ;
58+
59+ const totalMinutes = days * 24 * 60 + hours * 60 + minutes ;
60+
4061 const reason =
4162 interaction . options . getString ( "reason" ) || "Violation of sacred Alteruism" ;
4263
@@ -58,7 +79,25 @@ export async function execute(
5879 }
5980
6081 try {
61- await targetMember . timeout ( duration * 60 * 1000 , reason ) ;
82+ if ( totalMinutes <= 0 ) {
83+ await interaction . reply ( {
84+ content :
85+ "**THOU MUST DECREE A DURATION! Provide at least 1 minute (days/hours/minutes).**" ,
86+ flags : MessageFlags . Ephemeral ,
87+ } ) ;
88+ return ;
89+ }
90+
91+ if ( totalMinutes > 40320 ) {
92+ await interaction . reply ( {
93+ content :
94+ "**THE DECREE EXCEEDS THE DIVINE LIMIT!** Maximum silence is **40320 minutes (28 days)**." ,
95+ flags : MessageFlags . Ephemeral ,
96+ } ) ;
97+ return ;
98+ }
99+
100+ await targetMember . timeout ( totalMinutes * 60 * 1000 , reason ) ;
62101
63102 const entryId = await ModerationLogger . addEntry ( {
64103 type : "timeout" ,
@@ -68,9 +107,17 @@ export async function execute(
68107 moderatorTag : executor . user . tag ,
69108 reason : reason ,
70109 guildId : interaction . guild . id ,
71- duration : duration ,
110+ duration : totalMinutes ,
72111 } ) ;
73112
113+ const durationParts : string [ ] = [ ] ;
114+ if ( days ) durationParts . push ( `${ days } day${ days === 1 ? "" : "s" } ` ) ;
115+ if ( hours ) durationParts . push ( `${ hours } hour${ hours === 1 ? "" : "s" } ` ) ;
116+ if ( minutes )
117+ durationParts . push ( `${ minutes } minute${ minutes === 1 ? "" : "s" } ` ) ;
118+ const durationDisplay =
119+ durationParts . join ( ", " ) || `${ totalMinutes } minutes` ;
120+
74121 const embed = new EmbedBuilder ( )
75122 . setColor ( "#FFD700" )
76123 . setTitle ( "🤐 DIVINE SILENCE IMPOSED" )
@@ -86,7 +133,7 @@ export async function execute(
86133 { name : "ACTION ID" , value : `${ entryId } ` , inline : true } ,
87134 {
88135 name : "DURATION OF REFLECTION" ,
89- value : `${ duration } minutes` ,
136+ value : `${ durationDisplay } ( ${ totalMinutes } minutes) ` ,
90137 inline : true ,
91138 } ,
92139 { name : "REASON FOR SILENCE" , value : reason , inline : false } ,
0 commit comments