Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface IPostwmClass
- {
- Task<Dictionary<ButtonBuilder, Embed>> PostWMMessage(SocketUser user, string? l = null);
- // Define other methods used by InteractionHandler or other classes if needed
- }
- public class PostwmClass : IPostwmClass
- {
- private readonly IConfiguration _configuration;
- private readonly IUserTranslationsHandler _userTranslationsHandler;
- public PostwmClass(IConfiguration config, IUserTranslationsHandler userTranslationsHandler)
- {
- _configuration = config;
- _userTranslationsHandler = userTranslationsHandler;
- }
- public async Task<Dictionary<ButtonBuilder, Embed>> PostWMMessage(SocketUser user, string? l = null)
- {
- var t = _userTranslationsHandler;
- var id = user.Id;
- var embed = new EmbedBuilder()
- .WithTitle($":wave: {await t.T("verification_hello", id, l: l)}")
- .AddField($"**\n{await t.T("verification_whatoffer", id, l: l)}**",
- $":white_check_mark: {await t.T("verification_offer1", id, l: l)}\n" +
- $":white_check_mark: {await t.T("verification_offer2", id, l: l)}\n" +
- $":white_check_mark: {await t.T("verification_offer3", id, l: l)}\n" +
- $":white_check_mark: {await t.T("verification_offer4", id, l: l)}\n\n" +
- $":exclamation: {await t.T("verification_rules1", id, l: l, v: new string[] { $"<#{_configuration["rulesChannel"]}>" })}\n\n")
- .WithImageUrl("https://i.imgur.com/B0udNXR.png").WithColor(Color.Blue);
- var buttonBuilder = new ButtonBuilder()
- .WithLabel(await t.T("verification_button", id, l: l)).WithCustomId("application_apply").WithStyle(ButtonStyle.Success).WithEmote(Emoji.Parse(":envelope_with_arrow:"));
- try
- {
- var dictionary = new Dictionary<ButtonBuilder, Embed>
- {
- { buttonBuilder, embed.Build() }
- };
- return dictionary;
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.ToString());
- return null!;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement