【发布时间】:2017-12-14 00:02:37
【问题描述】:
我在创建依赖关系图时遇到问题,因为我认为它是 Discord.Commands 的一部分。我所能找到的只是样本和机器人已经使用了与我相同的线路,但我的视觉工作室认为这是一个错误。
using System;
using System.Reflection;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using Discord.Commands;
namespace UCS_bot
{
public class Program
{
public static void Main(string[] args) =>
new Program().Start().GetAwaiter().GetResult();
private DiscordSocketClient client;
private CommandHandler handler;
public async Task Start()
{
client = new DiscordSocketClient(new DiscordSocketConfig() { LogLevel = LogSeverity.Info });
var token = "******";
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
var map = new DependancyMap();
map.Add(client);
它一直说我缺少 using 指令,但我 99% 确定它是 Discord.Commands。
我该如何解决这个问题?
【问题讨论】:
-
具体是哪一行说您缺少
using指令? -
右键单击,快速操作和重构...,选择使用...
标签: c# discord discord.net