Plugin for @sapphire/framework to post stats to several discord bot lists.
This plugin allows you to post stats to several discord bot lists.
- Fully ready for TypeScript!
- Includes ESM ready entrypoint
- Easy to use
@kaname-png/plugin-bot-list
depends on the following packages. Be sure to install these along with this package!
You can use the following command to install this package, or replace npm install
with your package manager of choice.
npm install @kaname-png/plugin-bot-list @sapphire/framework
In your main or setup file, register the plugin:
require('@sapphire/plugin-bot-list/register');
Once the plugin is registered, we have to configure some options.
async function main() {
const client = new SapphireClient({
botList: {
clientId: 'YOUR_CLIENT_ID', // Optional; by default it is the bot's id
debug: false, // (Optional), shows debug messages; by default it is false
shard: false, // (Optional), enable sharding support; by default it is false
autoPost: {
enabled: true, // (Optional); by default it is enabled
interval: 3_600_000 // (Optional); by default it is set to 1 hour
},
keys: {
topGG: 'YOUR_AWESOME_TOP_GG_API_KEY' // Your top.gg API key (a list will be found below)
}
}
});
await client.login();
}
void main();
In your main or setup file, register the plugin:
import '@sapphire/plugin-bot-list/register';
Once the plugin is registered, we have to configure some options.
async function main() {
const client = new SapphireClient({
botList: {
clientId: 'YOUR_CLIENT_ID', // Optional; by default it is the bot's id
debug: false, // (Optional), shows debug messages; by default it is false
shard: false, // (Optional), enable sharding support; by default it is false
autoPost: {
enabled: true, // (Optional); by default it is enabled
interval: 3_600_000 // (Optional); by default it is set to 1 hour
},
keys: {
topGG: 'YOUR_AWESOME_TOP_GG_API_KEY' // Your top.gg API key (a list will be found below)
}
}
});
await client.login();
}
void main();
If you enable the autoPost option, the plugin will automatically publish the data for you; you don't need to do anything else!
If you want to manually post the data, you can use the following method:
client.botList.postStats();
You can also retrieve the approximate number of users or guilds from this method:
client.botList.computeUsers();
client.botList.computeGuilds();
This plugin is a fork of the @devtomio/plugin-botlist plugin, which was created by jzeuzs which has not been maintained for over a year now and has some issues.
Thanks goes to these wonderful people (emoji key):
Kaname 💻 🐛 📖 🚇 🚧 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!