starboard
Easiest starboard system ever existed !
This function should be used only in
messageReactionAdd
,messageReactionDelete
andmessageDelete
events
Implementation
simplydjs.starboard(reaction, {
channelId: '01234567890123' // channelId (required)
// options (Optional)
})
tip
When using the function for messageDelete
event, replace reaction
to message
Example:
client.on('messageDelete', () => {
simplydjs.starboard(message, {
channelId: '01234567890123' // channelId (required)
// options (Optional)
})
})
Output
Types
simplydjs.starboard(
reactionOrMessage: MessageReaction | ExtendedMessage,
options: starboardOption
): Promise<void>
- reaction:
MessageReaction
|ExtendedMessage
- options:
starboardOption
Options
starboardOption
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
strict | boolean | ❌ | false | Enables strict mode in starboard |
channelId | string | ✅ | - | Channel Id to send the star board |
embed | CustomizableEmbed | ❌ | default embed | Pass a CustomizableEmbed Object to customize the embed |
min | number | ❌ | 2 | The number of reactions required to list in the starboard |
emoji | string | ❌ | ⭐ | Emoji required as reaction to list the message on the starboard |
export type starboardOption = {
embed?: CustomizableEmbed;
channelId?: string;
min?: number;
emoji?: string;
strict?: boolean;
};
Example
Default settings
messageReactionAdd.js
const simplydjs = require('simply-djs')
simplydjs.starboard(reaction, {
channelId: '1234567890123', // required
})
messageReactionRemove.js
simplydjs.starboard(reaction, {
channelId: '1234567890123', // required
})
messageDelete.js
simplydjs.starboard(message, {
channelId: '1234567890123', // required
})
Customized with options
messageReactionAdd.js
const simplydjs = require('simply-djs')
simplydjs.starboard(reaction, {
channelId: '1234567890123', // required
strict: true,
embed: {
title: "Starboard"
color: simplydjs.toRgb("#406dbc")
}
emoji: '⭐',
min: 2,
})
messageReactionRemove.js
simplydjs.starboard(reaction, {
channelId: '1234567890123', // required
strict: true,
emoji: '⭐',
min: 2,
})
messageDelete.js
simplydjs.starboard(message, {
channelId: '1234567890123', // required
strict: true,
})