Commit graph

207 commits

Author SHA1 Message Date
Necroforger
1ff9565306 Added UserConnections function and structs (#514)
* Added UserConnections function and structs

* Rename Connection to UserConnection

* Embed Integrations inside GuildIntegration and remove GuildIntegrationAccount

* Replaced GuildIntegration with Integration
2018-03-07 15:45:09 -08:00
Sebastian Winkler
18dfe540ad adds GuildAuditLog() (#504)
* adds GuildAuditLogs()

* adds missing comments to GuildAuditLog
2018-01-11 07:09:12 -08:00
Bruce Marriner
b58212ae33 If there's an err, return it :) 2017-12-27 21:13:27 +00:00
psheets
e024d5f032 Add ChannelEditComplex (#493)
* Add ChannelEditComplex

* Fixed comment format

* gofmt

* Reverted permissions and fixed ChannelEditComplex

* Reverted Perms

* Delete discordgo - Shortcut.lnk

removed link

* Added ChannelID param to ChannelEditComplex

* gofmt
2017-12-14 21:59:07 -08:00
vim2meta
74a0038b63
Update restapi.go 2017-11-19 10:13:04 -05:00
vim2meta
d4e2b50ce4
Update restapi.go 2017-11-19 10:12:21 -05:00
Lukas Breuer
1b69ba4a5f
Format restapi.go with gofmt 2017-11-11 19:49:05 +01:00
Lukas Breuer
a838552b22
Remove XKCDPass Invites
This feature has been removed from the API quite some time ago.
2017-11-11 18:40:05 +01:00
Carson Hoffman
8f1a335d25 Added fix for #437 (#452) 2017-10-08 17:54:06 -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
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
robbix1206
d6b616c58f #429-Fix (#432) 2017-08-19 10:36:29 -07:00
Necroforger
faa8ececc0 MessageReactionsRemoveAll (#414) 2017-07-29 08:00:05 -07: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
AAAAAAAAAAA
ef520cb26d Add GuildMemberDeleteWithReason (#399) 2017-07-02 17:42:05 -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
legolord208
6aec04d69d omitempty (#383) 2017-05-20 10:56:45 -07:00
legolord208
aa3973f956 Made error constants (Fixed #315) (#377) 2017-05-08 06:48:19 -07:00
Bruce
5e2c93b4f1 Added warning to New/Login functions fixes #342 2017-05-03 21:47:57 +00:00
legolord208
2b80b35528 ChannelFileSendWithComplex (#370)
* ChannelFileSendWithComplex

* Moved to ChannelMessageSendComplex

* Oops

* Return consistency

* Re-used variable

* Omit empty
2017-05-01 07:50:49 -07:00
jonas747
4fb7760b59 Added reason go GuildBanCreate (#367)
* Added reason go GuildBanCreate

* Added GuildBanCreateWithReason
2017-04-28 18:41:48 -07:00
legolord208
5cc4af9aa2 Chaining ChannelMessageEditComplex (#365)
* Chaining ChannelMessageEditComplex

* Removed .Do()
2017-04-28 12:24:38 -07:00
legolord208
43c8b518ad Added user notes (#361)
* Added user notes

* Added note websocket event (thanks iopred :D)

* Added ready event (thanks again, iopred)

* Renamed function
2017-04-28 12:22:02 -07:00
Lord-Ptolemy
be3675c2c2
Fixed grammatical error 2017-04-27 21:27:35 -04:00
LEGOlord208
65f0cb9f73 Arise error when user has 2FA (#359)
* Arise error when user has 2FA

* Fixed error message

* Removed ticket
2017-04-18 21:35:17 -07:00
Bruce
7044ac3441 username can be omitted on UserUpdate 2017-04-14 14:00:25 +00:00
LEGOlord208
7bcc0fbaca Added more fields (#354)
* Added more fields

* Fixed error

* Yep ok
2017-04-11 21:51:24 -07:00
LEGOlord208
851e8d3581 SendContent (#352)
* SendContent

* Fixed error...?

* Commented

* Yep let's do that

* Oops

* Oki

* Whatever you say, Travis... :<

* Omit them empty structs
2017-04-09 21:47:32 -07:00
LEGOlord208
fea42d937a ChannelMessageSendComplex (#349)
* ChannelMessageSendComplex

* ChannelMessageEditComplex

* I am a murderer.

* Travis didn't like that.

* I can't spell
2017-04-07 20:15:31 -07:00
LEGOlord208
a08cbd9ba7 It's not bot only though... 2017-04-05 14:46:35 +02:00
LEGOlord208
d4f874c0f4 UserAvatar to accept user object. (#337)
* UserAvatar to accept user object.

One of the most important thing with this library is that it does 1 request per function. You have 100% control over how many web requests get made.
UserAvatar breaks that.

UserAvatar now accepts a user, which not only makes you know how many web requests gets made, but might also save on web requests if you have an existing user object.

* Removed dots. Please work, travis :<

* Ohhh... A friend spotted the error!

* `go fmt` and fixed comment... PLS TRAVIS
2017-03-13 10:10:58 -07:00
Sebastian Winkler
b7f00b390a Added ChannelMessageSendEmbedWithMessage (#335)
* Added ChannelMessageSendEmbedWithMessage

* Updates ChannelMessageSendEmbed to use ChannelMessageSendEmbedWithMessage
2017-03-13 08:05:01 -07:00
Jonathan Alexander
383bdad7dd Add support for @me in GuildMemberNickname (#319) 2017-02-11 22:17:54 -08:00
jonas747
dce3ada92b Proper ratelimit buckets for RoleAdd and RoleRemove (#311) 2017-01-14 10:04:36 -08:00
Floretta
dacb0a3a0c Added comment line describing the around parameter 2017-01-03 16:42:27 +01:00
Floretta
c4c9502072 added Around parameter to ChannelMessages 2017-01-02 22:49:03 +01:00
jonas747
edc3213ffb Reuse http client, and export it (#301) 2016-12-25 16:23:11 -08:00
Bruce Marriner
9e777a083b Linting. 2016-12-11 12:45:34 -06:00
Chris Rhodes
fb346787be Improve permissions. (#298)
* Fix permissions to take into account @everyone override in channels.

* Keep early exit for channel owner.
2016-12-10 20:31:16 -08:00
jonas747
86a21ea94b Updated userguilds to new api (#296)
* Updated userguilds to new api

* Fixed typos
2016-12-10 09:45:07 -08:00
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
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
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
54e0bd6087 Fix Admin permission calculations. 2016-11-29 19:09:01 -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
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