Commit graph

948 commits

Author SHA1 Message Date
Chris Rhodes
36601253a4 Remove use of reflect.
This introduces gogenerate'ed EventHandlers from the files in events.go

This also adds support for AddHandlerOnce.
2016-12-03 23:31:07 -08:00
Chris Rhodes
24a51f654f 👌 2016-11-30 18:02:13 -08:00
Chris Rhodes
9f7a7c9352 Don't stomp on messages or permission overrides on ChannelUpdate. 2016-11-30 17:59:17 -08:00
AI
2092185ec5 Implement support for new member role endpoint (#289)
Implements support for the new member role add and delete endpoint
hammerandchisel/discord-api-docs#179
2016-11-30 08:57:22 -08:00
Chris Rhodes
315ae45231 Set GuildID on all members in discordgo land not in state. 2016-11-29 20:23:10 -08:00
Matthew Gerstman
d726f93375 Fix issue with trailing slashes in MacOS (#292)
* Fix issue with trailing slashes in MacOS
2016-11-29 19:24:22 -08:00
Chris Rhodes
20d230cd04 Update GuildID's on GuildAdd 2016-11-29 19:17:03 -08:00
Chris Rhodes
54e0bd6087 Fix Admin permission calculations. 2016-11-29 19:09:01 -08:00
Chris Rhodes
1bc3fb9cd7 Set the GuildID for Members and VoiceStates on ready. 2016-11-29 19:05:09 -08:00
Matthew Gerstman
b5698e658d Fix issue with trailing slashes in MacOS (#292)
* Fix issue with trailing slashes in MacOS
2016-11-27 20:48:33 -08:00
Chris Rhodes
03343b41fd Update discord.go 2016-11-23 17:18:37 -08:00
Chris Rhodes
ddfeefaf75 Update discord.go 2016-11-23 17:18:05 -08:00
rytone
3f6a127baa Support for editing messages with embed data (#290) 2016-11-19 20:28:52 -08:00
Chris Rhodes
717c8f2538 Support embed messages. 2016-11-13 22:04:30 -08:00
Chris Rhodes
b7c7e60fd5 Fix presence unmarshalling as the values are inconsistent from Discord. (#287) 2016-11-12 11:59:51 -08:00
Chris Rhodes
c352d7016c Clean up ordering of internal handlers. (#285) 2016-11-12 11:50:06 -08:00
Chris Rhodes
c5a94de19c Silence missing voice op codes. 2016-11-11 08:20:00 -08:00
Chris Rhodes
8f6d44ccee Fix GuildBans. 2016-11-09 22:27:12 -08:00
AI
ed7a451a31 Add support for relationships (#284)
* Add support for relationships

Adds Support for:
  - Sending friend request.
  - Accepting friend request.
  - Getting all the relationships.
  - Getting all the mutual friends with another user.
  - Blocking a user.

**Note:**
  - Bot accounts are not allowed to access the endpoint.
  - May close bwmarrin/discordgo#150

* Implement requested changes

Changed the uint8 declarations to int.

* Change the missed unint8 declaration to int

Missed one instance of unint8 during previous push.
2016-11-08 17:07:04 -08:00
AI
602885488b Fix supprt for reaction endpoint (#283)
- Adds support for deleting the reaction for a given user.
    - Requires MANAGE_MESSAGES permission.
  - Fixes the Sesssion.MessageReactions(...) function.
2016-11-08 11:49:30 -08:00
AI
982cd7d7c3 Add support for the prune endpoint (#282)
* Add support for the prune endpoint

Adds functions to get the amount of members that could be pruned
and to prune members using the prune endpoint.
May close: bwmarrin/discordgo#147

* Deal with the go vet error

Removed the json tags from the unexported struct.
Should pass the tests now.

* Make the PR consistent with the rest of the file.

Removes url building in favour of string concatenation.

* Fix the previous commit

Adds back the result struct.
Converts the uint32 to string.

* Deal with golint comments

* Remove the failing test

Cleans up the uri concatenation.
Removes the failing test due to incorrect permissions.
2016-11-07 16:06:08 -08:00
jonas747
5d1dd7ddac Add nick and roles to Presence 2016-11-07 15:53:54 -08:00
jonas747
f0cb678022 Add member_count to guild 2016-11-06 09:09:54 -08:00
Chris Rhodes
3e7c0435bc Reduce severity of wsConn close error logging. 2016-11-05 00:16:15 -07:00
Chris Rhodes
4edcbf8e53 Reduce severity of wsConn close error logging. 2016-11-05 00:15:16 -07:00
jonas747
56b19073d3 Ratelimits (#273)
* Added ratelimiter

Handles the new ratelimit headers
 - X-RateLimit-Remaining
 - X-RateLimit-Reset
 - X-RateLimit-Global

* Pad only reset time with a second

* Moved ratelimiter out of internal package

* Change for loop, move global ratelimit check inside sleep check

* Moved ratelimiter locking to getBucket

* Added global bucket

* Changed how bucket id's are done

Now each request function will need to specify the bucket id if the
endpoint contains minor variables

* Allow empty bucketID in request

* Remove some uneeded Endpoint* function calls

* Added test for global ratelimits

* Fixed a silly little mistake causing incorrect ratelimits

* Update test comments, Fixed treating a endpoint as 2 in ratelimiting

* Use date header from discord instead of relying on sys time sync

* Update all REST functions to use RequestWithBucketID

* Embed mutex into bucket

* Added webhook and reaction buckets
2016-11-04 08:07:22 -07:00
Chris Rhodes
5a40e65c72 Merge pull request #276 from iopred/develop
Fix GuildBans. Fixes #263
2016-11-03 22:46:02 -07:00
Chris Rhodes
5ef835fc80 Fix GuildBans. Fixes #263 2016-11-03 22:39:55 -07:00
Chris Rhodes
ef4e2224f9 Merge pull request #275 from iopred/reactions
Add support for Message Reactions.
2016-11-03 22:14:38 -07:00
Chris Rhodes
c96162c425 Add support for Message Reactions. 2016-11-03 22:07:06 -07:00
Chris Rhodes
84a92549bc Merge pull request #274 from iopred/develop
Add Webhook support.
2016-11-03 19:47:15 -07:00
Chris Rhodes
ee3e500749 Add webhook support. 2016-11-03 19:41:57 -07:00
Chris Rhodes
e37343d4d4 Update examples to use Bot tokens. 2016-10-29 16:30:19 -07:00
Chris Rhodes
4c32e41288 Update examples to use Bot tokens. 2016-10-29 16:30:07 -07:00
Austin Davis
212fc66a25 casing matters for some reason tried BOT and it returns a 401. (#268)
Also got the name of the executable wrong in mytoken (damn copy paste...)
2016-10-13 19:14:54 -07:00
Austin Davis
f878362d73 casing matters for some reason tried BOT and it returns a 401. (#268)
Also got the name of the executable wrong in mytoken (damn copy paste...)
2016-10-13 19:14:03 -07:00
jonas747
9187964002 Added custom rest error type (#271) 2016-10-13 19:13:42 -07:00
jonas747
9f24531220 Update ChannelMessageAck because of api changes (#270) 2016-10-13 12:42:05 -07:00
Austin Davis
c5abbfa42e Updates docs to include the newly required "Bot" infront of bot user tokens. (#266) 2016-10-04 20:16:44 -07:00
Chris Rhodes
9b41864a68 Remove 1.5, lint is broken :(
:killme:
2016-10-04 20:12:36 -07:00
Chris Rhodes
c4c27915f7 Bring back 1.5, make lint non fatal. 2016-10-04 20:12:31 -07:00
Chris Rhodes
9ac041f85a Remove 1.5 from travis as golint seems to have lost support. 2016-10-04 20:12:25 -07:00
Chris Rhodes
4b9d2e31cc Remove 1.5, lint is broken :(
:killme:
2016-10-04 20:07:32 -07:00
Chris Rhodes
7b7b45cfba Fix lint warnings. 2016-10-04 20:01:50 -07:00
Chris Rhodes
f31b65315b Bring back 1.5, make lint non fatal. 2016-10-04 20:01:07 -07:00
Chris Rhodes
3cf4816e18 Remove 1.5 from travis as golint seems to have lost support. 2016-10-04 19:51:08 -07:00
Austin Davis
627f9a3ca6 Updates docs to include the newly required "Bot" infront of bot user tokens. (#266) 2016-10-04 14:45:36 -07:00
robbix1206
af3fe4842a Add Support of changing user status (#258)
Add Support of changing user status
2016-09-28 10:04:37 -07:00
Chris Rhodes
c6ee0d2dd5 Clean up state access. (#261)
Clean up state access.
2016-09-27 22:45:12 -07:00
Chris Rhodes
0115c9c335 Clean up state access. 2016-09-27 22:36:38 -07:00