Commit graph

1573 commits

Author SHA1 Message Date
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
nitroflap
11283ba0ab
feat(interactions): number application command option 2022-03-02 22:05:22 +03:00
42Atomys
df7555c758
feat: Add Guild Member Cover & Accent Color support (#1117)
* feat: add field to struct

* feat(user): Add Banner support

* Update user.go

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

* Update user.go

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

* docs(banner): Replace all cover word with banner

* docs(banner): Remove link on image formatting on banner

* Update util.go

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

* feat(structs#Member): removed BannerURL

* fix(user): wording in comment to BannerURL

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-03-02 21:29:10 +03:00
Fedor Lapshin
4b615bec36
fix(structs): duplicated intents definition 2022-02-27 19:31:03 +03:00
42Atomys
9448b0eb96
Add Guild Scheduled Event Support (#1032)
* Add Guild Scheduled Events support

* Add missing Indents for Guild Scheduled Events

* fix: Do update from new schedules updates and repository updates

* doc: Add missing documentation on const

* doc: Add missing documentation on events struct

* tests: Add a Skip condition when dgBot is not set to prevent segfault

* fix: Somes changes following the last review steps

* docs: Add an example to manipulate GuildScheduledEvent

* clean: Remove useless pointers on struct used to retrieve data

* tests: Test extra query params on GuildScheduledEventUsers requests

* clean: Remove unused variables

* feat: Add nullable types to provide null value to Discord API when is necessary

* feat: Use NullableString in ScheduledEvents

* docs: Add example for usage of NullableString

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

* fix: Review changes to move back nullable string into a simple MarshalJSON

* fix: Remove NullString on tests and examples

* doc: Add missing doc

* Update structs.go

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

* fix: misunderstood MarhsalJSON

* fix: Follow the convention of discordgo on url.Values

* Update examples/scheduled_events/main.go

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

* changes: use conditional instead on Sprintf

* fix: Add missing status on Params

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

* changes: Move flag.Parse inside the init function

* fix: remove null statement of test suite

* fix: Rewrite Marshal of GuildScheduledEventParams to prevent a stack overflow on marshall same type

* clean: Remove unused Intents

* Update restapi.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 restapi.go

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

* doc: polish the documentation

* clean: Final polish code

* doc: Add information about 1:1 usage

* Update discord_test.go

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

* doc: remove unnecessary additional infos

* Update structs.go

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

* Update discord_test.go

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

* Update restapi.go

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

* chore(examples/scheduled_events): removed NullString comment

* fix(structs): grammar in comment to EntityType

* fix: run gofmt

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-27 18:22:31 +03:00
nitroflap
5056d53d17 Revert "feat(structs#Session): made sessionID and sequence fields public"
This reverts commit 4390b565fa.
2022-02-27 18:11:50 +03:00
nitroflap
4390b565fa
feat(structs#Session): made sessionID and sequence fields public 2022-02-27 17:46:03 +03:00
nitroflap
80f525fa77
feat(github/release): added fallback category back 2022-02-27 13:06:34 +03:00
Fedor Lapshin
d76fc29889
feat(github/release): dropped fallback category 2022-02-27 13:03:12 +03:00
Fedor Lapshin
401c108917
feat(github): add release template 2022-02-27 13:02:09 +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
Fedor Lapshin
a4d694738f
feat: min and max constraints for slash command options (#1026)
* feat: min and max constraints for slash command options

* fix: typo

* feat: changed slash command options min-max values to float

* feat: improved min max constraints

* feat: removed helper functions

* fix(examples): helper functions

* feat(components): made MaxValues int in SelectMenu

* fix(examples/components): MaxValues

* feat(interactions#ApplicationCommandOption): removed pointer from MaxValue

* feat(examples): removed helper functions for MinValue and MinValues

* fix(examples): removed newOptionalInt
2022-02-26 21:02:33 +03:00
nitroflap
58b2c2e55d
fix(event): removal of once-handlers 2022-02-26 15:07:48 +03:00
nitroflap
f25b625499
feat(message): added content_type to MessageAttachment 2022-02-26 15:01:01 +03:00
Andres Perez
dd5b9c6c05
Add Guild Member avatar (#1077)
* Add guild member avatar

* add avatar field on Member struct

* add endpoints for guild avatars

* add avatarURL util function for *User.AvatarURL and *Member.AvatarURL

* set GuildID on after GuildMember request

* fix Member.Avatar comment

* fix: gofmt

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-26 00:26:51 +03:00
Austin Alvarado
70e829694d
Add Invite Create/Delete (#1105)
* Add Invite Create/Delete

* rename const

* Refactor Application

* Feedback & deprecation

* lint fix for godoc comment

* review feedback
2022-02-26 00:13:27 +03:00