mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
More Variable Activities
This commit is contained in:
@@ -9,6 +9,7 @@ const client = new Client({
|
|||||||
disableMentions: 'everyone',
|
disableMentions: 'everyone',
|
||||||
disabledEvents: ['TYPING_START']
|
disabledEvents: ['TYPING_START']
|
||||||
});
|
});
|
||||||
|
const { formatNumber } = require('./util/Util');
|
||||||
const activities = require('./assets/json/activity');
|
const activities = require('./assets/json/activity');
|
||||||
const leaveMsgs = require('./assets/json/leave-messages');
|
const leaveMsgs = require('./assets/json/leave-messages');
|
||||||
|
|
||||||
@@ -50,12 +51,15 @@ client.registry
|
|||||||
client.on('ready', () => {
|
client.on('ready', () => {
|
||||||
client.logger.info(`[READY] Logged in as ${client.user.tag}! ID: ${client.user.id}`);
|
client.logger.info(`[READY] Logged in as ${client.user.tag}! ID: ${client.user.id}`);
|
||||||
activities.push(
|
activities.push(
|
||||||
{ text: `in ${client.guilds.cache.size} servers`, type: 'PLAYING' },
|
{ text: () => `${formatNumber(client.guilds.cache.size)} servers`, type: 'WATCHING' },
|
||||||
{ text: `with ${client.registry.commands.size} commands`, type: 'PLAYING' }
|
{ text: () => `with ${formatNumber(client.registry.commands.size)} commands`, type: 'PLAYING' },
|
||||||
|
{ text: () => `${formatNumber(client.users.cache.size)} users`, type: 'WATCHING' },
|
||||||
|
{ text: () => `${formatNumber(client.channels.cache.size)} channels`, type: 'WATCHING' }
|
||||||
);
|
);
|
||||||
client.setInterval(() => {
|
client.setInterval(() => {
|
||||||
const activity = activities[Math.floor(Math.random() * activities.length)];
|
const activity = activities[Math.floor(Math.random() * activities.length)];
|
||||||
client.user.setActivity(activity.text, { type: activity.type });
|
const text = typeof activity.text === 'function' ? activity.text() : activity.text;
|
||||||
|
client.user.setActivity(text, { type: activity.type });
|
||||||
}, 60000);
|
}, 60000);
|
||||||
if (client.memePoster.id && client.memePoster.token) {
|
if (client.memePoster.id && client.memePoster.token) {
|
||||||
client.setInterval(() => client.memePoster.post(), client.memePoster.time);
|
client.setInterval(() => client.memePoster.post(), client.memePoster.time);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.5.1",
|
"version": "114.5.2",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user