Development (#112)

Co-authored-by: Samuel Shuert <samuel.shuert@gmail.com>
main
PineaFan 2 years ago committed by GitHub
parent 4de1612e5d
commit a6e3793b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,8 +86,9 @@ const callback = async (interaction: CommandInteraction | ButtonInteraction, mem
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
let formattedReason: string | null = null;
if (reason) {
reason = reason
formattedReason = reason
.split("\n")
.map((line) => "> " + line)
.join("\n");
@ -102,7 +103,7 @@ const callback = async (interaction: CommandInteraction | ButtonInteraction, mem
.setTitle("Banned")
.setDescription(
`You have been banned from ${interaction.guild.name}` +
(reason ? ` for:\n${reason}` : ".\n*No reason was provided.*")
(formattedReason ? ` for:\n${formattedReason}` : ".\n*No reason was provided.*")
)
.setStatus("Danger")
],

@ -74,8 +74,9 @@ const callback = async (interaction: CommandInteraction | ButtonInteraction, mem
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
let formattedReason: string | null = null;
if (reason) {
reason = reason
formattedReason = reason
.split("\n")
.map((line) => "> " + line)
.join("\n");
@ -90,7 +91,7 @@ const callback = async (interaction: CommandInteraction | ButtonInteraction, mem
.setTitle("Kicked")
.setDescription(
`You have been kicked from ${interaction.guild.name}` +
(reason ? ` for:\n${reason}` : ".\n*No reason was provided.*")
(formattedReason ? ` for:\n${formattedReason}` : ".\n*No reason was provided.*")
)
.setStatus("Danger")
],

@ -250,8 +250,9 @@ const callback = async (
let dmMessage;
try {
if (notify) {
let formattedReason: string | null = null;
if (reason) {
reason = reason
formattedReason = reason
.split("\n")
.map((line) => "> " + line)
.join("\n");
@ -266,7 +267,7 @@ const callback = async (
.setTitle("Muted")
.setDescription(
`You have been muted in ${interaction.guild.name}` +
(reason ? ` for:\n${reason}` : ".\n*No reason was provided*") +
(formattedReason ? ` for:\n${formattedReason}` : ".\n*No reason was provided*") +
"\n\n" +
`You will be unmuted at: <t:${Math.round(Date.now() / 1000) + muteTime}:D> at ` +
`<t:${Math.round(Date.now() / 1000) + muteTime}:T> (<t:${

@ -81,8 +81,9 @@ const callback = async (interaction: CommandInteraction): Promise<void> => {
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
let formattedReason: string | null = null;
if (reason) {
reason = reason
formattedReason = reason
.split("\n")
.map((line) => "> " + line)
.join("\n");
@ -97,7 +98,7 @@ const callback = async (interaction: CommandInteraction): Promise<void> => {
.setTitle("Softban")
.setDescription(
`You have been softbanned from ${interaction.guild.name}` +
(reason ? ` for:\n${reason}` : ".\n*No reason was provided.*")
(formattedReason ? ` for:\n${formattedReason}` : ".\n*No reason was provided.*")
)
.setStatus("Danger")
],

@ -57,6 +57,13 @@ const callback = async (interaction: CommandInteraction): Promise<unknown> => {
let dmMessage;
try {
if (notify) {
let formattedReason: string | null = null;
if (reason) {
formattedReason = reason
.split("\n")
.map((line) => "> " + line)
.join("\n");
}
dmMessage = await (interaction.options.getMember("user") as GuildMember).send({
embeds: [
new EmojiEmbed()
@ -64,7 +71,7 @@ const callback = async (interaction: CommandInteraction): Promise<unknown> => {
.setTitle("Unmuted")
.setDescription(
`You have been unmuted in ${interaction.guild.name}` +
(reason ? ` for:\n> ${reason}` : " with no reason provided.")
(formattedReason ? ` for:\n> ${formattedReason}` : " with no reason provided.")
)
.setStatus("Success")
]

@ -84,8 +84,9 @@ const callback = async (
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
let formattedReason: string | null = null;
if (reason) {
reason = reason
formattedReason = reason
.split("\n")
.map((line) => "> " + line)
.join("\n");
@ -100,7 +101,7 @@ const callback = async (
.setTitle("Warned")
.setDescription(
`You have been warned in ${interaction.guild.name}` +
(reason ? ` for:\n${reason}` : ".\n*No reason was provided*") +
(formattedReason ? ` for:\n${formattedReason}` : ".\n*No reason was provided*") +
"\n\n" +
(createAppealTicket
? `You can appeal this in the ticket created in <#${

Loading…
Cancel
Save