Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Mod rewrite #89

Open
wants to merge 145 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
5e57314
Added function to user other units than days for mutes/bans
Jun 21, 2021
dadf5f7
Removed unnecessary variable
Jun 21, 2021
5d4df8b
Enhanced code style
Jun 21, 2021
5d56820
Added whitespaces around operators
Jun 21, 2021
8f03625
Made reports available on private messages
Jun 22, 2021
ddf2d4d
Added report, warn, kick, mute and ban db ids to ulog for mods
Jun 22, 2021
49fa943
Merge branch 'develop' into mod_rewrite
Jun 22, 2021
19ee12a
Fixed giving too many arguments to pubsub subscription
Jun 22, 2021
ce407fe
Added function to attach an evidence image to reports
Jun 23, 2021
aba7d8c
Added evidence image to database on reports
Jun 23, 2021
e65030a
Added function to attach an evidence image to warns
Jun 23, 2021
79f2cd1
Added function to attach an evidence image to mutes
Jun 23, 2021
e4415dd
Added function to attach an evidence image to kicks
Jun 23, 2021
15c0c2a
Added function to attach an evidence image to bans
Jun 23, 2021
fdd45a0
Added evidence images to user log
Jun 23, 2021
9615ecd
Added function to edit warn reasons
Jul 5, 2021
1a01fa0
Removed forgotten print statements
Jul 5, 2021
8298a34
Added function to edit mute reasons
Jul 6, 2021
199b7f5
Added function to edit mute durations
Jul 6, 2021
c30138c
Added function to edit kick reasons
Jul 7, 2021
458d35a
Added function to edit ban reasons
Jul 7, 2021
ca83e22
Added a function to edit ban durations
Jul 11, 2021
478c50d
Fixed possibility to use senseless time periods for mute/ban edits
Jul 11, 2021
d70eec7
Added mod level to database for warns, mutes, kicks, bans
Jul 12, 2021
becc4e0
Added setting for whether to send a user a concerning delete message
Jul 17, 2021
a547afb
Merge branch 'develop' into mod_rewrite
Jul 17, 2021
288fb8a
Added a function to delete warns
Jul 17, 2021
abad9ad
Added a function to delete mutes
Jul 17, 2021
ebbe380
Added a function to delete kicks
Jul 18, 2021
70dea0c
Added a function to delete bans
Jul 18, 2021
875d0c1
Fixed not comparing whether the original warn/mute/kick/ban creator i…
Jul 18, 2021
26238a1
Added mod comparison to unmutes/unbans
Jul 18, 2021
a4c6966
Added function to put bans initiated through discords ban system into…
Jul 18, 2021
ed72339
Updated get_userlog_entries pubsub documentation
Jul 19, 2021
0d7d7c7
Merge develop into mod_rewrite
Jul 19, 2021
9154bf8
Merge branch 'develop' into mod_rewrite
Jul 19, 2021
5eb7b4b
Added command aliases
Jul 19, 2021
d6b73c1
Added mod tools documentation
Jul 19, 2021
dbc1b3b
Added send_delete_message command to mod tools documentation
Jul 19, 2021
7946870
Fixed codestyle
Jul 19, 2021
fe60c02
Fixed linter
Jul 19, 2021
c84a256
Fixed codestyle again
Jul 19, 2021
af85478
Fixed linter again
Jul 19, 2021
fb069da
Fixed codestyle and linter again
Jul 19, 2021
85afe31
Fixed documentation linter
Jul 19, 2021
4b07055
Merge branch 'develop' into mod_rewrite
Defelo Jul 19, 2021
b858edf
Fixed issue #83: reports will be send to alert channel instead of cha…
Jul 19, 2021
acc12aa
Merge remote-tracking branch 'origin/mod_rewrite' into mod_rewrite
Jul 19, 2021
2b63fe1
Added permissions to mod tools documentation
Jul 19, 2021
2dbe36d
Improved mod cog documentation
Jul 20, 2021
e0f9c1c
Added confirmation request to reports (issue #70)
Jul 20, 2021
0d4dc50
Improved code style
Aug 22, 2021
cf05dc3
Fixed codestyle check
Aug 22, 2021
e4ede02
Why does codestyle hate me so much?
Aug 22, 2021
0510244
Merge branch 'develop' into mod_rewrite
LoCrealloc Oct 20, 2021
ef2e012
Updated mod_rewrite for pycord and fixed various bugs
LoCrealloc Oct 22, 2021
cde9736
Improved code style as requested by the reviewers
LoCrealloc Oct 23, 2021
e64e78f
Improved code style as requested by GitHub
LoCrealloc Oct 23, 2021
fd8cff5
Improved code style as requested by GitHub, again
LoCrealloc Oct 23, 2021
0a94039
Improved code style as requested by GitHub, because this linter simpl…
LoCrealloc Oct 23, 2021
551be3e
Removed years and months as possible durations for mutes/bans and cha…
LoCrealloc Nov 26, 2021
aa2e7b5
Merge branch 'develop' into mod_rewrite
LoCrealloc Dec 4, 2021
17701b7
Added checks for permissions
LoCrealloc Dec 4, 2021
c69cb43
Made reports only visible for team members
LoCrealloc Dec 4, 2021
c9ef10c
Adjusted ban logging for bulk bans
LoCrealloc Dec 4, 2021
55c2db5
It's time to fight the linter again...
LoCrealloc Dec 4, 2021
2454c1b
Improved code style
LoCrealloc Dec 4, 2021
7ada140
Codestyle, again (what else)
LoCrealloc Dec 4, 2021
44eda90
Do you like me now?
LoCrealloc Dec 4, 2021
76a78c3
No, it does not
LoCrealloc Dec 4, 2021
1058538
Fixed typing
LoCrealloc Dec 13, 2021
b9bfa20
Fixed permission check
LoCrealloc Dec 13, 2021
d4801ad
Removed evidence from user message
LoCrealloc Dec 26, 2021
dbf8066
Replaced get_user calls with fetch_user queries
LoCrealloc Dec 26, 2021
3da93ee
Merge branch 'develop' into mod_rewrite
LoCrealloc Dec 27, 2021
1a21e5e
Added report channel to alert embed if the channel is a thread
LoCrealloc Dec 27, 2021
f2a63fe
Removed duplicated code
LoCrealloc Dec 27, 2021
4955e50
Added alert message if bot can not fetch audit logs
LoCrealloc Dec 30, 2021
f22f5d5
Added alert message if no mute role is configured
LoCrealloc Dec 30, 2021
b6dab46
Replaced a warn check with a kick check
LoCrealloc Dec 30, 2021
7701e84
Merge branch 'develop' into mod_rewrite
LoCrealloc Dec 30, 2021
79bd958
Made mute/ban duration changes just editing db entries instead of cre…
LoCrealloc Jan 1, 2022
964de98
Merge remote-tracking branch 'origin/mod_rewrite' into mod_rewrite
LoCrealloc Jan 1, 2022
47d6d61
Renamed functions and fixed a bit of codestyle
LoCrealloc Jan 2, 2022
1fe407d
Added information about previous mutes when banning a member
LoCrealloc Jan 2, 2022
0f45012
Made send_delete_message command return the current settings when no …
LoCrealloc Jan 2, 2022
bcb70a1
Added confirmation when no evidence is given
LoCrealloc Jan 2, 2022
9ffcce8
Replaced db query
LoCrealloc Jan 2, 2022
cb44a58
Improved check for banning permissions
LoCrealloc Jan 2, 2022
bef7479
Merge branch 'develop' into mod_rewrite
LoCrealloc Jan 3, 2022
e4cf759
Added docs decorator
LoCrealloc Jan 3, 2022
d21f728
Added guild only check for setting
LoCrealloc Jan 3, 2022
ff19912
Enhanced ban detection feature
LoCrealloc Jan 4, 2022
498ecf6
Updated ulog pubsub function
LoCrealloc Jan 4, 2022
cf7e683
Added keyword arguments for changelog calls
LoCrealloc Jan 4, 2022
542befc
Merge branch 'develop' into mod_rewrite
Defelo Jan 12, 2022
30d1c41
Made mod loop run every minute
LoCrealloc Mar 5, 2022
882a446
Improved code style
LoCrealloc Mar 6, 2022
4a0445b
Made black fix itself
LoCrealloc Mar 6, 2022
a04a8c0
Merge develop into mod rewrite
LoCrealloc Mar 6, 2022
96fea7a
Merge develop into mod_rewrite
Defelo Mar 6, 2022
aaedeb4
Removed unnecessary variable & made black reformat my code
LoCrealloc Mar 7, 2022
0954ff5
Tried to reduce the "Cognitive Complexity"
LoCrealloc Mar 31, 2022
7a26e16
Added more information to unban/unmute changelog embeds (#71)
LoCrealloc Apr 5, 2022
db86093
Improved codestyle
LoCrealloc Apr 5, 2022
01be19f
Used inheritance to simplify database models
LoCrealloc Apr 9, 2022
161c208
Improved database model inheritance
LoCrealloc Apr 11, 2022
d416442
Fixed wrong indents
LoCrealloc Apr 11, 2022
7c8fbed
Improved codestyle
LoCrealloc Apr 11, 2022
f34d648
Improved codestyle
LoCrealloc Apr 11, 2022
85653e2
Improved codestyle
LoCrealloc Apr 11, 2022
f6fb93a
Merge remote-tracking branch 'origin/mod_rewrite' into mod_rewrite
LoCrealloc Apr 11, 2022
03f0563
Merge branch 'develop' into mod_rewrite
LoCrealloc Apr 11, 2022
62d4ba9
Improved codestyle
LoCrealloc Apr 11, 2022
46c525c
Fixed amazingly stupid indents I defnitely did not make myself
LoCrealloc Apr 11, 2022
54700b5
Fixed amazingly stupid indents I defnitely did not made myself
LoCrealloc Apr 11, 2022
806df15
Merge remote-tracking branch 'origin/mod_rewrite' into mod_rewrite
LoCrealloc Apr 11, 2022
c5dc1fe
Fixed typing
LoCrealloc Apr 16, 2022
7a897a5
Improved code style
LoCrealloc Apr 16, 2022
3d9a2a7
Removed code duplicates
LoCrealloc May 2, 2022
85d89f7
fixed some minor issues
LoCrealloc May 26, 2022
bd33356
Merge branch 'develop' into mod_rewrite
LoCrealloc Jun 1, 2022
ee27096
Merge branch 'develop' into mod_rewrite
LoCrealloc Jun 6, 2022
da3ea3a
Merge branch 'develop' into mod_rewrite
LoCrealloc Jun 20, 2022
ab5680a
Fixed breaking changes caused by the library
LoCrealloc Jun 20, 2022
0aa6342
reviewed code until `handle_get_userlog_entries` and added todos
TheCataliasTNT2k Jun 20, 2022
9c4d502
Re-added years and months to the duration converter and enhanced its …
LoCrealloc Jun 21, 2022
c8ccd29
Removed on confirmation handler and replaced it with the class locate…
LoCrealloc Jun 21, 2022
6293f60
Fixed bugs in mod loop and ban retriever
LoCrealloc Jun 22, 2022
4ec42dc
Removed entire mod level comparison functionality again..
LoCrealloc Jun 22, 2022
6bc8b4a
Added support for discords timeout feature
LoCrealloc Jun 25, 2022
6aec0ff
Added support for discords timeout feature
LoCrealloc Jul 4, 2022
987d9ae
Made the bot do not require a mute role anymore necessarily
LoCrealloc Jul 4, 2022
d840d87
Added docstrings to functions
LoCrealloc Jul 11, 2022
6d515a4
Added pubsub for role updates and made mod cog assign mute role autom…
LoCrealloc Jul 11, 2022
bc97b64
Made functions private
LoCrealloc Jul 11, 2022
d9dae40
Removed ugly TODO-comments
LoCrealloc Jul 11, 2022
32a9894
Merge branch 'develop' into mod_rewrite
Defelo Sep 23, 2022
2489fad
Merge branch 'develop' into mod_rewrite
LoCrealloc Sep 24, 2022
a1f5dd7
Made content filter userlog query accept parameters that are only ne…
LoCrealloc Sep 24, 2022
aff7dd2
Merge remote-tracking branch 'origin/mod_rewrite' into mod_rewrite
LoCrealloc Sep 24, 2022
8cb2a8d
Merge branch 'develop' into mod_rewrite
LoCrealloc Sep 24, 2022
8f28426
Removed duplicated changelog entry
LoCrealloc Sep 26, 2022
58d76cc
Fixed wrong translation
LoCrealloc Sep 26, 2022
48a83ce
Added check for the moderate_members permission on mute command
LoCrealloc Sep 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion administration/roles/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .models import PermaRole, RoleAuth
from .permissions import RolesPermission
from ...contributor import Contributor
from ...pubsub import send_alert, send_to_changelog
from ...pubsub import role_updated, send_alert, send_to_changelog


tg = t.g
Expand All @@ -32,6 +32,7 @@ async def configure_role(ctx: Context, role_name: str, role: Role, check_assigna
check_role_assignable(role)

await RoleSettings.set(role_name, role.id)
await role_updated(role=role, role_name=role_name)
await reply(ctx, t.role_set)
await send_to_changelog(ctx.guild, t.log_role_set(Config.ROLES[role_name][0], role.name, role.id))

Expand Down
4 changes: 2 additions & 2 deletions information/user_info/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async def userinfo(self, ctx: Context, user: Optional[Union[User, int]] = None):

@commands.command(aliases=["userlog", "ulog"])
@optional_permissions(UserInfoPermission.view_userlog)
async def userlogs(self, ctx: Context, user: Optional[Union[User, int]] = None):
async def userlogs(self, ctx: Context, user: Optional[Union[User, int]] = None, show_ids: Optional[bool] = False):
"""
show moderation log of a user
"""
Expand Down Expand Up @@ -283,7 +283,7 @@ async def userlogs(self, ctx: Context, user: Optional[Union[User, int]] = None):
else:
out.append((verification.timestamp, t.ulog.verification.revoked))

responses = await get_userlog_entries(user_id, ctx.author)
responses = await get_userlog_entries(user_id, show_ids, ctx.author)
for response in responses:
out += response

Expand Down
2 changes: 1 addition & 1 deletion moderation/content_filter/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ContentFilterCog(Cog, name="Content Filter"):
CONTRIBUTORS = [Contributor.Infinity, Contributor.Defelo]

@get_userlog_entries.subscribe
async def handle_get_ulog_entries(self, user_id: int, _):
async def handle_get_ulog_entries(self, user_id: int, *_):
out = []

log: BadWordPost
Expand Down
2 changes: 1 addition & 1 deletion moderation/invites/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class InvitesCog(Cog, name="Allowed Discord Invites"):
]

@get_userlog_entries.subscribe
async def handle_get_ulog_entries(self, user_id: int, _):
async def handle_get_ulog_entries(self, user_id: int, *_):
out = []

async for log in await db.stream(filter_by(InviteLog, applicant=user_id)): # type: InviteLog
Expand Down
2 changes: 1 addition & 1 deletion moderation/mediaonly/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def handle_can_respond_on_reaction(self, channel: TextChannel) -> bool:
return not await db.exists(filter_by(MediaOnlyChannel, channel=channel.id))

@get_userlog_entries.subscribe
async def handle_get_userlog_entries(self, user_id: int, _) -> list[tuple[datetime, str]]:
async def handle_get_userlog_entries(self, user_id: int, *_) -> list[tuple[datetime, str]]:
out: list[tuple[datetime, str]] = []

deletion: MediaOnlyDeletion
Expand Down
Loading