@tryforge/forge.topgg
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ForgeTopGG

Automatically post your bot stats and receive vote events from the site.

To receive vote events, you must set your webhook url in the settings of your bot/server on top.gg to the ip/domain of your bot host + the port it's listening to, which by default is 3000 and /dblwebhook at the end.

Example (JavaScript)

const { ForgeTopGG } = require("@tryfroge/forge.topgg");
const { ForgeClient } = require("@tryforge/forgescript");

const top = new ForgeTopGG({
    token: "top.gg token",
    auth: "top.gg authorization value for webhooks",
    events: [
        "error",
        "posted",
        "voted"
    ],
    post: {
        interval: 3_600_000 // Update bot stats every hour
    }
})

const client = new ForgeClient({
    intents: [
        "Guilds",
        "MessageContent",
        "GuildMessages",
    ],
    events: [],
    mobile: true,
    useInviteSystem: true,
    prefixes: ["!", "<@$botID>"],
    extensions: [
        top
    ],
})

top.commands.add({
    type: "error",
    code: `$log[Error $postStatsError]`
})

top.commands.add({
    type: "posted",
    code: `$log[posted!]`
})

top.commands.add({
    type: "voted",
    code: `$log[voted by $voteUserID]`
})

client.login("bot token")

Package Sidebar

Install

npm i @tryforge/forge.topgg

Weekly Downloads

4

Version

1.0.0

License

ISC

Unpacked Size

64.5 kB

Total Files

111

Last publish

Collaborators

  • yuzudaneko
  • berk404
  • aggelos_007