问题描述
我试图列出一个角色列表,但该列表很混乱,如果可能的话,有人会根据列表的排列顺序告诉我。 美好的一天:)
foreach(var roles in Client.GetGuild(Guild).Roles)
{
MessageBox.Show(String.Format("Role name: {0}",roles.Name));
}
解决方法
只需使用
even though you specified lossless compression,there will be differences because of the color conversion
,
对于使用Windows窗体软件的公会中的列表角色
ulong idg = Convert.ToUInt64(textbox1.text);
var guildid = _client.GetGuild(idg);
foreach (var role in guildid.Roles)
{
MessageBox.Show(role.Name);
}
对于不和谐的机器人
[Command("listrole")]
public async Task listRoleasync()
{
foreach (var role in Context.Guild.Roles)
{
await Context.Channel.SendMessageAsync(role.Name);
}
}