diff --git a/.eslintrc b/.eslintrc index 5e26092..0e06e20 100644 --- a/.eslintrc +++ b/.eslintrc @@ -32,6 +32,7 @@ "no-plusplus": "off", "no-shadow": "off", "no-return-assign": "off", + "no-await-in-loop": "off", "class-methods-use-this": "off", "no-continue": "off", "no-restricted-syntax": "off", diff --git a/.github/workflow/eslint.yml b/.github/workflow/eslint.yml new file mode 100644 index 0000000..f67ccc6 --- /dev/null +++ b/.github/workflow/eslint.yml @@ -0,0 +1,21 @@ +name: ESLint + +on: + push: + branches: [ production ] + pull_request: + branches: [ production ] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + - name: Install modules + run: yarn + - name: Run ESLint + run: yarn lint diff --git a/README.md b/README.md index 24e49be..8454b5f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# Discord Ping Blocker +![ESLint](https://github.com/NewCircuit/ping-pewds/actions/workflows/eslint.yml/badge.svg?style=flat-square) -This is a Discord bot written in Typescript, using Discord Commando. +# Discord Ping Blocker (ping-pewds) + +### This is a Discord bot written in Typescript, using the [Sapphire Framework](https://www.sapphirejs.dev/) + +#### [View Available Commands](docs/commands.md) ## Requirements * [NodeJS](https://nodejs.org/) @@ -39,8 +43,10 @@ npm run pm2 ### Bot specific configuration |Key|Default|Description| |---|---|---| +|dryrun|`false`|Prevents actually performing the discord punishment, however will insert a record into the database| |token|None|The oauth bot token provided by Discord| |prefix|`!`|The string the bot looks for to indicate a command is fired| +|guild|None|The Guild ID to monitor (currently only watches one guild)| |owners|`[]`|An array of owner snowflakes| |blockTimeout|`10`|The delay in minutes to stop blocking pings if a `block`ed user has spoken| |block|`[]`|The user IDs that the bot will listen for and block mentions of| @@ -48,6 +54,9 @@ npm run pm2 |notifyRoles|`[]`|The role IDs that will get notified when a `block`ed user becomes active| |notifyChannels|`[]`|The channel IDs that a message will be sent to notify `notifyRoles`| |excludedChannels|`[]`|The channel IDs that the bot will completely ignore| +|moderatorRoles|`[]`|The role IDs that the bot should consider moderators| +|lenientRoles|`[]`|The role IDs that should be considered lenient when punishing| +|muteRole|`''`|The role ID that will be assigned to *mute* them.| ### Database specific configuration |Key|Default|Description| diff --git a/config.default.yml b/config.default.yml index 1e119b3..3cf2c7a 100644 --- a/config.default.yml +++ b/config.default.yml @@ -1,13 +1,17 @@ bot: + dryrun: false # this skips the actual punishment if true, but displays and updates database as usual token: 'BotToken' prefix: '!' + guild: '' # the guild that the bot will be attached to owners: ['id1', 'id2'] blockTimeout: 10 # delay in minutes to stop blocking pings if a specific user has spoken - block: [] # User IDs that will the bot will listen for mentions of notifyTimeout: 10 # delay in minutes until notified roles will be alerted that the blocked users are no longer active notifyRoles: [] # Role IDs that will get notified when a blocked user is active notifyChannels: [] # Channel IDs that will get notified when a blocked user is active excludedChannels: [] # Channel IDs that should be ignored by the bot + moderatorRoles: [] # Role IDs that are considered moderators or administrators + lenientRoles: [] # Role IDs that when punished, will have lighter punishments + muteRole: '' # the Role ID that will be assigned to muted users database: host: 'localhost' port: 5432 diff --git a/docs/commands.md b/docs/commands.md new file mode 100644 index 0000000..f071b2f --- /dev/null +++ b/docs/commands.md @@ -0,0 +1,107 @@ +# Commands provided by this bot + +This guide assumes that the command prefix is `!`. Wherever you see the `!` symbol, you should assume +that this is whatever the prefix is set to by the administrators. + +## Monitored User Commands +##### These are commands that are only available to users who should have ping protection. +____ + +### Extend Ping Window +``` +!extend