32 |
let user: GuildMember; |
let user: GuildMember; |
33 |
let dm = true; |
let dm = true; |
34 |
let reason: string | undefined; |
let reason: string | undefined; |
35 |
|
|
36 |
if (options.isInteraction) { |
if (options.isInteraction) { |
37 |
user = await <GuildMember> (msg instanceof ContextMenuInteraction ? options.options.getMember('user') : options.options.getMember('member')); |
user = await <GuildMember> (msg instanceof ContextMenuInteraction ? options.options.getMember('user') : options.options.getMember('member')); |
38 |
|
|
83 |
} |
} |
84 |
} |
} |
85 |
|
|
86 |
|
if (user.id === client.user?.id) { |
87 |
|
await msg.reply("Oh no no no... wait wait, you can't just do that with me!?!? Can you? :grin:"); |
88 |
|
return; |
89 |
|
} |
90 |
|
|
91 |
|
const anonymous = options.isInteraction ? options.options.getBoolean('anonymous') ?? false : false; |
92 |
|
|
93 |
try { |
try { |
94 |
await Punishment.create({ |
await Punishment.create({ |
95 |
type: PunishmentType.SHOT, |
type: PunishmentType.SHOT, |
115 |
{ |
{ |
116 |
name: "Reason", |
name: "Reason", |
117 |
value: typeof reason === 'undefined' ? '*No reason provided*' : reason |
value: typeof reason === 'undefined' ? '*No reason provided*' : reason |
118 |
} |
}, |
119 |
|
...(!anonymous ? [{ |
120 |
|
name: "💉 Doctor", |
121 |
|
value: `${(msg.member?.user as User).tag}` |
122 |
|
}] : []) |
123 |
]) |
]) |
124 |
] |
] |
125 |
}); |
}); |
145 |
.setDescription(user.user.tag + " got a shot." + (!dm ? "\nThey have DMs disabled. They will not know that they got a shot." : '')) |
.setDescription(user.user.tag + " got a shot." + (!dm ? "\nThey have DMs disabled. They will not know that they got a shot." : '')) |
146 |
.addFields([ |
.addFields([ |
147 |
{ |
{ |
148 |
name: "Given by", |
name: "💉 Doctor", |
149 |
value: (msg.member!.user as User).tag |
value: (msg.member!.user as User).tag |
150 |
}, |
}, |
151 |
{ |
{ |