finitereality / disccord Goto Github PK
View Code? Open in Web Editor NEWA Discord library for C++
License: MIT License
A Discord library for C++
License: MIT License
This issue will be used to track the status of the websocket client.
Flowchart for reference: http://i.imgur.com/Wy5wbGq.png
Unit tests are needed to ensure the code I'm writing actually works. This involves adding some stuff to the CMakeLists to allow building of unit tests.
We're probably missing something in the CMakeLists. I have no idea what's missing, though.
This is super duper tedious. I gave up after writing three.
List shamelessly stolen from Discord.Net
What tools should we use for generating documentation? What should the docs contain?
Keeping this here as a note to myself: this shouldn't be hard to add.
The endpoint(s) are open now, probably will be released (on canary) very soon:tm:, so may as well prepare to support this so it's not forgotten later.
NOTE: will update the issue's task list if more things end up being needed
1. disccord::models
audit_logs
modelstd::vector<audit_log_entry>
audit_log_entry
has a member std::vector<audit_log_change>
{
"users": ["<user models>"],
"audit_log_entries": [{
"target_id": "<?snowflake>",
"user_id": "<snowflake>",
"id": "<snowflake>",
"action_type": "<int enum>",
"changes": [{
"?old_value":"<snowflake>/<string>/<bool>/<int>",
"new_value":"<snowflake>/<string>/<bool>/<int>",
"key":"<key_types>"
}]
}]
}
key_types
:{
NAME: "name",
ICON_HASH: "icon_hash",
SPLASH_HASH: "splash_hash",
OWNER_ID: "owner_id",
REGION: "region",
AFK_CHANNEL_ID: "afk_channel_id",
AFK_TIMEOUT: "afk_timeout",
MFA_LEVEL: "mfa_level",
WIDGET_ENABLED: "widget_enabled",
WIDGET_CHANNEL_ID: "widget_channel_id",
VERIFICATION_LEVEL: "verification_level",
EXPLICIT_CONTENT_FILTER: "explicit_content_filter",
DEFAULT_MESSAGE_NOTIFICATIONS: "default_message_notifications",
VANITY_URL_CODE: "vanity_url_code",
POSITION: "position",
TOPIC: "topic",
TYPE: "type",
BITRATE: "bitrate",
PERMISSION_OVERRIDES: "permission_overrides",
ROLES_ADD: "$add",
ROLES_REMOVE: "$remove",
NICK: "nick",
DEAF: "deaf",
MUTE: "mute",
PERMISSIONS: "permissions",
COLOR: "color",
HOIST: "hoist",
MENTIONABLE: "mentionable",
CODE: "code",
CHANNEL_ID: "channel_id",
INVITER_ID: "inviter_id",
MAX_USES: "max_uses",
USES: "uses",
MAX_AGE: "max_age",
TEMPORARY: "temporary",
APPLICATION_ID: "application_id",
AVATAR_HASH: "avatar_hash",
ID: "id",
PERMISSIONS_GRANTED: "allow",
PERMISSIONS_DENIED: "deny",
REASON: "reason"
}
action_type
enums:{
ALL: null, (in our case, we will have ALL map to 0)
GUILD_UPDATE: 1,
CHANNEL_CREATE: 10,
CHANNEL_UPDATE: 11,
CHANNEL_DELETE: 12,
CHANNEL_OVERWRITE_CREATE: 13,
CHANNEL_OVERWRITE_UPDATE: 14,
CHANNEL_OVERWRITE_DELETE: 15,
MEMBER_KICK: 20,
MEMBER_PRUNE: 21,
MEMBER_BAN_ADD: 22,
MEMBER_BAN_REMOVE: 23,
MEMBER_UPDATE: 24,
MEMBER_ROLE_UPDATE: 25,
ROLE_CREATE: 30,
ROLE_UPDATE: 31,
ROLE_DELETE: 32,
INVITE_CREATE: 40,
INVITE_UPDATE: 41,
INVITE_DELETE: 42,
WEBHOOK_CREATE: 50,
WEBHOOK_UPDATE: 51,
WEBHOOK_DELETE: 52,
EMOJI_CREATE: 60,
EMOJI_UPDATE: 61,
EMOJI_DELETE: 62
}
action_type
s, will build an enum class audit_logs_action_type
.2. disccord::rest
GET /guilds/{guild.id}/audit-logs
limit: <int> (default is 50, can be 1-100)
query: <string> "before"/"after"
id : <snowflake>
action_type: <integer>
All future code should be wrapped to 80 columns (including line terminators: we use line-feeds, so that means 79 columns available for code).
This is to make the code easier to read on a single screen without having to scroll horizontally.
Most importantly, the section on Constructors. This means defining appropriate ctors for types, or deleting them if not appropriate.
I realized this test case wasn't being covered in the unit tests atm. Here is some information in why I think there may be an issue. Let me know if you want more info/tests to be sure.
full_url
correctly, and will break when calling the api method.full_url
, but it seems the major parameter in bucket_url
actually takes the value. this won't break any endpoints, since we only use full_url
, but will still break unit tests.For routes like test 1 and 2, as a quick "fix", I am just turning them into a single major/minor param for now. (i believe it only affects these 2 exact routes in question)
1. Tested this scenario:
auto myRoute = get_route("PUT", "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me",
"1234567890", "0987654321", "%E2%AD%90");
Error
REQUIRE( myRoute.full_url == "/channels/1234567890/messages/0987654321/reactions/%E2%AD%90/@me" )
with expansion:
"/channels/1234567890/messages/0987654321/reactions/%E2%AD%90"
==
"/channels/1234567890/messages/0987654321/reactions/%E2%AD%90/@me"
2. Tested this scenario:
auto myRoute = get_route("DELETE", "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}",
"1234567890", "0987654321", "%E2%AD%90", "4321098765");
Error
due to unexpected exception with message:
basic_string::replace: __pos (which is 18446744073709551615) > this->size()
(which is 60)
3. Tested this scenario:
get_route("GET", "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}",
"1234567890", "0987654321", "%E2%AD%90");
Error
REQUIRE( myRoute.bucket_url == "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}" )
with expansion:
"/channels/1234567890/messages/{message.id}/reactions/{emoji}"
==
"/channels/{channel.id}/messages/{message.id}/reactions/{emoji}"
4. Tested this scenario:
auto myRoute = get_route("DELETE", "/channels/{channel.id}/messages/{message.id}/reactions",
"1234567890", "0987654321");
Error
REQUIRE( myRoute.bucket_url == "/channels/{channel.id}/messages/{message.id}/reactions" )
with expansion:
"/channels/1234567890/messages/{message.id}/reactions"
==
"/channels/{channel.id}/messages/{message.id}/reactions"
5. Tested this scenario:
auto myRoute = get_route("GET", "/guilds/{guild.id}/members?before={user}&limit={limit}",
"1234567890", "0987654321", "100");
Error
REQUIRE( myRoute.bucket_url == "/guilds/{guild.id}/members?before={user}&limit={limit}" )
with expansion:
"/guilds/1234567890/members?before={user}&limit={limit}"
==
"/guilds/{guild.id}/members?before={user}&limit={limit}"
How can someone learn this library when there are no docs?
See Travis for an example of what occurs.
Building in Debug mode seems to mean that everything is fine, at least for me.
Some areas are missing const
where the values returned/used/etc are not modified and so should be const.
This issue will be used to track the status of the REST API.
GET /gateway
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.