Commit graph

1454 commits

Author SHA1 Message Date
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
Fahim-Ferdous
4cc53b7ed4
Removal procedure for slash commands example (#1103)
Remove commands on exit.
2022-02-23 20:59:04 +03:00
Reed Trevelyan
0b48d46eef
add disable prop to selectMenu (#1102) 2022-02-22 00:14:47 +03:00
Riley
8ac9c13dda
Guild Template (#1091)
* feat: guild templates

* task(endpoints): go fmt endpoints

* task(endpoints): go fmt

* docs(restapi): resolve suggestions from code review

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

* fix(restapi): add missing image field

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-21 01:00:36 +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
aidan michael lineberry
6015eed933
Vectorization of DiscordGo mark (#1099)
* Add vector imagination of discordgo.png

* Delete discordgo.png

* Update README.md to use vector artwork

Added alternative text and used relative reference to artwork

* README.md more meaningful alt text

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

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-16 23:23:27 +03:00
Fedor Lapshin
e39ed2f8ce
feat(restapi): reworded comment of GuildApplicationCommandsPermissions 2022-02-16 22:38:08 +03:00
Bjorn Zandvliet
d5bacb5401
Add Default Permission to #943 (#1071)
* Create edit application command permissions endpoint

* Add remaining command permissions endpoints

* Clean up naming a bit

* Add docs for application command permissions endpoints

* Update comments

* More comments

* :^)

* Put the verb in API method names at the end

* Review feedback

* Add default permissions

* feat(restapi): rewording of comments to application command permissions endpoints

* fix(rest): errors for application commands permissions endpoints

* style(interactions): changed order of fields in ApplicationCommand

Co-authored-by: NotUnlikeTheWaves <hleistra@gmail.com>
Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-02-16 22:17:26 +03:00
Fedor Lapshin
0a0955c5f9
Application commands: attachment option (#1088)
* feat(interactions): application command attachment option

* fix(interactions): corrected application command attachment option type
2022-02-16 21:02:44 +03:00
nitroflap
0494cdf33c
feat(components): added comment to MessageComponentFromJSON 2022-02-16 16:50:33 +03:00
nitroflap
fca422b28f
fix(examples): signal.Notify unbuffered channel 2022-02-16 16:47:30 +03:00
nitroflap
d8f15b1bc6
feat(discord_test): check for DGU_TOKEN for compatibility 2022-02-16 16:41:37 +03:00
nitroflap
12b412a989
feat(discord_test): rewrote init as TestMain 2022-02-16 16:39:50 +03:00
nitroflap
3d0ad546d1
feat(discord_test#init): check for oauth2 token 2022-02-16 16:38:21 +03:00
nitroflap
7044ee62cb
fix(examples/avatar): parameters for UserUpdate 2022-02-16 16:32:48 +03:00
nitroflap
e16b1f8e5b
fix(structs): added back old intent definitions for compatibility 2022-02-16 16:31:13 +03:00
Fedor Lapshin
971184a542
CI (#1076)
* feat: ci barebones

* fix(.github/workflows): checkout

* feat(.golangci.yml): removed presets

* feat(workflows/ci): moved matrix to test job

* feat(golangci-lint): disabled all linters except golint

* fix(workflows/ci): golangci-lint action cache fix

* feat(workflows/ci): custom step with golangci-lint on normal commit

* feat(.github/workflows): moved setup-go into individual jobs

* feat(workflows/ci): only new lint issues for pull requests
2022-02-16 16:24:17 +03:00
Pedro Pessoa
c871464295
update intents (#1097) 2022-02-16 15:30:32 +03:00
Pedro Pessoa
115adf2866
add missing json error codes (#1096)
* add missing json error codes

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

* requested changes

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

* formatting

* add ErrCodeEmbedDisabled back

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-16 15:29:20 +03:00