mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-13 01:22:43 -04:00
Implemented Discord conversation summaries
This commit is contained in:
@@ -120,9 +120,10 @@ public class BotServices
|
||||
_discord.OnPresenceUpdated += DiscordOnPresenceUpdated;
|
||||
_discord.OnChannelCreated += DiscordOnChannelCreated;
|
||||
_discord.OnChannelDeleted += DiscordOnChannelDeleted;
|
||||
_discord.OnConversationSummaryUpdate += DiscordOnConversationSummaryUpdate;
|
||||
await _discord.StartWsClient();
|
||||
}
|
||||
|
||||
|
||||
private async Task BuildRainbet()
|
||||
{
|
||||
var settings = await SettingsProvider.GetMultipleValuesAsync([BuiltIn.Keys.Proxy, BuiltIn.Keys.RainbetEnabled]);
|
||||
@@ -646,6 +647,13 @@ public class BotServices
|
||||
db.SaveChanges();
|
||||
}
|
||||
|
||||
private void DiscordOnConversationSummaryUpdate(object sender, DiscordConversationSummaryUpdateModel summary, string guildId)
|
||||
{
|
||||
_logger.Info($"Received a conversation summary update for guild {guildId}");
|
||||
var discordIcon = SettingsProvider.GetValueAsync(BuiltIn.Keys.DiscordIcon).Result;
|
||||
_chatBot.SendChatMessage($"[img]{discordIcon.Value}[/img] {summary.Topic}: {summary.SummaryShort} 🤖🤖", true);
|
||||
}
|
||||
|
||||
private void DiscordOnChannelDeleted(object sender, DiscordChannelDeletionModel channel)
|
||||
{
|
||||
_logger.Info($"Received channel deletion event of type {channel.Type} with name {channel.Name}");
|
||||
|
||||
Reference in New Issue
Block a user