Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo documentation #63

Merged
merged 6 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dist/
docs/build
docs/
# Logs
logs
*.log
Expand Down
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,26 @@ You can also setup webhooks via Topgg.Webhook, look down below at the examples f

# Links

[Documentation](https://topggjs.rtfd.io)
[Documentation](https://topgg.js.org)
jpbberry marked this conversation as resolved.
Show resolved Hide resolved

[API Reference](https://docs.top.gg) | [GitHub](https://github.com/top-gg/node-sdk) | [NPM](https://npmjs.com/package/@top-gg/sdk) | [Discord Server](https://discord.gg/EYHTgJX)

# Auto-Posting

If you're looking for an easy way to post your bot's stats (server count, shard count), check out [`topgg-autoposter`](https://npmjs.com/package/topgg-autoposter)

# Popular Examples

## Auto-Posting stats

If you choose not to use [`topgg-autoposter`](https://npmjs.com/package/topgg-autoposter) you can always do it yourself manually;
If you're looking for an easy way to post your bot's stats (server count, shard count), check out [`topgg-autoposter`](https://npmjs.com/package/topgg-autoposter)

```js
const client = Discord.Client() // Your discord.js client

const Topgg = require('@top-gg/sdk')

const api = new Topgg.Api('Your top.gg token')
const client = Discord.Client() // Your discord.js client or any other
const { AutoPoster } = require('topgg-autoposter')

setInterval(() => {
api.postStats({
serverCount: client.guilds.cache.size,
shardId: client.shard.ids[0], // if you're sharding
shardCount: client.options.shardCount
AutoPoster('topgg-token', client)
.on('posted', () => {
console.log('Posted stats to Top.gg!')
})
}, 1800000) // post every 30 minutes
```
With this your server count and shard count will be posted to top.<span>gg
With this your server count and shard count will be posted to Top.<span>gg

## Webhook server

Expand All @@ -55,7 +45,7 @@ const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
const webhook = new Topgg.Webhook('topggauth123') // add your Top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.listener(vote => {
// vote is your vote object
Expand Down
230 changes: 0 additions & 230 deletions docs/Api.md

This file was deleted.

42 changes: 0 additions & 42 deletions docs/Changelog.md

This file was deleted.

19 changes: 0 additions & 19 deletions docs/Makefile

This file was deleted.

Loading