I am making a C# bot and what it basically does is send messages to a discord webhook. To my bot I added the question "How many links does the message need to have" For example: 1 line = "Message" 3 lines = "Message" "Message" "Message"
I know how to do that. But, there is multiple things someone can choose from. I have set the limit to 10 I dont know how to make the string as much as needed.
Do I need to use switch cases, or if else statements?
AmountOfLines is user input how many lines MessageToSend it the message that will be sent Message is the user input for the message
So I did
String MessageToSend
if(AmountOfLines == 1)
{
MessageToSend = Message;
}
if(AmountOfLines == 2)
{
MessageToSend = Message + Environment.NewLine + Message;
}
And so on. But the MessageToSend in the lines after the code shown before just acts like it is never seen before. It shows Error use of unassigned local variable "MessageToSend"
I want to know what way i need to use to give the string different text depending on an input.
If anything is wrong about question, tell me in comments and dont close it becausr it has happened many times.. I am new.