Skip to content

Commit 23c78f2

Browse files
committed
Initial commit in new repository
0 parents  commit 23c78f2

15 files changed

+4048
-0
lines changed

.editorconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 2

.gitignore

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# Typescript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# Knub data
63+
/data
64+
65+
# PHPStorm
66+
.idea/
67+
68+
# Misc
69+
/convert.js

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
### Config format example
2+
3+
Config files are currently located at `data/guilds/<guildId>.yml` (and `data/guilds/global.yml` for global plugins).
4+
5+
```yml
6+
levels:
7+
50: mod
8+
100: admin
9+
10+
plugins:
11+
mod_plugin:
12+
config:
13+
kick_message: 'You have been kicked'
14+
permissions:
15+
kick: false
16+
overrides:
17+
- level: '>=50'
18+
permissions:
19+
kick: true
20+
- level: '>=100'
21+
config:
22+
kick_message: 'You have been kicked by an admin'
23+
spam:
24+
config:
25+
filter_words: ['heck']
26+
overrides:
27+
- channel: '1234'
28+
config:
29+
+filter_words: ['foo']
30+
- level: '>=50'
31+
config:
32+
-filter_words: ['heck']
33+
```

knexfile.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require('dotenv').config();
2+
3+
module.exports = {
4+
client: 'mariasql',
5+
connection: {
6+
host: process.env.DB_HOST,
7+
user: process.env.DB_USER,
8+
password: process.env.DB_PASSWORD,
9+
db: process.env.DB_DATABASE,
10+
timezone: 'UTC',
11+
charset: 'utf8mb4'
12+
}
13+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
exports.up = async function(knex, Promise) {
2+
await knex.schema.createTableIfNotExists('mod_actions', table => {
3+
table.increments('id');
4+
table.bigInteger('guild_id').unsigned().notNullable();
5+
table.integer('case_number').unsigned().notNullable();
6+
table.bigInteger('user_id').index().unsigned().notNullable();
7+
table.string('user_name', 128).notNullable();
8+
table.bigInteger('mod_id').index().unsigned().nullable().defaultTo(null);
9+
table.string('mod_name', 128).nullable().defaultTo(null);
10+
table.string('action_type', 16).notNullable();
11+
table.bigInteger('audit_log_id').unique().nullable().defaultTo(null);
12+
table.dateTime('created_at').index().defaultTo(knex.raw('NOW()')).notNullable();
13+
14+
table.unique(['guild_id', 'case_number']);
15+
});
16+
17+
await knex.schema.createTableIfNotExists('mod_action_notes', table => {
18+
table.increments('id');
19+
table.integer('mod_action_id').unsigned().notNullable().index().references('id').inTable('mod_actions').onDelete('CASCADE');
20+
table.bigInteger('mod_id').index().unsigned().nullable().defaultTo(null);
21+
table.string('mod_name', 128).nullable().defaultTo(null);
22+
table.text('body').notNullable();
23+
table.dateTime('created_at').index().defaultTo(knex.raw('NOW()')).notNullable();
24+
});
25+
};
26+
27+
exports.down = async function(knex, Promise) {
28+
await knex.schema.dropTableIfExists('mod_action_notes');
29+
await knex.schema.dropTableIfExists('mod_actions');
30+
};

0 commit comments

Comments
 (0)