ayoub-toxic
v1.0.0
Published
A simple module based on MirageZoe's module: better-discord-antispam.js! While containing the same efficiency(quick and simple setup), it comes with new things like setting up a report channel, timed mutes(added mute & unmute automatically) and many more
Downloads
4
Maintainers
Readme
mute-ayoub.js
A simple module based on MirageZoe's module: better-discord-antispam.js! While containing the same efficiency(quick and simple setup), it comes with new things like setting up a report channel, timed mutes(added mute & unmute automatically) and many more features coming on the way! DISCLAMER: You can only setup 1 set of configuration per client. (That means that you can't configure settings for each server for now. You can only modify in which guild checker is run and in which checker is not run.)
How to add this to your node_modules:
To install this module type in your console command below:
npm i mute-ayoub
An example of how to set up:
Below you will find an example that would explain everything and what you must set up! (it's not too different!)
const Discord = require('discord.js');
const antispam = require('mute-ayoub'); // Requiring this module.
const client = new Discord.Client();
client.on('ready', () => {
// Module Configuration Constructor
ayoub(client, {
mutecmd: "", // The mute command. If there is no command set, by default.
muteMessage: "was muted since we don't like too much advertisement type people!",
mutedRole: "muted", // Here you put the name of the role that should not let people write or anything else in your server. If there is no role set, by default, the module will attempt to create the role for you & set it correctly for every channel in your server. It will be named "muted".
timeMuted: "10m", // This is how much time member X will be muted. if not set, default would be 10 min.
logChannel: "mute-logs" // This is the channel where every report about spamming goes to. If it's not set up, it will attempt to create the channel.
mprefix: "#" //the prefix of the mute command. If there is no command set, by default.
});
// Rest of your code
});
client.on('message', msg => {
client.emit('checkMessage', msg);
// Rest of your code
}
client.login('token');
This is the main setup you have to add in order to mute annoying people.
Little bit of documentation...
ayoub(<Client>);
This will configure module to run on its default configuration.
<Client>
- Variable that defines new Discord.Client()
ayoub
- Variable that defines require('mute-ayoub')
client.emit('checkMessage', <Message>)
<Message>
- Variable that defines the message itself. (client.on('message', async (msg) =>{})
in this situation msg is the variable.)
This will basically send your message to module. In fact is REQUIERED for module to run.
ayoub(client, {
mutecmd: "mute",
muteMessage: "",
mutedRole:"",
timeMuted: "10m",
logChannel: "",
mprefix: "#"
});
ayoub
- Variable that defines require('mute-ayoub')
<Client>
- Requiered, Discord.Client
muteMessage
- Optional, Type: String, Minimum 5 Characters
mutedRole
- Optional, Type: String
timeMuted
- Optional, Type: Integer
logChannel
- Optional, Type: String
mprefix
- Optional, Type: String
mutecmd
- Optional, Type: String
NOTE: The module will throw errors for assigning incorect types to configuration values.
P.S: If you have any issues, bugs or trouble setting the module up. feel free to open an issue on Github