【问题标题】:Discord.Net DependencyMap issueDiscord.Net DependencyMap 问题
【发布时间】: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


【解决方案1】:

这可能是一个错字,应该是DependencyMap 而不是DependancyMap

https://discord.foxbot.me/docs/api/Discord.Commands.DependencyMap.html

【讨论】:

猜你喜欢
  • 2017-02-17
  • 1970-01-01
  • 1970-01-01
  • 2019-05-13
  • 2021-09-13
  • 2019-02-08
  • 2021-04-08
  • 2019-05-10
  • 2020-10-03
相关资源
最近更新 更多