api-mystic-stats
v2.2.7
Published
Post stats to mysticbot.xyz
Downloads
8
Maintainers
Readme
Mystic - Stats
Simple package to easily post stats to mysticbot.xyz. By default, it posts stats every 5 minutes. It uses discord.js to login and post stats.
npm i -s api-mystic-stats
NodeJS
const { PostStats } = require('api-mystic-stats');
const stats = new PostStats({
apiToken: '<your_bot_api_token>',
botToken: '<your_bot_token>'
});
stats.on('postStats', (res) => console.log(res.ok ? 'Posted stats.' : 'Failed to post stats.'));
TypeScript / ES6
import { PostStats } from 'api-mystic-stats';
const stats = new PostStats({
apiToken: '<your_bot_api_token>',
botToken: '<your_bot_token>'
});
stats.on('postStats', (res) => console.log(res.ok ? 'Posted stats.' : 'Failed to post stats.'));
Options
export interface PostStatsOptions {
/** API Token - https://mysticbot.xyz/dashboard/bots/[yourBotId]/api */
apiToken: string;
/** Bot token - https://discord.com/developers. */
botToken: string;
/** Interval to to post stats in minutes.
* @default 5 */
interval?: number;
}