mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
wip
This commit is contained in:
parent
7195d43c74
commit
6173b085a3
26 changed files with 1112 additions and 91 deletions
54
labscore/client.js
Normal file
54
labscore/client.js
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue