【发布时间】:2021-03-13 11:06:22
【问题描述】:
您好,我一直在尝试在 Discord.net 中开发一个机器人,到目前为止它做得很好。 虽然我遇到的问题是我正在尝试使用 ITextChannel 中的 GetMessagesAsync 选项。 不幸的是,我不知道如何启动 RequestOptions,我尝试搜索 the documentation 却一无所获。
private ulong SearchMessageByMessageLink(ulong messageId, ITextChannel channel)
{
var messageList = GetMessagesAsync(100, channel,options:[{around:messageId}]);//fix
return 1;
}
public IAsyncEnumerable<IReadOnlyCollection<IMessage>> GetMessagesAsync(ulong id, ITextChannel channel, RequestOptions options)
{
CacheMode mode = CacheMode.AllowDownload;
IAsyncEnumerable<IReadOnlyCollection<IMessage>> messageList = channel.GetMessagesAsync(100, mode, options);
return messageList;
}
我想知道 Discord.net 是否可以使用 around:messageId 雪花功能。
【问题讨论】:
标签: c# discord.net