This commit is contained in:
skidfire
2026-09-06 19:59:27 -04:00
parent 55d8e11a5d
commit fe3468c65d
247 changed files with 338183 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
using Vanadium.Controllers;
using Newtonsoft.Json;
namespace Vanadium.Hubs
{
public static class DiscordBotHub
{
public static async Task BroadcastBotEvent(string eventType, object payload)
{
try
{
var message = JsonConvert.SerializeObject(new
{
type = "botEvent",
eventType = eventType,
data = payload,
timestamp = DateTime.UtcNow
});
await NotificationsController.SendToAll(message);
}
catch (Exception ex)
{
Console.WriteLine($"[DiscordBotHub] Error broadcasting bot event: {ex.Message}");
}
}
public static async Task BroadcastBotMessage(string message)
{
try
{
var json = JsonConvert.SerializeObject(new
{
type = "botMessage",
message = message,
timestamp = DateTime.UtcNow
});
await NotificationsController.SendToAll(json);
}
catch (Exception ex)
{
Console.WriteLine($"[DiscordBotHub] Error broadcasting bot message: {ex.Message}");
}
}
}
}