1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-01 12:34:28 +00:00
Commit graph

272 commits

Author SHA1 Message Date
starshines ca70e0cca9
discord: Add per-guild avatars, ModifyMe -> ModifyCurrentUser (#278)
* v3: discord, api, gateway: add per-guild avatars

* api: rename ModifyMe to ModifyCurrentUser
2021-09-28 11:46:36 -07:00
samhza e203e31ab3
discord: Update to match current API docs (#277)
* discord: update permission constants

* discord: update MessageType constants, add ephemeral field to Attachment

Renamed ApplicationCommandMessage to ChatInputCommandMessage and add
ContextMenuCommand. Add the ephemeral field to Attachment.

* discord: add version field to Command

* gateway: remove ApplicationCommandUpdateEvent

52f1824451
2021-09-23 21:37:50 -07:00
diamondburned 76ec9cd43d discord: Fix InteractionOption.String 2021-09-09 21:12:22 -07:00
samhza dc92845315
discord: move Interaction over; update api.CommandCreateData (#274)
- Moved gateway.InteractionCreateData to discord.Interaction, now
gateway.InteractionCreateData is a struct that wraps
discord.Interaction.
- Split InteractionData into CommandInteractionData and
ComponentInteractionData.
- Renamed ButtonInteraction to ComponentInteraction.
- Updated api.CommandCreateData to add new fields.
- Update Component types' Type() methods to pointer receivers.
2021-09-09 16:06:44 -07:00
Maximilian von Lindern 02712516e3 discord: Change type of SelectComponent.MinValues to option.Int 2021-08-30 13:23:43 -07:00
Maximilian von Lindern 53c72c1e16 option: Move conflicting types into package discord 2021-08-30 13:23:43 -07:00
Maximilian von Lindern 2647267460
discord: Fix style issues (#272)
* Discord: Fix comment style issues

* Discord: use URL type alias for URls instead of string
2021-08-30 13:15:59 -07:00
rigormorrtiss eece98903a
discord: Add Banner & Accent fields to User (#267)
* feat(discord): add banner & accent_color field to User struct

* feat(discord): use type Color (uint32) for User.AccentColor

* discord: change field name to Accent
2021-08-16 23:48:36 -07:00
rigormorrtiss b253a5659b
discord: Add Invitable field for threads (#268) 2021-08-16 22:37:33 -07:00
rigormorrtiss e97dcb750c
discord: Add omitempty option to Attachment.ContentType (#263) 2021-08-12 11:45:48 -07:00
Juby210 21888dcfc2
discord: Add missing ContentType to Attachment (#262) 2021-08-11 18:16:50 -07:00
starshines f7880b91ee
discord: Add select component type (#260) 2021-08-10 14:02:30 -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 101fe46313
api: Add missing slash command endpoints (#252)
* api: add missing slash command endpoints
* fix examples
* api: Remove Original prefix from Client.OriginalInteractionResponse,
  EditOriginalResponse, and DeleteOriginalResponse
2021-08-03 11:44:20 -07:00
Starshine System 127c6776ac discord: add missing command option types 2021-08-03 09:07:09 -07:00
rigormorrtiss 2fe1150d01
discord: Update Sticker struct, add missing fields (#251)
* Update Sticker struct & add missing fields

* Remove PreviewAsset field from Sticker

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

* Update discord/message.go

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

* Change Sticker.User type to *User

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

* Update discord/message.go

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

* Sticker types start from 0

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

* Change Sticker.SortValue type to *int

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

* Remove extra space

* Un-ignore Sticker.Tags field

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>

Co-authored-by: Maximilian von Lindern <maximilian.v.lindern@gmail.com>
2021-08-02 16:16:06 -07:00
Maximilian von Lindern ce4bd67f17
discord: Add missing webhook fields (#250)
* discord: add missing webhook fields
* discord: add missing ,omitempty tags on Webhook
* discord: add missing ,omitempty tags on Webhook
2021-08-02 16:14:34 -07:00
Starshine System 9651328b74
discord: Raise embed description limit to 4096 characters (#243) 2021-07-11 13:19:54 -07:00
samhza 1b12057e51
discord: Make OverboundError.Error() have a pointer receiver (#232) 2021-06-18 00:15:02 -07:00
samhza 37b8871c65
api: Update sending/editing messages for v9 (#230)
api.{Send,Edit}MessageData and their equivalents in package api/webhook
have been updated to add some fields added in Discord API v9.
(webhook.Client).EditMessage now also returns a message, because that
endpoint returns a message on success.
2021-06-17 23:32:11 -07:00
Germano Eichenberg 94090b92ff
discord, gateway: Add IsPending to Member & SupplementalMember (#231) 2021-06-17 13:40:57 -07:00
diamondburned 68313eb872 discord: Fix Channel not unmarshaling 2021-06-14 15:23:08 -07:00
Maximilian von Lindern c8e7eff04e discord: rename ActivityTimestamp to ActivityTimestamps 2021-06-06 13:12:24 -07:00
Maximilian von Lindern f1f4f06979
*: Rename error types to have Error suffix (#215) 2021-06-06 12:40:24 -07:00
Samuel Hernandez 40e1a3757d *: Migrated Go Modules to v3 2021-06-01 19:59:01 -07:00
Maximilian von Lindern c45096c9fa
discord: Fix faulty marshal of Channel.RTCRegionID (#210) 2021-05-30 14:14:41 -07:00
Maximilian von Lindern 5a1837a094 discord/api: Add StageInstances 2021-05-29 22:17:39 -07:00
diamondburned 4595c87e36 discord: Fix {un,}marshal loop 2021-05-29 22:07:39 -07:00
Maximilian von Lindern 6f73088e7d api/discord: Add RTCRegionID and VoiceQuality 2021-05-29 22:07:39 -07:00
diamondburned b936d00ead discord: Minor comment fixes for components 2021-05-29 21:32:38 -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
unknown a1ab986ded discord: Emoji methods use IsUnicode() 2021-05-29 14:16:44 -07:00
unknown 58fea822e1 discord: Fixed docs links 2021-05-29 14:16:44 -07:00
unknown d69abe49de discord: Add AllVoice perms 2021-05-29 14:16:44 -07:00
unknown f5b3e3972b discord: Use consts for Discord constants 2021-05-29 14:16:44 -07:00
Chan Wen Xu c880cb2fc8 interaction: Implement buttons 2021-05-29 14:16:44 -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
diamondburned 968112fb53 Discord: typed snowflake for Interaction 2021-02-17 17:41:19 -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
mavolin d940a97a0f Discord: add support for string based OverwriteTypes as used in GuildCreate 2021-01-10 13:29:11 -08:00
diamondburned dcee1c2506 Discord: Fixed MessageType values 2021-01-05 13:38:37 -08:00
diamondburned 3e2814748f Discord: Fixed Sticker rec bug, simpler TagList method 2020-12-19 16:08:28 -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 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
diamondburned 6ef093eb98 Gateway: Refactor, v8 user struct updates
This commit refactored several structures from package discord to be in
package gateway. Those structures are mostly presence ones, which per
official documentation has a lot more to do with the Gateway API than
the REST API or anything else.

This commit also renamed several global variables to have a more
consistent and obvious name.

As of v8, the user API has had a lot of minor and some major changes,
especially regarding its Ready event API. The most significant change is
the addition of the ReadySupplemental event as well as several changes
to the Ready field itself.

All of these changes above are breaking, and they have already broken
the state package. These breaking changes will be addressed in other
packages by the next commit.
2020-11-28 17:22:03 -08:00
diamondburned ba1200059c Discord: Fixed regression of unmarshaling Permission in Guild 2020-11-22 15:14:14 -08:00
mavolin fc5d10ced8 Discord: optimize struct sizes; add missing fields 2020-11-22 09:16:24 -08:00
mavolin a616eae7f0 API: rename ServiceX constants to XService 2020-11-22 09:14:07 -08:00
mavolin 0ec646e2a6 Discord: add Discord Service 2020-11-22 09:14:07 -08:00
mavolin da8de00e75 Discord: remove unnecessary option types 2020-11-22 09:14:07 -08:00
mavolin eb528da31d Discord: add missing Integration fields 2020-11-22 09:14:07 -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
Maximilian von Lindern d6a45529ad
Discord: Add Sticker (#167)
* Discord: add sticker related types

* Discord: add Sticker field to Message
2020-11-21 08:35:19 -08:00
Terra Brown cdc0cfc300
Discord: (*Member).Mention proper format (#164) 2020-11-18 15:55:15 -08:00
mavolin f9a59ac2e7 Discord: add doc to MessageReference
Add addtiontional type information to MessageReference as found in discord/discord-api-docs#2053
2020-11-03 10:25:57 -08:00
mavolin eb118dc1d6 Discord: add Message.ReferencedMessage and InlinedReplyMessage 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 108913b701 Discord: OverwriteType to accept numbers both stringed and not
Because Discord is so incompetent that they can't even handle 1s and 0s
in JSON, we can't really predict when they quote a number and when they
don't, because as it turns out, the documentation does not cover all
cases.

This commit adds a JSONUnmarshaler into OverwriteType to always trim the
quotes around then parse the number manually.
2020-10-29 13:25:03 -07:00
diamondburned 21ac7972fa Discord: Renamed guild_const.go to guild_consts.go for correctness 2020-10-29 13:21:02 -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 795cbdef53 Discord: Fixed redundant and broken OverwriteType 2020-10-28 14:49:30 -07:00
diamondburned 994ddca1e1 Discord: Updated the Presence struct to be smaller
This commit omits a few fields in the Presence struct in accordance to
the new v8 structures.

    Removed roles, premium_since, and nick
2020-10-28 14:39:44 -07:00
diamondburned d405cc22b7 Discord: Embed fields deprecated 2020-10-28 14:13:19 -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 8aa60ebf8e *: Removed the Game field
The Activities field should now be used. Access the first element.
2020-10-28 14:01:08 -07:00
mavolin 647efb8030 Discord: add Mention method to mentionable Snowflakes 2020-09-24 11:54:45 -07:00
mavolin 5acf9f3f22 Discord: fix invalid role mention generation 2020-08-24 16:32:51 -07:00
diamondburned 87c648ae1d Discord: ParseSnowflake now uses ParseUint 2020-08-19 21:53:22 -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
mavolin 2a032ebfab Discord: add watching activity 2020-08-03 17:46:04 -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 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 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
Tadeo Kondrak d290b0d01c *: Add typed Snowflake IDs (#122)
This PR closes #120.
2020-07-29 16:58:33 -07:00
diamondburned d18298aca9 Discord: Updated message's URL 2020-07-17 11:33:57 -07:00
diamondburned 7572caad31 Discord: Added Relationship API methods; moved structs around 2020-07-14 18:01:24 -07:00
mavolin 52bec08cc6 Discord: fix discovery splash url not getting properly calculated 2020-05-24 17:24:58 -07:00
mavolin 46b001548d Discord: fix wrong hash for discovery splash url 2020-05-24 09:08:24 -07:00
mavolin 19b970bad7 Discord: fix #105 2020-05-23 14:24:03 -07:00
Maximilian von Lindern ce38507fb0
Discord: fixes around meta images (#104)
* API: fix illogical order of parameters

* Discord: fixes around meta images
2020-05-23 10:17:30 -07:00
mavolin 6fbc3e6afd Discord: fix #102 2020-05-23 09:04:12 -07:00
mavolin 530bff74a2 Discord: fix faulty default image link 2020-05-22 14:40:36 -07:00
Maximilian von Lindern 68701704a1 Discord: fix wrong field naming 2020-05-22 08:14:35 -07:00
mavolin 68d3129bfd Discord: add docs 2020-05-22 08:14:35 -07:00
mavolin f4be7971ee Discord: add missing fields to Guild struct 2020-05-22 08:14:35 -07:00
mavolin c5f1bf4753 Discord: add docs for auditlog.go 2020-05-18 10:25:17 -07:00
mavolin 805df29c2e Discord: fix #83 2020-05-17 10:34:47 -07: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
Maximilian von Lindern 2c98f4e8e4
Discord: fix typo 2020-05-15 22:13:15 +02:00
mavolin 2c4022734b
Discord: create XURLWithType methods 2020-05-15 22:07:27 +02:00
mavolin ceb6986749
Discord: add ImageType 2020-05-15 21:52:45 +02:00
mavolin 6ee5a1b26d
Discord: fix #70 2020-05-15 20:39:08 +02:00
mavolin b5dedf9408
API/Discord: add GuildPreview 2020-05-15 20:10:35 +02:00
diamondburned (Forefront) 1ca7d1c62c Discord: Fixed Snowflake Valid() returning true for null 2020-05-14 01:03:48 -07:00
diamondburned (Forefront) aa07ff9a43 Discord: Fixed Emoji.APIString() mishandling Unicode characters 2020-05-14 00:49:10 -07:00
Matthew Penner 592d2f7172 Fix null snowflakes being formatted as 18446744073709551615 2020-05-13 15:51:26 -06:00
mavolin 04a80d33e8
API: add docs, use option types 2020-05-12 03:44:13 +02:00
mavolin b3bfc29732
Utils: move Enum to package enum 2020-05-11 22:43:52 +02:00
mavolin b17c32187e
API: implement option and nullable types. 2020-05-11 05:24:59 +02:00
mavolin a29a521c5a
Utils: add nullable package 2020-05-11 04:30:34 +02:00
mavolin c1f942bb92
Discord: use Enum type for types mentioned in #29 2020-05-11 03:26:46 +02:00
diamondburned bc27d1481d
Merge pull request #37 from mavolin/35-modify-integration 2020-05-10 16:50:47 -07:00
mavolin 1b990cd58d
Discord: add dedicated type for ExpireBehavior 2020-05-11 01:45:44 +02:00
mavolin 3dd8daca3d
Discord: Fix #32 2020-05-10 22:11:11 +02:00
diamondburned (Forefront) 0f38294048 API: Added GuildWithCount 2020-05-09 14:59:39 -07:00
diamondburned (Forefront) f9c962fb96 Discord: Added tests for Snowflake 2020-05-08 14:11:56 -07:00
diamondburned (Forefront) 2cad0e87b6 Discord: Marshalled Snowflakes are now -1 when null 2020-05-08 13:56:00 -07:00
diamondburned (Forefront) 55323ee753 Discord: Allow -1 null Snowflake, fixed snowflake time bug 2020-05-08 13:52:46 -07:00
diamondburned (Forefront) cd1dfa10a0 Discord: Removed an inappropriate comment 2020-05-07 20:07:48 -07:00
diamondburned (Forefront) 52ca6638f5 Discord: Fixed incorrect Audit Log structures 2020-05-07 20:01:44 -07:00
diamondburned (Forefront) 56d189be3d Discord/API: Added Audit Log 2020-05-07 17:09:45 -07:00
Samuel Hernandez d252ad1db3
Discord: Fix UserFlags constants for good 2020-05-05 21:08:40 -04:00
diamondburned (Forefront) 3536ae4cb6 Discord: Added a helper HasFlag function 2020-05-04 23:13:15 -07:00
Samuel Hernandez becc1e129a
Discord: Added PublicFlags to User
In the Discord API, User objects were recently given a public_flags
property that bots can access (without OAuth). I've added a field to the
User struct for this.
2020-05-05 01:34:45 -04:00
diamondburned (Forefront) d4fd61c24b Discord: Fixed invalid iota for UserFlags 2020-05-04 20:36:39 -07:00
diamondburned (Forefront) 88eb0a6d85 Discord: Added missing UserFlags constants, fixed overflow 2020-05-04 20:22:06 -07:00
diamondburned (Forefront) 3005c7b44a Voice: Separated UDP and WS into packages, added io.Writer API 2020-04-24 19:36:33 -07:00
diamondburned (Forefront) 0d81f9176a Discord: Added a fallback avatar URL 2020-04-14 20:52:48 -07:00
diamondburned (Forefront) 9873d475aa State: Added Reaction state handlers 2020-04-12 16:14:27 -07:00
diamondburned (Forefront) b5f7af70f3 Gateway: Changed UpdateStatus to be more valid 2020-03-31 20:45:56 -07:00
diamondburned (Forefront) 74f7f5877d Gateway: Fixed more omitempties for UpdateStatus 2020-03-30 22:50:46 -07:00
diamondburned (Forefront) 38eabeb1e9 Gateway: Fixed UpdateStatus omitempty and structs 2020-03-30 22:46:34 -07:00
diamondburned (Forefront) 9f6d1bde30 Gateway: Separated Activity types 2020-03-30 22:00:28 -07:00
diamondburned (Forefront) c9829b9e28 Gateway: Fixed invalid Since type for UpdateStatusData 2020-03-30 21:46:03 -07:00
diamondburned (Forefront) 6cd4b361ce Discord: Added Channel.IconURL 2020-03-05 15:49:44 -08:00
diamondburned (Forefront) 687cad0c72 Discord: Fixed incorrect ActivityType constant 2020-02-23 18:20:13 -08:00
diamondburned (Forefront) 55ebeaf45f Discord: Added a convenient RGB function for Color 2020-02-23 10:11:10 -08:00
diamondburned (Forefront) 4a1d6ad456 Gateway: Added SESSIONS_REPLACE 2020-02-23 09:56:16 -08:00
diamondburned (Forefront) e0589785c5 Discord: Added missing Height and Width into EmbedImage 2020-02-22 16:38:19 -08:00
diamondburned (Forefront) ee60638a55 Gateway: Added more constants
ad3a26ff9a
b30636692a
2020-02-21 23:56:25 -08:00
diamondburned (Forefront) a44cdcc34a Discord: Added Link embed type 2020-02-21 23:05:35 -08:00
diamondburned (Forefront) 4b53d72db1 Discord: Removed invalid avatar discriminator URL 2020-02-17 09:28:52 -08:00
diamondburned (Forefront) 0f3eb688e1 M*erge branch 'master' of github.com:diamondburned/arikawa 2020-02-10 20:26:27 -08:00
diamondburned (Forefront) 60f1963c4b Discord: EditedTimestamp no longer a pointer 2020-02-10 20:26:22 -08:00
Juby210 914eb27a5d
Reactions instead of reaction in message struct 2020-02-10 16:12:47 +01:00
diamondburned (Forefront) 330020b6f2 Discord: added Guild URL methods 2020-02-06 16:51:29 -08:00
Carlo Field 1b607b9aa5
Add missing permissions to permission summaries 2020-01-27 20:51:56 +01:00
diamondburned (Forefront) 1c25ccbf8e Bot: added data return types 2020-01-26 01:06:54 -08:00
diamondburned (Forefront) cea3e47c27 discord: Fixed APIString method for emoji 2020-01-25 00:05:14 -08:00
diamondburned (Forefront) 7836c15cf8 Added User AvatarURL 2020-01-23 22:00:41 -08:00
diamondburned (Forefront) 4d547d6f10 Added Message URL method 2020-01-23 21:49:34 -08:00