Commit Graph

745 Commits

Author SHA1 Message Date
Hamza Ali 34a7c3ba2e
gateway: Skip unknown events while reconnecting (#255)
This change skips events that are unknown while the bot reconnects. This
is an event that is particularly rare as it requires unimplemented
events being called in the time before a bot's HELLO -> RESUME events
are called. This change explicitly returns unknown events as a special
time defined in wsutil/op.go and ignores them from reaching gateway/op.go
2021-10-27 20:16:03 -07:00
bumbread c780d474d4
readme: Fix non-compiling example (#258) 2021-08-08 15:02:11 -07:00
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
diamondburned 30b69eab93 voice: Fix race condition, see #237 2021-06-30 00:19:13 -07:00
diamondburned 26c06802d8 bot: Clarify unexported *Context field 2021-06-22 16:10:21 -07:00
trybefore 8254a9bed2
bot: Wait catch SIGTERM (#233)
Signed-off-by: Daniel Boman <daniel.boman@pm.me>
2021-06-22 13:42:08 -07:00
diamondburned 1a77edb1b1 state: Fix voice state removal condition
This commit addresses issue #220.
2021-06-08 02:54:20 -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 56aaed3d60 State: Fix data race between ready and guild create handler 2021-05-29 12:38:22 -07:00
unknown f8195f6e87 discord: Add Emoji.IsCustom() & IsUnicode() methods 2021-05-20 22:53:46 -07:00
unknown 25152c85d9 discord: Fixed typo 2021-05-20 22:53:46 -07:00
unknown cfd620ee39 discord: Add User.Tag() method 2021-05-20 22:53:46 -07:00
unknown 5026795551 discord: Add CreatedAt() methods 2021-05-20 22:53:46 -07:00
unknown a10c4d2062 discord: Document User.Mention() 2021-05-20 22:53:46 -07:00
Chan Wen Xu 5b63307a4a discord: Add certified moderator user flag
A new user flag has been documented in discord/discord-api-docs@55cd3d7.
This commit adds the flag to arikawa.
2021-05-20 09:40:21 -07:00
Starshine System 20166f33cc
gateway: fix Joined field in GuildCreateEvent (#193) 2021-04-11 16:56:05 -07:00
diamondburned cafff103e5 Bot: Add ErrorReplier
This commit adds the ErrorReplier callback into Context, which allows
the user to implement a custom way to format errors, such as putting
them into an embed.
2021-04-08 13:09:10 -07:00
diamondburned 728bc5c472 Gateway: Test Reconnect error 2021-04-07 11:42:13 -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 9925461a25 Gateway: Potential fix for URL() 2021-04-05 12:20:56 -07:00
diamondburned c9a7ec8122 Gateway: Add URL test 2021-04-05 12:20:56 -07:00
diamondburned 2dadb0701d Gateway: Add automatic BotData connection
This commit modifies Gateway constructors to allow the user to easily
feed existing Identifier instances as well as updating those instances
to adhere to the Discord-returned gateway rate limits.

These changes should make it easier for typical bot sharding, although
automatic sharding is not implemented.
2021-04-05 12:20:56 -07:00
diamondburned 050c1b6497 Webhook: Add rate limiter and WithContext 2021-03-05 20:01:33 -08:00
diamondburned 1ffbde98c5 State: Guarantee message order in store 2021-02-25 23:57:45 -08:00
diamondburned f5dc90c2d4 API: Add File.AttachmentURI for convenience 2021-02-24 01:59:33 -08:00
diamondburned 3713c9d404 Bot: Added Run(); updated examples 2021-02-23 21:40:44 -08:00
diamondburned 3b5a4ed94d Voice: Add packet correction for RTCP per RFC3350 2021-02-22 12:33:12 -08:00
diamondburned a939a26cab Bot: Errors to reply as well 2021-02-18 11:08:21 -08:00
diamondburned 968112fb53 Discord: typed snowflake for Interaction 2021-02-17 17:41:19 -08:00
diamondburned 65d7b8765b Bot: Allow self-mentions; deprecate SanitizeMessage 2021-02-14 13:14:38 -08:00
diamondburned 74019dc909 Bot: Reply with reference to message 2021-02-14 12:39:39 -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
diamondburned d13aa00a57 Bot: Fixed extra space in top-level comments 2021-02-07 17:21:16 -08:00
diamondburned 5a18435190 Gateway: Better Activities type for UpdateStatusData
This is a breaking change.
2021-02-07 17:03:12 -08:00
diamondburned 0ab9d901e1 Example: Fixed simple bot intents 2021-02-07 16:22:38 -08:00
diamondburned ac2f3ba68a Bot: Close gracefully by default 2021-01-29 23:25:15 -08:00
Maximilian von Lindern a969b11709
Gateway: Add graceful closing with CloseGracefully (#185)
* gateway: add the possibility of graceful closure

* wsutil: rename ConnGracefulCloser to GracefulCloser

* Gateway: rename Gateway.CloseSession to .CloseGracefully
2021-01-29 20:25:10 -08:00
Prophet 878b36fa2f
Example links in readme direct to v2 examples (#184) 2021-01-28 13:45:57 -08:00
diamondburned c43fe15964 CI: Properly skip PRs 2021-01-28 13:41:43 -08:00
diamondburned 00ec43c794 Added Sourcehut CI 2021-01-28 00:11:58 -08:00
Matthew Penner 7c3374543e Discord: Add basic support for slash commands 2021-01-27 10:44:14 -08:00
diamondburned afc4183020 Discord: Activity to have AppID instead for consistency
This change is breaking for the discord.Activity struct, but it's worth
having the consistency.
2021-01-27 10:30:09 -08:00
diamondburned 5252b5af8d httputil: Fix Timeout causing premature cancelation 2021-01-24 22:45:56 -08:00
Dan Anstis da3f728ed4
Bot: Handle iphone style quotes (#182) 2021-01-14 16:23:14 -08:00
diamondburned de3049b730 httputil: Fixed JSON body not reusable 2021-01-13 15:22:45 -08:00
mavolin d940a97a0f Discord: add support for string based OverwriteTypes as used in GuildCreate 2021-01-10 13:29:11 -08:00
diamondburned d9a159d948 Bot: Fixed invalid test breaking 2021-01-05 21:15:38 -08:00
diamondburned 771591e5eb State: Error out on fetching permission of a channel not in guild 2021-01-05 21:09:16 -08:00
diamondburned 8a21375916 CI: Removed perseverance test due to CI time 2021-01-05 13:39:13 -08:00