support in master #356

Merged
edraft merged 7 commits from support into master 2023-09-10 18:23:39 +02:00
Owner
No description provided.
edraft added 7 commits 2023-09-03 15:49:21 +02:00
edraft changed title from support in master to WIP: support in master 2023-09-05 17:59:03 +02:00
edraft changed title from WIP: support in master to support in master 2023-09-05 18:01:54 +02:00
edraft added this to the Support project 2023-09-05 18:01:58 +02:00
edraft self-assigned this 2023-09-05 18:02:00 +02:00
edraft requested review from Ebola-Chan 2023-09-05 18:02:05 +02:00
Ebola-Chan approved these changes 2023-09-10 14:21:25 +02:00
Ebola-Chan left a comment
Contributor

Einen Änderungsvorschlag habe ich, aber musst du wissen, ob es sich lohnt diesen umzusetzen.

Einen Änderungsvorschlag habe ich, aber musst du wissen, ob es sich lohnt diesen umzusetzen.
@ -79,3 +80,3 @@
access = False
if type(element) == AutoRole:
if type(element) == Achievement:
Contributor

Ich sehe sehr oft doppelten Code. Wie wäre es, wenn wir dies in eine Methode auslagern?

if type(element) == Achievement:
    element: Achievement = element
    access = check_user_permission_by_server_id(permissions, bot, user, element.server.id:)
def check_user_permission_by_server_id(permissions: PermissionService, bot: DiscordBotServiceABC, user: AuthUser, server_id: int)
    for u in user.users:
        u: User = u
        guild = bot.get_guild(u.server.discord_id)
        member = guild.get_member(u.discord_id)
        if permissions.is_member_moderator(member) and u.server.id == server_id
            return true
Ich sehe sehr oft doppelten Code. Wie wäre es, wenn wir dies in eine Methode auslagern? ```python if type(element) == Achievement: element: Achievement = element access = check_user_permission_by_server_id(permissions, bot, user, element.server.id:) ``` ```python def check_user_permission_by_server_id(permissions: PermissionService, bot: DiscordBotServiceABC, user: AuthUser, server_id: int) for u in user.users: u: User = u guild = bot.get_guild(u.server.discord_id) member = guild.get_member(u.discord_id) if permissions.is_member_moderator(member) and u.server.id == server_id return true ```
Author
Owner

Zu selten der gleiche Code
Die Fallunterscheidung ist sehr Individuell gestaltet :/

Zu selten der gleiche Code Die Fallunterscheidung ist sehr Individuell gestaltet :/
edraft marked this conversation as resolved
edraft-dev approved these changes 2023-09-10 18:23:33 +02:00
edraft merged commit 2e0c1babe4 into master 2023-09-10 18:23:39 +02:00
Sign in to join this conversation.
No description provided.