Skip to content

Commit d1f4fe7

Browse files
SCDeroxgithub-actions[bot]jateute
authored
V2 Release
This is a new stable version which includes breaking changes and new features. Commits: * docs: Documented all functions in helpers.js * feat: Config reloading * feat: proper config reloading * feat: removed logging * docs: Added warning about botReady * style: added eslint * style: added github workflow eslint checker * style: github-workflow bug fix * style: github-workflow bug fix #2 * feat: added jsdocs docs generation * generated documentation * docs: Added better documentation * generated documentation * feat: added `client.logChannel` * fix: not returning promise when checking build-in-config * generated documentation * fix: .eslintrc.js contained wrong value * generated documentation * fix: `sendMultipleSiteButtonMessage` didn't work with just one site * feat: @-mentioning the user now serves as a prefix * docs: Updated CHANGELOG.md * style: fixed some things for eslint * fix: bot not responding to message with prefix * feat: `command.config.args` must now be an integer * feat: added bot-operators who can reload configuration (replacement for `config.ownerID`; use `command.config.restricted` to access it) * docs: Improved navigation in README.md * generated documentation * feat: Added cli * generated documentation * feat: cli now showing promt * docs: fixed some typos * style: not longer counting comments to max file length * feat: added slash-commands * generated documentation * docs: removed timestamp in footer to sop useless re-generation of documentation on push * generated documentation * fix: CLI-Files of modules not being loaded correctly * feat: show prompt when wrong command entered * fix: removed strings referring to migration-helper as it is not going to be implemented * docs: added rules for modules * docs: added another rule for modules * docs: updated changelog * docs: updated README.md * fix: config generation failed when folder didn't exist * feat: Added compareArrays to helpers.js * doc: Documented ephemeral parameter * fix: module dir does not exist * feat: better comparing if command sync is needed * feat: show error for users if the bot isn't ready yet * fix: Some build-in configuration not getting generated * fix(workflow): Pushing to main instead of dev branch * generated documentation * doc: fixed link * generated documentation * fix: reload command not restricted * feat: added `client.guild` property * feat: show invite url if bot is not on server * fix: command syncing every time even if commands are up-to-date * fix: Objects values not compared correctly in `compareArrays` * feat: Slash-Command-Permissions * generated documentation * feat: Subcommands-Handling * feat: `beforeSubcommand` function added * doc: Made it clearer when `onLoad` really gets triggered * fix: commands sync before configuration loaded * feat: command.permissions and command.options can now be functions * fix: not finishing config check after file write required * fix: trying to execute sub commands on commands without subcommands * fix: ephemeral answers weren't ephemeral sometimes * tests: """fixed""" tests * feat: /reload now also syncs commands to make sure permissions are up-to-date * fix: bot crashing after trying to sendMultipleSiteButtonMessage with more than one site is triggered * generated documentation * fix: commands loaded before config checked * docs: Improved documentation for developers * fixed: wrong defaultPermission in some circumstances * fix: not executing permission function under some circumstances * generated documentation * fix: syncing commands when syncing is not required * fix: executing command.permissions function to late * style: fixed unexpected use of undefined * feat: added arrayToApplicationCommandPermissions to helpers.js * generated documentation * fix: crash when trying to get module author after command failure * fix: commands without subcommand-group would crash * feat: added updateChecker * generated documentation * fix: removed spaces from some logging outputs * fix: showing prompt after config got checked * feat: added admin-tools module * feat: added auto-publisher module * feat: added auto-react module * perf: using `string.replaceAll()` instead of `string.split().join()` (ES2021) * fix(auto-react): crashing under some circumstances * feat: added `client.intervals` to make the life of developers easier * feat: added betterstatus module * fix: docs not building * generated documentation * feat: added `client.jobs` to make the life of developers easier * fix: `command.beforeSubcommand` not getting executed even if set * tests: """fixed""" tests * feat: added birthday module * generated documentation * locale: fixed german string * fix(config-loading): resolving promise to early * feat: added giveaways * docs: fixed error * generated documentation * feat: added `randomIntFromInterval` to helpers.js * feat: added `randomElementFromArray` to helpers.js * fix: `allowNull` getting ignored * fix(auto-react): Bot not checking if ready * fix: missing space in log * feat: added levels module * generated documentation * feat(levels): Added leaderboardChannel * generated documentation * fix(levels): Not showing users in /leaderboard * feat: added partner-list module * generated documentation * docs: improved docs * generated documentation * docs: added more sponsor information * feat: added ping-on-vc-join module * generated documentation * fix: `/reload` trying to execute non-existing function * fix(sync-commands): syncing commands even if no syncing is needed * feat: added serverinfo module * style: fixed eslint test fail * generated documentation * fix: removed wrong early return * feat: added suggestions module * generated documentation * docs: added `configFile.content[].params[].fieldValue` for `select`-fields * feat: added welcomer module Closes #30 * docs: removed beta-warning Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ole <78431813+jateute@users.noreply.github.com>
1 parent a28af29 commit d1f4fe7

161 files changed

