mystic-stats
TypeScript icon, indicating that this package has built-in type declarations

2.2.4 • Public • Published

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 mystic-stats

NodeJS

const { PostStats } = require('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 '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;
}

Package Sidebar

Install

npm i mystic-stats

Weekly Downloads

1

Version

2.2.4

License

ISC

Unpacked Size

12.6 kB

Total Files

6

Last publish

Collaborators

  • glitched_king