brpeterman / discordrb Goto Github PK
View Code? Open in Web Editor NEWThis project forked from discordrb/discordrb
Discord API for Ruby
License: MIT License
This project forked from discordrb/discordrb
Discord API for Ruby
License: MIT License
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"
}
}
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"
}
}
Data in the READY message that is not being saved or used:
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"
}
}
A bunch of User members are not tracked per server:
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)/
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"
}
}
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"
}
}
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.