here is my add channel command:
const { RichEmbed } = require(“discord.js”)
module.exports.run = async (bot, message, args, settings) => {
let errorembed = new RichEmbed()
.setTitle(“Error”)
.setColor("#ED3833")
.setDescription("<@" + message.author.id + “>” + " You don’t have permission to use that command")
const db = require(‘quick.db’);
if (!args[0]) message.channel.send(“Please specify a setting to change”)
if (!message.member.permissions.has('ADMINISTRATOR') && message.author.id !== "476188720521805825") return message.channel.send(errorembed);//{
if (args[0] === "ignored") {
let sChannel = message.mentions.channels.first() || message.guild.channels.get(args[1]);
if (!sChannel) {
message.channel.send("That channel could not be found");
}
const create = await settings.create({
name: `ignored`,
description: `${sChannel.id}`,
guild: message.guild.id
});
console.log(`${sChannel.id} Added`)
return message.reply(`<#${sChannel.id}> has been added to the spam channel list`);
}
catch (e) {
if (e.name === ‘SequelizeUniqueConstraintError’) {
return message.reply(‘Error’);
}
return message.reply(‘Error’);
}
let sembed = new RichEmbed()
.setTitle("Success")
.setColor("#3FC83B")
.setDescription(<#${sChannel.id}> has been added to the spam channel list
)
message.channel.send(sembed);
}
}
module.exports.config = {
name: “addchannel”
}
and here is the command to fetch the channels:
const Discord = require(“discord.js”)
const db = require(‘quick.db’)
module.exports.run = async (bot, message, args, settings) => {
if(message.author.bot || message.channel.type === “dm”) return;
const rowCount = await settings.destroy({ where: { description: null }});
const tagList = await settings.findAll({ attributes: [‘description’] });
const tagString = tagList.map(t => t.name).join(’, ') || ‘No channels found’;
let e = new Discord.RichEmbed()
.setTitle(Spam Channels
)
.setColor(#36BBF6
)
.setDescription(tagString)
return message.channel.send(e)
}
module.exports.config = {
name: “channels”
}
and it isn’t fetching the channel.