Commit Graph

1998 Commits

Author SHA1 Message Date
Isabella
c59d3299bc fix: typo in Activity#flags 2018-08-21 13:19:45 -05: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
d91deefd79 fix(RequestHandler): DiscordAPIError#path should be the path, not the route 2018-08-21 12:05:33 +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
Frangu Vlad
4a24e8c12c Remove double iteration (#2773) 2018-08-19 13:37:00 +02:00
Florian
f8057b01cb feat: add guild.fetchVanityCode() (#2732)
* Error for guild.fetchVanityURL feature not enabled

* added GET/guilds/{guild.id}/vanity-url endpoint

* fix: code conventions

* adopted suggestion

* Changed error message according to change request

* Renamed method

to indicate that only the code is fetched, not the entire url.

* Update Guild.js
2018-08-18 13:57:58 +02:00
Frangu Vlad
94214fa733 misc: Remove Clyde (#2764)
* Remove Clyde

* Remove Clyde avatar overwrite

* Remove Clyde from the user pattern
2018-08-18 13:21:24 +02:00
Kyra
b2707e9ee5 cleanup(VoiceRegion): remove no longer existing sampleHostname (#2759) 2018-08-18 10:57:08 +02:00
Frangu Vlad
1e0379375e cleanup: remove more left-over selfbot constants (#2761)
* misc: Remove left-over selfbot stuff

* Forgot this
2018-08-18 10:55:09 +02:00
Frangu Vlad
e935611e50 fix(GuildBanAddHandler): not emitting guildBanAdd for uncached users (#2763) 2018-08-18 10:53:23 +02:00
Kyra
4999f675cd src: delete leftover UserConnection class (#2758) 2018-08-17 16:52:57 +02:00
bdistin
d437cecb3f Fix permission checking for Administrator channel overwrites (#2756) 2018-08-17 08:46:09 +01:00
Kyra
3f81b613d8 fix: Handle async stacks correctly (#2744)
* fix: Capture stack traces in APIRouter to preserve async stack

* fix: Handle the stack trace better

* fix: Check if error is an instance of Error (5XX rejects with Result)

* fix: Error.captureStackTrace is not supported in all browsers
2018-08-16 19:51:21 +01:00
Amish Shah
e2726f5a9a voice: remove createReceiver, just use VoiceConnection.receiver 2018-08-16 18:30:54 +01:00
Amish Shah
97c34b5b6f voice: clean up packet handling 2018-08-16 11:28:28 +01:00
Amish Shah
64832abfdb voice: clear connect timeout after connected (fixes #2752) 2018-08-15 14:25:47 +01:00
Amish Shah
38597de271 voice: patch in default VoiceStateUpdate in case on doesn't exist, cache member 2018-08-15 14:02:11 +01:00
SpaceEEC
700201e3fe fix(GuildAuditLogs): default target to object with target_id (#2742) 2018-08-15 09:58:27 +02:00
bdistin
6506252054 fix/refactor: fix GuildMember#presence getter and cleanup (#2751)
* Fix guild being a guild and not an AbstractHandler in PresenceUpdate

* update the default guild to be a Guild, and not GuildMember

* getters return null instead of undefined

* fix lint
2018-08-15 08:50:22 +02:00
Kyra
75254748b1 fix(Client): do not redefine _timeouts and _intervals of BaseClient (#2748)
Fixes an issue with the process permanently hanging.
2018-08-14 20:39:56 +02:00
bdistin
0ad7c24aa3 docs(User): fix hydrabolt's tag (#2747) 2018-08-14 19:09:10 +02:00
Amish Shah
e0f52162ea voice: allow for streaming silence to avoid audio glitches with repeated pausing/resuming (#2354) 2018-08-14 12:12:59 +01:00
Amish Shah
e666574f36 document GuildMember#voice 2018-08-14 11:50:11 +01:00
Isabella
bb0700ade3 fix: Util#cleanContent parsing of GuildMember 2018-08-13 15:59:35 -05:00
Amish Shah
6852a15cee voice: fix StreamDispatcher#pause trying to call null function 2018-08-13 17:54:11 +01:00
Amish Shah
bfde1dd8f2 fix: StreamDispatcher doesn't emit finish if ended while paused (#2648) 2018-08-13 17:35:21 +01:00
Amish Shah
edf9c448fb fix: message passing empty data to GuildMember#_patch 2018-08-13 16:49:10 +01:00
Amish Shah
d276850c52 fix: GuildMemberStore now works with custom structures again 2018-08-13 16:21:11 +01:00
Amish Shah
332e30d31e fix: GuildMemberStore now patches existing members (#1870) 2018-08-13 16:02:05 +01:00
Jacz
180813d3e8 Consistency with Getters. 2018-08-12 07:41:10 +01:00
Jacz
f9da255b44 More preformant way, forgot to commit this before whoops 2018-08-12 07:40:13 +01:00
Jacz
c1183f3534 Fixes VoiceChannel.members bug
Closes #2736
2018-08-12 07:40:13 +01:00
bdistin
b7e61f21ca fix(PresenceStore): pass user id as extra (#2733)
fix #2731
2018-08-11 18:24:30 +02:00
Amish Shah
e2ceea65ba Fix default presence for Users 2018-08-11 11:48:18 +01:00
Amish Shah
8ac664801c GuildChannel#setParent should allow channel to be a Snowflake (#2644) 2018-08-11 11:34:24 +01:00
Amish Shah
7968442dbf VoiceChannel#members should be a Collection, not an Array 2018-08-11 11:27:34 +01:00
Amish Shah
ea764afad2 add ClientPresence, remove ClientPresenceStore 2018-08-11 10:46:51 +01:00
Amish Shah
3c2eaff226 fix default presences again, remove redundant extras in PresenceStore 2018-08-11 10:19:31 +01:00
Amish Shah
f5ea673ebd fix default presence 2018-08-11 00:26:24 +01:00
Amish Shah
34ed3c6014 Update documentation for presenceUpdate 2018-08-10 17:09:05 +01:00
Amish Shah
e059581eee GuildMember#voice never undefined, improve documentation for VoiceState 2018-08-10 17:05:26 +01:00
Amish Shah
08eff66939 Make presences track users and guilds, emit them in presenceUpdate 2018-08-10 16:46:14 +01:00
Amish Shah
fe8ece0192 voice state fixes 2018-08-10 15:15:52 +01:00
Amish Shah
df54d11dce Merge branch 'master' of https://github.com/hydrabolt/discord.js 2018-08-10 14:45:07 +01:00
Amish Shah
be5efea461 rewrite voice state handling 2018-08-10 14:44:59 +01:00
NbOpposite
ea4375bf90 Fixed splitting messages with codeblocks (#2720) 2018-08-10 15:44:32 +02:00
Kyra
0f63c50c06 fix: Util.basename being unreliable (#2679)
* fix: Util.basename being unreliable

new URL for WHATWG parsing was not chosen because it only works for URLs and threw in local pathes, path.basename is unreliable (according to the devs' note), and path.parse seems to work well.

* docs: Update Util.basename's description
2018-08-10 11:23:22 +02:00