mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Move Things Around
This commit is contained in:
@@ -6,25 +6,14 @@ Public Source Code for the Discord Bot XiaoBot, a Discord bot coded in JavaScrip
|
||||
## Adding it to Your Server
|
||||
You can add XiaoBot to your server with [this link](https://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343).
|
||||
|
||||
> Note: Please do not change the permissions. It could break the bot.
|
||||
|
||||
## Home Server
|
||||
You can join the home server with [this link](https://discord.gg/fqQF8mc).
|
||||
|
||||
## Modules
|
||||
[discord.js](https://discord.js.org/#/), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)
|
||||
[discord.js](https://discord.js.org/#/), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sequelize](http://docs.sequelizejs.com/en/v3/), [pg](https://github.com/brianc/node-postgres)
|
||||
|
||||
## APIs
|
||||
[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com/), [random.cat](http://random.cat/)
|
||||
|
||||
## Self-Hosting
|
||||
You can Self-Host the bot easily, provided you have API keys and a Discord Bot Token. [Node.js](https://nodejs.org/en/) is also required, with at least version 7.6.0 recommended.
|
||||
|
||||
APIs that require API Keys:
|
||||
|
||||
[Wattpad](https://developer.wattpad.com/docs/api) | [Wordnik](http://developer.wordnik.com/docs.html) | [osu!](https://osu.ppy.sh/p/api) | [YouTube Data](https://developers.google.com/youtube/v3/) | [SoundCloud](https://developers.soundcloud.com/)
|
||||
|
||||
You will also need a Discord App and Token. You can get those [here](https://discordapp.com/developers/applications). No support is provided for self-hosting, if you self-host, you should know how to do so. All API Keys and the Token should be placed in environment variables.
|
||||
|
||||
## Licensing
|
||||
The bot is licensed under an [ISC license](https://opensource.org/licenses/ISC). See the file `LICENSE.md` for more information.
|
||||
The bot is licensed under an [ISC License](https://opensource.org/licenses/ISC). See the file `LICENSE.md` for more information.
|
||||
|
||||
@@ -44,7 +44,7 @@ module.exports = class InfoCommand extends Command {
|
||||
.addField('Library',
|
||||
'[discord.js](https://discord.js.org/#/)', true)
|
||||
.addField('Modules',
|
||||
'[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)')
|
||||
'[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sequelize](http://docs.sequelizejs.com/en/v3/), [pg](https://github.com/brianc/node-postgres)')
|
||||
.addField('APIs',
|
||||
'[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com/), [random.cat](http://random.cat/)');
|
||||
return message.embed(embed);
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
<li><a href="http://momentjs.com">moment</a></li>
|
||||
<li><a href="https://github.com/jsmreese/moment-duration-format">moment-duration-format</a></li>
|
||||
<li><a href="https://cheerio.js.org/">cheerio</a></li>
|
||||
<li><a href="http://docs.sequelizejs.com/en/v3/">sequelize</a></li>
|
||||
<li><a href="https://github.com/brianc/node-postgres">pg</a></li>
|
||||
</ul>
|
||||
<h2>APIs</h2>
|
||||
<ul>
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
<div class="xiaobox">
|
||||
<h2>Notes:</h2>
|
||||
<ol>
|
||||
<li>Moderation Commands Require a Channel Named "mod_logs" to send Ban/Kick/Unban/Warn Logs</li>
|
||||
<li>To use Member Join/Leave Logging, make a channel named "member_logs"</li>
|
||||
<li>Moderation Commands Require a Channel Named "mod_logs" to send Ban/Kick/Unban/Warn Logs, or you can set a channel with x;modchannel</li>
|
||||
<li>To use Member Join/Leave Logging, make a channel named "member_logs", or set a channel with x;memberchannel</li>
|
||||
<li>Use x;help to View a Command List</li>
|
||||
<li>Visit my <a href="https://discord.gg/fqQF8mc">Home Server</a> for more support, or for updates, or if you just want to hang out.</li>
|
||||
</ol>
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
<div class="xiaobox">
|
||||
<h2>Notes:</h2>
|
||||
<ol>
|
||||
<li>Moderation Commands Require a Channel Named "mod_logs" to send Ban/Kick/Unban/Warn Logs</li>
|
||||
<li>To use Member Join/Leave Logging, make a channel named "member_logs"</li>
|
||||
<li>Moderation Commands Require a Channel Named "mod_logs" to send Ban/Kick/Unban/Warn Logs, or you can set a channel with x;modchannel</li>
|
||||
<li>To use Member Join/Leave Logging, make a channel named "member_logs", or set a channel with x;memberchannel</li>
|
||||
<li>Use x;help to View a Command List</li>
|
||||
<li>Visit my <a href="https://discord.gg/fqQF8mc">Home Server</a> for more support, or for updates, or if you just want to hang out.</li>
|
||||
</ol>
|
||||
@@ -73,6 +73,8 @@
|
||||
<li><a href="http://momentjs.com">moment</a></li>
|
||||
<li><a href="https://github.com/jsmreese/moment-duration-format">moment-duration-format</a></li>
|
||||
<li><a href="https://cheerio.js.org/">cheerio</a></li>
|
||||
<li><a href="http://docs.sequelizejs.com/en/v3/">sequelize</a></li>
|
||||
<li><a href="https://github.com/brianc/node-postgres">pg</a></li>
|
||||
</ul>
|
||||
<h2>APIs</h2>
|
||||
<ul>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const { CommandoClient } = require('discord.js-commando');
|
||||
const { carbon, discordBots } = require('./poststats');
|
||||
const path = require('path');
|
||||
const client = new CommandoClient({
|
||||
commandPrefix: 'x;',
|
||||
owner: '242699360352206850',
|
||||
disableEveryone: true,
|
||||
invite: 'https://discord.gg/fqQF8mc'
|
||||
});
|
||||
const path = require('path');
|
||||
const { carbon, discordBots } = require('./structures/Stats');
|
||||
const SequelizeProvider = require('./providers/Sequelize');
|
||||
const Database = require('./structures/PostgreSQL');
|
||||
const database = new Database();
|
||||
|
||||
+8
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "16.2.2",
|
||||
"version": "16.2.3",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
@@ -12,11 +12,15 @@
|
||||
"url": "git+https://github.com/dragonfire535/xiaobot.git"
|
||||
},
|
||||
"keywords": [
|
||||
"discord-bot",
|
||||
"bot",
|
||||
"commando",
|
||||
"discord-js",
|
||||
"discord",
|
||||
"discord-api"
|
||||
"discord-api",
|
||||
"discord-bot",
|
||||
"discord-js",
|
||||
"discord.js-commando",
|
||||
"postgres",
|
||||
"postgresql"
|
||||
],
|
||||
"author": "dragonfire535",
|
||||
"license": "ISC",
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
const Sequelize = require('sequelize');
|
||||
|
||||
const database = new Sequelize(process.env.DATABASE_URL, { logging: false });
|
||||
|
||||
class Database {
|
||||
module.exports = class Database {
|
||||
static get db() {
|
||||
return database;
|
||||
}
|
||||
|
||||
start() {
|
||||
database.authenticate()
|
||||
.then(() => console.log('Connection to database has been established successfully.'))
|
||||
.then(() => console.log('Synchronizing database...'))
|
||||
.then(() => console.log('[Database] Connection has been established successfully.'))
|
||||
.then(() => console.log('[Database] Synchronizing...'))
|
||||
.then(() => database.sync()
|
||||
.then(() => console.log('Synchronizing database done!'))
|
||||
.catch(error => console.error(`Error synchronizing the database: ${error}`))
|
||||
.then(() => console.log('[Database] Synchronizing complete!'))
|
||||
.catch(err => console.error(`[Database] Error synchronizing: ${err}`))
|
||||
)
|
||||
.then(() => console.log('Ready to rock!'))
|
||||
.catch(err => console.error(`Unable to connect to the database: ${err}`));
|
||||
.then(() => console.log('[Database] Ready!'))
|
||||
.catch(err => console.error(`[Database] Unable to connect: ${err}`));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Database;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user