https://github.com/developerjosh/pickle-bot
https://github.com/developerjosh/pickle-bot
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/developerjosh/pickle-bot
- Owner: DeveloperJosh
- License: mit
- Created: 2020-10-31T15:55:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-22T19:02:49.000Z (over 5 years ago)
- Last Synced: 2025-12-26T15:10:48.067Z (6 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Setting Up Commando
## Getting Super Powers
How Mr.Commando's Index.js file looks
{% code title="Index.js" %}
```javascript
const { CommandoClient } = require('discord.js-commando');
const { Structures } = require('discord.js');
const { MessageEmbed } = require('discord.js');
const DBL = require("dblapi.js");
const path = require('path');
const fs = require('fs');
require('dotenv').config();
Structures.extend('Guild', Guild => {
class MusicGuild extends Guild {
constructor(client, data) {
super(client, data);
this.musicData = {
queue: [],
isPlaying: false,
nowPlaying: null,
songDispatcher: null,
volume: 1
};
this.triviaData = {
isTriviaRunning: false,
wasTriviaEndCalled: false,
triviaQueue: [],
triviaScore: new Map()
};
}
}
return MusicGuild;
});
const client = new CommandoClient({
commandPrefix: process.env.PREFIX,
unknownCommandResponse: false,
owner: 'your id here',
invite: 'your support server here',
disableEveryone: true
});
client.registry
.registerDefaultTypes()
.registerGroups([
{ id: 'fun', name: 'Fun' },
{ id: 'mod', name: 'Moderation' },
{ id: 'music', name: 'Music' },
{ id: 'util', name: 'Utility' },
{ id: 'other', name: 'Other' },
])
.registerCommandsIn(path.join(__dirname, 'commands'));
fs.readdir('./events/', (err, files) => {
if (err) return console.error;
files.forEach(file => {
if (!file.endsWith('.js')) return;
const evt = require(`./events/${file}`);
let evtName = file.split('.')[0];
console.log(`Loaded event '${evtName}'`);
client.on(evtName, evt.bind(null, client));
});
});
const dbl = new DBL(process.env.DBL, client);
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
});
client.login(process.env.TOKEN);
```
{% endcode %}
The .env file use this to put your tokens and the prefix
{% code title=".env" %}
```javascript
TOKEN=
PREFIX=?
DBL=
```
{% endcode %}
The config.json file use this for your apt tokens
{% code title="config.json" %}
```javascript
{
"YoutubeAPI": "",
"top": "",
"newsAPI": ""
}
```
{% endcode %}