Fixed some on member join stuff

This commit is contained in:
Sven Heidemann 2022-11-18 14:14:01 +01:00
parent d3279eb7c7
commit f5a71a8450
2 changed files with 2 additions and 1 deletions

View File

@ -77,10 +77,10 @@ class BaseOnMemberJoinEvent(OnMemberJoinABC):
try: try:
server = self._servers.get_server_by_discord_id(member.guild.id) server = self._servers.get_server_by_discord_id(member.guild.id)
user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id) user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id)
if user is not None: if user is not None:
self._user_joins.add_user_joined_server(UserJoinedServer(user, datetime.now())) self._user_joins.add_user_joined_server(UserJoinedServer(user, datetime.now()))
self._db.save_changes()
return return
self._logger.debug(__name__, f'Add user: {member.id}') self._logger.debug(__name__, f'Add user: {member.id}')

View File

@ -88,5 +88,6 @@ class LevelService:
user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id) user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id)
if user is None: if user is None:
self._logger.warn(__name__, f'User not found {member.guild.name}@{member.name}') self._logger.warn(__name__, f'User not found {member.guild.name}@{member.name}')
return
await self.set_level(user) await self.set_level(user)