Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Automod v3 #89

Open
wants to merge 47 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1fc2847
Delete src directory
JohnDavid30 Dec 10, 2022
f220a70
Delete logs directory
JohnDavid30 Dec 10, 2022
686830f
Delete dashboard directory
JohnDavid30 Dec 10, 2022
f7432ae
Delete bot.js
JohnDavid30 Dec 10, 2022
6d36e59
Delete config.js
JohnDavid30 Dec 10, 2022
1e31a28
Delete .env.example
JohnDavid30 Dec 10, 2022
3e856c7
Update package.json
JohnDavid30 Dec 10, 2022
ee9ee1b
Add files via upload
JohnDavid30 Dec 10, 2022
93bab8f
Add files via upload
JohnDavid30 Dec 10, 2022
166aa05
Create data
JohnDavid30 Dec 10, 2022
3427b7b
Add files via upload
JohnDavid30 Dec 10, 2022
659aa66
Add files via upload
JohnDavid30 Dec 10, 2022
f9120d3
Create test
JohnDavid30 Dec 10, 2022
0600ce3
Delete test
JohnDavid30 Dec 10, 2022
be3bdbd
Delete data
JohnDavid30 Dec 10, 2022
3868f5d
Create test
JohnDavid30 Dec 10, 2022
509c3f4
Add files via upload
JohnDavid30 Dec 10, 2022
fc7ba17
Add files via upload
JohnDavid30 Dec 10, 2022
4670f9a
Delete test
JohnDavid30 Dec 10, 2022
5347281
Create dashboard
JohnDavid30 Dec 10, 2022
878e689
Delete dashboard
JohnDavid30 Dec 10, 2022
8e50256
Create app.js
JohnDavid30 Dec 10, 2022
b76671e
Add files via upload
JohnDavid30 Dec 10, 2022
fade641
Create test
JohnDavid30 Dec 10, 2022
2fe50ef
Add files via upload
JohnDavid30 Dec 10, 2022
c1d6c98
Delete test
JohnDavid30 Dec 10, 2022
88f0e2d
Create test
JohnDavid30 Dec 10, 2022
0056656
Add files via upload
JohnDavid30 Dec 10, 2022
a7413e8
Delete test
JohnDavid30 Dec 10, 2022
ac6ad59
Create all.css
JohnDavid30 Dec 10, 2022
f206eb3
Add files via upload
JohnDavid30 Dec 10, 2022
7097830
Add files via upload
JohnDavid30 Dec 10, 2022
9c4e9db
Create test
JohnDavid30 Dec 10, 2022
89baad2
Create test
JohnDavid30 Dec 10, 2022
5906c69
Add files via upload
JohnDavid30 Dec 10, 2022
26e0ec4
Add files via upload
JohnDavid30 Dec 10, 2022
0c96d7a
Delete test
JohnDavid30 Dec 11, 2022
8cfca29
Delete test
JohnDavid30 Dec 11, 2022
ed80e8f
FUNDING.yml
JohnDavid30 Dec 11, 2022
29cb81c
Delete .github directory
JohnDavid30 Dec 11, 2022
e4a2ad5
Create bug_report.md
JohnDavid30 Dec 11, 2022
de18a88
Create command-request.md
JohnDavid30 Dec 11, 2022
3a240b0
Create feature_request.md
JohnDavid30 Dec 11, 2022
e1a6e91
Create .gitkeep
JohnDavid30 Dec 11, 2022
2ca4650
Create dockerfile
JohnDavid30 Dec 11, 2022
9f570e4
Rename config.js to config.example.js
JohnDavid30 Dec 11, 2022
d8c050e
Delete logs directory
JohnDavid30 Dec 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 0 additions & 20 deletions .env.example

This file was deleted.

3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug-unverified
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**If possible**
- NodeJS version:
- Bot version:

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/command-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Command Request
about: Suggest a command for this project
title: ''
labels: cmd-request
assignees: ''

---

**Is your command request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe what command you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
1 change: 0 additions & 1 deletion .github/workflows/FUNDING.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/node.js.yml

This file was deleted.

26 changes: 20 additions & 6 deletions bot.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
require("dotenv").config();
require("module-alias/register");

const path = require("path");
const { startupCheck } = require("@utils/botUtils");
// register extenders
require("@helpers/extenders/Message");
require("@helpers/extenders/Guild");
require("@helpers/extenders/GuildChannel");

const { checkForUpdates } = require("@helpers/BotUtils");
const { initializeMongoose } = require("@src/database/mongoose");
const { BotClient } = require("@src/structures");
const { validateConfiguration } = require("@helpers/Validator");

global.__appRoot = path.resolve(__dirname);
validateConfiguration();

// initialize client
const client = new BotClient();
client.loadCommands("src/commands");
client.loadContexts("src/contexts");
client.loadEvents("src/events");


