我的异常表明用户= null,但我不明白为什么? UserId在调试器中传递
private async Task ReactionAdd(Cacheable<IUserMessage, ulong> cache, ISocketMessageChannel socketMessageChannel, SocketReaction reaction)
{
if (reaction.MessageId == 771361839917170748)
{
var emote = Emote.Parse("<:NepSmug:740928682310500412>").ToString();
if (reaction.Emote.ToString() == emote)
{
var sockettextChannel = socketMessageChannel as SocketTextChannel;
ulong roleid = 741342300499738715;
var role = sockettextChannel.Guild.GetRole(roleid);
var user = sockettextChannel.Guild.GetUser(reaction.UserId);
await user.AddRoleAsync(role);
}
}
}