Code Monkey home page Code Monkey logo

Comments (15)

RedKinda avatar RedKinda commented on June 2, 2024 4

Userbotting is against ToS of both Discord and Midjourney, and is grounds for a permanent ban
-signed Midjourney dev

from twilight.

rksm avatar rksm commented on June 2, 2024

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.

rksm avatar rksm commented on June 2, 2024

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.

rksm avatar rksm commented on June 2, 2024

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.

Erk- avatar Erk- commented on June 2, 2024

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

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.

rksm avatar rksm commented on June 2, 2024

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.

Erk- avatar Erk- commented on June 2, 2024

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.

Does that mean that you are using it with a user token instead of a bot token?

from twilight.

rksm avatar rksm commented on June 2, 2024

Yes, I do.

from twilight.

Erk- avatar Erk- commented on June 2, 2024

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.

rksm avatar rksm commented on June 2, 2024

So what about the remaining deserialization issues?

from twilight.

Erk- avatar Erk- commented on June 2, 2024

So what about the remaining deserialization issues?

Do they happen when you connect with a bot token?

from twilight.

rksm avatar rksm commented on June 2, 2024

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.

Erk- avatar Erk- commented on June 2, 2024

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.

rksm avatar rksm commented on June 2, 2024

Sorry to hear that. Anyway, thanks for your time.

from twilight.

rksm avatar rksm commented on June 2, 2024

Maybe put a reasonable UI on it then?

from twilight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.