@kaname-png/plugin-bot-list
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Neko Plugins Logo

@kaname-png/plugin-bot-list

Plugin for @sapphire/framework to post stats to several discord bot lists.

GitHub codecov npm (scoped) npm

Description

This plugin allows you to post stats to several discord bot lists.

Features

  • Fully ready for TypeScript!
  • Includes ESM ready entrypoint
  • Easy to use

Installation

@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

Usage

JavaScript

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();

TypeScript

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();

How to use

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();

Information

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.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Kaname

💻 🐛 📖 🚇 🚧 👀

This project follows the all-contributors specification. Contributions of any kind welcome!

Package Sidebar

Install

npm i @kaname-png/plugin-bot-list

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

73.5 kB

Total Files

24

Last publish

Collaborators

  • kaname-png