Commit Graph

272 Commits

Author SHA1 Message Date
Gus Caplan
57977b063e channel stuff (#1775)
* channel stuff

* abstract channel creation

* Update Channel.js

* Update Channel.js

* Update Channel.js

* Update Guild.js

* Update Constants.js

* e
2017-08-13 13:57:25 +02:00
SpaceEEC
b2c7fcb603 Add support for new game types (#1777) 2017-08-13 13:56:45 +02:00
Gus Caplan
3ba224900f new application stuff very hype (#1764)
* application stuff, more to come

* docstrings

* Update Message.js
2017-08-11 19:09:06 +02:00
SpaceEEC
d9262f2682 Added and fixed a bunch of docs stuff (#1767)
- Fixed a common copy paste fail `the the <thing>` in various places
- Apparently I can't type Resolvable correctly,
Fixed that wherever applicable
- Documented GroupDMChannel#nicks so that it will be displayed on the docs
- GroupDMChannel#icon is nullable
- Removed empty InviteOptions typdef, as its properties are now documented in GuildChannel#createInvite
- MessageMentions#channels is no longer nullable
- RoleData#permissions takes a PermissionResolvable or an array of them
- Webhook#avatar is nullable
- Added HTTPOptions typedef and added it to ClientOptions typedef
- ClientUserChannelOverride#muted is for a channel and not a guild directly
2017-08-10 20:31:10 +02:00
SpaceEEC
fa5c4efa2b Fixed a bunch of ClientUserGuildSettings stuff and its docs (#1758) 2017-08-10 01:25:24 +02:00
Gus Caplan
e5be902568 where we're going we don't need referrers (#1749) 2017-08-04 10:46:10 +02:00
SpaceEEC
abfda7c3cc Fixed ClientUser#createGroupDM on user accounts and added some more GroupDMChannel stuff (#1747)
* ClientUser#createGroupDM now works like the docs states on user accounts

* Added GroupDMChannel#setIcon and fixed null handling for the channel name

* Added an s

* Don't resolve when icon is falsy and removed useless name trimming

* Removed now unnecessary name constant

* vscode being great

* Added GroupDMChannel#iconURL
2017-08-04 09:17:46 +02:00
stupid cat
b8034525e3 Add user_guild_settings support (#1365)
* user guild settings

* Use direct collection

* I'm a goof

* double goof

* Structure properties

* Forgot to register listener

* wrong class names

* No more get in docs

* avoid waterfalls, bot checks

* trycatch

wow i thought i already did this :notlikecat:

* 👀

* Update ClientUser.js

* Update ClientUserGuildSettings.js

* Update UserGuildSettingsUpdate.js

* Update ClientUserChannelOverride.js

* Update ClientUserGuildSettings.js
2017-08-01 04:28:15 +02:00
SpaceEEC
11556c0b3b Moved all error strings to src/errors/messages and a few other things (#1695)
* Added missing error messages
As well as `Guild#setRolePosition` and `Guild#setChannelPosition`'s first arg validation
And fixed a typo in `Guild#setChannelPosition`
`roles` -> `channels`

* Reverted collection and Util constructors

* Removed leftover messages
Should have been in the second commit.

* It's a single invalid permission and removed unused flag error

* Fix INVALID_TOKEN -> TOKEN_INVALID as of #1703
2017-07-21 02:27:19 +02:00
FireController1847
e50bf2cdad Fix Recommended Shards (#1672) 2017-07-10 10:37:31 +01:00
Gus Caplan
e3cd000ec0 update http options to fit discord spec (#1656)
* Update Constants.js

* Update APIRequest.js

* Update Invite.js

* Update Constants.js
2017-07-05 09:10:06 +01:00
Gus Caplan
f8a1f2c23b fix this again (#1655) 2017-07-04 03:58:54 +02:00
Gus Caplan
e57bfc9313 undefined check to merge default (#1654) 2017-07-04 03:48:20 +02:00
SpaceEEC
c42e53d70d Fixed User#fetchProfile, UserProfile#premium and added #flags (#1629)
* Fixed User#fetchProfile, UserProfile#premium and added #flags

* made UserProfile#flags a getter and stored the raw bitfield under UserProfile#_flags

* lowercased Flags
2017-07-04 00:28:53 +02:00
aemino
2b56de7728 Expose DiscordAPIError and API error constants (#1641)
* Expose DiscordAPIError

* Expose API error constants

* Add typedef for APIError

* Integligently forgot to save file
2017-07-02 01:20:35 +01:00
Gus Caplan
63e54982f4 Errors Standardization (#1246)
* errors and stuff

* more errors

* all the errors

* fix build
2017-06-25 18:48:05 +01:00
Gus Caplan
cada8763a9 clean up cdn resources (#1597)
* Create Constants.js

* Update Constants.js
2017-06-24 23:32:48 +01:00
Amish Shah
b694ab1b80 Add internal sharding options 2017-06-11 11:36:58 +01:00
SpaceEEC
d6041f9fb3 Added Client#status and Message#type typedefs (#1571)
* typedef for MessageTypes and linked Client#status to Status

* should be singular

* typedef for Voiceconnection#status
2017-06-09 16:27:49 +02:00
Évelyne Lachance
06f4c679d3 Add count optional argument to Collection methods (#1552)
* Add `count` optional argument to Collection methods

[NON-BREAKING CHANGE]
An optional `count` argument is added to the following methods:
- random() and randomKey()
- first() and firstKey()
- last() and lastKey()

If `count` is used, the method returns an array instead of only the value. Performance impact non-existent for existing code. Performance for returning an array has been measured and this is the fastest I could find (array[i] = value is faster than array.push()).

* Update Collection.js

Fixed spacing/line length errors according to suggestions by codacy/pr

* Fixed docs

Added proper `@returns {*|Array}` as the methods might return either. Also added params where missing (whoops)

* Further doc fixes

Per Crawl's comments, fixed (i + 1) spacing as well as fixed {Integer} to {number}

* random() and randomKey() fix

Per Hydra's comment, random() and randomKey() now ensures unique values.
I've also resolved potential issues with requesting a count higher than the collection size. A collection with 10 items will only ever return at most 10 items using the `count` property.

* Can I facepalm harder

Had wrong header comments ^_^

* Fixed for "values/value" and Omited

Also, added "Positive" integer check.

* looks like I "omitted" a change, there.

* Update Collection.js

* Update Collection.js

* Update Collection.js
2017-06-07 18:52:41 -04:00
Schuyler Cebulskie
28dc3e6a2e Utilise Object.values for Permissions.ALL 2017-06-02 00:36:34 -04:00
PhoenixShay
22e8237bf1 Fix Util.js : fetchRecommendedShards() (#1532)
* Fix Util.js : fetchRecommendedShards()

I'm not sure who thought this was a good idea, but by removing gateway, it broke fetchRecommendedShards() in Util.js as it uses ${Constants.Endpoints.gateway.bot}.

* Update Constants.js

* Update Constants.js

* Update Util.js

* Update Constants.js
2017-05-28 22:54:56 +02:00
Drahcirius
4292134647 Refactored static resolvers to Util (#1517)
* ready event will now throw errors properly

* ws login rejection fix

* moved static resolves to util
2017-05-23 12:18:18 +02:00
Gus Caplan
0baa59b679 Internal API Request Rewrite (#1490)
* start rewrite

* converted guilds

* more changes

* convert GuildMember

* convert User and remove friend methods which kill people

* convert more stuff

* even more stuff

* make things nicer

* speed and fixes and stuff

* almost finished

* fix

* Update Client.js

* uwu

* Update RESTMethods.js

* message editing

* fix router

* fix issue with references

* message delete reason

* move message sending

* fix dm

* message splitting

* NO MORE REST METHODS

* Update Client.js

* Update WebhookClient.js

* remove all those endpoints from the constants

* Update ClientUser.js

* Update ClientUser.js

* fixes

* Update ClientUser.js

* complaiancy

* all sort of fixes

* merge master (#1)

* Fix Permissions now that member is deprecated (#1491)

* removing more deprecation leftovers (#1492)

* Fix MessageCollectors

* Fix awaitMessages (#1493)

* Fix MessageCollector#cleanup

* Fix MessageCollector#postCheck

* Add max option back for safety

* Update Invite.js (#1496)

* guild setPosition missing docs (#1498)

* missing docs

* update return docs

* indent

* switched .invites for the apirouter and invite.js

* make multiple options an object

* Update ClientUser.js

* fix nicks

* Update WebhookClient.js
2017-05-21 07:04:19 +02:00
Crawl
79253544ea Relink permission#FLAGS on docs 2017-05-20 21:04:31 +02:00
Crawl
ca926ee404 Remove all deprecated methods / props 2017-05-14 20:15:55 +02:00
Gus Caplan
6ac2252794 make default avatar resolving better (#1484)
* Update Constants.js

* Update User.js

* Update Constants.js

* Update Constants.js
2017-05-13 17:41:32 +02:00
SpaceEEC
d9e5bdea19 added Invite#presenceCount and Invite#memberCount (#1460)
* added Invite#online and Invite#memberCount

* requested change
2017-05-05 23:24:02 +02:00
SpaceEEC
e6437388cf Endpoints.Guild(...).Emoji(...) should not use CDN (#1462) 2017-05-05 02:22:55 +02:00
Gus Caplan
35ef9cd33d Add Guild#nameAcronym and make avatar/iconURLs into functions (#1144)
* Guild#iconURL(format, size);
* OAuth2Application#iconURL(format, size);
* User#iconURL(format, size);
2017-05-01 20:37:00 +01:00
Amish Shah
8bab9fb122 Add VIEW_AUDIT_LOG to Permissions docs 2017-05-01 11:15:09 +01:00
Crawl
ac92d2cecc Improve docs a bit 2017-04-30 04:30:44 +02:00
Amish Shah
1a69331f0c Merge branch 'master' of https://github.com/hydrabolt/discord.js 2017-04-29 21:09:56 +01:00
Amish Shah
c40252381b Deprecate all the things 2017-04-29 21:09:53 +01:00
Gus Caplan
4127cf6e40 Experimental support for Audit Logs (#1403)
* start audit logs

* make better var types so gawdl3y doesn't shit on this

* add constructor stuff

* make more changes

* add entry creation

* add methods

* make it all work hopefully

* aaa

* aaaa

* i wish i could test this locally

* fix users, guild when i feel like it

* make guild prop non-enumerable

* make better types

* change nouns

* e

* Update GuildAuditLogs.js

* Update GuildAuditLogs.js

* Update GuildAuditLogs.js

* eek

* Update GuildAuditLogs.js

* Update GuildAuditLogs.js

* friggin trailing spaces

* Update GuildAuditLogs.js

* docs!

* Update GuildAuditLogs.js

* reason stuff

* Update GuildAuditLogs.js

* Update GuildAuditLogs.js

* support before/after for pagination

* Update Guild.js

* Update GuildAuditLogs.js

* mfw using github web editor

* fix build

* Update Guild.js

* amazing cache fuckery shit evil

* cool stuff

* make building audit logs nicer

* ban endpoint stuff

* dox

* <.<
2017-04-29 20:34:57 +01:00
Amish Shah
b0a3528411 sorry gus i borked 2017-04-29 20:00:05 +01:00
Drahcirius
9ee695a291 incorrect variable name convention (#1427)
I'm not pr farming, I swear.
Gus told me to fix it.
2017-04-28 19:46:24 +02:00
Drahcirius
89745fe132 emojis should use cdn endpoint (#1425) 2017-04-28 18:47:18 +02:00
Drahcirius
2accb7b6fd small typo fix in emoji id endpoint (#1424) 2017-04-28 18:11:12 +02:00
Amish Shah
195fcfa15c Rewrite WebSocket internals (#1410)
* Start rewriting Manager and Connection

* more stuff

* stuff

* Fix ready bug

* some stuff i forgot

* fix some stuff

* add stupid heartbeat ack like seriously who cares

* woo!

* fix a bug

* rate limit the dumb websocket

* stuff

* hdocs

* Docs

* Remove ClientManager#setupKeepAlive as it is now redundant

* Change Client._pingTimestamp to a getter that fetches the timestamp from the WebSocketConnection

* are you happy now eslint smh

* make gus happy

* Add CloseEvent external doc

* Make sure to emit 'reconnecting' when actually reconnecting

* ffs

* Fix RESUME logic

* Add heartbeat ack debug messages, including latency data

* Dumb stuff for Gus

* thx eslint

* more dumb stuff

* more dumb crap smh gus i h8 u

* moar messages

* fix for using wrong status, causing certain events not to be fired (#1422)
2017-04-28 16:13:06 +01:00
bdistin
298ee4e79f Throw an error if you try to initiate a new SnowflakeUtil class instance (#1413) 2017-04-25 23:29:30 +02:00
SpaceEEC
909b825c94 Fixed acknowledging of channels (#1411)
* Fixed acknowledging of channels

* using channel#lastMessageID and resolve when it's not present
2017-04-25 23:29:08 +02:00
SpaceEEC
401822a094 Made search argument optional, added useronly warning and fixed endpoint (#1407) 2017-04-24 14:31:39 +02:00
Crawl
6abe014ac3 Change theme prop type 2017-04-23 07:04:44 +02:00
SpaceEEC
d0c2b84659 Fixed Util.arraysEqual, made it better and updated its docs (#1374)
* commit

* improved docs
2017-04-12 19:37:31 +02:00
SpaceEEC
6187c17097 readded inviteLink endpoint (#1369) 2017-04-11 22:21:28 +02:00
Gus Caplan
8dfc96d460 fix message acking (#1368) 2017-04-11 17:54:25 +01:00
Gus Caplan
0a56fa0aae websocket cleanup (#1346)
* websocket cleanup

* resume event

* Update Resumed.js

* Update WebSocketManager.js
2017-04-10 20:02:17 +02:00
Gus Caplan
e5293647a3 (╯°□°)╯︵ ┻━┻ (#1347) 2017-04-07 12:13:13 +02:00
Crawl
d1d8179460 Revert "add auth session change handling" (#1342)
* Revert "User settings (#1337)"

This reverts commit 801633b970.

* Revert "add auth session change handling (#1339)"

This reverts commit 5d85de0883.
2017-04-06 13:50:31 +02:00