1.3.7 • Published 3 years ago

discord-mod-bot v1.3.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

❔ About

Discord-Mod-Bot is a package that makes it easier to make a moderation discord bot, with easily functions to kick, ban, mute members etc. And last but not least.. Why are you still reading this?! Go for it and install it!

📊 Installation

Before installing:

  1. You need to have node.js installed
  2. You need the NPM package 'discord.js'

After you have/did this.. You can finally install the package!

Terminal Command:

$ npm install discord-mod-bot

✏ Usage

Currently available commands:

  • Kick - Kicks a member from the server
  • Ban - Bans a member from the server
  • Mute - Mutes a member from the server
  • Unmute - Unmutes a member from the server when he/she is muted
  • Lock - Locks a channel in the server.
  • Unlock - Unlocks a channel in the server when locked.
  • Slowmode - Updates the slowmode for a channel.

More coming soon..

kick

Kicks a member from the server.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
memberThe member to kickGuildMember2
reasonThe reason why the member is kickedstring3
descriptionThe message of the embedstring4

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !kick do..
    if(message.content.startsWith('!kick')) {

        // Getting the member that is mentioned (has to be a GuildMember not a User)
        const member = message.mentions.members.first()

        // The reason of the mute
        const reason = 'Did something wrong!'

        // Running the kick command with the needed params
        // All {} to use with the description: {member.tag}, {member.username}, {member.id}, {member.mention}, {author.tag}, {author.username}, {author.id}, {author.mention}, {reason}
        command.kick(message, member, reason, '`{member.tag}` ({member.id}) was kicked by {author} with the reason {reason}')

    }

})

// Logging into the client
client.login('TOKEN')

ban

Bans a member from the server.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
memberThe member to kickGuildMember2
reasonThe reason why the member is kickedstring3
daysThe total days of the baninteger4
descriptionThe message of the embedstring5

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !kick do..
    if(message.content.startsWith('!ban')) {

        // Getting the member that is mentioned (has to be a GuildMember not a User)
        const member = message.mentions.members.first()

        // The reason of the mute
        const reason = 'Did something wrong!'

        // The total days of the ban
        const days = 7

        // Running the ban command with the needed params
        // All {} to use with the description: {member.tag}, {member.username}, {member.id}, {member.mention}, {author.tag}, {author.username}, {author.id}, {author.mention}, {reason}, {days}
        command.ban(message, member, reason, days, '`{member.tag}` ({member.id}) was banned by {author} with the reason {reason} for {days} days')

    }

})

// Logging into the client
client.login('TOKEN')

mute

Mutes a member from the server.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
memberThe member to muteGuildMember2
roleThe mute roleGuildRole3
timeThe time of the mutestring4
reasonThe reason of the mutestring5
descriptionThe message of the embedstring6

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !mute do..
    if(message.content.startsWith('!mute')) {

        // Getting the member that is mentioned (has to be a GuildMember not a User)
        const member = message.mentions.members.first()

        // The role the user gets when muted
        const role = message.guild.roles.cache.find(role => role.name === 'muted')

        // The time of the mute, example: 10s / 15m / 2h / 1d
        const time = '10s'
        // If no time 
        const time = null || false

        // The reason of the mute
        const reason = 'Did something wrong!'

        // Running the mute command with the needed params
        // All {} to use with the description: {member.tag}, {member.username}, {member.id}, {author.tag}, {author.username}, {author.id}, {author.mention}, {reason}, {time}, {role.name},{role.id}, {role.mention}
        command.mute(message, member, role, time, reason, '`{member.tag}` ({member.id}) has been muted by {author} with the reason {reason} for {time} with the role {role.name} | {role.id}')

    }

})

// Logging into the client
client.login('TOKEN')

unmute

