question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[problem] using sendMessage(with emotes) via DiscordWebhookClient

See original GitHub issue

i want to use external/internal emotes in webhook response but it doesnt work for all emotes , so it doesnt properly work for me.

i am calling emotes with (<:id:id>) , so i dont know name but if i use this structure it works well when i replay to user via DiscordBot ; but in webhook responses only i see the text: :id: or :name: even i call with name like (<:name:id>) (bot has full permission)

here is my usage

e.Missions is an IEnumerable<Myclass> ToWebhookEmbed can convert to Embed type e.Missions.Select(p => p.ToWebhookEmbed() returns to IEnumerable<Embed>

var wbhooks = await guild.GetWebhooksAsync(RequestOptions);
 RestWebhook my_webhook = wbhooks.First();
DiscordWebhookClient wbClient = new DiscordWebhookClient(my_webhook );

 wbClient.SendMessageAsync(string.Empty, false, e.Missions.Select(p => p.ToWebhookEmbed()), "bot name", "bot image").Wait();

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
WorkingRobotcommented, Dec 20, 2018

In order to use external emotes, the bot must be in that guild. Webhooks, though, can only use emotes in the server it’s in.

1reaction
MAttila42commented, Feb 5, 2021

I know this is an old thread, but how is it possible that a javascript bot did EXACTLY what I and this guy needed? The bot straight up sent an emote from a different server USING A WEBHOOK. It searched its cache and sent what it found:

return client.emojis.cache.find(e => e.name == name);

SOMEHOW a webhook message appeared, showing an emote, that isn’t on the server.

Edit: I’ve been working on this all day now and found out why and how. This thread shouldn’t be closed saying “it’s impossible”. It’s possible. The webhook can use anything that sending bot has, so the external emojis too. BUT it doesn’t use the bot’s permissions. It only has the permissions of the everyone role. So all you need to do is give that the perm to send external emojis.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[problem] using sendMessage(with emotes) via ...
i want to use external/internal emotes in webhook response but it doesnt work for all emotes , so it doesnt properly work for...
Read more >
Recently Active 'discord.net' Questions
I am writing a discord bot using Discord.Net and C# and our server has many custom emotes in certain announcements. When I use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found