jlnpinheiro/discord-webhook-client

How can I split this into to webhooks

JustinWrld opened this issue · 5 comments

``public` async void RoundBtn1_Click(object sender, EventArgs e)
{
MessageBox.Show("Your ticket has been sent!" + Environment.NewLine + Environment.NewLine + "Please allow up to 24 hours for our staff to reply to your message and please make sure your discord dms are open.");

        // Create an instance of the class DiscordWebhookClient with your Discord webhook URL.
        var client = new JNogueira.Discord.Webhook.Client.DiscordWebhookClient("https://discord.com/api/webhooks/");
    // Create your DiscordMessage with all parameters of your message.
    var message = new DiscordMessage(
        "New Ticket",
        username: "//",
        avatarUrl: "//",
        tts: false,
        embeds: new[]
    {
                new DiscordMessageEmbed(
        "User Information",
        color: 3843043,
        author: new DiscordMessageEmbedAuthor("//"),
        url: "//",
        description: "Coded By: //",
        fields: new[]
        {
            new DiscordMessageEmbedField("User:", ResponseInformation.loginresponse.UserName),
            new DiscordMessageEmbedField("Email:", ResponseInformation.loginresponse.Email),
            new DiscordMessageEmbedField("//:", //()),
            new DiscordMessageEmbedField("Discord :", tbDiscord.Text),
            new DiscordMessageEmbedField("Subject:", cbSubject.Text),
            new DiscordMessageEmbedField("Message:", tbMessage.Text),
            new DiscordMessageEmbedField("Version: 2.3")

        },

        footer: new DiscordMessageEmbedFooter("//")


            )

        }

    );
      
   
       await client.SendToDiscord(message);
        this.Close();
    
    }

``
all the // means the information I have cut out

if i would have to split it up then i would like to make this part of the 1st webhook
new DiscordMessageEmbedField("User:", ResponseInformation.loginresponse.UserName), new DiscordMessageEmbedField("Email:", ResponseInformation.loginresponse.Email), new DiscordMessageEmbedField("//:", //()),
and the rest as a second webhook

Hi @JustinWrld
You cannot split one message in 2 webhooks. Can you send 2 messages (first with webhook "1" and secound with webhook "2")?
Ok?

Hi @JustinWrld
You cannot split one message in 2 webhooks. Can you send 2 messages (first with webhook "1" and secound with webhook "2")?
Ok?
@jlnpinheiro
yeah i was think of doing that but i don't understand how i will do that

@jlnpinheiro do you by change have an example for what you were talking about

@JustinWrld lock at this code above:

var client1 = new JNogueira.Discord.Webhook.Client.DiscordWebhookClient("URL webhook 1");
var message1 = new DiscordMessage(...);
await client1.SendToDiscord(message1);
...
var client2 = new JNogueira.Discord.Webhook.Client.DiscordWebhookClient("URL webhook 2");
var message2 = new DiscordMessage(...);
await client2.SendToDiscord(message2);

Can I help you?

perfect ill try that out i will let you know