Fixed on message for new member #481

This commit is contained in:
Sven Heidemann 2025-01-07 15:53:19 +01:00
parent 2bb22c0297
commit 3abd145ce2
2 changed files with 8 additions and 1 deletions

View File

@ -50,7 +50,9 @@ class AchievementOnMessageEvent(OnMessageABC):
return return
server = self._servers.get_server_by_discord_id(message.guild.id) server = self._servers.get_server_by_discord_id(message.guild.id)
user = self._users.get_user_by_discord_id_and_server_id(message.author.id, server.id) user = self._users.find_user_by_discord_id_and_server_id(message.author.id, server.id)
if user is None:
return
user.message_count += 1 user.message_count += 1
self._users.update_user(user) self._users.update_user(user)

View File

@ -86,6 +86,11 @@ class BaseOnMessageEvent(OnMessageABC):
if message is None or message.guild is None: if message is None or message.guild is None:
return return
server = self._servers.get_server_by_discord_id(message.guild.id)
user = self._users.find_user_by_discord_id_and_server_id(message.author.id, server.id)
if user is None:
return
self._logger.info(__name__, f"Received message: {LogMessageHelper.get_log_string(message)}") self._logger.info(__name__, f"Received message: {LogMessageHelper.get_log_string(message)}")
self._append_received_message_count(message.guild.id) self._append_received_message_count(message.guild.id)