discord / embedded-app-sdk

🚀 The Discord Embedded App SDK lets you build rich, multiplayer experiences as Activities inside Discord.
https://discord.com/developers/docs/activities/overview
MIT License
1.23k stars 172 forks source link

An error occurs "Failed to execute 'postMessage' on 'Window' " when execute DiscordSDK.commands.getChannel() #69

Open Daikonnbatake opened 6 months ago

Daikonnbatake commented 6 months ago

English (google translate): An error occurs when using the getChannel() function as shown below. I think the error is probably occurring when messages are passed between Discord Client and embedded-app-sdk.

This screenshot is taken when trying to get the voice channel. Strangely, this error occurs only for voice channels and textchannels that have at least one text message. Also, it seems that the channel data is being acquired correctly on the SDK side.

We would appreciate it if you could check it out. Thank you.

日本語 (original): 下記の通り getChannel() 関数を使用するとエラーが発生します。 おそらく Discord Client と embedded-app-sdk の間でメッセージを受け渡すタイミングで発生しているエラーだと思います。

このスクリーンショットはボイスチャンネルを取得しようとした際のものです。 奇妙なことに voice channel でも、textchannel でも text message が 1 件以上あるチャンネルでのみこのエラーが発生します。 またチャンネルのデータは SDK 側では正しく取得できているようです。

ご確認いただけますと幸いです。 よろしくお願いいたします。

const channelId = <my channel id>;
const result = await DiscordSDK.commands.GetChannel({ channel_id: channelId });

log

Daikonnbatake commented 5 months ago

English (google translate): This error seems to occur when using the MESSAGE_READ permission. Removing MESSAGE_READ fixed the error.

日本語 (original): このエラーは MESSAGE_READ 権限を使用すると発生するようです。 MESSAGE_READ を削除するとエラーが解消されました

matthova commented 5 months ago

Thank you for making this issue and describing the minimal repro. We're going to look into a patch for this