0.3 - Statistiken (#46) #102

Merged
edraft merged 28 commits from #46 into 0.3 2022-11-09 20:55:06 +01:00
3 changed files with 0 additions and 74 deletions
Showing only changes of commit 273548411b - Show all commits

View File

@ -1,37 +0,0 @@
from cpl_discord.container import Guild
from cpl_query.extension import List
from bot_data.model.auto_role import AutoRole
from bot_data.model.client import Client
from bot_data.model.known_user import KnownUser
from bot_data.model.level import Level
from bot_data.model.server import Server
from bot_data.model.user import User
from bot_data.model.user_joined_server import UserJoinedServer
from bot_data.model.user_joined_voice_channel import UserJoinedVoiceChannel
from modules.stats.model.statistic_result import StatisticResult
async def user_xp_asc(
auto_roles: List[AutoRole],
clients: List[Client],
known_users: List[KnownUser],
levels: List[Level],
servers: List[Server],
user_joined_servers: List[UserJoinedServer],
user_joined_voice_channel: List[UserJoinedVoiceChannel],
users: List[User],
guild: Guild
) -> StatisticResult:
result = StatisticResult()
result.header.append('Name')
result.header.append('XP')
for user in users.order_by(lambda u: u.xp):
row = List(str)
member = guild.get_member(user.discord_id)
row.append(member.name)
row.append(str(user.xp))
result.values.append(row)
return result

View File

@ -1,37 +0,0 @@
from cpl_discord.container import Guild
from cpl_query.extension import List
from bot_data.model.auto_role import AutoRole
from bot_data.model.client import Client
from bot_data.model.known_user import KnownUser
from bot_data.model.level import Level
from bot_data.model.server import Server
from bot_data.model.user import User
from bot_data.model.user_joined_server import UserJoinedServer
from bot_data.model.user_joined_voice_channel import UserJoinedVoiceChannel
from modules.stats.model.statistic_result import StatisticResult
async def user_xp_desc(
auto_roles: List[AutoRole],
clients: List[Client],
known_users: List[KnownUser],
levels: List[Level],
servers: List[Server],
user_joined_servers: List[UserJoinedServer],
user_joined_voice_channel: List[UserJoinedVoiceChannel],
users: List[User],
guild: Guild
) -> StatisticResult:
result = StatisticResult()
result.header.append('Name')
result.header.append('XP')
for user in users.order_by_descending(lambda u: u.xp):
row = List(str)
member = guild.get_member(user.discord_id)
row.append(member.name)
row.append(str(user.xp))
result.values.append(row)
return result