@@ -35,13 +35,11 @@ console.log(botData)
35
35
* Posts your bots data to DisStat.
36
36
* Warning: You shouldn't use this when autoposting.
37
37
*
38
- * @param {Object} data - The data to post:
39
- * @param {number} data.servers - The amount of servers your bot is in, e.g. client.guilds.cache.size
40
- * @param {number} data.users - The amount of users your bot can see, e.g. client.users.cache.size
41
- * @param {number} data.shards - The amount of shards your bot is using, e.g. client.shard.count
38
+ * @param {Object} data - The data to post
39
+ * @see https://disstat.pages.dev/docs
40
+ * @returns {Promise<Object>} - Only on error: The error object received from the API
42
41
*/
43
- const newBotData = await disstat .postData ({ servers: 42 , users: 100 , shards: 1 })
44
- console .log (newBotData)
42
+ disstat .postData ({ guilds: 42 , users: 100 , shards: 1 })
45
43
46
44
/*
47
45
* Posts a command to DisStat using custom graphs.
@@ -59,17 +57,22 @@ disstat.postCommand("help", "581146486646243339", "1081089799324180490")
59
57
* Posts data for a custom graph to DisStat.
60
58
* Note that using a new type here creates the custom graph
61
59
* on DisStat if you have enough unused graph slots.
60
+ *
62
61
* Don't use names like "servers" or "users" here, as they are reserved
63
62
* for the main graphs, and would get overwritten.
64
63
*
64
+ * "type" must not be longer than 50 characters.
65
+ * "value1", "value2" and "value3" must not be longer than 100 characters.
66
+ *
65
67
* @param {string} type - The name of the custom graph to post to
66
68
* @param {string|Number} value1? - First custom value (e.g. an event name like "interactionCreate")
67
69
* @param {string|Number} value2? - Second custom value (e.g. a user ID)
68
70
* @param {string|Number} value3? - Third custom value (e.g. a guild ID)
69
71
*/
70
72
disstat .postCustom (" events" , " interactionCreate" )
71
73
72
- if (message .content .includes (" <@" + bot .user .id + " >" )) {
74
+ if (message .content .includes (" <@" + client .user .id + " >" )) {
75
+ message .reply (" My prefix is `!` 🤖" )
73
76
disstat .postCustom (" ping" )
74
77
}
75
78
```
@@ -80,10 +83,10 @@ if (message.content.includes("<@" + bot.user.id + ">")) {
80
83
const DisStat = require (" disstat" )
81
84
const disstat = new DisStat (... )
82
85
86
+ // This event also gets emitted on autoposting.
83
87
disstat .on (" post" , (error , data ) => {
84
88
if (error) console .log (" An error occurred while posting:" , error, data)
85
89
else console .log (" Posted data successfully:" , data)
86
- // This event also gets emitted on autoposting.
87
90
})
88
91
89
92
disstat .on (" autopostStart" , () => {
@@ -93,7 +96,6 @@ disstat.on("autopostError", (error, data) => {
93
96
console .log (" Autopost failed: " + error, data)
94
97
})
95
98
disstat .on (" autopostSuccess" , data => {
96
- console .log (" Successfully posting data:" , data)
99
+ console .log (" Successfully posted data:" , data)
97
100
})
98
-
99
101
```
0 commit comments