diff --git a/Commands/CloseCommand.cs b/Commands/CloseCommand.cs index 13d833e..22319f1 100644 --- a/Commands/CloseCommand.cs +++ b/Commands/CloseCommand.cs @@ -85,7 +85,7 @@ public class CloseCommand : ApplicationCommandModule await using FileStream file = new FileStream(Transcriber.GetPath(ticket.id), FileMode.Open, FileAccess.Read); DiscordMessageBuilder message = new DiscordMessageBuilder(); - message.WithEmbed(embed); + message.AddEmbed(embed); message.AddFiles(new Dictionary { { Transcriber.GetFilename(ticket.id), file } }); await logChannel.SendMessageAsync(message); @@ -106,7 +106,7 @@ public class CloseCommand : ApplicationCommandModule await using FileStream file = new FileStream(Transcriber.GetPath(ticket.id), FileMode.Open, FileAccess.Read); DiscordMessageBuilder message = new DiscordMessageBuilder(); - message.WithEmbed(embed); + message.AddEmbed(embed); message.AddFiles(new Dictionary { { Transcriber.GetFilename(ticket.id), file } }); await staffMember.SendMessageAsync(message); diff --git a/Commands/TranscriptCommand.cs b/Commands/TranscriptCommand.cs index 3f46a91..ea1067f 100644 --- a/Commands/TranscriptCommand.cs +++ b/Commands/TranscriptCommand.cs @@ -84,7 +84,7 @@ public class TranscriptCommand : ApplicationCommandModule await using FileStream file = new FileStream(Transcriber.GetPath(ticket.id), FileMode.Open, FileAccess.Read); DiscordMessageBuilder message = new DiscordMessageBuilder(); - message.WithEmbed(new DiscordEmbedBuilder + message.AddEmbed(new DiscordEmbedBuilder { Color = DiscordColor.Green, Description = "Ticket " + ticket.id.ToString("00000") + " transcript generated by " + command.Member.Mention + ".\n", @@ -101,7 +101,7 @@ public class TranscriptCommand : ApplicationCommandModule await using FileStream file = new FileStream(Transcriber.GetPath(ticket.id), FileMode.Open, FileAccess.Read); DiscordMessageBuilder directMessage = new DiscordMessageBuilder(); - directMessage.WithEmbed(new DiscordEmbedBuilder + directMessage.AddEmbed(new DiscordEmbedBuilder { Color = DiscordColor.Green, Description = "Transcript generated!\n" diff --git a/SupportChild.cs b/SupportChild.cs index 9e79771..cc9bc48 100644 --- a/SupportChild.cs +++ b/SupportChild.cs @@ -15,7 +15,19 @@ namespace SupportChild; internal static class SupportChild { // Sets up a dummy client to use for logging - public static DiscordClient discordClient = new DiscordClient(new DiscordConfiguration { Token = "DUMMY_TOKEN", TokenType = TokenType.Bot, MinimumLogLevel = LogLevel.Debug }); + private static readonly DiscordConfiguration config = new() + { + Token = "DUMMY_TOKEN", + TokenType = TokenType.Bot, + MinimumLogLevel = LogLevel.Debug, + AutoReconnect = true, + Intents = DiscordIntents.All, + LogTimestampFormat = "yyyy-MM-dd HH:mm:ss", + LogUnknownEvents = false + }; + + public static DiscordClient discordClient { get; private set; } = new(config); + private static SlashCommandsExtension commands = null; private static void Main() @@ -52,7 +64,6 @@ internal static class SupportChild { await discordClient.DisconnectAsync(); discordClient.Dispose(); - Logger.Log("Discord client disconnected."); } Logger.Log("Loading config \"" + Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "config.yml\""); @@ -81,16 +92,10 @@ internal static class SupportChild Logger.Log("Setting up Discord client..."); // Setting up client configuration - DiscordConfiguration cfg = new DiscordConfiguration - { - Token = Config.token, - TokenType = TokenType.Bot, - MinimumLogLevel = Config.logLevel, - AutoReconnect = true, - Intents = DiscordIntents.All - }; + config.Token = Config.token; + config.MinimumLogLevel = Config.logLevel; - discordClient = new DiscordClient(cfg); + discordClient = new DiscordClient(config); Logger.Log("Hooking events..."); discordClient.Ready += EventHandler.OnReady; diff --git a/SupportChild.csproj b/SupportChild.csproj index f7e609f..77d9f3f 100644 --- a/SupportChild.csproj +++ b/SupportChild.csproj @@ -2,7 +2,7 @@ Exe - 3.0.2.2 + 3.1.0.0 ellie_icon.ico net8.0 SupportChild.SupportChild @@ -19,7 +19,7 @@ https://cdn.discordapp.com/attachments/765441543100170271/914327948667011132/Ellie_Concept_2_transparent_ver.png LICENSE https://toastielab.dev/Emotions-stuff/SupportChild - 3.0.2 + 3.1.0 default @@ -31,16 +31,15 @@ - - - + + - + diff --git a/Transcriber.cs b/Transcriber.cs index e1981ce..ee2500b 100644 --- a/Transcriber.cs +++ b/Transcriber.cs @@ -24,19 +24,22 @@ internal static class Transcriber Channel channel = await discordClient.GetChannelAsync(new Snowflake(channelID)); Guild guild = await discordClient.GetGuildAsync(channel.GuildId); - ExportRequest request = new ExportRequest( - Guild: guild, - Channel: channel, - OutputPath: GetPath(ticketID), - Format: ExportFormat.HtmlDark, - After: null, - Before: null, - PartitionLimit: PartitionLimit.Null, - MessageFilter: MessageFilter.Null, - ShouldDownloadMedia: false, - ShouldReuseMedia: false, - DateFormat: "yyyy-MMM-dd HH:mm" - ); + ExportRequest request = new( + guild, + channel, + GetPath(ticketID), + null, + ExportFormat.HtmlDark, + null, + null, + PartitionLimit.Null, + MessageFilter.Null, + true, + false, + false, + "en-US", + true + ); await exporter.ExportChannelAsync(request); } diff --git a/lib/DiscordChatExporter.Core.dll b/lib/DiscordChatExporter.Core.dll index 938808d..0023b89 100644 Binary files a/lib/DiscordChatExporter.Core.dll and b/lib/DiscordChatExporter.Core.dll differ