useClusterClient

This commit is contained in:
derpystuff 2022-07-04 23:25:53 +02:00
parent c3213c28d8
commit b9e0d40cf3

View file

@ -1,7 +1,8 @@
const { Constants, ClusterClient, CommandClient, InteractionCommandClient } = require('detritus-client'); const { Constants, ClusterClient, CommandClient, InteractionCommandClient } = require('detritus-client');
const { ActivityTypes, PresenceStatuses } = require('detritus-client/lib/constants');
const Paginator = require('./paginator').PaginatorCluster const Paginator = require('./paginator').PaginatorCluster
// Create client
const cluster = new ClusterClient("", { const cluster = new ClusterClient("", {
cache: {messages: {expire: 60 * 60 * 1000}}, cache: {messages: {expire: 60 * 60 * 1000}},
gateway: { gateway: {
@ -11,9 +12,9 @@ const cluster = new ClusterClient("", {
presence: { presence: {
activity: { activity: {
name: 'v2', name: 'v2',
type: Constants.ActivityTypes.WATCHING, type: ActivityTypes.WATCHING,
}, },
status: Constants.PresenceStatuses.ONLINE, status: PresenceStatuses.ONLINE,
}, },
} }
}); });
@ -34,13 +35,16 @@ const commandClient = new CommandClient(cluster, {
activateOnEdits: true, activateOnEdits: true,
mentionsEnabled: false, mentionsEnabled: false,
prefix: commandPrefix, prefix: commandPrefix,
useClusterClient: true,
ratelimits: [ ratelimits: [
{duration: 60000, limit: 50, type: 'guild'}, {duration: 60000, limit: 50, type: 'guild'},
{duration: 5000, limit: 5, type: 'channel'}, {duration: 5000, limit: 5, type: 'channel'},
] ]
}); });
const interactionClient = new InteractionCommandClient() const interactionClient = new InteractionCommandClient(cluster, {
useClusterClient: true
})
const { maintower } = require('./logging'); const { maintower } = require('./logging');
const { icon } = require('./utils/markdown'); const { icon } = require('./utils/markdown');