cheesecord.js v3.1.0
cheesecord.js
A discord.js framework \ Inspired by discord.py and built on top of discord.js@12.0.0-dev (master branch)
Why cheesecord.js?
- Advanced argument parsing
- Command aliases
- Command cooldowns
- Command permissions
- Command loader system
- Multiple prefixes
Installation
npm i cheesecord.js --save
Documentation
Client
This class extends Discord.Client.
const { Client } = require("cheesecord.js");
const client = new Client(ClientOptions);
.cache
\
A Map to store cached data in your Client instance
Returns: Map
.commands
Returns: CommandStore
.events
Returns: EventStore
.prefixes
Returns: Array
.login(token)
Parameter | Type | Description |
---|---|---|
token | string | The token of the client |
Returns: void
commandError \
This event is emitted when an error is thrown while calling Command.run()
.
Parameter | Type | Description |
---|---|---|
message | Message | The message of the command |
err | Error | The error caught |
cooldown \ This event is emitted when a command is on cooldown.
Parameter | Type | Description |
---|---|---|
message | Message | The message of the command |
cooldown | number | The remaining cooldown in milliseconds |
missingPermissions \ This event is emitted when a member doesn't have the required permissions to run the command.
Parameter | Type | Description |
---|---|---|
message | Message | The message of the command |
permissions | Array | The permissions needed |
ClientOptions
Property | Type | Default | Description |
---|---|---|---|
ignoreBots | boolean | true | Whether the bot ignores bots' messages |
ownerID | string | The ID of the owner | |
prefixes | Array | The prefixes for the client |
CommandStore
This class extends Map and it contains Command objects mapped by the name (and the aliases) of the commands. \
Loads command files from ./commands
including its subdirectories.
.disable(name)
\
Returns true
if command is successfully disabled, false
if the argument is invalid.
Parameter | Type | Description |
---|---|---|
name | string | The name of the command (or alias) |
Returns: boolean
.enable(name)
\
Returns true
if command is successfully enabled, false
if the argument is invalid.
Parameter | Type | Description |
---|---|---|
name | string | The name of the command (or alias) |
Returns: boolean
.reload(name)
\
Returns true
if command is successfully reloaded, false
if the argument is invalid.
Parameter | Type | Description |
---|---|---|
name | string | The name of the command (or alias) |
Returns: boolean
.reloadAll()
Returns: void
Command
.properties
\
The object provided in exports.properties
Property | Type | Default | Description |
---|---|---|---|
aliases | Array | [] | The command aliases |
cooldown | number | The command cooldown in milliseconds | |
enabled | boolean | true | Whether the command is enabled |
inDMs | boolean | false | Whether the command can be used in DMs |
inGuilds | boolean | true | Whether the command can be used in guilds |
ownerOnly | boolean | false | Whether it is an owner-only command |
permissions | Array | [] | The permissions required |
Returns: Object
.run
\
The function provided in exports.run
\
this
in the function refers to the Context object.
Returns: Function
.uri
\
The path of the command file
Returns: string
Context
.client
Returns: Client
.message
\
Returns the message that triggered the command.
Returns: Message
.author
\
Returns the author of the message.
Returns: User
.channel
\
Returns the channel where the message was sent in.
Returns: DMChannel or TextChannel
.guild
\
Returns the guild the message was sent in.
Returns: Guild
.member
\
Returns the member who sent the message.
Returns: GuildMember
.embed()
\
A shortcut to new Discord.MessageEmbed()
Returns: MessageEmbed
.findChannel(query)
\
A utility to get a Channel from message.guild.channels
Parameter | Type | Description |
---|---|---|
query | string | The search query |
Returns: TextChannel or VoiceChannel or CategoryChannel
.findMember(query)
\
A utility to get a GuildMember from message.guild.members
Parameter | Type | Description |
---|---|---|
query | string | The search query |
Returns: GuildMember
.findRole(query)
\
A utility to get a Role from message.guild.roles
Parameter | Type | Description |
---|---|---|
query | string | The search query |
Returns: Role
.alert(message, duration)
\
Sends a message but deletes it after a certain duration.
Parameter | Type | Description |
---|---|---|
message | string | The message to send |
duration | number | The duration of the message (in milliseconds) |
Returns: Promise[**Message**](https://discord.js.org/#/docs/main/master/class/Message)
EventStore
This class extends Map and it contains event files mapped by the name of the events. \
Loads event files from ./events
including its subdirectories.
Event Files
Property | Type | Description |
---|---|---|
exports.run | Function | The callback function |
You can access the Client instance with this.client
inside exports.run
.
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago