基本上,我为第一个Disord机器人写了代码(可能是错误的)。仅登录的基本版本将无法运行。它给我关于的错误找不到类型或名称空间名称'DiscordClient与“ LogMessageEventArgs”重复相同程序代码:using Discord;using Discord.Commands;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DiscordBot{ class Program{ static void Main(string[] args) { MyBot bot = MyBot(); } }}MyBot代码:using Discord;using Discord.Commands;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DiscordBot{ class MyBot { DiscordClient discord; public MyBot() { discord = new DiscordClient(x => { x.LogLevel = LogSeverity.Info; x.LogHandler = Log; }); discord.ExecuteAndWait(async () => { await discord.Connect("the token"); }); } private void Log (object sender, LogMessageEventArgs e) { Console.WriteLine(e.Message); } }}
1 回答
- 1 回答
- 0 关注
- 159 浏览
添加回答
举报
0/150
提交
取消