Commit graph

62 commits

Author SHA1 Message Date
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
JurrijnP
05bae35ddb
Add 1 more message type 2019-08-19 10:55:59 +02:00
JurrijnP
f4f8cc09bc
Added more message types
Added Premium Guild Sub message types.
2019-08-02 20:06:45 +02:00
JurrijnP
5fb15f5823 Add Pinned to Message struct (#633)
* Bump to v0.17.0

* Add members from GuildMembersChunk to state (#454)

* Revert "Add members from GuildMembersChunk to state (#454)" (#455)

This reverts commit e4487b30d4.

* added clarification when initializing discordgo

from the code I ran on my system with the latest changes this seems to be the syntax for the authentication tokens. I'm guessing it was just never updated.
Let me know if this is incorrect. 
Thanks!

* travis: update go versions

* Add Pinned member to message struct

Pinned member was missing.

* Missed an :

* Update README.md

* Removed space
2019-07-21 21:10:35 -07:00
Soumil07
412fc067e6 Add WebhookID member to message property (#607)
* track membercount on memberAdd and leave

* requested changes

* add WebhookID member to message
2018-10-26 07:57:14 -07:00
Dim
82c8cf21b2 Add GuildID to multiple structs (#541) 2018-05-02 17:07:23 -07:00
Carson Hoffman
964060f34c General documentation improvements 2018-03-14 14:57:40 -04:00
Wim
ffa9956c9b Fix role mention replacement (#509)
* Fix role mention replacement

* Fix message test too
2018-02-14 15:05:22 -08:00
Bruce
06b35cfe24 Linting. 2017-09-03 20:01:46 +00:00
legolord208
7bb0965a6f Updated to v6 (fixes #408) (#410)
* Updated to v6

* Unified websocket and REST version
2017-07-22 06:17:39 -07:00
legolord208
5a02430c02 ContentWithMoreMentionsReplaced for roles and nicks (Fixes #208) (#375)
* ContentWithMentionReplaced on roles and nicks (Fixes #208)

* Compatibility

* Like this? 🤔

* More efficient regexp

* Tweaked a little

* Tweaked a little more

* Tweaked even more

* Removed unessecary crap condition that is useless

* Disallow voice channel

* Moved regexp declaration
2017-06-13 08:49:41 -07:00
rfw
874325a504 Add and fix support for multiple file uploads via ChannelMessageSendComplex via the new field MessageSend.Files. (#391)
For compatibility with existing library consumers, the File field is retained but will behave as if Files contained that single file. If both are specified, ChannelMessageSendComplex will return an error.

The message JSON payload is moved to a form-data field called `payload_json`, instead of set in multipart form data. This is supported and the recommended way, as per the API docs.

Apparently, you can attach multiple files if you just name the parts names differently in the multipart request. The parts are named here using the order the files were specified, as `file%d`. This is not documented in the API docs, but definitely works.

This also removes serialization of the File field via json.Marshal, as it will never be directly serialized in the JSON. The new field, Files, is similarly not marshaled.

This additionally adds a ContentType field in File, which can be used to specify the content type of the attached file. The ContentType field will default to setting the header to `application/octet-stream` if empty. Discord currently doesn't do much with the Content-Type header, but we should pass this information along anyway in accordance to the MIME standard.
2017-06-10 13:13:28 -07:00
legolord208
2b80b35528 ChannelFileSendWithComplex (#370)
* ChannelFileSendWithComplex

* Moved to ChannelMessageSendComplex

* Oops

* Return consistency

* Re-used variable

* Omit empty
2017-05-01 07:50:49 -07:00
legolord208
5cc4af9aa2 Chaining ChannelMessageEditComplex (#365)
* Chaining ChannelMessageEditComplex

* Removed .Do()
2017-04-28 12:24:38 -07:00
LEGOlord208
851e8d3581 SendContent (#352)
* SendContent

* Fixed error...?

* Commented

* Yep let's do that

* Oops

* Oki

* Whatever you say, Travis... :<

* Omit them empty structs
2017-04-09 21:47:32 -07:00
LEGOlord208
fea42d937a ChannelMessageSendComplex (#349)
* ChannelMessageSendComplex

* ChannelMessageEditComplex

* I am a murderer.

* Travis didn't like that.

* I can't spell
2017-04-07 20:15:31 -07:00
Chris Rhodes
c96162c425 Add support for Message Reactions. 2016-11-03 22:07:06 -07:00
Chris Rhodes
ee3e500749 Add webhook support. 2016-11-03 19:41:57 -07:00
uppfinnarn
0c11cae782 Timestamp type; a string with a Parse() function
Closes #204
2016-07-28 21:16:10 +02:00
Chris Rhodes
96bcdc00a5 Replace multiple replaces with one regex replace. 2016-05-03 20:51:04 -07:00
Bruce
2136202ea9 Merge pull request #188 from jonas747/develop
Add mention_roles
2016-04-30 07:48:24 -05:00