如何使用自定义表情符号



我一直在尝试在嵌入消息中使用自定义表情符号,但不起作用

我试着使用表情符号甚至表情包,但它们都不起作用

var questionMark = new Emoji("<:questionmark:640216780689637390>");
await ReplyAsync($"{questionMark}");

如果我这样做,它只显示":问号:",但不显示表情符号,我希望表情符号显示

从文档粘贴的副本

public async Task SendAndReactAsync(ISocketMessageChannel channel)
{
var message = await channel.SendMessageAsync("I am a message.");
// Creates a Unicode-based emoji based on the Unicode string.
// This is effectively the same as new Emoji("💕").
var heartEmoji = new Emoji("U0001f495");
// Reacts to the message with the Emoji.
await message.AddReactionAsync(heartEmoji);
// Parses a custom emote based on the provided Discord emote format.
// Please note that this does not guarantee the existence of
// the emote.
var emote = Emote.Parse("<:thonkang:282745590985523200>");
// Reacts to the message with the Emote.
await message.AddReactionAsync(emote);
}

在表情符号类中,不需要放置"<"one_answers">"。所以你的代码应该像这个

var questionMark = new Emoji(":questionmark:640216780689637390");
await ReplyAsync($"{questionMark}");

相关内容

  • 没有找到相关文章

最新更新