Lines changed: 29399 additions & 5035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
'parserOptions': {
88
'ecmaVersion': 12
99
},
10-
'ignorePatterns': ['.eslintrc.js'],
10+
'ignorePatterns': ['.eslintrc.js', 'docs/', 'gen-doc/'],
1111
'rules': {
1212
'no-unused-vars': 'error',
1313
'accessor-pairs': 'error',
@@ -51,7 +51,7 @@ module.exports = {
5151
'error',
5252
'last'
5353
],
54-
'complexity': 'error',
54+
'complexity': ['error', 50],
5555
'computed-property-spacing': [
5656
'error',
5757
'never'
@@ -67,6 +67,15 @@ module.exports = {
6767
'error',
6868
'property'
6969
],
70+
'require-jsdoc': ['error', {
71+
'require': {
72+
'FunctionDeclaration': true,
73+
'MethodDefinition': false,
74+
'ClassDeclaration': true,
75+
'ArrowFunctionExpression': false,
76+
'FunctionExpression': false
77+
}
78+
}],
7079
'dot-notation': 'off',
7180
'eol-last': 'off',
7281
'eqeqeq': 'error',
@@ -114,7 +123,7 @@ module.exports = {
114123
'max-classes-per-file': 'error',
115124
'max-depth': 'off',
116125
'max-len': 'off',
117-
'max-lines': 'error',
126+
'max-lines': ['error', {max: 500, skipComments: true}],
118127
'max-lines-per-function': 'off',
119128
'max-nested-callbacks': 'error',
120129
'max-params': 'off',
@@ -148,6 +157,7 @@ module.exports = {
148157
'no-extra-bind': 'error',
149158
'no-extra-label': 'error',
150159
'no-extra-parens': 'off',
160+
'no-extra-semi': 'error',
151161
'no-floating-decimal': 'error',
152162
'no-implicit-globals': 'off',
153163
'no-implied-eval': 'error',
@@ -305,4 +315,4 @@ module.exports = {
305315
'error'
306316
]
307317
}
308-
};
318+
};

.github/CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributing to this repository
2+
## Getting started
3+
Before you begin:
4+
* This bot is powered by Node.js. Please make sure you have node.js 16 or newer installed.
5+
* Please review our [Code of Conduct](CODE_OF_CONDUCT.md) and our [Terms of service](https://sc-net.work/tos)
6+
* We highly suggest joining our [discord](https://sc-net.work/dc) to discuss up-coming changes with the rest of our community. You can also apply for the open-source-developer-role [here](https://sc-net.work/open-source-dev-application).
7+
8+
## Setting up
9+
1. Fork and clone this repository and make sure you are on the current **main** branch as that's were development happens. If you are developing a new module, please use the **stable** branch.
10+
2. Run `npm ci`
11+
3. You can code now ^^
12+
4. Run `npm test` to run ESLint and to ensure any JSDoc changes are valid
13+
5. [Submit a pullrequest](https://github.com/SCNetwork/CustomDcBot/compare).

.github/SUPPORT.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Seeking support?
2+
3+
We only use this issue tracker for bug reports and feature request. We are not able to provide general support or answer questions in the form of GitHub issues.
4+
5+
For general questions or problems with this bot, please use [discussions](https://github.com/SCNetwork/CustomDCBot/discussions).
6+
7+
Any issues that don't directly involve a bug or a feature request will likely be closed and redirected.

.github/workflows/build-docs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build gen-doc
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-docs:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Install dependencies
13+
run: npm install
14+
- name: Build gen-doc
15+
run: npx jsdoc -c jsdoc.conf.json
16+
- name: Commit & Push
17+
uses: actions-js/push@master
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
message: generated documentation
21+
branch: dev

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
This changelog contains mostly API-Changes and changes for developers.
4+
5+
## v2.0.0
6+
7+
* Added new configuration-option `logLevel`
8+
* Added logger (`client.logger`) to allow for more detailed logs (instance
9+
of [log4js.Logger](https://github.com/log4js-node/log4js-node))
10+
* Added `--pm2-setup`-command-argument to indicate an [pm2](https://pm2.keymetrics.io)-setup
11+
* Switched to discord.js version 1.13 which includes breaking changes
12+
* Reworked some configuration-loading and switched to `jsonfile` as a dependencies
13+
* Configuration of every module is now stored in a global client object: `client.configuration[moduleName]`. Please use
14+
this instead of using `require` as this method allows users to reload configuration.
15+
* Commands are now slash commands. Old commands are not recommended being used, but can be by changing `commands-dir`
16+
to `message-commands-dir`. Remember, that in future we may remove this feature.
17+
* It's no longer required to add `module` as a config-parameter for every command
18+
* Added `sendMultipleSiteButtonMessage` to `/src/functions/helpers.js` to create fancy multiple-site-embed-messages
19+
* `embedType()` now returns [MessageOptions](https://discord.js.org/#/docs/main/stable/typedef/MessageOptions)
20+
* `footer` can now be set for each embed individually
21+
* `.eslintrc.js` added - please use this configuration if you create a pullrequest
22+
* Added `client.logChannel` ([TextChannel](https://discord.js.org/#/docs/main/stable/class/TextChannel)) which should be
23+
used as a default for log-channels and in which some relevant information gets sent. ⚠️ In some cases this value
24+
is `null` so always catch or check the value before any calls on this property.
25+
* Forgot the prefix of your bot? You can now use @-mentions instead of your prefix
26+
* `mesageCommand.config.args` now only (!) accepts an integer which represents how many arguments are at least needed
27+
* Slash-Commands are now available and should be used as much as possible
28+
* Errors in the executing of a command will nun result in a message to the user

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
opensource@sc-network.net.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

0 commit comments

Comments
 (0)