17 Replies
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
You just send a post request to the webhook url with the content as JSON in the body of the request.
Make HTTP requests with the HttpClient - .NET
Learn how to make HTTP requests and handle responses with the HttpClient in .NET.
There are probably also some webhook libraries already made for C#
Minimal example:
(obviously you should replace the
webhookUrl
string with your actual webhook URL)Records!
ty
btw what does
record WebhookContent(string Content);
do?
oh i realize
what is a recordIt's like a class, but it only has one property called
Content
figured it out
thanks
You could replace it with this instead if you wanted to
The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
Yes, you can only
await
a Task<T>
inside an async methodthat doesnt tell me much
What does your code look like?
SendMessage needs to be
async
async Task SendMessage
alright
ty
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.