Comments (15)
Userbotting is against ToS of both Discord and Midjourney, and is grounds for a permanent ban
-signed Midjourney dev
from twilight.
And a similar issue with PRESENCE_UPDATE
, missing field guild_id
, payload: {"t":"PRESENCE_UPDATE","s":3,"op":0,"d":{"user":{"username":"xyz","id":"123","global_name":null,"discriminator":"3218","avatar_decoration":null,"avatar":"0ed452de979d05d3be21f7a6549ba4ac"},"status":"offline","last_modified":1685661311926,"client_status":{},"broadcast":null,"activities":[]}}
from twilight.
I wasn't able to pinpoint what exact fields needed fixing for the presence update but I got it to work by adding #[serde(default)]
to all pub guild_id: Option<Id<GuildMarker>>
fields: rksm@1ac78cb
from twilight.
And one more: 2023-06-03T01:05:25.614067Z WARN midjourney_api_v2: error receiving event gateway event could not be deserialized: source=missing field
application_id at line 1 column 101, event={"t":"INTERACTION_CREATE","s":3,"op":0,"d":{"nonce":"1664800419089616897","id":"1114359151653568552"}}
It seems the fields token
, type
and application_id
are all optional: rksm@f5a7f56
from twilight.
And one more:
2023-06-03T01:05:25.614067Z WARN midjourney_api_v2: error receiving event gateway event could not be deserialized: source=missing field
application_idat line 1 column 101, event={"t":"INTERACTION_CREATE","s":3,"op":0,"d":{"nonce":"1664800419089616897","id":"1114359151653568552"}}
It seems the fields
token
,type
andapplication_id
are all optional: rksm@f5a7f56
Hmm that seems to go against what the documentation tells us https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure
from twilight.
For the background, I'm using twilight to interact with the midjourney bot. When posting a new /imagine
interaction, the InteractionCreate
event that comes back just contains an id and none field. twilight parses this as
InteractionCreate(
InteractionCreate(
Interaction {
app_permissions: None,
application_id: None,
channel: None,
channel_id: None,
data: None,
guild_id: None,
guild_locale: None,
id: Id<InteractionMarker>(1114365312637337740),
kind: None,
locale: None,
member: None,
message: None,
token: None,
user: None,
},
),
)
from twilight.
For the background, I'm using twilight to interact with the midjourney bot. When posting a new
/imagine
interaction, theInteractionCreate
event that comes back just contains an id and none field.
Does that mean that you are using it with a user token instead of a bot token?
from twilight.
Yes, I do.
from twilight.
We generally only support the bot API, any other usage will be largely unsupported. As it is not documented and is against the Terms of Service of Discord.
from twilight.
So what about the remaining deserialization issues?
from twilight.
So what about the remaining deserialization issues?
Do they happen when you connect with a bot token?
from twilight.
I have no idea but this is about #[serde(default)]
annotations of already optional fields. This stuff breaks because those fields are expected but not present.
from twilight.
Because they are documented to always be present when connecting with a bot user:
https://discord.com/developers/docs/topics/gateway-events#ready-ready-event-fields
https://discord.com/developers/docs/resources/guild#unavailable-guild-object
https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields
If you run into issues while connected with a bot account let us know.
from twilight.
Sorry to hear that. Anyway, thanks for your time.
from twilight.
Maybe put a reasonable UI on it then?
from twilight.
Related Issues (20)
- Signature validation utility HOT 7
- Failed event deserialization: image hash isn't in a discord image hash format
- String option trims prefixed zeros of integer input
- Lavalink v4 update will break twilight-lavalink HOT 3
- Better discoverability of the book
- `UpdateFollowup` falsely returns `EmptyBody` HOT 1
- Invalid UpdateRolePositions body
- Expose HeaderMap in addition to HeaderIter for twilight-http responses HOT 9
- [RFC] Flatten `PartialX` Types with `X`
- Support Media Channels
- Deserialization errors for members with joined_at=null HOT 1
- `Message.referenced_message` field doesn't exist or is `null` ambiguous
- Creating a ban does not delete any messages
- Investigate static HTTP form boundary
- Formatter macros HOT 10
- Editing a guild member (changing voice-channel) hangs indefinitely HOT 6
- Error message is unhelpful, and this doesn't require an error HOT 1
- Make `ListBody<T>` lazily deserializable HOT 4
- GuildCreate does not have guild_scheduled_event
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twilight.