Commit graph

832 commits

Author SHA1 Message Date
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
Chris Rhodes
03343b41fd Update discord.go 2016-11-23 17:18:37 -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
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
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
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
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
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
Chris Rhodes
10b5bd0b32 Merge remote-tracking branch 'bwmarrin/develop' into develop 2016-09-27 22:36:10 -07:00
Chris Rhodes
b71136ac14 Merge pull request #259 from b1naryth1ef/bugfix/voice-state-update-api-usage
Remove API call in onVoiceStateUpdate
2016-09-27 22:35:56 -07:00
Chris Rhodes
663abba05e Merge remote-tracking branch 'bwmarrin/develop' into develop 2016-09-27 22:25:36 -07:00
Chris Rhodes
2e2e02fc11 Support a very light state in all cases to support b1nzy's upcoming PR (#260)
Support a very light state in all cases to support b1nzy's upcoming PR
2016-09-27 22:09:44 -07:00
Chris Rhodes
581f6e7867 Merge pull request #256 from jonas747/request-members
Added RequestGuildMembers to request guild members from the gateway
2016-09-27 22:08:36 -07:00
Chris Rhodes
ef83d2098f Merge pull request #236 from jonas747/split
Added UserGuild struct, UserGuilds now returns a UserGuild slice
2016-09-27 22:04:37 -07:00
Chris Rhodes
6c53613186 Thanks govet. 2016-09-27 22:02:28 -07:00
jonas747
1dcdf130fd Fix Another typo 2016-09-28 07:00:11 +02:00
Chris Rhodes
8164119cac Support a very light state in all cases to support b1nzy's upcoming PR 2016-09-27 21:44:16 -07:00
jonas747
c9d0ac8463 Update comment to UserGuild 2016-09-28 06:43:37 +02:00
jonas747
1ecb7458e9 Fix typos 2016-09-28 06:31:39 +02:00
Chris Rhodes
42e934d3b2 Merge pull request #246 from robbix1206/timestamps
Timestamps
2016-09-27 21:22:07 -07:00
Chris Rhodes
8bd3f75441 Merge pull request #227 from jonas747/retry
Retry on 502's
2016-09-27 21:19:25 -07:00
Chris Rhodes
910b864864 Merge pull request #255 from jonas747/msg-timestamps-missing
Apply more fields to existing message in message update
2016-09-27 21:15:14 -07:00
Chris Rhodes
9b6b657083 Merge pull request #249 from iopred/develop
Correctly merge GUILD_UPDATE events. Closes #242
2016-09-27 21:15:03 -07:00
andrei
1edd3b6484 Remove API call in onVoiceStateUpdate 2016-09-27 17:39:14 -07:00