From 0ce919117031eed2292eb9d52c5811b1eb11e61d Mon Sep 17 00:00:00 2001 From: Brendan McShane Date: Mon, 28 Nov 2022 17:13:42 -0500 Subject: [PATCH] Add disable title to slash commands --- Instagram Reels Bot/Modules/SlashCommands.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Instagram Reels Bot/Modules/SlashCommands.cs b/Instagram Reels Bot/Modules/SlashCommands.cs index 3cf6a4f..8d0b890 100644 --- a/Instagram Reels Bot/Modules/SlashCommands.cs +++ b/Instagram Reels Bot/Modules/SlashCommands.cs @@ -64,10 +64,10 @@ public SlashCommands(CommandHandler handler, Subscriptions subs, IConfiguration } //Create embed builder: - IGEmbedBuilder embed = new IGEmbedBuilder(response, Context.User.Username, HasSpoilers); + IGEmbedBuilder embed = (!string.IsNullOrEmpty(_config["DisableTitle"]) && _config["DisableTitle"].ToLower() == "true") ? (new IGEmbedBuilder(response)) : (new IGEmbedBuilder(response, Context.User.Username)); - //Create component builder: - IGComponentBuilder component = new IGComponentBuilder(response, Context.User.Id, _config); + //Create component builder: + IGComponentBuilder component = new IGComponentBuilder(response, Context.User.Id, _config); if (response.isVideo) { @@ -150,8 +150,8 @@ public async Task Profile([Summary("username", "The username of the Instagram ac return; } - IGEmbedBuilder embed = new IGEmbedBuilder(response, Context.User.Username); - IGComponentBuilder component = new IGComponentBuilder(response, Context.User.Id, _config); + IGEmbedBuilder embed = (!string.IsNullOrEmpty(_config["DisableTitle"]) && _config["DisableTitle"].ToLower() == "true") ? (new IGEmbedBuilder(response)) : (new IGEmbedBuilder(response, Context.User.Username)); + IGComponentBuilder component = new IGComponentBuilder(response, Context.User.Id, _config); await FollowupAsync(embed: embed.AutoSelector(), allowedMentions: AllowedMentions.None, components: component.AutoSelector()); }