Unmutes a member from the server when he/she is muted.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
memberThe member to unmuteGuildMember2
roleThe mute roleGuildRole3
reasonThe reason of the mutestring4
descriptionThe message of the embedstring5

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !unmute do..
    if(message.content.startsWith('!unmute')) {

        // Getting the member that is mentioned (has to be a GuildMember not a User)
        const member = message.mentions.members.first()

        // The mute role of the server
        const role = message.guild.roles.cache.find(role => role.name === 'muted')

        // The reason of the unmute
        const reason = 'Did something wrong!'

        // Running the unmute command with the needed params
        // All {} to use with the description: {member.tag}, {member.username}, {member.id}, {member.mention}, {author.tag}, {author.username}, {author.id}, {author.mention}, {reason}, {role.name}, {role.id}, {role.mention}
        command.unmute(message, member, role, reason, '`{member.tag}` ({member.id}) has been unmuted by {author} with the reason {reason} with the role {role.name} | {role.id}')

    }

})

// Logging into the client
client.login('TOKEN')

lock

Locks a channel in the server.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
channelThe channel to lockGuildChannel2
reasonThe reason why the channel is lockedstring3
descriptionThe message of the embedstring4

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !lock do..
    if(message.content.startsWith('!lock')) {

        // Getting the channel that has to be locked
        const channel = message.mentions.channels.first() || message.channel

        // The reason of the lock
        const reason = 'A raid is happening!'

        // Running the lock command with the needed params
        // All {} to use with the description: {channel.name}, {channel.id}, {channel.mention}, {reason}, {author.tag}, {author.username}, {author.id}, {author.mention}
        command.lock(message, channel, reason, 'The channel {channel.name} ({channel.id}) has been locked by {author.tag} ({author.id}) with the reason {reason}')

    }

})

// Logging into the client
client.login('TOKEN')

unlock

Unlocks a channel in the server when locked.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
channelThe channel to unlockGuildChannel2
reasonThe reason why the channel is unlockedstring3
descriptionThe message of the embedstring4

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !unlock do..
    if(message.content.startsWith('!unlock')) {

        // Getting the channel that has to be unlocked
        const channel = message.mentions.channels.first() || message.channel

        // The reason of the unlock
        const reason = 'The raid is over!'

        // Running the unlock command with the needed params
        // All {} to use with the description: {channel.name}, {channel.id}, {channel.mention}, {reason}, {author.tag}, {author.username}, {author.id}, {author.mention}
        command.unlock(message, channel, reason, 'The channel {channel.name} ({channel.id}) has been unlocked by {author.tag} ({author.id}) with the reason {reason}')

    }

})

// Logging into the client
client.login('TOKEN')

slowmode

Updates the slowmode for a channel.

Parameters:

ParameterDescriptionTypePosition
messageThe param of your message eventObject1
channelThe channel to change slowmodeGuildChannel2
timeThe amount of seconds of the slowmodeInteger3
reasonThe reason of the new slowmodestring4
descriptionThe message of the embedstring5

Example:

// Importing the client of the discord.js modules
const client = new (require('discord.js')).Client()

// Setting up the module with the settings
require('discord-mod-bot')(client)

// Requiring the commands of the module
const { command } = require('discord-mod-bot')

// Starting up the client
client.on('ready', async () => {
    console.log(`${client.user.tag} is online!`)
})

client.on('message', async message => {

    // When the message is !slowmode do..
    if(message.content.startsWith('!slowmode')) {

        // Getting the channel for the new slowmode
        const channel = message.mentions.channels.first() || message.channel

        // The new time of the slowmode, example: 10 = 10 seconds (NOTE: Maximum = 21600)
        const time = '10'

        // The reason of the slowmode
        const reason = 'To many spam of messages!'

        // Running the unlock command with the needed params
        // All {} to use with the description: {channel.name}, {channel.id}, {channel.mention}, {time}, {reason}, {author.tag}, {author.username}, {author.id}, {author.mention}
        command.slowmode(message, channel, time, reason, 'The slowmode of the channel {channel.name} ({channel.id}) has been updated to {time} seconds by {author.tag} ({author.id}) with the reason {reason}')

    }

})

// Logging into the client
client.login('TOKEN')

💻 Developers

This package has been developed by:

Koenie06 and I am Intelligent

📰 Links

Discord:

Koenie06#9999 I am Intelligent#0001

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.0

3 years ago

1.2.8

3 years ago

1.1.9

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

6 years ago

1.0.0

6 years ago