Using the Discord.Net (v2.0.0) and Discord.Addons.Interactive (v2.2.0) packages in Visual Studio 2019
I'm new to c# so I probably have some terminology wrong. I'm trying to access the ReplyAsync and NextMessageAsync functions but VS can't find them. I get an error: "The name 'ReplyAsync' does not exist in the current context." I've tried referencing Discord, Discord.Commands, and Discord.Addons.Interactive in the Using header section. The examples I've seen don't refer to others. My code is below:
using Discord;
using Discord.Addons.Interactive;
using Discord.Commands;
using Discord.WebSocket;
using System;
using System.IO;
using System.Threading.Tasks;
namespace SWNABot
{
class Program
{
public static void Main(string[] args)...
private DiscordSocketClient client;
public async Task MainAsync()...
public async Task Test_NextMessageAsync()
{
await ReplyAsync("What is 2+2?");
var response = await NextMessageAsync();
if (response != null)
await ReplyAsync($"You replied: {response.Content}");
else
await ReplyAsync("You did not reply before the timeout");
}
}
}
I took this function from the sample code at https://github.com/foxbot/Discord.Addons.Interactive/blob/master/SampleApp/Modules/SampleModule.cs