| ... | ... | @@ -13,10 +13,10 @@ Some things to note |
| 13 | 13 | - Roles always are added at the bottom of the role list, meaning none of your other roles should have colors. |
| 14 | 14 | |
| 15 | 15 | To use me, simply run |
| 16 | | > /paint <color> |
| 16 | > \`/paint <color>\` |
| 17 | 17 | > Where <color> is any valid HEX or CSS color value. |
| 18 | 18 | |
| 19 | | Created by dave caruso, <https://paperdave.net>, support \`me@paperdave.net\``; |
| 19 | Created by paper clover, <https://paperclover.net>, support \`namepaint@paperclover.net\``; |
| 20 | 20 | |
| 21 | 21 | const client = new Discord.Client({ |
| 22 | 22 | intents: [ |
| ... | ... | @@ -25,13 +25,14 @@ const client = new Discord.Client({ |
| 25 | 25 | ], |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | | function updateClientStatus() { |
| 29 | | client.user?.setActivity(`/paint | ${client.guilds.cache.size} servers.`) |
| 28 | async function updateClientStatus() { |
| 29 | const totalGuilds = (await client.shard.fetchClientValues("guilds.cache.size")).reduce((a, b) => a + b); |
| 30 | client.user?.setActivity(`/paint | ${totalGuilds} servers.`) |
| 30 | 31 | } |
| 31 | 32 | |
| 32 | 33 | client.on('ready', async() => { |
| 33 | 34 | console.log(`Logged in as ${client.user?.tag}!`); |
| 34 | | updateClientStatus(); |
| 35 | updateClientStatus().catch((err) => { console.error(err); }); |
| 35 | 36 | |
| 36 | 37 | // client.application.commands.create({ |
| 37 | 38 | // name: 'paint', |
| ... | ... | @@ -157,7 +158,7 @@ client.on('guildMemberRemove', (member) => { |
| 157 | 158 | }); |
| 158 | 159 | |
| 159 | 160 | client.on('guildDelete', guild => { |
| 160 | | 	updateClientStatus(); |
| 161 | updateClientStatus().catch(err => console.error(err)); |
| 161 | 162 | }); |
| 162 | 163 | |
| 163 | 164 | async function getDefaultChannel(guild: Discord.Guild) { |
| ... | ... | @@ -184,7 +185,7 @@ client.on('guildCreate', async(guild) => { |
| 184 | 185 | let defaultChannel = await getDefaultChannel(guild) as Discord.TextChannel; |
| 185 | 186 | defaultChannel && defaultChannel.send(helpMessage); |
| 186 | 187 | |
| 187 | | updateClientStatus(); |
| 188 | updateClientStatus().catch(err => console.error(err)); |
| 188 | 189 | }); |
| 189 | 190 | |
| 190 | 191 | client.login(process.env.TOKEN); |