1
1
require ( "dotenv" ) . config ( ) ;
2
- const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require ( "discord.js" ) ;
2
+ const {
3
+ SlashCommandBuilder,
4
+ ActionRowBuilder,
5
+ ButtonBuilder,
6
+ ButtonStyle,
7
+ InteractionContextType,
8
+ MessageFlags,
9
+ } = require ( "discord.js" ) ;
3
10
4
11
module . exports = {
5
12
data : new SlashCommandBuilder ( )
6
13
. setName ( "sue" )
7
14
. setDescription ( "Fake lawsuits to sue anyone!" )
8
- . setDMPermission ( false )
15
+ . setContexts ( InteractionContextType . Guild )
9
16
. addUserOption ( ( option ) =>
10
17
option . setName ( "user" ) . setDescription ( "The user you want to start a lawsuit against" ) . setRequired ( true )
11
18
)
@@ -31,17 +38,21 @@ module.exports = {
31
38
description : "Why would you sue yourself?" ,
32
39
} ,
33
40
] ,
34
- ephemeral : true ,
41
+ flags : MessageFlags . Ephemeral ,
35
42
} ) ;
36
43
37
- if ( user . id === process . env . OWNERID ) {
44
+ if ( user . bot === true && interaction . user . id === process . env . OWNERID ) {
45
+ sentence = "Defendant needs to pay the plaintiff $10M USD\nDefendant sentenced to death" ;
46
+ additionalFooterNote = "" ;
47
+ } else if ( user . id === process . env . OWNERID ) {
38
48
sentence = "Plaintiff needs to pay the defendant $10M USD\nPlaintiff sentenced to death" ;
39
49
additionalFooterNote = "imagine suing the owner lol, i own this court dude" ;
40
50
} else if ( user . bot === true ) {
41
51
sentence = "Defendant is not guilty\nPlaintiff needs to pay the defendant $1M USD" ;
42
52
additionalFooterNote = "imagine suing a bot lol" ;
43
53
} else {
44
54
sentence = "Death Penalty" ;
55
+ additionalFooterNote = "" ;
45
56
}
46
57
47
58
await interaction . reply ( {
@@ -64,11 +75,8 @@ module.exports = {
64
75
value : details ,
65
76
} ,
66
77
] ,
67
- timestamp : new Date ( ) . toISOString ( ) ,
68
78
footer : {
69
- text :
70
- `Disclaimer: It's not real.` ||
71
- `Disclaimer: It's not real. also ${ additionalFooterNote } ` ,
79
+ text : `Disclaimer: It's not real.` || `Disclaimer: It's not real. also ${ additionalFooterNote } ` ,
72
80
} ,
73
81
} ,
74
82
] ,
@@ -82,13 +90,14 @@ module.exports = {
82
90
83
91
collector . on ( "ignore" , ( i ) =>
84
92
i . reply ( {
85
- ephemeral : true ,
86
93
embeds : [
87
- new EmbedBuilder ( {
94
+ {
95
+ color : 0x0ccab6 ,
88
96
title : "**Lawsuit Generator**" ,
89
97
description : "You're not the author of the lawsuit!" ,
90
- } ) ,
98
+ } ,
91
99
] ,
100
+ flags : MessageFlags . Ephemeral ,
92
101
} )
93
102
) ;
94
103
collector . on ( "collect" , async ( i ) => {
@@ -126,7 +135,6 @@ module.exports = {
126
135
value : sentence ,
127
136
} ,
128
137
] ,
129
- timestamp : new Date ( ) . toISOString ( ) ,
130
138
footer : {
131
139
text :
132
140
additionalFooterNote === ""
0 commit comments