Added more command to use mod logs
This commit is contained in:
@@ -73,7 +73,7 @@ export = {
|
|||||||
`,
|
`,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: interaction.guild!.iconURL({ forceStatic: false }) || "",
|
url: interaction.user.avatarURL({ forceStatic: false }) || "",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: "ID: " + channel.id,
|
text: "ID: " + channel.id,
|
||||||
|
|||||||
@@ -3,15 +3,16 @@ import {
|
|||||||
PermissionFlagsBits,
|
PermissionFlagsBits,
|
||||||
userMention,
|
userMention,
|
||||||
} from "discord.js"
|
} from "discord.js"
|
||||||
import { color } from "../../config/options.json"
|
import { color, devMessage } from "../../config/options.json"
|
||||||
import waitinglistSchema = require("../schemas/waitinglistSchema")
|
import waitinglistSchema = require("../schemas/waitinglistSchema")
|
||||||
import { Command } from "../interfaces"
|
import { Command } from "../interfaces"
|
||||||
|
import logToChannel from "../utils/functions/logtochannel"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "remove",
|
name: "remove",
|
||||||
description: "Remove a person on the waiting list.",
|
description: "Remove a person on the waiting list.",
|
||||||
type: "slash",
|
type: "slash",
|
||||||
dev: false,
|
false: true,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -41,7 +42,7 @@ export = {
|
|||||||
const mod = interaction.user!
|
const mod = interaction.user!
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
const waitinglist = await waitinglistSchema.findOne({ UserID: user.id })
|
const waitinglist = await waitinglistSchema.findOne({ userID: user.id })
|
||||||
|
|
||||||
if (!waitinglist) {
|
if (!waitinglist) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
@@ -57,25 +58,44 @@ export = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await waitinglistSchema.findOneAndDelete({ UserID: user.id })
|
await waitinglistSchema.findOneAndDelete({ userID: user.id })
|
||||||
|
|
||||||
|
await logToChannel("mod", {
|
||||||
|
embeds: [{
|
||||||
|
author: {
|
||||||
|
name: mod.username,
|
||||||
|
icon_url: mod.avatarURL({ forceStatic: false }) || undefined,
|
||||||
|
},
|
||||||
|
title: "Waiting List - Remove User",
|
||||||
|
description: `
|
||||||
|
**User:** ${userMention(user.id)}
|
||||||
|
**Reason:** ${reason}
|
||||||
|
**Mod:** ${userMention(mod.id)}
|
||||||
|
`,
|
||||||
|
color: embedColor,
|
||||||
|
thumbnail: {
|
||||||
|
url: mod.avatarURL({ forceStatic: false }) || "",
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
icon_url: user.avatarURL({ forceStatic: false }) || undefined,
|
||||||
|
text: "ID: " + user.id,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toISOString()
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
|
title: "Waiting List - Remove User",
|
||||||
description:
|
description:
|
||||||
userMention(user.id) +
|
"**User:** " + userMention(user.id) + "\n" +
|
||||||
" has been removed from the waiting list.\n" +
|
"**Reason:** `" + reason + "`",
|
||||||
"**Reason:** `" +
|
|
||||||
reason +
|
|
||||||
"`\n" +
|
|
||||||
"**Moderator:** " +
|
|
||||||
userMention(mod.id),
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: "User ID: " + user.id,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: user.displayAvatarURL({ forceStatic: false }),
|
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || "",
|
||||||
},
|
}
|
||||||
timestamp: new Date().toISOString(),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ import {
|
|||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
PermissionFlagsBits,
|
PermissionFlagsBits,
|
||||||
userMention,
|
userMention,
|
||||||
|
GuildMember,
|
||||||
} from "discord.js"
|
} from "discord.js"
|
||||||
|
import { color, devMessage } from "../../config/options.json"
|
||||||
import { Command } from "../interfaces"
|
import { Command } from "../interfaces"
|
||||||
|
import logToChannel from "../utils/functions/logtochannel"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "setnick",
|
name: "setnick",
|
||||||
@@ -31,9 +34,9 @@ export = {
|
|||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
const user = interaction.options.getUser("user")!
|
const member = interaction.options.getMember("user") as GuildMember
|
||||||
const nickname = interaction.options.getString("nickname")
|
const nickname = interaction.options.getString("nickname")
|
||||||
const member = await interaction.guild!.members.fetch(user.id)
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
if (!member.manageable) {
|
if (!member.manageable) {
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@@ -45,12 +48,39 @@ export = {
|
|||||||
|
|
||||||
await member.setNickname(nickname, `Set by ${interaction.user.tag}`)
|
await member.setNickname(nickname, `Set by ${interaction.user.tag}`)
|
||||||
|
|
||||||
|
await logToChannel("mod", {
|
||||||
|
embeds: [{
|
||||||
|
author: {
|
||||||
|
name: interaction.user.username,
|
||||||
|
icon_url: interaction.user.avatarURL({ forceStatic: false }) || undefined,
|
||||||
|
},
|
||||||
|
title: "Nickname",
|
||||||
|
description: `
|
||||||
|
**User:** ${userMention(member.id)}
|
||||||
|
**Nickname:** ${nickname}
|
||||||
|
**Moderator:** ${userMention(interaction.user.id)}
|
||||||
|
`,
|
||||||
|
color: embedColor,
|
||||||
|
thumbnail: {
|
||||||
|
url: interaction.user.avatarURL({ forceStatic: false }) || "",
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
text: "ID: " + member.user.id,
|
||||||
|
icon_url: member.user.avatarURL({ forceStatic: false }) || undefined,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toISOString()
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content:
|
embeds: [{
|
||||||
"Set the nickname of " +
|
description: `Successfully set the nickname of ${userMention(member.id)} to ${nickname}`,
|
||||||
userMention(member.id) +
|
color: embedColor,
|
||||||
" to " +
|
footer: {
|
||||||
nickname,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
|
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined,
|
||||||
|
}
|
||||||
|
}],
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user