You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awaitctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command only works in <#{Program.cfgjson.InsiderInfoChannel}>!",ephemeral:true);
11
+
return;
12
+
}
13
+
14
+
DiscordComponent[]buttons=
15
+
[
16
+
newDiscordButtonComponent(DiscordButtonStyle.Primary,"insiders-info-roles-menu-callback","Choose your Insider roles"),
17
+
newDiscordButtonComponent(DiscordButtonStyle.Secondary,"insiders-info-chat-btn-callback","I just want to chat for now")
18
+
];
19
+
20
+
varbuilder=newDiscordInteractionResponseBuilder()
21
+
.WithContent($"{Program.cfgjson.Emoji.Insider} Choose your Insider roles here! Or, you can choose to chat in <#{Program.cfgjson.InsidersChannel}> without being notified about new builds.")
awaite.Message.ModifyAsync(newDiscordMessageBuilder().WithContent($"{cfgjson.Emoji.Success} Override successfully added. <@{newOverwrite.Id}> already had an override in <#{pendingOverride.ChannelId}>, so here are their new permissions:\n**Allowed:** {newOverwrite.Allowed}\n**Denied:** {newOverwrite.Denied}"));
202
202
}
203
+
elseif(e.Id=="insiders-info-roles-menu-callback")
204
+
{
205
+
// Shows a menu in #insider-info that allows a user to toggle their Insider roles
206
+
207
+
// Defer interaction
208
+
awaite.Interaction.DeferAsync(ephemeral:true);
209
+
210
+
// Fetch member
211
+
varmember=awaite.Guild.GetMemberAsync(e.User.Id);
212
+
213
+
// Fetch Insider roles to check whether member already has them
awaitmember.ReplaceRolesAsync(memberRoles,"Applying Insider roles chosen in #insiders-info");
287
+
288
+
awaite.Interaction.CreateFollowupMessageAsync(newDiscordFollowupMessageBuilder().WithContent($"{cfgjson.Emoji.Success} Your Insider roles have been updated!").AsEphemeral(true));
289
+
}
290
+
elseif(e.Id=="insiders-info-chat-btn-callback")
291
+
{
292
+
// Button in #insiders-info that checks whether user has 'insiderChat' role and asks them to confirm granting/revoking it
.WithContent($"{cfgjson.Emoji.Warning} Please note that <#{cfgjson.InsidersChannel}> is **not for tech support**! If you need tech support, please ask in the appropriate channels instead. Press the button to acknowledge this and get the {insiderChatRole.Mention} role.")
awaite.Interaction.EditFollowupMessageAsync(e.Message.Id,newDiscordWebhookBuilder().WithContent($"{cfgjson.Emoji.Success} You have been given the {insiderChatRole.Mention} role!"));
awaite.Interaction.EditFollowupMessageAsync(e.Message.Id,newDiscordWebhookBuilder().WithContent($"{cfgjson.Emoji.Success} You have been removed from the {insiderChatRole.Mention} role!"));
348
+
}
203
349
else
204
350
{
205
351
awaite.Interaction.CreateResponseAsync(DiscordInteractionResponseType.ChannelMessageWithSource,newDiscordInteractionResponseBuilder().WithContent("Unknown interaction. I don't know what you are asking me for.").AsEphemeral(true));
0 commit comments