mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-29 05:35:38 -05:00
Update punishments.ts
This commit is contained in:
parent
ca871c21ad
commit
0d88cf9267
@ -28,6 +28,7 @@ export default class punishments extends Schema {
|
|||||||
createId = async()=>Math.max(...(await this._content.find({})).map(x=>x.id), 0) + 1;
|
createId = async()=>Math.max(...(await this._content.find({})).map(x=>x.id), 0) + 1;
|
||||||
async makeModlogEntry(punishment:Punishment){
|
async makeModlogEntry(punishment:Punishment){
|
||||||
// Format data into an embed
|
// Format data into an embed
|
||||||
|
const channel = ['kick', 'ban'].includes(punishment.type) ? '1048341961901363352' : this.client.config.mainServer.channels.logs;
|
||||||
const embed = new this.client.embed()
|
const embed = new this.client.embed()
|
||||||
.setTitle(`${punishment.type[0].toUpperCase() + punishment.type.slice(1)} | Case #${punishment._id}`)
|
.setTitle(`${punishment.type[0].toUpperCase() + punishment.type.slice(1)} | Case #${punishment._id}`)
|
||||||
.addFields(
|
.addFields(
|
||||||
@ -43,8 +44,8 @@ export default class punishments extends Schema {
|
|||||||
embed.addFields({name: '🔹 Overwrites', value: `This case overwrites Case #${cancels.id}\n\`${cancels.reason}\``})
|
embed.addFields({name: '🔹 Overwrites', value: `This case overwrites Case #${cancels.id}\n\`${cancels.reason}\``})
|
||||||
}
|
}
|
||||||
// Send it off to specific Discord channel.
|
// Send it off to specific Discord channel.
|
||||||
(this.client.channels.cache.get(this.client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds:[embed]});
|
(this.client.channels.cache.get(channel) as Discord.TextChannel).send({embeds:[embed]});
|
||||||
}// hi tae
|
}// hi tae --- hi
|
||||||
getTense(type:string){// Get past tense form of punishment type, grammar yes
|
getTense(type:string){// Get past tense form of punishment type, grammar yes
|
||||||
return {
|
return {
|
||||||
ban: 'banned',
|
ban: 'banned',
|
||||||
|
Loading…
Reference in New Issue
Block a user