mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 12:21:00 -05:00
Update packages and improved case update a bit better.
This commit is contained in:
parent
18cba32f79
commit
cd98bc1d5c
@ -28,14 +28,14 @@
|
||||
"discord.js": "14.8.0",
|
||||
"moment": "2.29.4",
|
||||
"ms": "2.1.3",
|
||||
"mongoose": "7.0.1",
|
||||
"mongoose": "7.0.2",
|
||||
"systeminformation": "5.17.12",
|
||||
"@octokit/rest": "19.0.7",
|
||||
"typescript": "4.9.5",
|
||||
"typescript": "5.0.2",
|
||||
"xml-js": "1.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "18.15.0",
|
||||
"@types/node": "18.15.3",
|
||||
"ts-node": "10.9.1"
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,8 @@ export default {
|
||||
update: async()=>{
|
||||
const reason = interaction.options.getString('reason');
|
||||
await client.punishments._content.findByIdAndUpdate(caseId, {reason});
|
||||
await interaction.reply({embeds: [new client.embed().setColor(client.config.embedColorGreen).setTitle('Case updated').setDescription(`Case #${caseId} has been successfully updated with new reason:\n\`${reason}\``)]})
|
||||
if (await client.punishments._content.findById(caseId)) await interaction.reply({embeds: [new client.embed().setColor(client.config.embedColorGreen).setTitle('Case updated').setDescription(`Case #${caseId} has been successfully updated with new reason:\n\`${reason}\``)]});
|
||||
else interaction.reply({embeds: [new client.embed().setColor(client.config.embedColorRed).setTitle('Case not updated').setDescription(`Case #${caseId} is not stored on database, not updating the reason.`)]});
|
||||
},
|
||||
view: async()=>{
|
||||
const punishment = await client.punishments._content.findById(caseId);
|
||||
|
@ -45,7 +45,7 @@ export default class punishments extends Schema {
|
||||
}
|
||||
// Send it off to specific Discord channel.
|
||||
(this.client.channels.cache.get(channel) as Discord.TextChannel).send({embeds:[embed]});
|
||||
}// hi tae --- hi --- hru?
|
||||
}// hi tae --- hi --- hru? --- no answer ok
|
||||
getTense(type:string){// Get past tense form of punishment type, grammar yes
|
||||
return {
|
||||
ban: 'banned',
|
||||
@ -146,7 +146,7 @@ export default class punishments extends Schema {
|
||||
.setDescription(`${User.tag}\n<@${User.id}>\n(\`${User.id}\`)`)
|
||||
.addFields({name: 'Reason', value: reason},{name: 'Overwrites', value: `Case #${punishment.id}`})
|
||||
]})
|
||||
} else return `Successfully ${this.getTense(removePunishmentData.type)} ${User.tag} (\`${User.id}\`) for ${reason}`
|
||||
} else return `Successfully un${this.getTense(removePunishmentData.type.replace('un', ''))} ${User.tag} (\`${User.id}\`) for ${reason}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user