Fixed some bugs

This commit is contained in:
CorwinDev 2022-12-12 13:40:42 +01:00
parent 6ff356d285
commit 75b47ca7d9
6 changed files with 17 additions and 9 deletions

View file

@ -5,7 +5,7 @@ const voiceSchema = require("../../database/models/voice");
module.exports = async (client, interaction, args) => {
interaction.guild.channels.create({
name: "Custom voice",
type: "GUILD_CATEGORY"
type: Discord.ChannelType.GuildCategory,
}).then((cat) => {
interaction.guild.channels.create({
name: " Create Voice",

View file

@ -3,10 +3,17 @@ const chalk = require('chalk');
async function connect() {
mongoose.set('strictQuery', false);
mongoose.connect(process.env.MONGO_TOKEN, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
try {
await mongoose.connect(process.env.MONGO_TOKEN, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
} catch (err) {
console.log(chalk.red(`[ERROR]`), chalk.white(`>>`), chalk.red(`MongoDB`), chalk.white(`>>`), chalk.red(`Failed to connect to MongoDB!`), chalk.white(`>>`), chalk.red(`Error: ${err}`))
console.log(chalk.red("Exiting..."))
process.exit(1)
}
mongoose.connection.once("open", () => {
console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), chalk.red(`MongoDB`), chalk.green(`is ready!`))

View file

@ -1,4 +1,4 @@
const discord = require('discord.js');
const Discord = require('discord.js');
const voiceSchema = require("../../database/models/voice");
const channelSchema = require("../../database/models/voiceChannels");

View file

@ -1,4 +1,5 @@
const Schema = require("../../database/models/logChannels");
const Discord = require('discord.js');
module.exports = async (client) => {
client.getLogs = async function (guildId) {

View file

@ -203,7 +203,7 @@ module.exports = (client) => {
if (fields) embed.addFields(fields);
if (author) embed.setAuthor(author);
if (url) embed.setURL(url);
if (footer) embed.setFooter(footer);
if (footer) embed.setFooter({ text: footer });
if (color) embed.setColor(color);
if (functiondata && functiondata.Color && !color) embed.setColor(functiondata.Color)
return client.sendEmbed({

View file

@ -101,8 +101,8 @@ module.exports = {
model.findOne({ User: interaction.user.id }, async (err, data) => {
if (data && data.FLAGS.includes("DEVELOPER")) {
client.loadSubcommands(client, interaction, args);
}
else {
} else {
console.log(`[ERROR] >> Only Bot developers are allowed to do this`);
client.errNormal({
error: "Only Bot developers are allowed to do this",
type: 'reply'