9 |
import History from '../../automod/History'; |
import History from '../../automod/History'; |
10 |
import Punishment from '../../models/Punishment'; |
import Punishment from '../../models/Punishment'; |
11 |
import PunishmentType from '../../types/PunishmentType'; |
import PunishmentType from '../../types/PunishmentType'; |
12 |
|
import ModerationEmbed from '../../utils/ModerationEmbed'; |
13 |
|
|
14 |
export default class BeanCommand extends BaseCommand { |
export default class BeanCommand extends BaseCommand { |
15 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
98 |
|
|
99 |
await History.create(user.id, msg.guild!, 'bean', msg.member!.user.id, typeof reason === 'undefined' ? null : reason); |
await History.create(user.id, msg.guild!, 'bean', msg.member!.user.id, typeof reason === 'undefined' ? null : reason); |
100 |
|
|
101 |
try { |
try { |
102 |
await user.send({ |
await user.send({ |
103 |
embeds: [ |
embeds: [ |
104 |
new MessageEmbed() |
new MessageEmbed() |
105 |
.setAuthor({ |
.setAuthor({ |
106 |
iconURL: <string> msg.guild!.iconURL(), |
iconURL: <string> msg.guild!.iconURL(), |
107 |
name: `\tYou have been beaned in ${msg.guild!.name}` |
name: `\tYou have been beaned in ${msg.guild!.name}` |
108 |
}) |
}) |
109 |
.addFields([ |
.addFields([ |
110 |
{ |
{ |
111 |
name: "Reason", |
name: "Reason", |
112 |
value: typeof reason === 'undefined' ? '*No reason provided*' : reason |
value: typeof reason === 'undefined' ? '*No reason provided*' : reason |
113 |
} |
} |
114 |
]) |
]) |
115 |
] |
] |
116 |
}); |
}); |
117 |
} |
} |
118 |
catch (e) { |
catch (e) { |
119 |
console.log(e); |
console.log(e); |
126 |
console.log(e); |
console.log(e); |
127 |
} |
} |
128 |
|
|
129 |
await msg.reply({ |
/*await msg.reply({ |
130 |
embeds: [ |
embeds: [ |
131 |
new MessageEmbed() |
new MessageEmbed() |
132 |
.setAuthor({ |
.setAuthor({ |
145 |
} |
} |
146 |
]) |
]) |
147 |
] |
] |
148 |
|
});*/ |
149 |
|
|
150 |
|
await msg.reply({ |
151 |
|
embeds: [ |
152 |
|
new ModerationEmbed(user, msg.member!.user, { |
153 |
|
description: `${user.tag} has been beaned.` |
154 |
|
}) |
155 |
|
.setReason(reason) |
156 |
|
] |
157 |
}); |
}); |
158 |
} |
} |
159 |
} |
} |