Fixed #153 again

This commit is contained in:
Sven Heidemann 2023-01-04 17:19:36 +01:00
parent 661630bb37
commit a78d5f0fcb
16 changed files with 20 additions and 20 deletions

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -158,10 +158,10 @@ class UserGroup(DiscordCommandABC):
server = self._servers.find_server_by_discord_id(ctx.guild.id)
user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id)
if atr == self._atr_dict["xp"]:
if atr == 'xp':
value = str(user.xp)
elif atr == self._atr_dict["ontime"]:
elif atr == 'ontime':
value = str(round(
self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id)
.sum(lambda join: (join.leaved_on - join.joined_on).total_seconds() / 3600),
@ -194,7 +194,7 @@ class UserGroup(DiscordCommandABC):
server = self._servers.find_server_by_discord_id(ctx.guild.id)
user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id)
if atr == self._atr_dict["xp"]:
if atr == 'xp':
if not value.isnumeric():
await self._message_service.send_interaction_msg(ctx.interaction, self._t.transform('modules.base.user.set.error.value_type_not_numeric'))
return
@ -234,13 +234,13 @@ class UserGroup(DiscordCommandABC):
server = self._servers.find_server_by_discord_id(ctx.guild.id)
user = self._users.find_user_by_discord_id_and_server_id(member.id, server.server_id)
if atr == self._atr_dict["xp"]:
if atr == 'xp':
user.xp = 0
self._users.update_user(user)
self._db.save_changes()
await self._level.check_level(member)
elif atr == self._atr_dict["ontime"]:
elif atr == 'ontime':
self._user_joined_voice_channel.delete_user_joined_voice_channel_by_user_id(user.user_id)
self._db.save_changes()

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "",
"AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "0",
"Minor": "3",
"Micro": "0.rc4"
"Micro": "0.rc5"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",