Commit Graph

106 Commits

Author SHA1 Message Date
diamondburned 64bd519156 state: Store Threads as channels 2021-08-19 20:58:38 -07:00
Maximilian von Lindern c00567599b
api: Threads (#257)
* api/gateway: Implement threads

* discord/api: rename PermissionOverwrites fields to Overwrites

* discord: rename Minutes to ArchiveDuration

* discord: Rename ArchiveDuration constants

Co-authored-by: diamondburned <datutbrus@gmail.com>
2021-08-08 13:19:15 -07:00
Maximilian von Lindern 8e4e48e25e
state: Fix out of bound panic in Messages (#235) 2021-06-24 22:46:27 -07:00
diamondburned 5b328bdab0 shard: Remake shard manager (#226) 2021-06-14 15:22:55 -07:00
diamondburned ba49bff80a state: Fix voice state removal condition
This commit addresses issue #220.
2021-06-10 16:52:31 -07:00
Maximilian von Lindern a808b52f00
state: Add paginating State.Messages (#213)
* Store,State: Add update param to all store.XXXStore.XXXSet methods

* State: add paginating Messages

* Store: Fix test error

* store: merge shouldPrependMessage and shouldAppendMessage into single messageInsertPosition
2021-06-03 21:39:49 +02:00
Samuel Hernandez 40e1a3757d *: Migrated Go Modules to v3 2021-06-01 19:59:01 -07:00
Maximilian von Lindern df5954d2e1
all: Revert incorrect "GuildID" changes (#211) 2021-05-30 14:16:16 -07:00
Maximilian von Lindern d2b70ebfa7 all: Remove deprecated symbols 2021-05-29 22:17:44 -07:00
Scott 10c8837000 api: Finalized buttons implementation (#200)
* all: Added Components fields to message-related types
* discord: Documented Reactions field
* discord: Implement fix for Component
* gateway: Added User and Message fields to InteractionCreateEvent
* api: Made InteractionResponseData fields optional for UpdateMessage responses
* api: Deprecated and updated interaction response types
* gateway: Update optional interaction event fields
* discord: Added ComponentWrap for json unmarshalling
* state: Update components on MessageUpdate
* Updated buttons example
2021-05-29 21:32:33 -07:00
Maximilian von Lindern 56aaed3d60 State: Fix data race between ready and guild create handler 2021-05-29 12:38:22 -07:00
diamondburned 1ffbde98c5 State: Guarantee message order in store 2021-02-25 23:57:45 -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 4e62f120a2 Gateway: Readd Presences into Ready 2020-12-19 18:46:21 -08:00
diamondburned f11edb7260 State: Add Ready Supplement handlers 2020-12-18 22:51:26 -08:00
diamondburned c9dd51aeb6 Store: Fixed defaultstore out of bound error 2020-12-18 22:33:11 -08:00
diamondburned 88911a7d11 Store: Fixed defaultstore not accepting GroupDM channels 2020-12-18 22:18:04 -08:00
mavolin 7a7a56d613 State: remove redundant error return from NewFromSession 2020-12-15 08:32:18 -08:00
diamondburned f4860731fe State: Fixed defaultstore.Message oob crash 2020-11-29 18:21:33 -08:00
diamondburned e0adbfab35 State: Expose NoopStore implementation type 2020-11-29 17:19:47 -08:00
diamondburned c6679dc52c State: Separate Store into smaller interfaces, Cabinet API
This commit refactors the Store interface in State into smaller
interfaces in package store. These interfaces are combined into one
structure called a "Cabinet". The default implementation of those
interfaces have been rewritten in package defaultstore, while the old
no-op implementation stays with the store package.

This commit also omitted several state handlers for user events, as it
is unclear what they are actually structured like.
2020-11-29 16:57:58 -08:00
Maximilian von Lindern 3230916c45
State: don't check store if resource is not tracked through intents (#163)
Partially reviewed; good for the most part.
2020-11-19 10:43:31 -08:00
diamondburned 364f8388ed State: Fixed a mutex copy 2020-11-17 11:01:34 -08:00
diamondburned 6cbe95d2b3 State: Fixed erroneous context setting and races in Ready 2020-11-14 15:30:18 -08:00
diamondburned 615b52de57 Gateway: Added missing GuildCreateEvent handler 2020-11-01 18:58:03 -08:00
diamondburned b7b8118d0b State: Fixed breaking change from previous Gateway change 2020-10-28 19:47:22 -07:00
diamondburned 75df94d9f4 *: Migrated Go Modules to v2 2020-10-28 15:39:59 -07:00
mavolin 6dabffb46c State: fix case where Role would return nil error, even though no role was found 2020-10-18 13:44:37 -07:00
diamondburned f0c73f4c99 State: Ready events now automatically reset the state 2020-08-18 10:20:48 -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
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 78c36f13cd Discord: Rename Snowflake and Timestamp Valid methods (#128)
* Discord: rename Snowflake.Valid() to IsValid()

* Discord: rename Timestamp.Valid() to IsValid()
2020-07-29 16:58:33 -07:00
mavolin ba4b224168 handler: move package from /handler to /utils/handler 2020-07-29 16:58:33 -07:00
diamondburned e79132f2c5 State: Breaking API to fix race conditions in store 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 1c8aaaefcc State: Fixed individual message fetch missing GuildID 2020-07-17 11:35:44 -07:00
diamondburned 9d7f5cb953 Gateway: Deprecated useless type definitions for embedded structs 2020-07-14 21:38:31 -07:00
diamondburned edb8a46ef2 Gateway: Added intent helpers and more context API support 2020-07-11 12:50:32 -07:00
diamondburned (Forefront) 01021f0902 Fixed a compile bug 2020-06-19 00:59:44 -07:00
diamondburned (Forefront) 88dd0f8995 State now handles MsgCreate's missing Member.User field, some bug fixes
This addresses discord/discord-api-docs#1440.

State documentation has been added, which documents the store and
handlers as well.

Bug fixes include:

- PreHandler being called after the state handler; it is now called
before as documented.
- Minor behavior changes regarding Guild Create events. Refer to State's
documentation.
2020-06-19 00:33:22 -07:00
Maximilian von Lindern 1373e42fe1
State: fix State.Message not working when the message's channel is not found in the Store (#117)
* State: fix State.Message not working when the message's channel is not found in the Store

* State: fix State.Message not working when the message's channel is not found in the Store
2020-06-08 07:30:16 -07:00
Maximilian von Lindern de3d0e2160
Gateway: Split GuildCreateEvent (#116)
* Session: fix event handler loop not getting properly closed

* Implement #113

* Session: move guild events to state

* Session: close hStop
2020-06-06 13:47:15 -07:00
mavolin 943ca00ae5 State: implement #114 2020-06-06 10:24:34 -07:00
mavolin efd2ce4c03 State: reduce times a go routine is spawned 2020-06-06 10:24:34 -07:00
diamondburned (Forefront) 53c1ea0f0d State: Fixed Discord not setting GuildID for Ready.Guild.Channels 2020-05-17 23:11:14 -07:00
diamondburned (Forefront) dc303a8635 Merge branch 'master' of github.com:diamondburned/arikawa 2020-05-17 13:31:15 -07:00
diamondburned (Forefront) dfcf6770c3 State: Fixed message out-of-bound during copying 2020-05-17 13:31:08 -07:00
mavolin 41ce1f389e
make all error messages lowercase 2020-05-16 23:14:49 +02:00
mavolin 38b2d4d2b4
State: fix errors not returned 2020-05-16 22:36:46 +02:00
mavolin 6202f53ebb
State: implement #76 2020-05-16 22:15:59 +02:00