You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
twilight_http as of revision 561bebb's ListApplicationEmojis does not get deserialised correctly upon awaiting and calling .model()/.models() on it, and it raises DeserializeBodyError { kind: Deserializing, source: Some(Error("invalid type: map, expected a sequence", line: 1, column: 0)) }.
Steps to reproduce
Copy the minimal bot setup as stated in the twilight-gateway example here. Pin twilight-http, twilight-gateway and twilight-model to revision 561bebb.
Apply the following diff:
31a32,35> let app = client.current_user_application().await?.model().await?;> let emojis = client.get_application_emojis(app.id).await?.models().await?;> tracing::info!(?emojis);>
Prepare a bot account.
Run the bot via running DISCORD_TOKEN="..." cargo run, replacing ... with the bot's token.
Expected Behaviour
The application emojis should be logged in the console.
Actual Behaviour
The bot process shortly exits after running with the following error:
Error: failed to deserialize response body
Caused by:
invalid type: map, expected a sequence at line 1 column 0
Summary
twilight_http
as of revision 561bebb'sListApplicationEmojis
does not get deserialised correctly upon awaiting and calling.model()
/.models()
on it, and it raisesDeserializeBodyError { kind: Deserializing, source: Some(Error("invalid type: map, expected a sequence", line: 1, column: 0)) }
.Steps to reproduce
twilight-gateway
example here. Pintwilight-http
,twilight-gateway
andtwilight-model
to revision 561bebb.DISCORD_TOKEN="..." cargo run
, replacing...
with the bot's token.Expected Behaviour
The application emojis should be logged in the console.
Actual Behaviour
The bot process shortly exits after running with the following error:
Additional Information
The Discord API Documentation states that
GET /applications/{application.id}/emojis
returns an object containing a list of emoji objects for the given application under theitems
key, not a list itself (In contrast toGET /guilds/{guild.id}/emojis/{emoji.id}
). This may be the cause of the issue, as bothListApplicationEmojis
andGetEmojis
has the output of typeResult<Response<ListBody<Emoji>>, Error>
.The text was updated successfully, but these errors were encountered: