Commit Graph

71 Commits

Author SHA1 Message Date
bdistin
3d8207a3db refactor: comprehensive permissionOverwrites refactor (#2818)
* wip: comprehensive permissionOverwrites refactor

* PermissionOverwrites.resolve should Promise.reject()

where a promise is the expected return value

* On second thought, async rewrite to automatically reject on throw

* Fix some docs

* Fix a bug

* fix 2 more bugs

* typings: Updated for latest commit

* typings: Add missing method in GuildChannel

* typings: Add missing `| null` in PermissionOverwriteOption type

* Suggested changes
2018-09-21 12:21:51 +02:00
bdistin
6d184257b3 refactor: remove duplicate send checks (#2790)
* re-direct pr code to master

* fix Webhook send docs

* requested changes

* typings: Updated to latest commit

* requested change

* requested change
2018-09-21 10:59:58 +02:00
SpaceEEC
2cc0a31d5c typings(Message): member property is a readonly getter 2018-09-15 19:49:34 +02:00
SpaceEEC
1d77d1a9b8 fix(typings): remove UserConnection, fix various constructors
Closes #2825
2018-09-10 13:41:33 +02:00
Ash
e96a60361a feat(TextBasedChannel): add lastPinTimestamp and lastPinAt (#2813)
* add lastPinTimestamp

* typings

* use or instead of ternary
2018-09-03 09:11:52 +02:00
lipgloss
b068abb5de typings: add declaration of Message#url and MessageAttachment#size (#2821)
* add url to message typings

* also its readonly

* message attachment sizing typing
2018-09-03 08:53:20 +02:00
SpaceEEC
75745fe2ba typings(GuildChannel): permissionsFor's return value is nullable 2018-09-02 16:03:03 +02:00
SpaceEEC
6b9dd13d43 docs/typings(GuildChannel): permissionsfor returns a nullable readonly Permissions instance 2018-09-02 13:23:39 +02:00
SpaceEEC
b1ce602e79 fix/cleanup(typings): move static properties above methods
Make BitField.FLAGS declaration less strict, allowing enums and typed dicts
2018-09-02 10:42:22 +02:00
lipgloss
314161ab70 GuildEmoji.fetchAuthor() error handling (#2788)
* handle when client has insufficient permissions, add typing

* code review
2018-09-01 04:52:50 +02:00
Isabella
be4d6f9dc3 feat: add ClientOptions#retryLimit (#2805)
* feat: add ClientOptions#retryLimit

* hydra needs to learn how to code right

* a default would probably help

* move incrementor & update comment

* clarify docs on Infinity
2018-09-01 04:51:35 +02:00
Kyra
c63f15c8bc cleanup(Invite): remove outdated props, properly default to null (#2807) 2018-08-29 12:41:53 +02:00
Adam Gauthier
8821fd40bc cleanup: remove remaining apiRequestMethod docs and typings (#2806) 2018-08-29 08:43:28 +02:00
Kyra
c4df02782e feat: Guild Integrations (#2760)
* feat: Guild Integrations

* feat: Guild#createIntegration

* feat: Add ws event GUILD_INTEGRATIONS_UPDATE

* docs: Add `GUILD_INTEGRATIONS_UPDATE` to WSEventType

* misc: Fixed requested change

* docs: Updated typings

* typings: Sort members by name
2018-08-24 16:03:29 +02:00
SpaceEEC
82993fbe51 fix(ClientApplication): Message#application is a partial ClientApplication 2018-08-22 19:26:57 +02:00
Kyra
28d4f74b65 misc: update ClientApplication for the current API (#2767)
* misc: Update ClientApplication for the current API

* cleanup: ClientApplication#fetchAssets, removed createAsset

* Major cleanup time

* Merge to kyra's branch

* docs: Updated typings

* fix: re-add ClientApplication#{cover,coverImage()}

* typings(ClientApplication): move coverImage declaration up
2018-08-22 08:10:55 +02:00
1Computer1
19c298f5cc refactor: rewrite message creation (#2774)
* Rework createMessage
- MessageAttachment is now structurally similar to FileOptions
- No longer mutates the object passed as options
- Supports more permutations of arguments

* Ignore complexity warning

* Refactor name finding

* Fix typo

* Update typings

* Default name to null for MessageAttachment

* Make Message#reply use transformOptions

* Move transformOptions

* Fix Message#reply

* Fix mutation

* Update tests

* Fix options passing

* Refactor into APIMessage

* Fix webhook send

* Expose APIMessage

* Add documentation

* Add types

* Fix type doc

* Fix another type doc

* Fix another another type doc (is this one even right!?)

* Remove trailing comma

* Properly clone split options

* Add support for sending file as stream

* Missed a doc

* Resolve files only once when splitting messages

* This looks nicer

* Assign directly

* Don't cache data and files

* Missing return type

* Use object spread instead Object.assign

* Document constructors

* Crawl is a little dot

* comp pls

* tests: sanitize local file path, disable no-await-in-loop
2018-08-21 18:22:29 +02:00
SpaceEEC
55c58b60e7 typings: fix PermissionResolvable typedef, allow resolving of Readonly<BitField<T>> 2018-08-21 16:12:01 +02:00
bdistin
c62f01f0e4 refactor(BitField): base class for Permissions, ActivityFlags, Speaking (#2765)
* abstract BitField from Permissions

* reduce useless code, improve docs

* add a ReadOnly identifier to the return type of Bitfield#freeze()

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#partial-readonly-record-and-pick

* fix the RangeError

* update docs, convert Speaking and ActivityFlags to bitfields

* fix some docs

* Fix Speaking BitField oops

* docs for oops

* more incorrect docs

* Fix incorrectly named property

* add new classes to index

* fix missing @extends docs

* default bitfield resolve to 0, and cleanup defaulting everywhere

Also removes GuildMember#missiongPermissions() alias that had incorrect behavior

* Breaking: Rename Overwrite allowed and denied to allow and deny

To be consistent with the api's naming

* fix setSpeaking usage to bitfields instead of booleans

* fix speaking bug in playChunk

* docs: Updated typings

* fix: BitFieldResolvable should use RecursiveArray

* bugfix/requested change

* typings: Cleanup (#2)

* typings: Fix BitField#{toArray,@@iterator} output type

* typings: correct PermissionOverwrites property names and nitpicks
2018-08-21 11:56:41 +02:00
Kyra
6be8172539 misc: add UNKNOWN_WEBHOOK error code (#2775)
* Add UNKNOWN_WEBHOOK error code

* docs: Update typings
2018-08-21 10:41:42 +02:00
Kyra
5787deef26 feat: GuildEmbed support (#2766)
* feat: Guild embed support

* docs: Fixed setEmbed's reason argument not being optional

* fix: Guild#setEmbed should return the guild itself for consistency

* docs: Updated typings

* fix: Requested change
2018-08-21 10:40:47 +02:00
Frangu Vlad
0401b8ad77 feat: handle and forward WEBHOOKS_UPDATE events (#2762)
* src: Handle WEBHOOK_UPDATE events

* Commit rename of 77'
Or adding the letter S

* I missed this

* Properly do this now
Typos everywhere

* Typings

* refactor: remove now unnecessary guild variable
2018-08-21 10:38:35 +02:00
SpaceEEC
7546ca3fe0 typings(Guild): add fetchVanityCode
PR: #2732
Commit: f8057b01cb
2018-08-18 17:22:57 +02:00
zajrik
48f5a17fc4 cleanup(typings): Remove discord.js-test.ts
Useless file, filled with errors. Never served any real purpose. Discussed on discord. Can be replaced should a time come that we automate testing the typings further than just linting.
2018-08-18 05:35:09 -05:00
SpaceEEC
e7ee8d21d7 typings: VoiceState is extendable 2018-08-18 11:07:48 +02:00
SpaceEEC
58ce08255f typings: remove UserFlags and ClientApplicationCreateAssetsOptions
Leftover user bots declarations
2018-08-18 11:07:29 +02:00
SpaceEEC
c966aa2457 typings(VoiceRegion): remove no longer existing sampleHostname 2018-08-18 10:58:29 +02:00
zajrik
5fdd3a5877 tests(lint): Fix typings lint errors 2018-08-17 23:38:54 -05:00
SpaceEEC
6841b4e66a typings(VoiceConnection): receivers is now receiver and no longer an array
PR: N/A
Commit: e2726f5a9a
2018-08-17 16:58:41 +02:00
SpaceEEC
5942e8becc typings: remove user bots
PRs: #2559 #2758
Commits:
 - 5afd77ab73
 - 4999f675cd
2018-08-17 16:55:23 +02:00
SpaceEEC
9a95b6a1e8 typings(Client): voiceStateUpdate now always has an old state
PR: N/A
Commit: 38597de271
2018-08-15 15:05:13 +02:00
SpaceEEC
9b5df571b3 refactor: typings for voice state and presences refactor
Commits: ea4375bf90...e0f52162ea
PR: N/A
2018-08-14 20:29:13 +02:00
zajrik
1ff56eb09d Merge typings into master 2018-08-13 20:51:41 -05:00
Amish Shah
00ac62f975 chore: update typings 2018-08-10 16:59:01 +01:00
SpaceEEC
3d25277839 chore: update typings submodule 2018-07-15 08:42:40 +02:00
SpaceEEC
14eadb3ce0 chore: update submodule 2018-06-13 08:54:44 +02:00
SpaceEEC
faf27fabc0 chore: update typings submodule 2018-05-29 11:24:02 +02:00
SpaceEEC
75ebd5d23c chore: update typings submodule 2018-05-10 16:34:03 +02:00
SpaceEEC
6cde6decee fix(GuildEmoji): verify MANAGE_EMOJIS permission from Guild#me 2018-05-08 11:29:36 +02:00
Pascal
6069061fee chore: update typings submodule 2018-04-13 19:50:59 +02:00
Pascal
ca054affc7 chore: update typings submodule 2018-03-03 12:00:05 +01:00
Pascal
77dc3aafaa chore: update typings submodule 2018-02-19 16:11:49 +01:00
iCrawl
e6dfa38c85 chore: update typings(?) 2018-02-16 10:07:59 +01:00
Pascal
5cf8a634f8 chore: update typings submodule 2018-02-13 17:54:52 +01:00
Pascal
8c288b56a2 chore: update typings submodule 2018-01-26 09:25:30 +01:00
Pascal
5352e28700 chore: update typings submodule 2018-01-23 07:27:39 +01:00
Pascal
3300e39690 chore: update typings submodule 2018-01-21 13:12:31 +01:00
Schuyler Cebulskie
95d35a9efa Update typings submodule URL 2018-01-18 19:48:43 -05:00
Pascal
c125cc9c10 update typings 2018-01-17 17:20:45 +01:00
Crawl
5703e01132 update typings 2017-11-19 05:25:26 +01:00