From 28e94d9787871c909d94c6a5ff983cf8203d12e5 Mon Sep 17 00:00:00 2001 From: Hedius Date: Sun, 12 Mar 2023 13:45:41 +0100 Subject: [PATCH] Update to python 3.11 log guild joins and leaves --- Dockerfile | 2 +- src/BF4StatusBot/BF4StatusBot.py | 14 +++++++++++++- src/requirements.txt | 8 ++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 84af659..bc9a193 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Docker image for E4GL_BF4Status_DiscordBot # Creator: H3dius/Hedius gitlab.com/hedius -FROM python:3 +FROM python:3.11 # User and Group ID of the account used for execution ARG UID=4000 diff --git a/src/BF4StatusBot/BF4StatusBot.py b/src/BF4StatusBot/BF4StatusBot.py index 5ab2917..07f6565 100644 --- a/src/BF4StatusBot/BF4StatusBot.py +++ b/src/BF4StatusBot/BF4StatusBot.py @@ -14,6 +14,9 @@ # along with this program. If not, see . import nextcord +import logging + +from nextcord import Intents from .ServerMonitor.ServerMonitor import ServerMonitor @@ -25,7 +28,8 @@ class BF4StatusBot(nextcord.Client): """ def __init__(self, settings): - super().__init__() + intents = Intents().default() + super().__init__(intents=intents) self.settings = settings async def on_ready(self): @@ -34,3 +38,11 @@ async def on_ready(self): self.settings.as_bool('CHECK_MAP'), self.settings.as_int('INTERVAL_PRESENCE_CHANGE'), self.settings.as_int('INTERVAL_DATA_FETCH')) + + async def on_guild_join(self, guild): + logging.info(' Joined Guild ' + f'{guild.name} / {guild.id} / In {len(self.guilds)} guild') + + async def on_guild_remove(self, guild): + logging.info(' Left Guild ' + f'{guild.name} / {guild.id} / In {len(self.guilds)} guilds') diff --git a/src/requirements.txt b/src/requirements.txt index 5f88bcd..b72cbdb 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,4 +1,4 @@ -nextcord~=2.0.0.a4 -aiohttp~=3.8.1 -numpy~=1.22.0 -dynaconf~=3.1.7 +nextcord==2.4.0 +aiohttp==3.8.4 +numpy==1.24.2 +dynaconf==3.1.12