Warn Module update + started documentation + added guild aware permission checking#29
Open
GiregL wants to merge 21 commits intoDigitalPulseSoftware:masterfrom
GiregL:master
Open
Warn Module update + started documentation + added guild aware permission checking#29GiregL wants to merge 21 commits intoDigitalPulseSoftware:masterfrom GiregL:master
GiregL wants to merge 21 commits intoDigitalPulseSoftware:masterfrom
GiregL:master
Conversation
AntoineJT
reviewed
Jan 23, 2021
doc/index.md
Outdated
|
|
||
| - [Ban]() : Ban management module | ||
| - [Channel]() : Channel management module | ||
| - [Game]() : |
Contributor
There was a problem hiding this comment.
Game is the global module handling bot status
Contributor
Author
There was a problem hiding this comment.
I will recreate this PR, I made some mistakes.
(I will also update the Game description in the doc)
SirLynix
requested changes
Jan 23, 2021
| Default = true | ||
| }, | ||
| { | ||
| Name = "MinimalWarnRole", |
Contributor
Author
There was a problem hiding this comment.
Higher roles have the permission to warn, same for unwarn and MinimalUnwarnRole
module_warn.lua
Outdated
|
|
||
| function Module:GetWarnAmount(history, memberId) | ||
| local member = FindMember(history, memberId) | ||
| return table.length(member.Warns) |
module_warn.lua
Outdated
| if not memberHistory then | ||
| commandMessage:reply(string.format("The member **%s** (%d) already have zero warns.", targetMember.tag, targetMember.id)) | ||
| else | ||
| local lastWarn = table.remove(memberHistory.Warns, #memberHistory.Warns) |
Member
There was a problem hiding this comment.
No need for the second table.remove parameter
module_warn.lua
Outdated
| timestamp | ||
| )) | ||
| if not success then | ||
| self:LogInfo(errMessage) |
| if (commandTable.PrivilegeCheck) then | ||
| local success, ret = Bot:ProtectedCall("Command " .. commandName .. " privilege check", commandTable.PrivilegeCheck, message.member) | ||
| if (not success) then | ||
|
|
Contributor
Author
There was a problem hiding this comment.
I removed GuildAwarePrivilegeCheck
| @@ -0,0 +1,39 @@ | |||
| # Not a Bot - Discord Bot | |||
Member
There was a problem hiding this comment.
This shouldn't be part of this PR
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Warn module:
Documentation:
Bot modification: