Commit graph

82 commits

Author SHA1 Message Date
88a40c83dc
chore: move MessageEmbedBuilder
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / format (pull_request) Has been cancelled
CI / test (1.13) (pull_request) Has been cancelled
CI / test (1.14) (pull_request) Has been cancelled
CI / test (1.15) (pull_request) Has been cancelled
CI / test (1.16) (pull_request) Has been cancelled
CI / test (1.17) (pull_request) Has been cancelled
CI / test (1.18) (pull_request) Has been cancelled
2025-05-17 22:10:00 +09:00
6221ca05b9
feat: add MessageEmbedBuilder 2025-05-17 20:59:25 +09:00
Fedor Lapshin
9600402fc1
feat: components v2 structures 2025-04-26 14:05:02 +03:00
Fedor Lapshin
49980810d5
fix id type and add messageflags prefix to IS_COMPONENTS_V2 flag 2025-03-07 22:19:45 +03:00
Fedor Lapshin
4d660d08b9
feat(message): add MessageComponentsV2 flag 2025-03-07 22:16:17 +03:00
Fedor Lapshin
2d15f13e65
feat(Message): add MessageSnapshots (#1604) 2025-03-04 13:13:56 +03:00
Elliot Williams
00db80a651
feat(MessageReference): add Type (#1595)
https://discord.com/developers/docs/resources/message#message-reference-types
2025-03-04 12:44:35 +03:00
lon
41a66e5f15
feat(Message): add poll field (#1541) 2024-07-29 15:45:23 +03:00
Fedor Lapshin
d26ad10ba6
feat: implement polls (#1525)
* feat: add poll events

* feat: add poll structs

* feat(MessageSend): add poll field

* feat(InteractionResponseData): add poll field

* feat: add endpoints
2024-06-21 10:37:32 +03:00
Fedor Lapshin
a31fd8617e
feat: user apps (#1511)
* feat: add integration types

* feat(ApplicationCommand): add integration_types

* feat(interactions): implement contexts

* feat(Interaction): add authorizing_integration_owners

* chore(ApplicationCommand): deprecate DMPermission

* feat(Application): add integration_types_config

* feat(Message): add InteractionMetadata

* feat(ApplicationIntegrationTypeConfig): add omitempty tag to OAuth2InstallParams

* feat(Application): add omitempty tag to IntegrationTypesConfig
2024-06-20 17:56:18 +03:00
Fedor Lapshin
8968e58b4d
docs(message): remove the mention of Sticker objects 2024-02-26 14:18:02 +03:00
Earlopain
c3f22cb8ab
feat(message)!: use partial sticker objects (#1494) 2024-02-26 14:13:17 +03:00
AlexeyOplachko
7f80bc7978
fix(message)!: omit empty Components and Embeds (#1483)
---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2024-02-03 02:59:38 +03:00
ozraru
ff9176adcc
feat(MessageSend): add flags (#1427)
Add Flags field to MessageSend struct
2023-08-16 16:46:54 +03:00
ozraru
a7ba2904ba
feat: add new message flags (#1428)
Add MessageFlagsSuppressNotifications and MessageFlagsIsVoiceMessage.
---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-08-16 10:19:57 +03:00
Earlopain
1252b71f38
feat(MessageReference): add fail_if_not_exists (#1376)
* Add fail_if_not_exists to MessageReference
* Add SoftReference function to Message

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-05-14 18:53:29 +03:00
Yara McRobert
b7c431c368
Added stickers to type MessageSend (#1340)
* Added stickers to type MessageSend

* Update restapi.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update message.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-04-04 18:30:57 +03:00
BunnyTheLifeguard
86539504d9
fix: remove embedfield omitempty (#1262)
Remove omitempty from Name/value since the Discord API requires both to be submitted.

Fixes: #726
2022-10-24 01:30:03 +03:00
Dan Dryaev
410cf4fac5
Add files to MessageEdit (#1253)
* Add files to MessageEdit

* Remove files from json

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-10-07 14:47:55 +03:00
Corbett
c0803d021f
Add omitempty to channel_id in MessageReference struct (#1002) 2022-08-04 21:51:19 +03:00
ozraru
e1f154bfe7
Add replied_user to MessageAllowedMentions (#1175) 2022-05-06 23:30:13 +03:00
nixxquality
b138df6efe
Expose flags on MessageEdit so you can suppress embeds on other messages (#973)
* Expose Flags on MessageEdit and add SuppressEmbeds

Also fix typo in the message flags enum

* Fix deprecation comment

* Add omitempty to Flags member

I wasn't sure if this was going to work but the documentation says:

> The "omitempty" option specifies that the field should be omitted from the encoding if the field has an empty value, defined as false, 0, a nil pointer, a nil interface value, and any empty array, slice, map, or string.

Therefore, if Flags is unmodified it will be omitted.

* Make Components omitempty

I think the null value here may be triggering the "Cannot edit a message authored by another user"

* Remove convenience function for now

* Move deprecated member out of list

Stops the gofmt error

* Fix golint issue

* Change deprecation comment

* feat: code review changes

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-04-14 23:33:51 +03:00
Fedor Lapshin
79784e28e8
fix: remove omitempty from non-optional MessageEmbed* fields (#1001)
Co-authored-by: rigormorrtiss <rigormorrtiss@gmail.com>
2022-04-05 22:39:13 +03:00
fiatjaf
9586f7fb38
Remove omitempty for Embeds (#1106)
* do not omit empty .Embeds so we can clear embeds when editing.

* also do not omitempty for required: false in text inputs.
2022-03-07 15:51:03 +03:00
ToπSenpai
ca264d70ff
add interaction field to message struct (#1112)
* add message interaction field and struct

* Update message.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update message.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update message.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* add notice when member is present

* correct comment

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-26 23:16:57 +03:00
nitroflap
f25b625499
feat(message): added content_type to MessageAttachment 2022-02-26 15:01:01 +03:00
Flexolk
b7ce746717
Add get guild stickers support (#1095)
* Add get guild stickers support

* fix: change the type of Stickers of StickerPack to array pointer
2022-02-18 22:30:56 +03:00
Fedor Lapshin
992358e106
Threads reloaded (#1058)
* feat(endpoints): bumped discord version to 9

* feat: threads barebones

* feat(threads): documentation

* feat(threads): membership caching

* feat(threads): added type to StartThread method

* fix: replaced missing Timestamp definitions with time.Time

* chore: removed debug logs

* chore: removed thread alias for channel type

* feat(webhooks): separated thread option into method

* fix(state): ThreadMembersUpdate member duplication bug

* fix: golint

* feat(threads): pr fixes and BeforeUpdate in ThreadUpdate

* feat: removed unnecessary todo

* feat(state): removed thread last message update in MessageAdd

* Revert "feat(state): removed thread last message update in MessageAdd"

This reverts commit 4ca359fd2cc304e5d0ec2937e25c0c487a1f2096.

* feat(state): update only last message id for thread update

Implements updating message id in MESSAGE_CREATE and MESSAGE_DELETE events. Refer to https://discord.com/developers/docs/topics/gateway#thread-update for more info.

* fix(restapi): passing threadID in WebhookThreadExecute

* feat(state): dropped last_message_id updates for threads

* fix: gofmt

* feat(events#ThreadCreate): added newly_created field

* feat(restapi)!: corrected names of thread functions
2022-02-17 22:50:42 +03:00
constantoine
7248e0673e Explicit values 2022-02-09 11:59:10 +01:00
constantoine
f4ad6e85ea Add MessageFlags values 2022-02-09 11:23:02 +01:00
Jordan Cartwright
aba5dc811d
Stickers (#1057)
* added in sticker endpoints

* added sticker objects to messages

* add type to Sticker struct
2022-02-02 14:46:01 -05:00
Carson Hoffman
fccf6db03e
Remove Timestamp type, use time.Time 2021-12-24 12:38:50 -05:00
Fedor Lapshin
f0b7e81468
feat: ephemeral attachments (#1008) 2021-10-10 11:09:59 -04:00
xIceArcher
842ddb357a
Support for multiple embeds in message routes (#1000) 2021-10-10 10:56:47 -04:00
Fedor Lapshin
9d9602318a
Context menus (#978)
* Interactions: context menus

* Example for message context menus

* Added flags to followups

* Example for user context menus

* Godoc fix

* Rebase fix

* Update message types to reflect new separations

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-08-18 16:16:46 -04:00
Carson Hoffman
f7454d039f
Add more safety around message reference misuse 2021-08-10 21:40:36 -04:00
Fedor Lapshin
421e149650
Interactions: the Buttons (#933)
* Interactions: buttons

* Doc fix

* Gofmt fix

* Fix typo

* Remaking interaction data into interface

* Godoc fix

* Gofmt fix

* Godoc fix

* InteractionData helper functions and some fixes in slash commands example

* Fix components example

* Yet another fix of components example

* Fix interaction unmarshaling

* Gofmt fix

* Godoc fix

* Gofmt fix

* Corrected naming and docs

* Rolled back API version

* Requested fixes

* Added support of components to webhook and regular messages

* Fix components unmarshaling

* Godoc fix

* Requested fixes

* Fixed unmarshaling issues

* Components example: cleanup

* Added components tracking to state

* Requested fixes

* Renaming fix

* Remove more named returns

* Minor English fixes

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-06-27 12:16:52 -04:00
Carson Hoffman
f5bb723db8
Convert more constants to absolute values
See 843c765ae3 for reasoning.
2021-05-29 17:55:43 -04:00
post
4f55d76981
update Activity struct and add emoji functions (#895)
* update Activity struct and add emoji functions

* fix the emoji regex

* Remove inline type definitions

* Change function name

* fix message_test function name

* make custom unmarshaljson and change `CreatedAt` to `time.Time`

* fix

Co-authored-by: post <61803796+postrequest69@users.noreply.github.com>
2021-04-10 16:17:16 -04:00
Carson Hoffman
9fc2793e83
Add reply and application command message types 2021-01-20 18:14:50 -05:00
Carson Hoffman
93d5c5947b
Correct gap in message types 2021-01-20 18:13:18 -05:00
Nicholas Phillips
26be533516
Add omitempty to MessageReference's GuildID field
Direct Messages do not have the **guild_id** field for Message Referencing / the new Reply feature.
__Instead it is only **message_id** and **guild_id**__
2020-12-03 16:49:07 -05:00
Alexey
1b13267ba4 Add support for sending message reply 2020-11-20 16:11:12 +03:00
TroyDota
9ce4a230c8
Updates API (#785)
* Update to API

Updates the golang stuct to current api documentation and adds new util

* Revert of change.

* Update message.go

* Update structs.go

* Yikes this my hand hurts.

* Consistency

* Update message.go
2020-06-28 18:53:46 -04:00
Carson Hoffman
cab170c8f5
Add types to untyped constants 2020-06-28 16:57:51 -04:00
Carson Hoffman
895df5370c
Add allowed mentions 2020-04-19 10:29:47 -04:00
Carson Hoffman
afe392e6c1
Merge pull request #694 from BigHeadGeorge/fix-tts-casing
Fix inconsistent TTS casing
2019-12-26 20:22:41 -05:00
Sebastian Winkler
dce574199f
fixes lint 2019-10-03 14:52:55 +02:00
Sebastian Winkler
cb8dd746bc
adds message fields 2019-10-03 14:14:32 +02:00
tuckerrrrrrrrrrrr
bc6197c5e6 fix inconsistent tts casing 2019-09-10 18:09:24 -07:00