diamondburned
fdeff18f5d
API: Fix integration test
2020-12-16 14:51:32 -08:00
diamondburned
78a76ecb42
Discord: Revert "APIEmoji shouldn't be path-encoded"
...
This reverts commit dae2a0ffc1
.
2020-12-16 14:51:00 -08:00
diamondburned
dae2a0ffc1
Discord: APIEmoji shouldn't be path-encoded
2020-12-16 14:30:00 -08:00
diamondburned
1483dd71d8
Webhook: Shorter constructor function names
2020-12-16 13:22:26 -08:00
diamondburned
868825da7d
Webhook: Breaking fix redundant type names
2020-12-16 13:17:56 -08:00
diamondburned
525d0bb3f6
API: Move ExecuteWebhookData, add package sendpart for uploads
...
This commit moved ExecuteWebhookData from package api to package webhook
inside package api. This change required splitting the multipart
abstractions away from package api, so they are now inside package
sendpart in utils.
This commit will break code that uploads anything, as the type name is
now sendpart.File from api.SendMessageFile. The behavior should be the
same as before.
2020-12-16 13:11:11 -08:00
diamondburned
91dc41e388
API: Expose Max fetch constants
...
This commit exposes the Max fetch constants to allow package users to
externally reimplement any part of the API abstractions without having
to redeclare more constants.
2020-12-16 12:26:25 -08:00
diamondburned
86756dfbaa
Discord: Added typed APIEmoji
...
This commit adds a new discord.APIEmoji type along with changes to
certain methods in package API that utilizes this new type. Similarly to
typed snowflakes, this should help reduce mistakes when using the React
functions.
2020-12-16 12:24:23 -08:00
Maximilian von Lindern
f887060983
Webhook: Add support for message edit and delete ( #180 )
...
* Webhook: Add support for message edit and delete
* Webhook: remove global functions
* Webhook: move package Webhook into api/
* Webhook: Moved (unused in API) data struct to package webhook
Co-authored-by: diamondburned <datutbrus@gmail.com>
2020-12-16 12:11:11 -08:00
diamondburned
d65807ce15
API: Potential rate limit fix for reactions
2020-12-11 17:58:52 -08:00
diamondburned
b8994ed0da
Voice: Remove state-keeping of sessions
...
This commit gets rid of all the code that previously managed different
voice sessions in different guilds. This is because there is rarely ever
a need for this, and most bots that need this could do their own
keeping.
This change, although removes some features off of the package, adds a
lot of clarity on what to do exactly when it comes to connecting to a
voice channel.
In order to make the migration process a bit easier, an example has been
added which guides through using the voice.Session API.
2020-11-30 19:12:20 -08:00
Maximilian von Lindern
0a8b24339b
API: Added timeout if deadline is after rate limit ( #173 )
...
* Rate: don't sleep if sleep exceeds context deadline
* Httputil: add Client.Timeout
* Bot: set default API timeout to 5 minutes
* Rate: reduce calls to time.Now in Acquire
* API: Optimize to use deadline instead of recalculating
Co-authored-by: diamondburned <datutbrus@gmail.com>
2020-11-25 12:08:42 -08:00
mavolin
a3aa53dcff
API: rename Client.GuildVanityURL to Client.GuildVanityInvite
2020-11-21 10:12:12 -08:00
Maximilian von Lindern
1d58ea57fb
Discord: Add missing guild widget methods ( #168 )
...
* Discord: cleanup comments
* Discord: differentiate between GuildWidget and GuildWidgetSettings
* Discord: rename GuildImageURL and GuildImage to GuildWidgetURL and GuildWidget
* Discord: add missing guild widget endpoints
2020-11-21 09:40:54 -08:00
mavolin
59d2ac8959
API: fix wrong constants getting used for fetch limits
2020-11-21 08:36:14 -08:00
diamondburned
4992f4ab20
API: Fixed incorrect DeleteAllReactions endpoint
2020-11-14 16:32:16 -08:00
diamondburned
6cbe95d2b3
State: Fixed erroneous context setting and races in Ready
2020-11-14 15:30:18 -08:00
Ethien Duckett
456692da93
API: stay within the boundaries of messageIDs ( #160 )
2020-11-11 11:07:30 -08:00
Maximilian von Lindern
cc1975988d
API: abstract away boundary limits for DeleteMessages ( #159 )
...
remove boundary limits for DeleteMessages
rename deleteMessages to deleteMessagesRaw
use constant instead of limit literal
add min helper func
rename utils.go to math.go
2020-11-10 15:34:05 -08:00
mavolin
d8ccaf78c3
API: rename SendMessageData.MessageReference to SendMessageData.Reference and fix omit issues
2020-11-03 10:35:45 -08:00
mavolin
e3c85094a7
API: add MessageReference
2020-11-03 10:14:53 -08:00
mavolin
88258b51c2
replace usage of discordapp.com with discord.com in docs
2020-11-03 10:14:53 -08:00
mavolin
661f96da03
API: add RepliedUser to AllowMentions
2020-11-03 10:14:53 -08:00
mavolin
5716c78d97
API: replace use of whitelist with more inclusive synonyms
2020-11-03 10:14:53 -08:00
Maximilian von Lindern
607250ae55
Gateway: Added reconnect timeout; fixed UA ( #154 )
...
* Gateway: use gateway version 8
* API: remove old v0.0.1 version tag
* Discord: fix typos
* Gateway: add timeout
* Gateway: revert to returning errors on ReconnectCtx
2020-10-30 13:41:04 -07:00
diamondburned
75df94d9f4
*: Migrated Go Modules to v2
2020-10-28 15:39:59 -07:00
diamondburned
6183068c4d
Discord: Fixed incorrect OverwriteType string rules
2020-10-28 15:34:14 -07:00
diamondburned
f9f254148f
API: Fixed rate limiting tests
2020-10-28 15:23:47 -07:00
diamondburned
196cab2105
API: Better documented ModifyGuildWidgetData
2020-10-28 14:43:49 -07:00
diamondburned
2af51c9a5a
API: V8 breaking rate limit changes
...
This commit updates Retry-After to be seconds-accurate instead of the
previous millisecond-accurate. Another issue (#153 ) is opened to get a
more accurate number, which is in the JSON body instead of the header.
This commit also removed the rate limit precision header. It also uses a
more accurate calculation algorithm to derive the reset time.
2020-10-28 14:31:15 -07:00
diamondburned
7a757209c2
Discord: Minor changes in Overwrite for v2
...
This commit changes the Overwrite type to omit the old "_new" API and
use the new field names, which are striings-serialized. The
OverwriteType is now also a strings-serialized number.
2020-10-28 14:08:29 -07:00
diamondburned
6ce268a7fa
Gateway: Changed endpoint from v6 to v8
2020-10-28 13:56:11 -07:00
Maximilian von Lindern
397d288927
API: fix errors in message pagination and streamline changes with other pagination methods ( #150 )
...
* API: fix faulty pagination behavior
This fix fixes a condition which lead to all messages getting fetched if the limit was a multiple of 100, instead of just the limit.
* API: add NewestMessages
* API: clarify MessageAfter docs
* API: adapt paginating methods for guild, member and message reaction to match the style of message's pagination methods
* API: return nil if no items were fetched
* API: remove Messages and Rename NewestMessages to Messages
2020-10-19 07:47:43 -07:00
diamondburned
dec39c4c2d
API: Fixed Messages{Before,After} fetching incorrectly beyond 100s
2020-10-18 22:14:49 -07:00
mavolin
7d5cc89ff0
API: add KickWithReason
2020-08-22 10:05:37 -07:00
Maximilian von Lindern
a7e9439109
Discord/API: implement changes to permission, allow and deny fields ( #141 )
2020-08-17 17:10:43 -07:00
diamondburned
94cca0adca
httputil: Fixed unlock of unlocked mutex bug
2020-08-04 14:09:43 -07:00
mavolin
ba1fc650d1
API: fix wrong typed Snowflake
2020-07-29 20:03:24 -07:00
Maximilian von Lindern
1585797b52
*: Linting and typo fixes ( #134 )
...
* Linting and typo fixes
* Linting and typo fixes
* revert comma fix
2020-07-29 16:58:33 -07:00
mavolin
8baf8ee84b
Multipartutil: move back to package api
2020-07-29 16:58:33 -07:00
Maximilian von Lindern
908ef96089
Discord: Uint64 typed Snowflakes ( #132 )
...
* Use typed Snowflakes if possible
* Discord: make Snowflakes uint64
* Fix errors that emerged because of new typing
2020-07-29 16:58:33 -07:00
Maximilian von Lindern
32789bb6e2
*: Separate utils and internal ( #129 )
...
* Utils: move package utils/heart to internal/heart
* Utils: move package utils/moreatomic to internal/moreatomic
* Utils: move package utils/zlib to internal/zlib
2020-07-29 16:58:33 -07:00
Maximilian von Lindern
e1d9685cdb
API: separate token-based and bot-based interactions with webhooks ( #130 )
...
* API: separate token-based and bot-based interactions with webhooks
* API: move writeMultipart to internal/multipartutil
* Multipartutil: fix double filetype-suffix
2020-07-29 16:58:33 -07:00
Tadeo Kondrak
d290b0d01c
*: Add typed Snowflake IDs ( #122 )
...
This PR closes #120 .
2020-07-29 16:58:33 -07:00
diamondburned
7572caad31
Discord: Added Relationship API methods; moved structs around
2020-07-14 18:01:24 -07:00
diamondburned
bf7ca8450d
API: Fixed Ban panicking
2020-07-11 18:51:01 -07:00
diamondburned
712a061e8e
API: Added SetNote for user accounts
2020-07-11 14:27:03 -07:00
mavolin
960ba486bd
API: code cleanup
2020-05-24 17:28:04 -07:00
mavolin
a07f343b39
API: fix id field getting sent on EditChannelPermission
2020-05-24 17:28:04 -07:00
mavolin
6c3b1e0c56
API: verify Embed and AllowedMentions on message edit
2020-05-24 16:57:23 -07:00
mavolin
55e9c28d37
API: fix Message.Author.ID getting sent instead of Message.ID
2020-05-24 09:08:47 -07:00
mavolin
147b01641b
API: fix illogical order of parameters
2020-05-22 19:19:08 -07:00
mavolin
b67b993095
API: fix illogical order of parameters
2020-05-22 19:14:01 -07:00
mavolin
6cc6d05f5f
API: use CreateWebhookData instead of direct arguments
2020-05-22 19:00:51 -07:00
mavolin
93d9323b3b
API: fix accidental append instead of prepend
2020-05-22 17:09:55 -07:00
mavolin
7b52582c93
API: fix unlimited pagination error
2020-05-22 16:18:01 -07:00
mavolin
e4b43c0a83
Discord: fix invalid calc of after
2020-05-22 16:01:09 -07:00
mavolin
eefb6d731c
API: implement #93
2020-05-22 12:27:57 -07:00
mavolin
5fefaf07c4
API: fix #89
2020-05-22 10:47:46 -07:00
mavolin
1c53befad4
API: fix wrong endpoint for GuildWidget and ModifyGuildWidget
2020-05-17 10:34:11 -07:00
diamondburned
032ae736ab
Merge pull request #80 from mavolin/lowercase-errors
2020-05-16 17:32:17 -07:00
mavolin
b3fabae701
API: implement #77
2020-05-17 01:35:57 +02:00
mavolin
41ce1f389e
make all error messages lowercase
2020-05-16 23:14:49 +02:00
mavolin
22a6994c50
Discord: implement #74
2020-05-16 17:57:25 +02:00
mavolin
48a13e1fe8
API: add missing trailing linefeed
2020-05-15 20:38:22 +02:00
diamondburned
0c21aa8571
Merge pull request #69 from mavolin/46-guild-preview
...
API: Add missing GuildPreview endpoint
2020-05-15 11:28:29 -07:00
mavolin
b5dedf9408
API/Discord: add GuildPreview
2020-05-15 20:10:35 +02:00
diamondburned
f05eb0d5a8
Merge branch 'master' into 55-user-connections
2020-05-15 10:49:46 -07:00
diamondburned
6f6cf2b85c
Merge pull request #66 from mavolin/63-edit
2020-05-15 10:45:53 -07:00
mavolin
7cb3520bc7
API: re-add pointer to embed to preserve optionality
2020-05-15 19:40:00 +02:00
mavolin
b6fee46f69
API: remove comment
2020-05-15 19:37:10 +02:00
mavolin
4eef15ec7d
API: add UserConnections method ( #55 )
2020-05-15 19:31:23 +02:00
mavolin
a963ea46f1
API: fix missing doc
2020-05-15 19:29:04 +02:00
mavolin
52a7582dab
API: remove the pointer of Embed to concur with SendMessage
2020-05-15 19:19:13 +02:00
mavolin
11cf1eb769
API: implement #63
2020-05-15 19:17:52 +02:00
mavolin
e362b10084
API: update docs
2020-05-15 19:14:37 +02:00
diamondburned (Forefront)
763999a81e
API: Added extra Emoji documentation
2020-05-14 00:49:57 -07:00
diamondburned (Forefront)
91bc93f331
API: Fixed integration test
2020-05-12 17:34:36 -07:00
diamondburned (Forefront)
694c074902
API: Fixed EditMessage test
2020-05-12 17:29:22 -07:00
diamondburned (Forefront)
cc4e8c0966
API: Added test for EditMessage
2020-05-12 17:09:32 -07:00
diamondburned (Forefront)
9f1f7547b9
API: Reversed EditMessage API for backwards compatibility and consistency
2020-05-12 16:51:35 -07:00
diamondburned
c9bb0bbcb1
Merge pull request #61 from mavolin/49-message
2020-05-11 20:41:23 -07:00
diamondburned
554be03fc1
Merge pull request #62 from mavolin/56-webhooks
2020-05-11 20:41:01 -07:00
mavolin
b72ce3f220
API: implement #56
2020-05-12 05:26:09 +02:00
mavolin
72136d5aef
API: implement #49
2020-05-12 05:21:48 +02:00
diamondburned
73a4290ac9
Merge pull request #60 from mavolin/48-prune
2020-05-11 20:18:13 -07:00
mavolin
205f675f0c
API: implement #48
2020-05-12 05:15:50 +02:00
mavolin
31a96c888f
API: remove params
2020-05-12 05:08:55 +02:00
mavolin
56f7601547
API: implement #47
2020-05-12 04:58:41 +02:00
mavolin
fb3ea3ce10
API: code cleanup
2020-05-12 04:05:08 +02:00
Maximilian von Lindern
ae14c8fb73
Merge branch 'master' into 44-data-structs
2020-05-12 03:57:35 +02:00
mavolin
04a80d33e8
API: add docs, use option types
2020-05-12 03:44:13 +02:00
diamondburned
edfe429b22
Merge pull request #50 from mavolin/42-emoji
2020-05-11 17:32:56 -07:00
mavolin
ab140686c2
API: rename NewEmoji to NewCustomEmoji
2020-05-12 02:17:45 +02:00
diamondburned
36a18da10a
Merge pull request #53 from mavolin/39-empty-payload
2020-05-11 17:17:29 -07:00
diamondburned
79c3d58db3
Merge pull request #52 from mavolin/38-payload
2020-05-11 17:17:17 -07:00
mavolin
da42ff618a
API: fix unused payload
2020-05-12 02:16:08 +02:00
mavolin
d99b7448e5
API: remove unicode option and add explainatory comment.
2020-05-12 02:11:04 +02:00
mavolin
9cd753238a
API: improvements in docs
2020-05-11 21:07:08 +02:00
mavolin
17e5696cc9
API: close #42
2020-05-11 21:03:33 +02:00