Commit graph

1608 commits

Author SHA1 Message Date
ozraru
20aaca3b40
Overwrite entire emoji list on GuildEmojiUpdate (#1261)
* Overwrite entire emoji list on GuildEmojiUpdate

deleted emoji should be deleted from cache

* Updating GuildEmojis inline
2022-10-24 01:22:53 +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
Fedor Lapshin
1ff58d47ef
fix(MultipartBodyWithJSON): form file field name format (#1256) 2022-10-07 14:42:57 +03:00
Tsvetomir Bonev
bb321271cd
fix(structs): fix type of GuildScheduledEvent* enum values (#1254) 2022-10-07 14:41:27 +03:00
Nils Ponsard
bd58eb717e
fix(interactions): incorrect call of State.Role in RoleValue (#1237)
The gID parameter was passed to State.Role as roleID
and roleID was passed as guildID.
This commits inverts the arguments order to fix the issue.
2022-10-07 14:21:30 +03:00
Fedor Lapshin
e57064892a
Forum channels (#1246)
* feat: forums

Initial implementation of forum channels REST API

* fix: linter

* feat: cosmetic changes

Added periods in the end of all documentation comments

* fix(ChannelFlagRequireTag): incorrect value

Fix incorrect value of ChannelFlagRequireTag.

* refactor(DefaultReaction): rename to ForumDefaultReaction

Rename DefaultReaction to ForumDefaultReaction.

* fix(Channel): use ForumDefaultReaction

Use ForumDefaultReaction instead of DefaultReaction in DefaultReactionEmoji field.

* fix: gofmt

* feat: cosmetic changes

* Change "GUILD_FORUM" to "forum" in comment to ForumTag
* Fix spacing for documentation of embeds parameter in ForumThreadStartEmbeds

* docs(ForumThreadStartComplex): align parameters

Align documentation for parameters of ForumThreadStartComplex.
2022-09-29 23:24:27 +03:00
Fedor Lapshin
fea3d77574
feat(*): bump version to 0.26.1 2022-08-29 18:10:38 +03:00
Fedor Lapshin
aa9af1488f
feat(*): bump version to 0.26.0 2022-08-17 20:56:19 +03:00
Fedor Lapshin
622a7d8902
chore(GuildEdit)!: use a pointer for GuildParams (#1228) 2022-08-17 20:22:00 +03:00
Fedor Lapshin
576ecf0003
REST methods cleanup (#1217)
* refactor(GuildRoleEdit)!: use struct params

Refactor GuildRoleEdit to accept parameters using a Params struct.
Therefore also allow partial edits.

* feat(GuildRoleCreate): initial parameters

Make GuildRoleCreate accept a struct with initial parameters for a role

* refactor(ChannelEdit)!: replace ChannelEditComplex

Move funcitonality of ChannelEditComplex to ChannelEdit

* chore: deprecate ChannelEditComplex

* feat(GuildEmbed)!: allow partial edits

* Make fields omitempty
* Make `Enabled` field a pointer

* refactor(GuildEmbedEdit)!: use params struct

Refactor GuildEmbedEdit to accept parameters through GuildEmbed struct

* refactor(GuildMemberEdit)!: replace GuildMemberEditComplex

Move functionality fo GuildMemberEditComplex to GuildMemberEdit

* chore: deprecate GuildMemberEditComplex

* refactor(GuildEmojiCreate)!: use struct params

Refactor GuildEmojiCreate to take parameters using EmojiParams struct.

* refactor(GuildEmojiEdit)!: use struct params

Refactor GuildEmojiEdit to take parameters using EmojiParams struct.

* refactor(GuildMemberAdd)!: use struct params

Refactor GuildMemberAdd to take parameters using GuildMemberAddParams struct.

* refactor(GuildTemplateEdit)!: use struct params

Refactor GuildTemplateEdit to take parameters using GuildTemplateParams struct.

* refactor(GuildTemplateCreate)!: use struct params

Refactor GuildTemplateCreate to take parameters using GuildTemplateParams struct.

* chore(rest)!: use pointers for Params structs

Refactor methods with Params struct to use pointers

* chore: grammar and style fixes in comments
2022-08-17 18:41:11 +03:00
Fedor Lapshin
eee9bcb196
Remove remaining undocumented structs and fields (#1225)
* feat(events)!: drop undocumented structs and fields

* feat(structs)!: drop undocumented structs and fields

* fix(eventhandlers): regenerate event handling code

* fix(Ready): add PrivateChannels back
2022-08-17 17:50:21 +03:00
Fedor Lapshin
3cee831e8b
Add missing fields to GuildMemberParams (#1226)
* feat(GuildMemberParams): add missing fields

Add the following fields to GuildMemberParams
* channel_id

* mute

* deaf

* communication_disabled_until

* fix(GuildMemberParams): null values

Fix null values on omitted fields
2022-08-17 17:17:30 +03:00
Alfonso
73ebf67335
GuildFeatures added to UserGuild (#1223)
* GuildFeatures added to UserGuild

* Better comment phrasing

* Added GuildFeature type to Guild
2022-08-15 20:52:49 +03:00
Fedor Lapshin
7c87035a71
feat(voice): use Dialer for connections (#1220)
Use Session.Dialer for WebSocket connections.
2022-08-14 00:04:52 +03:00
Dylan Lau
f7309cdb9e
feat: add UserGuildMember (#1210)
* feat(UserGuildMember): add UserGuildMember

* Update restapi.go

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

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-08-13 23:59:17 +03:00
Wynell
262e8ba52b
Add dialer property in config (#1179)
Co-authored-by: eeWynell <eewynell@gmail.com>
2022-08-13 23:42:42 +03:00
Corbett
c0803d021f
Add omitempty to channel_id in MessageReference struct (#1002) 2022-08-04 21:51:19 +03:00
Fedor Lapshin
f60fb54c52
feat: add contributing.md
Add CONTRIBUTING.md doc to set guidelines for new contributions.
2022-08-01 18:50:50 +03:00
David G
8b18bf4dc7
Allow setting bool properties of ChannelEdit to false (#1199)
Setting e.g. ChannelEdit.Archived = false is currently not possible
as go will treat a false as empty and will omit the property
from the JSON object.
2022-07-29 18:45:18 +03:00
plally
039e6855ed
fix typo in InviteTargetEmbeddedApplication and in some comments (#1211) 2022-07-29 18:42:40 +03:00
Fedor Lapshin
0feaae8f1b
feat(ApplicationCommandOption): min and max length (#1208)
Implement min_length and max_length for string option type.
2022-07-15 00:40:21 +03:00
Fedor Lapshin
4e021d9140
Auto moderation (#1201)
* feat: auto moderation

* feat(examples/automod): add message content intent

* style(examples/automod): newline between sections

* feat(AutoModerationActionExecution): add user id

Add user_id field to AutoModerationActionExecution event.

* refactor(events): remove todos

Remove TODO comments for AutoModerationRuleUpdate and AutoModerationRuleDelete.

* feat(AutoModerationEventMessageSend): doc comment

Add documentation comment to AutoModerationEventMessageSend constant.
2022-07-03 21:51:15 +03:00
Fedor Lapshin
f697ccae8c
feat(ApplicationCommand): guild id (#1207)
Add missing guild_id field to ApplicationCommand structure
2022-07-02 23:27:27 +03:00
Fedor Lapshin
033c07d89d
feat(interactions): application permissions (#1206) 2022-07-02 23:24:07 +03:00
Zachinquarantine
f446e069a1
Remove deprecated GuildChannel and PrivateChannel methods (#1203)
First deprecated in 2016 with #163
2022-07-01 00:49:29 +03:00
plally
a7f0378623
add GET prefix for ApplicationCommands bucketID (#1193)
* add GET prefix for ApplicationCommands bucketID

* dont use local variable for bucketID

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

* format code

* remove newline

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-06-19 21:20:11 +03:00
Riley
5da28ed4b9
Fix GuildTemplate struct and documentation (#1191)
* fix(structs.go): fix GuildTemplate struct and documentation

* revert(structs.go): change description from a string ptr to a string

* fix(structs.go): make name and description a pointer and omitempty

* fix(structs.go): made Name field not a string pointer. removed extra files

* fix(structs.go): fix Name field not having a type
2022-06-19 18:47:03 +03:00
Elias*
a7b7eaa2af
Use with_localizations flag (#1196)
* Improve support for application command localizations

Signed-off-by: GitHub <noreply@github.com>

* Remove query string from bucket name

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

* Fix formatting

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-06-19 18:43:00 +03:00
Aderlx
e030c5fff8
Add Invite ExpiresAt field (#1198) 2022-06-14 23:23:32 +03:00
Andre Cesar Gomes
c8c153872c
feat: add missing fields to VoiceState struct (#1190) 2022-06-03 15:58:53 +03:00
wass88
414e505c56
Use MakeIntent in voice_recieve example (#1182) 2022-05-23 21:23:09 +03:00
Andres Perez
d7b4a482b5
Use MessageFlags in InteractionResponseData and WebhookParams (#1178) 2022-05-23 01:14:28 +03:00
Andrey Dudin
e455362760
Add ability to reply with embeds (#1160)
* Add ability to reply with embeds

* Fix typo in method comment
2022-05-14 22:56:30 +03:00
Andrei Khodko
fa14e19ad5
fix: check if opus created (#1166)
* fix: check is opus created

* fix: careful concurrency fixes
2022-05-14 22:52:33 +03:00
plally
c29e0d740f
make WebhookEdit fields pointers (#1174)
* make WebhookEdit fields pointers

* fix examples
2022-05-14 22:43:50 +03:00
Andres Perez
eab9aa5218
Remove broken links from README (#1180)
* remove broken links from README

* Restore Go Doc notice in README

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

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-05-14 22:21:51 +03:00
ozraru
e1f154bfe7
Add replied_user to MessageAllowedMentions (#1175) 2022-05-06 23:30:13 +03:00
Christian Gärtner
466321bed6
fix: type of AuditLogActionApplicationCommandPermissionUpdate (#1177) 2022-05-06 23:25:57 +03:00
Fedor Lapshin
9e0783c37f
Application commands: Permissions v2 (#1075)
* feat(interactions): default command permissions

* feat: add ApplicationCommandPermissionTypeChannel

* feat: add deprecation and oauth2 scope comments

* feat(interactions): add GuildAllChannelsID function

* feat(examples/slash_commands): application command permissions

* feat(events): add ApplicationCommandPermissionsUpdate

* feat: add AuditLogActionApplicationCommandPermissionUpdate

* feat(interactions#GuildAllChannelsID): use strconv instead of math/big

* feat(interactions#GuildAllChannelsID): error handling

* feat: cosmetic changes

* fix(examples/slash_commands): handle error returned by GuildAllChannelsID

* fix: typo

* fix: typo
2022-04-29 00:23:07 +03:00
Fedor Lapshin
cd95ccc2d3
feat(*): bump version to 0.25.0 2022-04-18 01:10:01 +03:00
Fedor Lapshin
9dc4ac5cac
Add InviteComplex (#1163)
* feat: implement InviteComplex

* fix: typo

* fix(rest#InviteComplex): guildScheduledEventID
2022-04-17 22:50:10 +03:00
Fedor Lapshin
eda859edc9
feat: custom JSON marshal/unmarshal functions (#1162) 2022-04-17 21:39:18 +03:00
Pancake-e
6f6516bf79
Updated RequestGuildMembers method and GuildMembersChunk event struct (#1156)
* Updated RequestGuildMembers method and GuildMembersChunk event struct

* Added nonce support to RequestGuildMembersBatch and code refactoring

* Minor change to RequestGuildMembersBatchList

* Removed usage of []json.Number in RequestGuildMembersBatchList

* Minor update to GuildMembersChunk struct and comments
2022-04-15 21:20:02 +03:00
Zander
24828068bc
Modify GuildEmojiEdit function of restapi.go (#1022)
* Modify GuildEmojiEdit function of restapi.go

Changes function to not omit empty role information. This allows for properly resetting the roles of an emoji, otherwise it appears to be presently impossible to reset the roles (without including a role ID in the edit request).

* feat: code review changes

* feat: fix typo and rephrase

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-04-15 21:18:47 +03:00
42Atomys
8a126aa174
feat: Add support of Stage Instance REST API and Events (#1158)
* feat: Add support of StageInstance RESTAPI and Events

* chore: Make the changes for following the current convention of package

* doc: Add missing docs and example for stage-instance

* doc: Add final log for deleted stage instance

* refactor: Prevent trailing slash on stage instance endpoint

* chore: Harmonize params structure

* Update structs.go

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

* docs: Remove deprecated doc

* docs: Add new documentation for restapi function

* Update structs.go

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

* Update structs.go

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

* Update restapi.go

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

* Update structs.go

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

* Update structs.go

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

* doc: Add sleep in example to let user see by themselves

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-04-15 00:08:49 +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
Nick Hanley
c615fc7f19
Add option to disable rate-limited request retry (#1151)
* Add option to disable rate-limited request retry

Closes #1011.

* feat: code review changes

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-04-14 22:35:06 +03:00
Dan Brakeley
2b359776da
fix error shadowing in InteractionRespond (#1030) 2022-04-14 22:30:21 +03:00
ToπSenpai
4d72c306b4
Add ApplicationID field to Interaction (#1125)
* add application_id to interaction struct and remove appID param from rest routes

* revert voice receive go mod & sum
2022-04-14 22:07:53 +03:00
Ben McKernan
16efe0842b
feat: add guild scheduled event user add/remove gateway events (#1155) 2022-04-11 18:41:32 +03:00