mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 19:45:16 +00:00
Fixed some bugs
This commit is contained in:
parent
6ff356d285
commit
75b47ca7d9
6 changed files with 17 additions and 9 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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!`))
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
const Schema = require("../../database/models/logChannels");
|
||||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.getLogs = async function (guildId) {
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue