Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ logs/
blapi.json
config.json
src/commands/fun/notes.json
src/commands/fun/notes.json
/.vscode/settings.json
/identifier.sqlite
.storyteller
.vscode
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<p align="center">

<img src="https://github.com/MDCYT/Any-Bot/actions/workflows/pre-release.yml/badge.svg">
<img src="https://github.com/MDCYT/Any-Bot/actions/workflows/pre-release.yml/badge.svg" alt="prerelease">

<img src="https://github.com/MDCYT/Any-Bot/actions/workflows/codeql-analysis.yml/badge.svg">

Expand Down
38 changes: 24 additions & 14 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
require("dotenv").config();
const Client = require("./src/client.js");
const config = require("./config.json");
const { Player } = require('discord-player');
const {index} = require("./src/utils/dashboard.js");
const { Player } = require("discord-player");
const botlist = config.botlist;
const discordModals = require("discord-modals");
global.__basedir = __dirname;
const WebSocket = require("ws");

const client = new Client(config, {
intents: 8191,
allowedMentions: { parse: ['users', 'roles'], repliedUser: true }
partials: ["CHANNEL"],
intents: 130815,
allowedMentions: { parse: ["users", "roles"], repliedUser: true },
});

discordModals(client);

client.player = new Player(client);
const player = client.player;

// Initialize client
function init() {

client.loadCommands("./src/commands");
client.loadSlashCommands("./src/slash")
client.loadSlashCommands("./src/slash");
client.loadButtons("./src/buttons");
client.loadSelectMenus("./src/selectmenus");
client.loadContextMenus("./src/contextmenus");
client.loadModals("./src/modals");
client.loadEvents("./src/events", client, player);
client.loadMusicEvents("./src/music", player);
client.loadTopics("./data/trivia");
Expand All @@ -27,18 +36,19 @@ function init() {
init();

if (botlist) {
let {botlist} = require("./src/utils/botlist.js")
botlist(client).then(() => {
client.logger.info("Botlist updated!");
}
);
let { botlist } = require("./src/utils/botlist.js");
botlist(client).then(() => {
client.logger.info("Botlist updated!");
});
}


if(!(client.shard)) {
const { index } = require("./src/utils/dashboard.js");
index(client);
if (!client.shard) {
const { index } = require("./src/utils/dashboard.js");
index(client).then(() => {
client.logger.info("Dashboard initialized!");
});
}

global.__Client = client;

process.on("unhandledRejection", (err) => client.logger.error(err));
4 changes: 2 additions & 2 deletions config-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"serverLogId": "Your_Server_Log_Channel_Id",
"supportServerInvite": "Your_Support_Server_Invite",
"mongodb_url": "Your_MongoDB_Url",
"botStats":{
"botStats": {
"guilds_channel": "Your_Guilds_Channel_Stats_Bot",
"users_channel": "Your_Users_Channel_Stats_Bot"
},
Expand All @@ -30,4 +30,4 @@
"osuapikey": "Osu_Api_Key"
},
"botlist": false
}
}
22,002 changes: 21,002 additions & 1,000 deletions data/fake_data.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/under_contruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
name: "under_construction",
run: async () => {
require("dotenv").config();
const {Client} = require("Discord.js");
const {Client} = require("discord.js");
global.__basedir = __dirname;

const client = new Client({
Expand All @@ -25,6 +25,6 @@ module.exports = {
)
});

client.login(process.env.TOKEN);
await client.login(process.env.TOKEN);
},
};
Loading