Giter Club home page Giter Club logo

discordrb's People

Contributors

brpeterman avatar kjcpaas avatar mackmm145 avatar meew0 avatar sarsntony avatar

Watchers

 avatar  avatar  avatar

discordrb's Issues

Missing data (VOICE_STATE_UPDATE)

This message is completely unimplemented. Here's an example of a user joining a channel:

{
  "t": "VOICE_STATE_UPDATE",
  "s": 62,
  "op": 0,
  "d": {
    "user_id": "102499714120826880",
    "token": "b497241bde14304d",
    "suppress": false,
    "session_id": "85ad37d0cb00877da4e9b78b6f361b12",
    "self_mute": true,
    "self_deaf": true,
    "mute": false,
    "guild_id": "101863722082930688",
    "deaf": false,
    "channel_id": "101863723735486464"
  }
}

Leaving a channel:

{
  "t": "VOICE_STATE_UPDATE",
  "s": 63,
  "op": 0,
  "d": {
    "user_id": "102499714120826880",
    "token": "b497241bde14304d",
    "suppress": false,
    "session_id": "85ad37d0cb00877da4e9b78b6f361b12",
    "self_mute": true,
    "self_deaf": true,
    "mute": false,
    "guild_id": "101863722082930688",
    "deaf": false,
    "channel_id": null
  }
}

Unmute+undeaf:

{
  "t": "VOICE_STATE_UPDATE",
  "s": 65,
  "op": 0,
  "d": {
    "user_id": "102499714120826880",
    "token": "d96966faafe91279",
    "suppress": false,
    "session_id": "85ad37d0cb00877da4e9b78b6f361b12",
    "self_mute": false,
    "self_deaf": false,
    "mute": false,
    "guild_id": "101863722082930688",
    "deaf": false,
    "channel_id": "101863723735486464"
  }
}

Mute:

{
  "t": "VOICE_STATE_UPDATE",
  "s": 66,
  "op": 0,
  "d": {
    "user_id": "102499714120826880",
    "token": "d96966faafe91279",
    "suppress": false,
    "session_id": "85ad37d0cb00877da4e9b78b6f361b12",
    "self_mute": true,
    "self_deaf": false,
    "mute": false,
    "guild_id": "101863722082930688",
    "deaf": false,
    "channel_id": "101863723735486464"
  }
}

Missing data (CHANNEL_CREATE)

Example:

{
  "t": "CHANNEL_CREATE",
  "s": 73,
  "op": 0,
  "d": {
    "type": "text",
    "topic": null,
    "position": 1,
    "permission_overwrites": [

    ],
    "name": "testchannel",
    "last_message_id": null,
    "is_private": false,
    "id": "103616534437429248",
    "guild_id": "101863722082930688"
  }
}

Missing data (READY)

Data in the READY message that is not being saved or used:

  • read_state
    • mention_count
    • last_message_id
    • id (seems to point to a guild ID)
  • guilds
    • voice_states
    • roles
    • presences
      • game_id
    • members
      • mute
      • deaf
      • joined_at
      • roles
      • direct link to an avatar file
    • icon
    • joined_at
    • channels
      • position
      • permissions
      • last_message_id
    • afk_timeout
    • afk_channel_id

Missing data (CHANNEL_DELETE)

Example:

{
  "t": "CHANNEL_DELETE",
  "s": 81,
  "op": 0,
  "d": {
    "type": "text",
    "topic": "",
    "position": 1,
    "permission_overwrites": [

    ],
    "name": "testchannel",
    "last_message_id": "103616806958166016",
    "is_private": false,
    "id": "103616534437429248",
    "guild_id": "101863722082930688"
  }
}

User data is not tracked per server

A bunch of User members are not tracked per server:

  • server_mute
  • server_deaf
  • self_mute
  • self_deaf
  • voice_channel

Any of these which are server-specific should either be converted to a hash or moved to another object (such as a Member).

Potential structure for User/Member:

Member contains a pointer to corresponding User.
User has pointers to corresponding Members in each server.
Servers contain Members, not Users.
Messages are from either Members or Users, depending on the context (private message vs channel message)/

Support roles and permissions

Roles in READY message:

        "roles": [
          {
            "position": -1,
            "permissions": 68608,
            "name": "@everyone",
            "id": "101863722082930688",
            "hoist": false,
            "color": 0
          },
          {
            "position": -1,
            "permissions": 66321439,
            "name": "admin",
            "id": "101883326079459328",
            "hoist": false,
            "color": 15158332
          },
          {
            "position": -1,
            "permissions": 36953088,
            "name": "member",
            "id": "101883580606607360",
            "hoist": false,
            "color": 0
          },
          {
            "position": -1,
            "permissions": 41155585,
            "name": "mod",
            "id": "102504105297059840",
            "hoist": false,
            "color": 3447003
          }
        ]

Roles for a single user:

        "members": [
          {
            "user": {
              "username": "Oyerth",
              "id": "101794296201494528",
              "discriminator": "2305",
              "avatar": "f220a1a41c2e2b3408f309d54753d7ae"
            },
            "roles": [
              "101883326079459328"
            ],
            "mute": false,
            "joined_at": "2015-10-09T02:10:04.260000+00:00",
            "deaf": false
          }

Permissions for a channel:

        "channels": [
          {
            "type": "text",
            "topic": "God damn it, Euix.",
            "position": 0,
            "permission_overwrites": [
              {
                "type": "role",
                "id": "101863722082930688",
                "deny": 0,
                "allow": 0
              }
            ],
            "name": "thelab",
            "last_message_id": "103705602961731584",
            "id": "101863722082930688"
          }

Role update:

{
  "t": "GUILD_ROLE_UPDATE",
  "s": 2,
  "op": 0,
  "d": {
    "role": {
      "position": -1,
      "permissions": 36953088,
      "name": "member",
      "id": "101883580606607360",
      "hoist": false,
      "color": 9936031
    },
    "guild_id": "101863722082930688"
  }
}

I assume GUILD_ROLE_CREATE and GUILD_ROLE_DELETE also exist, if they're anything like channels.

Role create:

{
  "t": "GUILD_ROLE_CREATE",
  "s": 8,
  "op": 0,
  "d": {
    "role": {
      "position": 4,
      "permissions": 36953089,
      "name": "new role",
      "id": "103923421166985216",
      "hoist": false,
      "color": 0
    },
    "guild_id": "101863722082930688"
  }
}

This is followed by a GUILD_ROLE_UPDATE to change the settings from their defaults.

Add role to member:

{
  "t": "GUILD_MEMBER_UPDATE",
  "s": 10,
  "op": 0,
  "d": {
    "user": {
      "username": "Overwatch",
      "id": "102899985732861952",
      "discriminator": "5470",
      "avatar": null
    },
    "roles": [
      "101883580606607360",
      "103923421166985216"
    ],
    "guild_id": "101863722082930688"
  }
}

Missing data (CHANNEL_UPDATE)

Example:

{
  "t": "CHANNEL_UPDATE",
  "s": 76,
  "op": 0,
  "d": {
    "type": "text",
    "topic": "",
    "position": 1,
    "permission_overwrites": [

    ],
    "name": "testchannel",
    "last_message_id": "103616806958166016",
    "is_private": false,
    "id": "103616534437429248",
    "guild_id": "101863722082930688"
  }
}

Roles are broken for multiple servers

Users are tracked outside of the context of a server, so their roles for each server are all mashed together. They should be tracked on a server-by-server basis.

Not a big deal at the moment, since roles and permissions don't do anything.

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.