So I'm trying to access a task form program.cs in form 1.cs but I cant find a way that works anywhere. Here is an example of what I want:
program.cs
private async void ConsoleSendMessage()
{
Console.WriteLine("Select the guild:");
var guild = GetSelectedGuild(_client.Guilds);
var textChannel = GetSelectedTextChannel(guild.TextChannels);
var msg = string.Empty;
while (msg.Trim() == string.Empty)
{
Console.WriteLine("Your message:");
msg = Console.ReadLine();
}
await textChannel.SendMessageAsync(msg);
}
And then I want to be able to run that task in form1.cs