Commit graph

74 commits

Author SHA1 Message Date
Sentinel
cb59c78e32
Add size parameters to IconURL and BannerURL (#1301)
* Add missing parameters/structs

Adds guild icon size parameter, guild banner size parameter, missing ClientStatus struct

* Add missing endpoint for animated banners

* feat: revert ClientStatus changes

Revert addition of ClientStatus since another PR was already merged with
it.

* feat: add documentation for size parameter

* refactor: move icon url logic into separate func

Move logic for icon URLs in various functions into a single iconURL
function. Similar to banner and avatar functions.

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-01-18 01:59:00 +03:00
Fedor Lapshin
4eef78e7e4
Role connections (#1295)
* feat: role connection metadata

* feat: add role connection endpoints

Add User Application Role Connection endpoints:
* Get User Application Role Connection
* Update User Application Role Connection

* feat: add example

Add basic example to showcase linked roles flow.

* refactor(endpoints): move role connection metadata

Move Application Role Connection Metadata endpoint to other Application
endpoints.
2022-12-26 02:31:49 +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
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
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
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
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
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
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
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
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
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
nitroflap
a8b351019f
feat(*): dropped more undocumented endpoints 2022-02-08 20:43:43 +03:00
nitroflap
d5c82ad374
feat(*)!: dropped undocumented endpoints 2022-02-08 18:25:24 +03: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
courtier
30251cf325
Fix EndpointInvite (#892) 2021-04-09 15:04:37 -04:00
Fedor Lapshin
b0fa920925
Slash commands (#856)
* UnknownBan error code addition

* GuildBan method implementation

* Gofmt fix

Gofmt fix

* Interactions: application commands basic API and gateway integration

* Some gitignore update

* Application commands and interactions API implementation

* Some fixes

* Some improvements of slash-commands example and slash-commands API

* OAuth2 endpoints backward compatibility

* Gofmt fix

* Requested fixes and documentation improvement for application commands

* Some fixes

* New and more interesting example of slash-commands usage, merging "interaction.go" and "interactions.go" into a single file. And some fixes.

* Gofmt and documentation fixes

* More fixes

* Gofmt fixes

* More fixes!

* Doc and endpoint fixes

* Gofmt fix

* Remove dependence on open gateway connection

* Remove redundant command ID checks

* Fix typo in ApplicationCommandCreate comment

* Tidy up function calls returning body

* Add upcoming API changes

* Correct return value name, swap parameter order

* Add Version field to ApplicationCommand

* Fix up language in comments

* Remove redundant conversion to float64

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-02-28 21:54:02 -05:00
Jim Eagle
4617d8e379
Add guild preview endpoint (#818) 2021-02-24 12:10:18 -05:00
Carson Hoffman
daaafb5a7f
Rename fields for v8 2021-01-20 18:22:39 -05:00
Carson Hoffman
9eb033c0db
Bump API version to v8 2021-01-20 18:05:39 -05:00
Aditya Diwakar
10195fcfbb Add support for news channels
Endpoint support added:
- @/channels/:id/messages/:id/crosspost - publishes a message in a news
  channel to followers
- @/channels/:id/followers - follows a news channel
2020-08-05 18:31:38 -04:00
Chris Rhodes
cecb79f8d5 Update Emoji endpoints to point to the CDN. 2020-07-27 21:17:05 +00:00
Noah Santschi-Cooney
69edfdf4ac
discordapp.com -> discord.com (#772)
Change API URL from discordapp.com to discord.com
2020-05-08 21:26:13 -04:00
Carson Hoffman
45124d8303 Revert "Changed domain from discordapp.com to discord.com (#769)"
This reverts commit f4ca8874a3.
2020-05-07 12:27:07 -04:00
Hunter Paulson
f4ca8874a3
Changed domain from discordapp.com to discord.com (#769)
* Allow resume on reconnect

* Version 0.20.3: allow resume on reconnect

* Update index.md

* Update README.md

* Update GettingStarted.md

* Update endpoints.go

* Update README.md

* Update event.go

* Update wsapi.go

* Update restapi.go

* Resolved spelling issue

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2020-05-04 21:13:28 -07:00
Sebastian Winkler
579121fe1a adds EndpointGuildIconAnimated; adds guild.IconURL() helper (#658) 2019-07-21 21:09:39 -07:00
diamond's alt
a6d2557a8e Added Asset and ApplicationAssets (#666)
Fixed ApplicationAssets returning the wrong type

Added Asset and ApplicationAssets
2019-07-21 21:06:20 -07:00
Sebastian Winkler
347a4f69b0 Add premium fields to Guild and Member (#656)
* adds premium fields to Guild and Member

* fixes formatting
2019-06-08 13:54:39 -07:00
Martín (Netux) Rodríguez
38d030aaed endpoints(): add EndpointEmojiAnimated (#572) 2018-08-17 11:52:12 -07:00
Sebastian Winkler
8f686efd24
adds GuildEmojiCreate, GuildEmojiEdit, and GuildEmojiDelete 2018-05-20 14:37:02 +02:00
Sebastian Winkler
e7e5f85367 adds default avatar generation to AvatarURL method (#488)
* adds default avatar generation to AvatarURL method

* converts discriminator string to integer in endpoints.go
2018-02-08 20:08:56 -08:00
Sebastian Winkler
18dfe540ad adds GuildAuditLog() (#504)
* adds GuildAuditLogs()

* adds missing comments to GuildAuditLog
2018-01-11 07:09:12 -08:00
Carson Hoffman
8f1a335d25 Added fix for #437 (#452) 2017-10-08 17:54:06 -07:00
Necroforger
aeda5eb7b1 Update bulk-delete endpoint (#451) 2017-10-08 15:37:24 -07:00
Nick Dumas
c4a08de525 Remove a misspelled copy of EndpointGuildInvites. Issue #440 (#441)
Reference Issue: https://github.com/bwmarrin/discordgo/issues/440
This endpoint was declard twice in endpoints.go, and used in the
GuildInvites() method on Session values. I replaced the misspelled
invocation.

All tests pass.
2017-09-07 13:46:40 -07:00
Chris Rhodes
fd8721a522 Revert "Fixed 404 when calling Session.GuildCreate (#439)"
This reverts commit cf237e4c25.
2017-09-04 21:39:35 -07:00
CarsonHoffman
cf237e4c25 Fixed 404 when calling Session.GuildCreate (#439) 2017-09-04 18:30:22 -07:00
Bruce
06b35cfe24 Linting. 2017-09-03 20:01:46 +00:00
Necroforger
faa8ececc0 MessageReactionsRemoveAll (#414) 2017-07-29 08:00:05 -07: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
jonas747
9d3cd03314 Add GatewayBot 2017-07-10 18:31:26 +02:00
Rinzen Necroforger
a71f5e3e61 Support animated avatar URLs (#388)
* Methods to obtain a user's avatar URL

* Created EndpointUserAvatarAnimated and updated AvatarURL

* Fixed the size parameter
2017-05-29 20:03:39 -07:00
legolord208
43c8b518ad Added user notes (#361)
* Added user notes

* Added note websocket event (thanks iopred :D)

* Added ready event (thanks again, iopred)

* Renamed function
2017-04-28 12:22:02 -07:00
alex
d55c9a45e7 Change image endpoints to use .png, add EndpointGroupIcon and cdn endpoints (#309) 2017-01-18 19:47:56 -08:00
AI
2092185ec5 Implement support for new member role endpoint (#289)
Implements support for the new member role add and delete endpoint
hammerandchisel/discord-api-docs#179
2016-11-30 08:57:22 -08:00
AI
ed7a451a31 Add support for relationships (#284)
* Add support for relationships

Adds Support for:
  - Sending friend request.
  - Accepting friend request.
  - Getting all the relationships.
  - Getting all the mutual friends with another user.
  - Blocking a user.

**Note:**
  - Bot accounts are not allowed to access the endpoint.
  - May close bwmarrin/discordgo#150

* Implement requested changes

Changed the uint8 declarations to int.

* Change the missed unint8 declaration to int

Missed one instance of unint8 during previous push.
2016-11-08 17:07:04 -08:00
AI
602885488b Fix supprt for reaction endpoint (#283)
- Adds support for deleting the reaction for a given user.
    - Requires MANAGE_MESSAGES permission.
  - Fixes the Sesssion.MessageReactions(...) function.
2016-11-08 11:49:30 -08: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
RealCodingTeam
12a226f56c huh 2016-06-28 11:10:38 -04:00