From 914b626f45b64daf479826c30dad7dec3393d7c0 Mon Sep 17 00:00:00 2001 From: gsd Date: Sat, 11 Mar 2023 23:32:55 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B0=D0=BA=20=D0=B1=D1=83=D0=B4=D0=B5?= =?UTF-8?q?=D1=82=20=D0=BA=D1=80=D1=83=D1=87=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin_ext/ban.py | 6 +++++- admin_ext/unban.py | 6 +++++- other_ext/vip_roles.py | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/admin_ext/ban.py b/admin_ext/ban.py index a1f9ff6..10b542b 100644 --- a/admin_ext/ban.py +++ b/admin_ext/ban.py @@ -13,7 +13,11 @@ class Extension: minutes: int = 0 ): await interaction.response.defer(thinking=True) - return await interaction.followup.send(f'{await self.__call__(profile, reason, minutes, interaction.user)}', ephemeral=False) + await interaction.followup.send(f'{await self.__call__(profile, reason, minutes, interaction.user)}', ephemeral=False) + try: + await self.core.loaded_extensions["ban_roles"].updater() + except: + print("Cannot update ban roles on main server") async def __call__(self, profile, reason, minutes, discord_user): steam64 = await self.core.GetSteam64OfDiscord(discord_user) diff --git a/admin_ext/unban.py b/admin_ext/unban.py index 43bb842..8efa5c2 100644 --- a/admin_ext/unban.py +++ b/admin_ext/unban.py @@ -11,7 +11,11 @@ class Extension: profile: str ): await interaction.response.defer(thinking=True) - return await interaction.followup.send(f'{await self.__call__(profile, interaction.user)}', ephemeral=False) + await interaction.followup.send(f'{await self.__call__(profile, interaction.user)}', ephemeral=False) + try: + await self.core.loaded_extensions["ban_roles"].updater() + except: + print("Cannot update ban roles on main server") async def __call__(self, profile, discord_user): steam64 = await self.core.GetSteam64OfDiscord(discord_user) diff --git a/other_ext/vip_roles.py b/other_ext/vip_roles.py index 16c08bb..aa00ec6 100644 --- a/other_ext/vip_roles.py +++ b/other_ext/vip_roles.py @@ -62,7 +62,7 @@ class Extension: if member is None: continue try: - print(f"Remove role({role_id}) from {member}") + print(f"Remove role({role_id}) from {member}", reason = "Автоматически, игрок больше не имеет вип") await member.remove_roles(VIP_ROLE) except Exception as err: print(f"Failed remove role ({role_id}) to {member}, err: {err}") @@ -72,6 +72,6 @@ class Extension: continue try: print(f"Add role({role_id}) to {member}") - await member.add_roles(VIP_ROLE) + await member.add_roles(VIP_ROLE, reason = "Автоматически, игрок приобрел(не точно) вип на серверах") except Exception as err: print(f"Failed add role ({role_id}) to {member}, err: {err}") \ No newline at end of file