MarcoPolo0306
MarcoPolo0306

Reputation: 17

Send message to Discord server based on input to text boxes?

I am trying to make an application app with C# in Visual Studio. I need some help with this, I want to submit a template like this:

<discord tag>
Link: <link>
Description: <desc>

Any help is useful! Thanks!

Upvotes: 0

Views: 465

Answers (1)

OfirD
OfirD

Reputation: 10460

Say you want to message a link to an article:

public class Article
{
    public string Link { get; set; }
    public string Description { get; set; }
}

Then try:

// implement your required logic for getting the tag
string tag = GetTag();

// implement your required logic for getting the reference
Article article = GetLinkWithDescription();

// Prepare the message
string message = string.Join(
   "\n", 
   $"<@{tag}>", 
   $"Link: {article.Link}", 
   $"Description: {article.Description}"
); 

// send the message
await Context.Channel.SendMessageAsync(message);

Upvotes: 1

Related Questions