Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Thai committed Dec 15, 2022
1 parent d38ec48 commit 0cb90a5
Show file tree
Hide file tree
Showing 376 changed files with 40,238 additions and 32,878 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# OwO Bot
[![Discord Bots](https://discordbots.org/api/widget/status/408785106942164992.svg)](https://discordbots.org/bot/408785106942164992) [![Discord Bots](https://discordbots.org/api/widget/servers/408785106942164992.svg)](https://discordbots.org/bot/408785106942164992) [![Discord Bots](https://discordbots.org/api/widget/lib/408785106942164992.svg)](https://discordbots.org/bot/408785106942164992)

[![Discord Bots](https://discordbots.org/api/widget/status/408785106942164992.svg)](https://discordbots.org/bot/408785106942164992) [![Discord Bots](https://discordbots.org/api/widget/servers/408785106942164992.svg)](https://discordbots.org/bot/408785106942164992) [![Discord Bots](https://discordbots.org/api/widget/lib/408785106942164992.svg)](https://discordbots.org/bot/408785106942164992)

Here are the codes for OwO Bot! Feel free to submit an issue or open a pull request!

## Self hosting

This discord bot uses [MariaDB](https://mariadb.org/) and [Redis](https://redis.io/) for its databases. Some files may be missing due to security reasons and can be found [here](https://github.com/ChristopherBThai/Discord-OwO-Bot/tree/master/secret).

## License

OwO Bot is licensed under the terms of [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://github.com/ChristopherBThai/Discord-OwO-Bot/blob/master/LICENSE) ("CC-BY-NC-SA-4.0"). Commercial use is not allowed under this license. This includes any kind of revenue made with or based upon the software, even donations.

The CC-BY-NC-SA-4.0 allows you to:

- [x] **Share** -- copy and redistribute the material in any medium or format
- [x] **Adapt** -- remix, transform, and build upon the material

Under the following terms:

- **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- **NonCommercial** — You may not use the material for commercial purposes.
- **NonCommercial** — You may not use the material for commercial purposes.
- **ShareAlike** — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

More information can be found [here](https://creativecommons.org/licenses/by-nc-sa/4.0/).

## Contributing

All merge requests are welcome! Just make sure to sign the [CLA](https://cla-assistant.io/ChristopherBThai/Discord-OwO-Bot) or else we cannot merge your changes.
60 changes: 36 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,72 @@
* Copyright (C) 2019 Christopher Thai
* This software is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
* For more information, see README.md and LICENSE
*/
require('dotenv').config()
*/
require('dotenv').config();

// Config file
const config = require('./src/data/config.json');

// Grab tokens and secret files
const debug = config.debug;
if(!debug) var tracer = require('dd-trace').init();
if (!debug) var tracer = require('dd-trace').init();

const request = require('./utils/request.js');
// Eris-Sharder
const Sharder = require('eris-sharder').Master;
var result,shards,firstShardID,lastShardID;
var result, shards, firstShardID, lastShardID;

// Helper files
if(require('cluster').isMaster){
if (require('cluster').isMaster) {
const global = require('./utils/global.js');
const RamCheck = new (require('./utils/ramCheck.js'))(global);
}

let clusters = 60;

(async () => {
try{
try {
//determine how many shards we will need for this manager
if (!debug&&require('cluster').isMaster){
if (!debug && require('cluster').isMaster) {
result = await request.fetchInit();
console.log(result);
shards = parseInt(result["shards"]);
firstShardID = parseInt(result["firstShardID"]);
lastShardID = parseInt(result["lastShardID"]);
shards = parseInt(result['shards']);
firstShardID = parseInt(result['firstShardID']);
lastShardID = parseInt(result['lastShardID']);
}
if(debug){
if (debug) {
shards = 2;
firstShardID = 0;
lastShardID = 1;
clusters = 2
clusters = 2;
}

console.log("Creating shards "+firstShardID+"~"+lastShardID+" out of "+shards+" total shards!");
console.log(
'Creating shards ' +
firstShardID +
'~' +
lastShardID +
' out of ' +
shards +
' total shards!'
);

// Start sharder
const sharder = new Sharder("Bot "+process.env.BOT_TOKEN, config.sharder.path, {
name: config.sharder.name,
clientOptions: config.eris.clientOptions,
debug:true,
shards,clusters,
firstShardID,
lastShardID,
});

}catch(e){
console.error("Failed to start eris sharder");
const sharder = new Sharder(
'Bot ' + process.env.BOT_TOKEN,
config.sharder.path,
{
name: config.sharder.name,
clientOptions: config.eris.clientOptions,
debug: true,
shards,
clusters,
firstShardID,
lastShardID,
}
);
} catch (e) {
console.error('Failed to start eris sharder');
console.error(e);
}
})();
Loading

0 comments on commit 0cb90a5

Please sign in to comment.