timely now has an option in gambling whether to use no protection, captcha, or button.

grpc api fix
This commit is contained in:
Toastie 2024-11-05 20:38:37 +13:00
parent c5aeb43046
commit e7cfd3a752
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
5 changed files with 89 additions and 16 deletions
src/EllieBot/Services/GrpcApi

View file

@ -17,10 +17,13 @@ public sealed class GreetByeSvc : GrpcGreet.GrpcGreetBase, IGrpcSvc, IEService
public ServerServiceDefinition Bind()
=> GrpcGreet.BindService(this);
private static GrpcGreetSettings ToConf(GreetSettings? conf)
private static GrpcGreetSettings ToConf(GreetSettings? conf, GreetType type)
{
if (conf is null)
return new GrpcGreetSettings();
return new GrpcGreetSettings()
{
Type = (GrpcGreetType)type
};
return new GrpcGreetSettings()
{
@ -35,9 +38,10 @@ public sealed class GreetByeSvc : GrpcGreet.GrpcGreetBase, IGrpcSvc, IEService
{
var guildId = request.GuildId;
var conf = await _gs.GetGreetSettingsAsync(guildId, (GreetType)request.Type);
var type = (GreetType)request.Type;
var conf = await _gs.GetGreetSettingsAsync(guildId, type);
return ToConf(conf);
return ToConf(conf, type);
}
public override async Task<UpdateGreetReply> UpdateGreet(UpdateGreetRequest request, ServerCallContext context)