Commit graph

1488 commits

Author SHA1 Message Date
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
Rootspring
064fa164a0
Add guild NSFW level (#1029)
* Add guild NSFW level

* Fix typo

* fix(structs): typo

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-04-10 23:41:53 +03:00
Fedor Lapshin
7e04178d26
feat(rest): add GuildEmoji (#1153) 2022-04-10 19:53:52 +03:00
Fedor Lapshin
cff170546c
Fix RateLimitPerUser on ChannelEdit (#1152)
* fix ability to turn off slowmode via ChannelEdit

* fix(structs): gofmt

Co-authored-by: Cyrus <50967051+Not-Cyrus@users.noreply.github.com>
2022-04-10 18:36:05 +03:00
Ceriath
fb0692b08d
Add example of emojiID to MessageReactionAdd (#798) 2022-04-08 01:23:20 +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
Adam Jarvis
c3c6c1b6c2
Payload for member edit (#1122)
* Create payload for Guild Member Edit

* Update rest API usage with new payload

* Update comment with ref to discord API

* Change data to pointer instead

* Change struct to just nick and roles

* Review comments

* feat(rest#GuildMemberEditComplex): return updated member and cosmetic changes

* feat(structs): renamed GuildMemberEditData to GuildMemberParams

* style(structs#GuildMemberParams): fix spacing

* fix(rest#GuildMemberEditComplex): use GuildMemberParams instead of GuildMemberEditData

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-04-05 01:33:27 +03:00
SwitchUpCB
0c27cedbcb
Slash commands example: parse options into a map (#1129)
* implement code resolutions

removes parseMap from the API and requires user inclusion

* optimize map initialization

* add note for parseOptionsToMap capacity

* feat(examples/slash_commands): removed parseOptionsToMap

* feat(examples/slash_commands): cosmetic changes

* fix(examples/slash_commands): typo

* fix(examples/slash_commands): another typo

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-04-04 19:20:02 +03:00
Pancake-e
7e3d187823
Added Guild Members Search Function (#1150)
* Added Guild Members Search Function

* Updated method name to be consistent with other endpoints

* Refactored and moved GuildMembersSearch method for consistency
2022-04-04 16:26:45 +03:00
Jim Eagle
4ef1d502cd
Update Go version in CI (#1147)
* Update ci go

* Update setup-go

* Update checkout

* Update golangci-lint-action

* Upgrade golangci-lint
2022-04-01 17:55:27 +03:00
nitroflap
4637c5b7e8
feat(rest): add pagination params for GuildBans 2022-04-01 00:08:25 +03:00
Fedor Lapshin
9356a844d9
Application commands localization (#1143)
* feat(interactions): application commands localization

* feat(interactions): add missing omitempty to localization fields

Co-authored-by: ToπSenpai <15636011+TopiSenpai@users.noreply.github.com>

Co-authored-by: ToπSenpai <15636011+TopiSenpai@users.noreply.github.com>
2022-03-31 22:26:23 +03:00
Jim Eagle
cd724aa48a
IconURL for GuildPreview and GuildWithCounts (#885)
* Add missing field

* Helpers

* Renames

* Use helper

* Add withCounts query option to Guild()

* Move IconURL

* Add IconURL to GuildPreview

* Update comments

* Send `[]` rather than `null` on empty activities slice

* Add more robust file support for webhooks

* Add withCounts query option to Guild()

* Update comments

* Split guild func

* 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>

* Revert

* Format yaml

* Add IconURL to GuildPreview

* Revert

* Revert space

* Update restapi.go

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

* Remove variadic

* Revert yamls

* Remove param

* Hardcode string

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-03-31 22:22:46 +03:00
Lucas Teske
1292ea9e38
fix: Fix debug message printing when debug is disabled. (#1043) 2022-03-29 16:00:28 +03:00
EvieDelta
dec22d7483
fix: add missing permission constants (#1144)
- UseActivities 0x8000000000
- ManageEvents 0x200000000
- UseExternalStickers 0x2000000000

Co-authored-by: EvieDelta <no public email>
2022-03-27 02:44:11 +03:00
Fedor Lapshin
0413c18206
Remove GuildSubscriptions field from Identify struct (#992)
Co-authored-by: rigormorrtiss <rigormorrtiss@gmail.com>
2022-03-23 21:50:47 +03:00
SwitchUpCB
12edb3b8c7
Move RESTError to restapi.go (#1130) 2022-03-14 00:26:43 +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
Shawn Toffel
ee34db7ade
Removed appID comment from InteractionRespond method without this parameter (#1123) 2022-03-07 13:38:34 +03:00
nitroflap
45e625d5af
feat(*): bumped version to 0.24.0 2022-03-02 22:32:28 +03:00
nitroflap
6cfbd16e1d
feat(structs): added ErrCodeMaximumGuildsReached back 2022-03-02 22:30:59 +03:00