1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-01 04:24:19 +00:00
Commit graph

190 commits

Author SHA1 Message Date
rigormorrtiss 2bc4bb656f
api: Update SendMessageData.Embed to .Embeds (#248)
* Update SendMessageData.Embed to .Embeds

Related: https://github.com/discord/discord-api-docs/pull/3105

Closes #239

* Fix test
2021-08-02 02:05:14 -07:00
Maximilian von Lindern 7785887719 API: Update the Client.CreateChannel docs to mention the recent permission change 2021-05-29 12:40:10 -07:00
Maximilian von Lindern ebc74e3168
Gateway: Sharding callback, proper closing (#190)
* Gateway: Fix gateway reconnect

This commit uses the correct timeout, Gateway.ReconnectTimeout, when reconnecting. Furthermore, it adds a delay between consecutive, failed reconnects.

* Gateway: Stop pacemaker when calling Gateway.CloseGracefully

* API: remove unnecessary leading/trailing whitespaces

* Gateway: Add Gateway.OnScalingRequired callback

* Gateway: Make all user initiated user closures graceful and ensure that closures are respected during reconnects

* Gateway: Fix typo

* Gateway: Add Gateway.ReconnectAttempts and deprecate .ReconnectTimeout

* Gateway: Add Gateway.Pause and reexport .Reconnect and .ReconnectCtx

* Gateway: Improve the Gateway.OnShardingRequired docs

* Wsutil: Code cleanup
2021-04-07 11:38:26 -07:00
Starshine System 37d285184a API: Add CrosspostMessage method 2021-04-06 15:34:28 -07:00
diamondburned 050c1b6497 Webhook: Add rate limiter and WithContext 2021-03-05 20:01:33 -08:00
diamondburned f5dc90c2d4 API: Add File.AttachmentURI for convenience 2021-02-24 01:59:33 -08:00
diamondburned 968112fb53 Discord: typed snowflake for Interaction 2021-02-17 17:41:19 -08:00
Scott abeaef8122
API: Added SendReply methods (#187)
* API: Added SendReply methods

* Grammar edit

* referenceID & adheres to 100 column limit
2021-02-14 12:29:41 -08:00
Matthew Penner 7c3374543e Discord: Add basic support for slash commands 2021-01-27 10:44:14 -08:00
diamondburned c6d8c741e8 CI: Add perseverance test for Gateway 2020-12-31 23:48:29 -08:00
diamondburned 2f6ab0d451 API: Fix atomic SIGSEGV in ARM 2020-12-31 10:24:51 -08:00
diamondburned 700b55102d API: Added JoinInvite 2020-12-31 00:16:43 -08:00
diamondburned f3f075b27f API: Add get Note endpoint 2020-12-26 16:13:10 -08:00
diamondburned d69d6750dc API: Separated min function 2020-12-26 16:08:41 -08:00
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