debugging bot api call

This commit is contained in:
Ben 2025-04-17 14:19:52 +02:00
parent abe03abff6
commit b118f7d103
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 16 additions and 0 deletions

View File

@ -4,8 +4,10 @@ using BiblioTech.Commands;
using BiblioTech.Rewards;
using Discord;
using Discord.WebSocket;
using DiscordRewards;
using Logging;
using Nethereum.Model;
using Newtonsoft.Json;
namespace BiblioTech
{
@ -42,6 +44,18 @@ namespace BiblioTech
return new Program().MainAsync(args);
}
public static void Write(EventsAndErrors cmd)
{
if (Log == null) return;
if (cmd == null)
{
Log.Log("cmd is null!");
return;
}
Log.Log(JsonConvert.SerializeObject(cmd));
}
public async Task MainAsync(string[] args)
{
Log.Log("Starting Codex Discord Bot...");

View File

@ -39,6 +39,8 @@ namespace BiblioTech.Rewards
[HttpPost]
public async Task<string> Give(EventsAndErrors cmd)
{
Program.Write(cmd);
await Safe(() => Program.ChainActivityHandler.ProcessChainActivity(cmd.ActiveChainAddresses));
await Safe(() => Program.EventsSender.ProcessChainEvents(cmd.EventsOverview, cmd.Errors));
return "OK";