Skip to content

Commit

Permalink
Update to python 3.11 log guild joins and leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedius committed Mar 12, 2023
1 parent 99cac01 commit 28e94d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 13 additions & 1 deletion src/BF4StatusBot/BF4StatusBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import nextcord
import logging

from nextcord import Intents

from .ServerMonitor.ServerMonitor import ServerMonitor

Expand All @@ -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):
Expand All @@ -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')
8 changes: 4 additions & 4 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 28e94d9

Please sign in to comment.