Khaaz / Cross-Server-Bot

Cross-Server bot - Link discord channels between them across servers.
MIT License
34 stars 15 forks source link

What is with this "webhook unavailable" message when an embed is sent #21

Open Endomou opened 3 years ago

Endomou commented 3 years ago

Hi! this is a very nice bot it took me a while to get how it works though but I got it working and I used this to link a discord channel of my mc server so it sends embeds if someone joins the server and if the server starts or stops but it says webhook unavailable in (server name) image

Khaaz commented 3 years ago

This most likely means that for this specific server the webhook doesn't work. It can be because of a bug of another sort, but in 90% of case it just mean that your config for this webhook is not correct (invalid token or id). Double check your config and make sure the webhook is correctly set-up. Make sure the bot has sufficient permissions as well. In case this issue still happens after you triple checked and you are 100% sure the webhook is correctly setup in your config and in your server, you can come back here for further investigations.

Endomou commented 3 years ago

alright I'm pretty sure the webhook id is fine because I tried swapping the webhook id and token of the two servers and from my testing what happened was the bot was linking the channel to itself which means it was sending the message to the same channel now when I swapped the webhook id and token back it was back to normal.

Normal webhook

Swapped webhook

also the problem is only that the bot can't copy the embed from the minecraft bot and send it to the other server. but it can send messages normally from one server to other if it's just text or images.

Endomou commented 3 years ago

I tested it more, it seems embeds from bots are the only messages that can't be copied but images from text and images and links can be sent to the other server.

Khaaz commented 3 years ago

I see, that makes sense. An easy fix is to stop all messages from bot, or prevent bots from talking in the channel. I apparently have not added support for embeds. It's basically trying to send an empty message which fails. I'll add that to the TODO list. Thanks for the report, this is a valid issue 👍🏻

joeydoesthings commented 3 years ago

Yeah this message is really annoying. if it could at least have a disable function in the config or something I'd really appreciate it.

Khaaz commented 3 years ago

The simplest way is to actually disable bots from sending messages in the configs Otherwise you can remove these lines here: https://github.com/Khaaz/Cross-Server-Bot/blob/master/src/utils.js#L59-L67