Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChannelCheck has too much redundant code #83

Closed
nathen418 opened this issue Apr 7, 2021 · 0 comments
Closed

ChannelCheck has too much redundant code #83

nathen418 opened this issue Apr 7, 2021 · 0 comments

Comments

@nathen418
Copy link
Member

Redundant code needs to be cleaned up in ChannelCheck.js
It needs to be simplified if at all possible

Example:

        //check if the user has been banned from using the bot 
        if (gate.BANNED_USERS.includes(messageAuth.id)) {
            message.delete();
            const banEmbed = new MessageEmbed()
                .setColor('#ff3505')
                .setTitle('User ban notice')
                .setDescription(`<@${messageAuth.id}>, You have been banned from using this bot by the owner.`,);
            message.channel.send(banEmbed)
                .then(msg => {
                    msg.delete({ timeout: 20000 })
                })
            return;
        }

and

        //check if the guild has been banned from using the bot 
        if (gate.BANNED_GUILDS.includes(message.guild.id)) {
            message.delete();
            const banEmbed = new MessageEmbed()
                .setColor('#ff3505')
                .setTitle('Guild ban notice')
                .setDescription(`<@${messageAuth.id}>, This guild has been banned from using this bot by the owner.`,);
            message.channel.send(banEmbed)
                .then(msg => {
                    msg.delete({ timeout: 20000 })
                })
            return;
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant