forked from EllieBotDevs/elliebot
Removed discrim from the database
Added .translateflags command Added captcha to timely, configurable in .conf gambling Changed bonuses for patreon rewards Fixed nunchi message color
This commit is contained in:
parent
41f1c7aa11
commit
d1bc423b99
29 changed files with 12080 additions and 4732 deletions
src/EllieBot/Services/GrpcApi
|
@ -28,6 +28,8 @@ public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService
|
|||
GetXpSettingsRequest request,
|
||||
ServerCallContext context)
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
var guild = _client.GetGuild(request.GuildId);
|
||||
|
||||
if (guild is null)
|
||||
|
@ -54,6 +56,26 @@ public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService
|
|||
Name = guild.GetRole(x)?.Name ?? "????"
|
||||
})));
|
||||
|
||||
var curRews = _xp.GetCurrencyRewards(request.GuildId);
|
||||
var roleRews = _xp.GetRoleRewards(request.GuildId);
|
||||
|
||||
var rews = curRews.Select(x => new RewItemReply()
|
||||
{
|
||||
Level = x.Level,
|
||||
Type = "Currency",
|
||||
Value = x.Amount.ToString()
|
||||
});
|
||||
|
||||
rews = rews.Concat(roleRews.Select(x => new RewItemReply()
|
||||
{
|
||||
Level = x.Level,
|
||||
Type = "Role",
|
||||
Value = guild.GetRole(x.RoleId)?.ToString() ?? x.RoleId.ToString()
|
||||
}))
|
||||
.OrderBy(x => x.Level);
|
||||
|
||||
reply.Rewards.AddRange(rews);
|
||||
|
||||
reply.ServerExcluded = isServerExcluded;
|
||||
|
||||
return reply;
|
||||
|
|
Reference in a new issue