#268_achievements #325

Merged
edraft merged 23 commits from #268_achievements into 1.1.0 2023-08-14 09:36:20 +02:00
3 changed files with 8 additions and 0 deletions
Showing only changes of commit 2578c47c44 - Show all commits

View File

@ -21,6 +21,10 @@ class Achievement(TableABC):
self._id = id
self._name = name
self._attribute = attribute
if operator not in ["==", "!=", "<=", ">=", "<", ">"]:
raise ValueError("operator must be ==,!=,<=,>=,< or >")
self._operator = operator
self._value = value
self._server = server

View File

@ -3,6 +3,8 @@ type User implements TableWithHistoryQuery {
discordId: String
name: String
xp: Int
messageCount: Int
reactionCount: Int
ontime: Float
level: Level

View File

@ -41,6 +41,8 @@ class UserQuery(DataQueryWithHistoryABC):
self.set_field("discordId", self.resolve_discord_id)
self.set_field("name", self.resolve_name)
self.set_field("xp", self.resolve_xp)
self.set_field("messageCount", lambda x, *_: x.message_count)
self.set_field("reactionCount", lambda x, *_: x.reaction_count)
self.set_field("ontime", self.resolve_ontime)
self.set_field("level", self.resolve_level)
self.add_collection(