This commit is contained in:
derpystuff 2022-05-21 16:21:08 +02:00
parent 7195d43c74
commit 6173b085a3
26 changed files with 1112 additions and 91 deletions

54
labscore/client.js Normal file
View file

@ -0,0 +1,54 @@
const { Constants, ClusterClient, CommandClient } = require('detritus-client');
const { createPaginator } = require('./paginator')
const Paginator = require('detritus-pagination').PaginatorCluster
// Create client
const cluster = new ClusterClient("", {
cache: {messages: {expire: 60 * 60 * 1000}},
gateway: {
identifyProperties: {
$browser: 'Discord Android',
},
presence: {
activity: {
name: 'v2',
type: Constants.ActivityTypes.WATCHING,
},
status: Constants.PresenceStatuses.ONLINE,
},
}
});
// Create this clusters paginator
const paginator = new Paginator(cluster, {
maxTime: 120000,
pageLoop: true,
pageNumber: true
});
(async () => {
// Run cluster
await cluster.run();
const commandClient = new CommandClient(cluster, {
activateOnEdits: true,
mentionsEnabled: true,
prefix: '.',
ratelimits: [
{duration: 60000, limit: 50, type: 'guild'},
{duration: 5000, limit: 5, type: 'channel'},
]
});
await commandClient.addMultipleIn('../commands/message/');
await commandClient.run()
commandClient.on('commandDelete', async ({reply}) => {
if (reply){
reply.delete();
}
});
})();
module.exports = {
paginator
}