-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
NeroGizmo
committed
Jul 13, 2022
0 parents
commit 31d511a
Showing
21 changed files
with
3,280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"plugins": ["security"], | ||
"extends": ["eslint:recommended", "plugin:security/recommended"], | ||
"ignorePatterns": ["temp.js", "**/dist/*.js"], | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 enjoyablee | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { Intents } = require("discord.js"); | ||
|
||
const config = { | ||
bot: { | ||
token: process.env.TOKEN, | ||
intents: [], // You can find the available intents on https://discord.js.org/#/docs/main/stable/class/Intents?scrollTo=s-FLAGS | ||
guildId: "", // Update this field to only register commands a guild, this will make the commands to load instantly in the selected gulld (Optional) | ||
}, | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require('dotenv').config() | ||
const url = "mongodb://Warns:warn@192.168.1.134:27017/Warns" | ||
const mongoose = require('mongoose'); | ||
mongoose.connect(url, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true | ||
}) | ||
// Util | ||
const ora = require('ora') | ||
const config = require('./config') | ||
const fs = require('fs') | ||
|
||
// Slash Commands | ||
const { Client, Collection } = require('discord.js') | ||
const slash = require('./src/util/slash') | ||
const { builtinModules } = require('module') | ||
|
||
// CLI | ||
const intentsLoader = ora('Registering Intents').start() | ||
|
||
// Checks | ||
let finalIntents = [] | ||
if (!Array.isArray(config.bot.intents)) { | ||
intentsLoader.warn( | ||
'Intents in config file must be in an array, default intents will be used' | ||
) | ||
} else { | ||
finalIntents = config.bot.intents | ||
intentsLoader.succeed('Loaded intents successfully from the config file') | ||
} | ||
|
||
const client = new Client({ intents: finalIntents }) | ||
module.exports = client; | ||
|
||
// Commands | ||
client.commands = new Collection() | ||
|
||
const events = fs | ||
.readdirSync('./src/events') | ||
.filter(file => file.endsWith('.js')) | ||
|
||
events.forEach(event => { | ||
const eventFile = require(`./src/events/${event}`) | ||
if (eventFile.oneTime) { | ||
client.once(eventFile.event, (...args) => eventFile.run(...args)) | ||
} else { | ||
client.on(eventFile.event, (...args) => eventFile.run(...args)) | ||
} | ||
}) | ||
|
||
client.login(config.bot.token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const mongoose = require('mongoose'); | ||
const statusSchema = mongoose.Schema({ | ||
status: String, | ||
}) | ||
|
||
module.exports = mongoose.model('Status', statusSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const mongoose = require('mongoose'); | ||
const warnSchema = mongoose.Schema({ | ||
userId: String, | ||
guildId: String, | ||
moderatorId: String, | ||
reason: String, | ||
timestamp: String, | ||
}) | ||
|
||
module.exports = mongoose.model('Warn', warnSchema); |
Oops, something went wrong.