// find unhandled promise rejections
process.on("unhandledRejection", (err) => client.logger.error(`Unhandled exception`, err));

(async () => {
await startupCheck();
// check for updates
await checkForUpdates();

// start the dashboard
if (client.config.DASHBOARD.enabled) {
client.logger.log("Launching dashboard");
try {
const { launch } = require("@root/dashboard/app");

// let the dashboard initialize the database
await launch(client);
} catch (ex) {
client.logger.error("Failed to launch dashboard", ex);
}
} else {
// initialize the database
await initializeMongoose();
}
await client.initializeMongoose();

// start the client
await client.login(process.env.BOT_TOKEN);
})();
134 changes: 134 additions & 0 deletions config.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
module.exports = {
OWNER_IDS: [], // Bot owner ID's
SUPPORT_SERVER: "", // Your bot support server
PREFIX_COMMANDS: {
ENABLED: true, // Enable/Disable prefix commands
DEFAULT_PREFIX: "!", // Default prefix for the bot
},
INTERACTIONS: {
SLASH: false, // Should the interactions be enabled
CONTEXT: false, // Should contexts be enabled
GLOBAL: false, // Should the interactions be registered globally
TEST_GUILD_ID: "xxxxxxxxxxx", // Guild ID where the interactions should be registered. [** Test you commands here first **]
},
EMBED_COLORS: {
BOT_EMBED: "#068ADD",
TRANSPARENT: "#36393F",
SUCCESS: "#00A56A",
ERROR: "#D61A3C",
WARNING: "#F7E919",
},
CACHE_SIZE: {
GUILDS: 100,
USERS: 10000,
MEMBERS: 10000,
},
MESSAGES: {
API_ERROR: "Unexpected Backend Error! Try again later or contact support server",
},

// PLUGINS

AUTOMOD: {
ENABLED: false,
LOG_EMBED: "#36393F",
DM_EMBED: "#36393F",
},

DASHBOARD: {
enabled: false, // enable or disable dashboard
baseURL: "http://localhost:8080", // base url
failureURL: "http://localhost:8080", // failure redirect url
port: "8080", // port to run the bot on
},

ECONOMY: {
ENABLED: false,
CURRENCY: "₪",
DAILY_COINS: 100, // coins to be received by daily command
MIN_BEG_AMOUNT: 100, // minimum coins to be received when beg command is used
MAX_BEG_AMOUNT: 2500, // maximum coins to be received when beg command is used
},

MUSIC: {
ENABLED: false,
IDLE_TIME: 60, // Time in seconds before the bot disconnects from an idle voice channel
MAX_SEARCH_RESULTS: 5,
DEFAULT_SOURCE: "SC", // YT = Youtube, YTM = Youtube Music, SC = SoundCloud
// Add any number of lavalink nodes here
// Refer to https://github.com/freyacodes/Lavalink to host your own lavalink server
LAVALINK_NODES: [
{
host: "localhost",
port: 2333,
password: "youshallnotpass",
id: "Local Node",
secure: false,
},
],
},

GIVEAWAYS: {
ENABLED: false,
REACTION: "🎁",
START_EMBED: "#FF468A",
END_EMBED: "#FF468A",
},

IMAGE: {
ENABLED: false,
BASE_API: "https://strangeapi.fun/api",
},

INVITE: {
ENABLED: false,
},

MODERATION: {
ENABLED: false,
EMBED_COLORS: {
TIMEOUT: "#102027",
UNTIMEOUT: "#4B636E",
KICK: "#FF7961",
SOFTBAN: "#AF4448",
BAN: "#D32F2F",
UNBAN: "#00C853",
VMUTE: "#102027",
VUNMUTE: "#4B636E",
DEAFEN: "#102027",
UNDEAFEN: "#4B636E",
DISCONNECT: "RANDOM",
MOVE: "RANDOM",
},
},

PRESENCE: {
ENABLED: false, // Whether or not the bot should update its status
STATUS: "online", // The bot's status [online, idle, dnd, invisible]
TYPE: "WATCHING", // Status type for the bot [PLAYING | LISTENING | WATCHING | COMPETING]
MESSAGE: "{members} members in {servers} servers", // Your bot status message
},

STATS: {
ENABLED: false,
XP_COOLDOWN: 5, // Cooldown in seconds between messages
DEFAULT_LVL_UP_MSG: "{member:tag}, You just advanced to **Level {level}**",
},

SUGGESTIONS: {
ENABLED: false, // Should the suggestion system be enabled
EMOJI: {
UP_VOTE: "⬆️",
DOWN_VOTE: "⬇️",
},
DEFAULT_EMBED: "#4F545C",
APPROVED_EMBED: "#43B581",
DENIED_EMBED: "#F04747",
},

TICKET: {
ENABLED: false,
CREATE_EMBED: "#068ADD",
CLOSE_EMBED: "#068ADD",
},
};
Loading