jlnpinheiro / discord-webhook-client Goto Github PK
View Code? Open in Web Editor NEWSimple client to send messages using a Discord webhook.
Simple client to send messages using a Discord webhook.
Doesn't work for me. I set up the project and copied the demo code but it doesn't send anything and not throwing any errors.
.NET Framework 4.8, webhook url is valid. I even tried sending a simple message without any embeds or emojis, same result.
Am I missing something?
Would it be possible to use this without having to send text alongside the embed message. As leaving blank throws a error
``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
I think its better to use .NET 7 (If I said the correct version) I got the error that said the code is too old
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.