mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Remove carbon, rip
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
Internet Systems Consortium license
|
Internet Systems Consortium license
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
Copyright (c) 2017, dragonfire535
|
Copyright (c) 2017, CherryStar
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||||
with or without fee is hereby granted, provided that the above copyright notice
|
with or without fee is hereby granted, provided that the above copyright notice
|
||||||
|
|||||||
+1
-3
@@ -11,7 +11,7 @@ const client = new CommandoClient({
|
|||||||
messageCacheLifetime: 600,
|
messageCacheLifetime: 600,
|
||||||
messageSweepInterval: 120
|
messageSweepInterval: 120
|
||||||
});
|
});
|
||||||
const { carbon, dBots, dBotsOrg, filterTopics, parseTopic } = require('./structures/Util');
|
const { dBots, dBotsOrg, filterTopics, parseTopic } = require('./structures/Util');
|
||||||
|
|
||||||
client.registry
|
client.registry
|
||||||
.registerDefaultTypes()
|
.registerDefaultTypes()
|
||||||
@@ -81,7 +81,6 @@ client.on('guildCreate', async guild => {
|
|||||||
console.log(`[GUILD] I have joined ${guild.name}! (${guild.id})`);
|
console.log(`[GUILD] I have joined ${guild.name}! (${guild.id})`);
|
||||||
const guilds = await client.shard.fetchClientValues('guilds.size');
|
const guilds = await client.shard.fetchClientValues('guilds.size');
|
||||||
const count = guilds.reduce((prev, val) => prev + val, 0);
|
const count = guilds.reduce((prev, val) => prev + val, 0);
|
||||||
carbon(count);
|
|
||||||
dBots(count, client.user.id);
|
dBots(count, client.user.id);
|
||||||
dBotsOrg(count, client.user.id);
|
dBotsOrg(count, client.user.id);
|
||||||
});
|
});
|
||||||
@@ -90,7 +89,6 @@ client.on('guildDelete', async guild => {
|
|||||||
console.log(`[GUILD] I have left ${guild.name}... (${guild.id})`);
|
console.log(`[GUILD] I have left ${guild.name}... (${guild.id})`);
|
||||||
const guilds = await client.shard.fetchClientValues('guilds.size');
|
const guilds = await client.shard.fetchClientValues('guilds.size');
|
||||||
const count = guilds.reduce((prev, val) => prev + val, 0);
|
const count = guilds.reduce((prev, val) => prev + val, 0);
|
||||||
carbon(count);
|
|
||||||
dBots(count, client.user.id);
|
dBots(count, client.user.id);
|
||||||
dBotsOrg(count, client.user.id);
|
dBotsOrg(count, client.user.id);
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "33.0.0",
|
"version": "32.0.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+1
-12
@@ -1,6 +1,6 @@
|
|||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
const { promisify } = require('util');
|
const { promisify } = require('util');
|
||||||
const { CARBON_KEY, DBOTS_KEY, DBOTSORG_KEY } = process.env;
|
const { DBOTS_KEY, DBOTSORG_KEY } = process.env;
|
||||||
|
|
||||||
class Util {
|
class Util {
|
||||||
static cleanXML(str) {
|
static cleanXML(str) {
|
||||||
@@ -22,17 +22,6 @@ class Util {
|
|||||||
.catch(err => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`));
|
.catch(err => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
static carbon(count) {
|
|
||||||
snekfetch
|
|
||||||
.post('https://www.carbonitex.net/discord/data/botdata.php')
|
|
||||||
.send({
|
|
||||||
key: CARBON_KEY,
|
|
||||||
servercount: count
|
|
||||||
})
|
|
||||||
.then(() => console.log('[CARBON] Successfully posted to Carbon.'))
|
|
||||||
.catch(err => console.error(`[CARBON] Failed to post to Carbon. ${err}`));
|
|
||||||
}
|
|
||||||
|
|
||||||
static dBotsOrg(count, id) {
|
static dBotsOrg(count, id) {
|
||||||
snekfetch
|
snekfetch
|
||||||
.post(`https://discordbots.org/api/bots/${id}/stats`)
|
.post(`https://discordbots.org/api/bots/${id}/stats`)
|
||||||
|
|||||||
Reference in New Issue
Block a user