huge changes once again
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index 448f26a..19a389b 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -1,6 +1,6 @@
import { ChannelType } from 'discord-api-types';
import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
-import generateEmojiEmbed from "../../../utils/generateEmojiEmbed.js";
+import EmojiEmbed from "../../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../../utils/confirmationMessage.js";
import getEmojiByName from "../../../utils/getEmojiByName.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
@@ -17,7 +17,7 @@
const callback = async (interaction: CommandInteraction): Promise<any> => {
let m;
- m = await interaction.reply({embeds: [new generateEmojiEmbed()
+ m = await interaction.reply({embeds: [new EmojiEmbed()
.setTitle("Loading")
.setStatus("Danger")
.setEmoji("NUCLEUS.LOADING")
@@ -27,7 +27,7 @@
try {
channel = interaction.options.getChannel("channel")
} catch {
- return await interaction.editReply({embeds: [new generateEmojiEmbed()
+ return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("CHANNEL.TEXT.DELETE")
.setTitle("Log Channel")
.setDescription("The channel you provided is not a valid channel")
@@ -36,7 +36,7 @@
}
channel = channel as Discord.TextChannel
if (channel.guild.id != interaction.guild.id) {
- return interaction.editReply({embeds: [new generateEmojiEmbed()
+ return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Log Channel")
.setDescription(`You must choose a channel in this server`)
.setStatus("Danger")
@@ -52,10 +52,10 @@
.send(true)
if (confirmation.success) {
try {
- await client.database.write(interaction.guild.id, {"logging.logs.channel": channel.id})
+ await client.database.guilds.write(interaction.guild.id, {"logging.logs.channel": channel.id})
} catch (e) {
console.log(e)
- return interaction.editReply({embeds: [new generateEmojiEmbed()
+ return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Log Channel")
.setDescription(`Something went wrong and the log channel could not be set`)
.setStatus("Danger")
@@ -63,7 +63,7 @@
], components: []});
}
} else {
- return interaction.editReply({embeds: [new generateEmojiEmbed()
+ return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Log Channel")
.setDescription(`No changes were made`)
.setStatus("Success")
@@ -72,10 +72,10 @@
}
}
let clicks = 0;
- let data = await client.database.read(interaction.guild.id);
+ let data = await client.database.guilds.read(interaction.guild.id);
let channel = data.logging.logs.channel;
while (true) {
- await interaction.editReply({embeds: [new generateEmojiEmbed()
+ await interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Log channel")
.setDescription(channel ? `Your log channel is currently set to <#${channel}>` : "This server does not have a log channel")
.setStatus("Success")
@@ -96,14 +96,14 @@
clicks += 1;
if (clicks == 2) {
clicks = 0;
- await client.database.write(interaction.guild.id, {}, ["logging.logs.channel"])
+ await client.database.guilds.write(interaction.guild.id, {}, ["logging.logs.channel"])
channel = undefined;
}
} else {
break
}
}
- await interaction.editReply({embeds: [new generateEmojiEmbed()
+ await interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Log channel")
.setDescription(channel ? `Your log channel is currently set to <#${channel}>` : "This server does not have a log channel")
.setStatus("Success")
diff --git a/src/commands/settings/logs/ignore.ts b/src/commands/settings/logs/ignore.ts
index 4b66307..12af085 100644
--- a/src/commands/settings/logs/ignore.ts
+++ b/src/commands/settings/logs/ignore.ts
@@ -1,7 +1,7 @@
import { ChannelType } from 'discord-api-types';
import Discord, { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import generateEmojiEmbed from "../../../utils/generateEmojiEmbed.js";
+import EmojiEmbed from "../../../utils/generateEmojiEmbed.js";
import { WrappedCheck } from "jshaiku";
import confirmationMessage from '../../../utils/confirmationMessage.js';
import keyValueList from '../../../utils/generateKeyValueList.js';
@@ -24,7 +24,7 @@
let channel = interaction.options.getChannel("addchannel")
let user = interaction.options.getUser("adduser")
let role = interaction.options.getRole("addrole")
- await interaction.reply({embeds: [new generateEmojiEmbed()
+ await interaction.reply({embeds: [new EmojiEmbed()
.setTitle("Loading")
.setStatus("Danger")
.setEmoji("NUCLEUS.LOADING")
@@ -34,7 +34,7 @@
try {
channel = interaction.guild.channels.cache.get(channel.id)
} catch {
- return await interaction.editReply({embeds: [new generateEmojiEmbed()
+ return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("CHANNEL.TEXT.DELETE")
.setTitle("Logs > Ignore")
.setDescription("The channel you provided is not a valid channel")
@@ -43,7 +43,7 @@
}
channel = channel as Discord.TextChannel
if (channel.guild.id != interaction.guild.id) {
- return interaction.editReply({embeds: [new generateEmojiEmbed()
+ return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Logs > Ignore")
.setDescription(`You must choose a channel in this server`)
.setStatus("Danger")
@@ -55,7 +55,7 @@
try {
user = interaction.guild.members.cache.get(user.id).user
} catch {
- return await interaction.editReply({embeds: [new generateEmojiEmbed()
+ return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("USER.DELETE")
.setTitle("Logs > Ignore")
.setDescription("The user you provided is not a valid user")
@@ -68,7 +68,7 @@
try {
role = interaction.guild.roles.cache.get(role.id)
} catch {
- return await interaction.editReply({embeds: [new generateEmojiEmbed()
+ return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("ROLE.DELETE")
.setTitle("Logs > Ignore")
.setDescription("The role you provided is not a valid role")
@@ -77,7 +77,7 @@
}
role = role as Discord.Role
if (role.guild.id != interaction.guild.id) {
- return interaction.editReply({embeds: [new generateEmojiEmbed()
+ return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Logs > Ignore")
.setDescription(`You must choose a role in this server`)
.setStatus("Danger")
@@ -97,12 +97,12 @@
.setColor("Warning")
.send(true)
if (confirmation.success) {
- let data = client.database.read(interaction.guild.id)
+ let data = client.database.guilds.read(interaction.guild.id)
if (channel) data.logging.logs.ignore.channels.concat([channel.id])
if (user) data.logging.logs.ignore.users.concat([user.id])
if (role) data.logging.logs.ignore.roles.concat([role.id])
if (interaction.options.getString("action") == "add") {
- await client.database.append(interaction.guild.id, data)
+ await client.database.guilds.append(interaction.guild.id, data)
}
}
}