3.1.0 • Published 5 years ago

cheesecord.js v3.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

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)

ParameterTypeDescription
tokenstringThe token of the client

Returns: void


commandError \ This event is emitted when an error is thrown while calling Command.run().

ParameterTypeDescription
messageMessageThe message of the command
errErrorThe error caught

cooldown \ This event is emitted when a command is on cooldown.

ParameterTypeDescription
messageMessageThe message of the command
cooldownnumberThe remaining cooldown in milliseconds

missingPermissions \ This event is emitted when a member doesn't have the required permissions to run the command.

ParameterTypeDescription
messageMessageThe message of the command
permissionsArrayThe permissions needed

ClientOptions

PropertyTypeDefaultDescription
ignoreBotsbooleantrueWhether the bot ignores bots' messages
ownerIDstringThe ID of the owner
prefixesArrayThe 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.

ParameterTypeDescription
namestringThe name of the command (or alias)

Returns: boolean


.enable(name) \ Returns true if command is successfully enabled, false if the argument is invalid.

ParameterTypeDescription
namestringThe name of the command (or alias)

Returns: boolean


.reload(name) \ Returns true if command is successfully reloaded, false if the argument is invalid.

ParameterTypeDescription
namestringThe name of the command (or alias)

Returns: boolean


.reloadAll()

Returns: void


Command

.properties \ The object provided in exports.properties

PropertyTypeDefaultDescription
aliasesArray[]The command aliases
cooldownnumberThe command cooldown in milliseconds
enabledbooleantrueWhether the command is enabled
inDMsbooleanfalseWhether the command can be used in DMs
inGuildsbooleantrueWhether the command can be used in guilds
ownerOnlybooleanfalseWhether it is an owner-only command
permissionsArray[]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

ParameterTypeDescription
querystringThe search query

Returns: TextChannel or VoiceChannel or CategoryChannel


.findMember(query) \ A utility to get a GuildMember from message.guild.members

ParameterTypeDescription
querystringThe search query

Returns: GuildMember


.findRole(query) \ A utility to get a Role from message.guild.roles

ParameterTypeDescription
querystringThe search query

Returns: Role


.alert(message, duration) \ Sends a message but deletes it after a certain duration.

ParameterTypeDescription
messagestringThe message to send
durationnumberThe 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

PropertyTypeDescription
exports.runFunctionThe callback function

You can access the Client instance with this.client inside exports.run.


3.1.0

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago