-
Notifications
You must be signed in to change notification settings - Fork 9
Warn Module update + started documentation + added guild aware permission checking #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GiregL
wants to merge
21
commits into
DigitalPulseSoftware:master
Choose a base branch
from
GiregL:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
de8932b
Warn module added
Lezenn 118c1eb
Changed mute and ban behaviour
Lezenn 8f64ef9
Fixed mute and phrases
Lezenn dfbb841
fixed global functions, nil in private messages, added origin of the …
Lezenn 13e8fac
Cleanup
Lezenn 6ffd656
Refactor
Lezenn 1ff4aa6
Refactor
Lezenn f4a129c
Started documentation
Lezenn f1e61f1
Added doc link to readme
Lezenn c5defdb
Added per-server privilege check (optional)
Lezenn 7520a3a
Added logging, popwarn command
Lezenn 86a487e
added logs
Lezenn 8ec4640
Cleanup and bug fixing
Lezenn e1b118f
Updated module doc
Lezenn 972a567
Removed GuildAwarePrivilegeCheck
Lezenn 5b753e8
Removed PrivilegeCheck (finally useless lol)
Lezenn b99c5a1
conflict resolving
Lezenn c36d456
Updating doc
Lezenn 0d0b5e6
added getMember Failure check
Lezenn 3c55592
Refactoring
Lezenn 774f4ad
Merge branch 'DigitalPulseSoftware:master' into master
GiregL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # Not a Bot | ||
|
|
||
| Source code of the bot of the french programming discord server NaN (Not a Name). https://discord.gg/zcWp9sC | ||
|
|
||
| [Documentation (WIP)](doc/index.md) |
This file contains hidden or 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
This file contains hidden or 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,39 @@ | ||
| # Not a Bot - Discord Bot | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be part of this PR |
||
|
|
||
| Not a Bot is a french moderation bot designed for the [Not a Name](https://discord.gg/zcWp9sC). | ||
|
|
||
| It is based on multiple configurable modules where each ones have their own task. | ||
|
|
||
| The bot is made in Lua, with a custom wrapper around the Discordia library. | ||
|
|
||
| ## Summary | ||
|
|
||
| ### Modules | ||
|
|
||
| - [Ban]() : Ban management module | ||
| - [Channel]() : Channel management module | ||
| - [Game]() : Global mudule handling bot status | ||
| - [Kick]() : Kick management | ||
| - [Mention]() : Mention reaction module | ||
| - [Message]() : Message handler module (includes custom commands) | ||
| - [Modmail]() : Modmail and tickets module | ||
| - [Modo]() : Alert and flags module | ||
| - [Mute]() : Mute management module | ||
| - [Pin]() : Message pinning module | ||
| - [Poll]() : Polling module | ||
| - [Purge]() : Purge management module | ||
| - [Quote]() : Message quoting module | ||
| - [Raid]() : Anti-raid module | ||
| - [RoleInfo]() : Infos about roles | ||
| - [Stats]() : Guild stat module | ||
| - [Twitch]() : Twitch notification module | ||
| - [Warn](modules/warn_module.md) : Warning module | ||
| - [Welcome]() : Welcome message module | ||
|
|
||
| ### API | ||
|
|
||
|
|
||
|
|
||
| ### External Resources | ||
|
|
||
| - [Discordia Library](https://github.com/SinisterRectus/Discordia) | ||
This file contains hidden or 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,64 @@ | ||
| # Warn Module | ||
|
|
||
| Back to the *[Summary](../index.md)*. | ||
|
|
||
| *[Sources of the module](../../module_warn.lua)* | ||
|
|
||
| The warn module is used to give members warnings about their behaviour in the guild. | ||
|
|
||
| After a given amount of warns, the member gets muted __if the mute module is enabled__ | ||
|
|
||
| ## Config | ||
|
|
||
|
|
||
| - Sanctions (Boolean) (default = true) | ||
| - Enables sanctions (mute and ban alert) when a member receives a warning. | ||
|
|
||
| - MinimalWarnRole (Role) (default = nothing) | ||
| - Minimal role to be able to warn members and see their histories | ||
| - Unlocks `warn` and `warnlist` | ||
|
|
||
| - MinimalUnwarnRole (Role) (default = nothing) | ||
| - Minimal role to be able to unwarn a member. | ||
| - Unlocks `popwarn` and `clearwarn` | ||
|
|
||
| - WarnAmountToMute (Integer) (default = 3) | ||
| - Number of warns needed to mute a member. | ||
|
|
||
| - WarnAmountToBan (Integer) (default = 9) | ||
| - Numbed of warns needed to send the ban alert to the moderators. | ||
|
|
||
| - DefaultMuteDuration (Duration) (default = 1 hour) | ||
| - Default mute duration when a member gets enough warnings. | ||
| - The duration increases as the warning amount increases: `duration = default_duration * (warnings / WarnAmountToMute)` | ||
|
|
||
| - BanInformationChannel (Channel) (default = nothing) | ||
| - Channel where all the ban notifications are sent when a player has enough warnings | ||
| - This setting is required to enable the module | ||
| - You still have to manually ban the member, the last choice remains to the moderation team. | ||
|
|
||
| - WarnLogChannel (Channel) (default = nothing) | ||
| - Channel where all the notifications about warns and unwarns are logged. | ||
|
|
||
| - SendPrivateMessage (Boolean) (default = true) | ||
| - Enable private messages to inform the member of his warning. | ||
|
|
||
| ## Commands | ||
|
|
||
| Assuming the bot prefix is `!` | ||
|
|
||
| - `!warn <target> [reason]` | ||
| - This command gives a warning to the target with the given reason. It also checks if the member should receive a mute or more (only if the option is enabled). | ||
| - If enabled, the member will receive a private message resuming the warning and where it comes from. | ||
| - Example : `!warn @SomePlayer You are a terrible liar` | ||
|
|
||
| - `!warnlist <target>` | ||
| - Shows all the warnings that the given user received. | ||
| - Example : `!warnlist @SomePlayer` | ||
|
|
||
| - `!clearwarns <target>` | ||
| - Clears all the history of the given member. | ||
| - Example : `!clearwarns @SomePlayer` | ||
|
|
||
| - `!popwarns <target>` | ||
| - Removes the last warn of the targeted member |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed GuildAwarePrivilegeCheck