Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编辑文本频道的主题。我尝试使用DiscordChannel.ModifyAsync,但我不知道 anAction<ChannelEditModel>是什么。我该如何使用它?
DiscordChannel.ModifyAsync
Action<ChannelEditModel>
您可以使用 Lambda 表达式:
public async Task ModifyChannel(CommandContext ctx, ulong id, [RemainingText] string topic) { var chn = await ctx.Client.GetChannelAsync(id); Action<ChannelEditModel> action = new(x => x.Topic = topic); await chn.ModifyAsync(action); }