Commit graph

989 commits

Author SHA1 Message Date
Bruce Marriner
1c4ea6df04 gofmt :) 2017-11-08 19:36:26 +00:00
Necroforger
d554270136 Allow size parameter to be omitted (#468) 2017-11-08 07:55:51 -08:00
NamedKitten
48eecda67e Forgot ... (#473) 2017-11-08 07:45:27 -08:00
NamedKitten
287add05a5 Fix typo. (#466) 2017-10-24 08:09:51 -07:00
Chris Rhodes
7373a96b71 Remove trailing space. 2017-10-23 13:35:53 -07:00
NamedKitten
d30b33abfa Add support for custom logging behaviour. (#465) 2017-10-23 13:08:14 -07:00
NamedKitten
70c6c583e4 Use v.log rather than log for consistency. (#464)
Change made to keep the use of logging consistent.
2017-10-23 11:20:07 -07:00
Cory Ory
8737777ce7 Implement Raw sending of status (Rich Presence and Online Status) (#462)
* Added ability to change the online status

* Add structs for rick presence implementation

* Refractor and publicise UpdateStatusData

* Add UpdateStatusComplex for raw status data sending

* Case gameType to int, stopped it compiling

* Might want to gofmt.

Doesn't do it on save because Gogland removed it and their new thing I
can't make sense of.

* Revert "Added ability to change the online status"

This reverts commit 235cd15a8eebbec070cb95a5853295387bceae1c.

* Change gametypeto match

* Move RLock to UpdateStatusComplex
2017-10-22 14:08:08 -07:00
Max Boße
28dc6f6f33 Add members from GuildMembersChunk to state (#456) 2017-10-10 10:35:07 -07:00
Carson Hoffman
8f1a335d25 Added fix for #437 (#452) 2017-10-08 17:54:06 -07:00
Necroforger
aeda5eb7b1 Update bulk-delete endpoint (#451) 2017-10-08 15:37:24 -07:00
Erik McClure
97a510ca0a Add rate limit buffering support (#430)
* Fix #406: reconnect() can be called while still connected

* Add memberMap to speed up member queries

* Fix error return value and remove deletion

* Fix GuildAdd member map initialization edge case

* Add rate limit buffering support

- Break request into requestInner
- Break LockBucket into LockBucketObject
- Change getBucket to GetBucket so it can be externally accessed
- Add RequestBuffer interface
- Add RequestBuffer pointer to Bucket struct
- Add RequestPostWithBuffer() function to Session

* Remove internal implementation, export ratelimiter instead
2017-10-07 10:54:46 -07:00
jD91mZM2
9da2c9e76a Added GameType (#435)
* Added GameType

* Delete useless function
2017-10-07 10:54:04 -07:00
Sebastian Winkler
7b6a91ac04 adds parent_id to channel struct (#448) 2017-09-22 07:42:59 -07:00
Bruce
b7d7e0342e Merge pull request #444 from robbix1206/recipientBug
Fix #443 (recipients not recipient)
2017-09-21 12:43:56 -05:00
robbix1206
24dcabd55d Fix #443 2017-09-21 00:32:49 +02:00
Nick Dumas
c4a08de525 Remove a misspelled copy of EndpointGuildInvites. Issue #440 (#441)
Reference Issue: https://github.com/bwmarrin/discordgo/issues/440
This endpoint was declard twice in endpoints.go, and used in the
GuildInvites() method on Session values. I replaced the misspelled
invocation.

All tests pass.
2017-09-07 13:46:40 -07:00
Chris Rhodes
fd8721a522 Revert "Fixed 404 when calling Session.GuildCreate (#439)"
This reverts commit cf237e4c25.
2017-09-04 21:39:35 -07:00
CarsonHoffman
cf237e4c25 Fixed 404 when calling Session.GuildCreate (#439) 2017-09-04 18:30:22 -07:00
Bruce
06b35cfe24 Linting. 2017-09-03 20:01:46 +00:00
Chris Rhodes
1b5dbef04e Merge commit 'd420e28024ad527390b43aa7f64e029083e11989' into develop 2017-08-19 11:20:04 -07:00
robbix1206
d6b616c58f #429-Fix (#432) 2017-08-19 10:36:29 -07:00
Jonas is my name
3c8a0dd940 Fix receiving voice after client sets extended header bit (#428) 2017-08-18 08:35:27 -07:00
Jonas is my name
308d058bf1 Fix presence update after breaking API change (#427) 2017-08-17 06:55:02 -07:00
Jonas is my name
3f2c1311d5 Export State.OnInterface (#417) 2017-08-13 19:52:05 -07:00
tsudoko
55d995899e Add NSFW channel field (#419) 2017-07-31 16:48:29 -07:00
Jonas is my name
ba1095f3e1 Add error code constants (#418)
* Add error code constants

* Woops forgot a space
2017-07-30 19:10:41 -07:00
Jonas is my name
b4faca0f46 Add option for calling event handlers sync or async (#416)
* Add option for calling event handlers sync or async

* Small doc update
2017-07-29 17:32:20 -07:00
Erik McClure
42d1f62e58 Add memberMap to State to speed up member queries (#411)
* Fix #406: reconnect() can be called while still connected

* Add memberMap to speed up member queries

* Fix error return value and remove deletion

* Fix GuildAdd member map initialization edge case
2017-07-29 08:09:06 -07:00
Necroforger
faa8ececc0 MessageReactionsRemoveAll (#414) 2017-07-29 08:00:05 -07:00
Necroforger
013faa1da4 Hardcoded reactions ratelimit (#398)
* add custom ratelimits

* check for nil ratelimiter

* Don't expose custom ratelimits to Session

* attempt to fix race conditions

* use defer instead

* Slightly improved ratelimiter

You shouldn't need to change the ratelimiters ratelimits while its
running so I removed the functions SetCustomRatelimit and
RemoveCustomRatelimit.
2017-07-29 07:53:02 -07:00
legolord208
7bb0965a6f Updated to v6 (fixes #408) (#410)
* Updated to v6

* Unified websocket and REST version
2017-07-22 06:17:39 -07:00
Erik McClure
71ede90b56 Fix #406: reconnect() can be called while still connected (#407) 2017-07-18 18:21:45 -07:00
Bruce
d51cda6e5a Merge pull request #392 from jonas747/feature-gatewaybot
Add GatewayBot
2017-07-11 12:57:02 -05:00
jonas747
31075bc148 Update the GatewayBot test to use the bot session 2017-07-10 18:36:19 +02:00
jonas747
83e18aad7d Fix comment for GatewayBot 2017-07-10 18:31:26 +02:00
jonas747
9d3cd03314 Add GatewayBot 2017-07-10 18:31:26 +02:00
Bruce
9d41d8595b Merge pull request #403 from jonas747/feature-bottest
Add bot account to testing
2017-07-09 21:36:30 -05:00
Anmol Sethi
d420e28024 voice.go: remove runtime.LockOSThread call from opusSender (#404)
runtime.LockOSThread does not do anything for performance and is instead
intended for interfacing with libraries that use thread local data structures.

Closes #402
2017-07-08 08:09:04 -07:00
jonas747
389ba8760d Add bot account to testing 2017-07-08 15:38:34 +02:00
Bruce
fc8d981e5e Removed link to old unofficial docs fixes #387 2017-07-04 17:25:42 +00:00
AAAAAAAAAAA
ef520cb26d Add GuildMemberDeleteWithReason (#399) 2017-07-02 17:42:05 -07:00
Erik McClure
bb4b96e26d Add heartbeat ACK response and error handling (#396)
* Add heartbeat ACK response and error handling

- Error when sending a heartbeat now triggers a reconnection
- Op7 now triggers a reconnection
- Session now tracks the last heartbeat ACK that was recieved. If the
last ACK is more than FailedHeartbeatAcks*heartbeatinterval in the past,
this is treated as a dead connection and a reconnection is forced.

* Address @iopred comments
2017-06-27 20:52:59 -07:00
legolord208
5a02430c02 ContentWithMoreMentionsReplaced for roles and nicks (Fixes #208) (#375)
* ContentWithMentionReplaced on roles and nicks (Fixes #208)

* Compatibility

* Like this? 🤔

* More efficient regexp

* Tweaked a little

* Tweaked a little more

* Tweaked even more

* Removed unessecary crap condition that is useless

* Disallow voice channel

* Moved regexp declaration
2017-06-13 08:49:41 -07:00
Ammar Bandukwala
0983790428 Fix goroutine leak in opusReceiver (#393) 2017-06-10 13:39:27 -07:00
rfw
874325a504 Add and fix support for multiple file uploads via ChannelMessageSendComplex via the new field MessageSend.Files. (#391)
For compatibility with existing library consumers, the File field is retained but will behave as if Files contained that single file. If both are specified, ChannelMessageSendComplex will return an error.

The message JSON payload is moved to a form-data field called `payload_json`, instead of set in multipart form data. This is supported and the recommended way, as per the API docs.

Apparently, you can attach multiple files if you just name the parts names differently in the multipart request. The parts are named here using the order the files were specified, as `file%d`. This is not documented in the API docs, but definitely works.

This also removes serialization of the File field via json.Marshal, as it will never be directly serialized in the JSON. The new field, Files, is similarly not marshaled.

This additionally adds a ContentType field in File, which can be used to specify the content type of the attached file. The ContentType field will default to setting the header to `application/octet-stream` if empty. Discord currently doesn't do much with the Content-Type header, but we should pass this information along anyway in accordance to the MIME standard.
2017-06-10 13:13:28 -07:00
Rinzen Necroforger
a71f5e3e61 Support animated avatar URLs (#388)
* Methods to obtain a user's avatar URL

* Created EndpointUserAvatarAnimated and updated AvatarURL

* Fixed the size parameter
2017-05-29 20:03:39 -07:00
legolord208
6aec04d69d omitempty (#383) 2017-05-20 10:56:45 -07:00
Bruce
f2cad25dc9 Bump version to v0.17.0-dev 2017-05-15 16:12:45 +00:00
Bruce
0993a94b4e Bump version to 0.16.0 2017-05-15 15:02:49 +00:00