Commit graph

1567 commits

Author SHA1 Message Date
Julien Tant
13748a3431
feat(member): add helper function for display name (#1426) 2023-12-29 23:22:24 +03:00
ikafly144
d2fd4c5587
feat(ThreadMember): implement Member field (#1325)
* Add Member field to TreadMember

* Add query params to ThreadMember and ThreadMembers

* Add json tag

* docs: add periods

* fix: gofmt

* docs: document withMember parameter

* docs(Session.ThreadMember): rephrase description of withMember parameter

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-12-23 06:44:08 +03:00
Fedor Lapshin
f7800efc52
docs(SelectMenu): correct a typo 2023-12-08 15:51:10 +03:00
Fedor Lapshin
0068a2db3c
feat(SelectMenu): default values (#1452)
* feat(SelectMenu): default values

* fix: remove unncessary pointer

Since SelectMenu is used as a nested structure, it is not possible to
partially edit it. Thus, an empty slice does not need to be accounted for,
and the pointer, which would only be omitted if the value is nil, can be
converted to a regular slice.

* fix: correct grammar in the comment to SelectMenuDefaultValueType
2023-12-08 15:47:42 +03:00
Julien
44e4acb7d5
feat(UserFlags): add BotHTTPInteractions and ActiveDeveloper (#1465)
---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-12-04 13:38:10 +03:00
LightningDev1
e8b8ad326b
feat(user): add UserPremiumType type (#1467)
* feat(user): Add UserPremiumType type

* chore(UserPremiumType): fix type name in comment

* style: periods

Add periods at the end of the documentation comments.

* chore(UserPremiumType): reword documentation comment

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-12-04 13:35:56 +03:00
Merlin
1f0b57f110
feat(WebhookParams): add thread_name field (#1412)
Add ThreadName field into WebhookParams to allow for creation of forum posts by webhooks.

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-09-22 16:03:45 +03:00
Earlopain
a2079d3138
feat(auditlog): add monetization actions (#1442) 2023-09-07 15:56:33 +03:00
guangwu
c2117695cc
fix: typo in modal example and getting started (#1443)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-09-04 21:42:02 +03:00
Earlopain
8ca6533433
feat(auditlog): add integration_type to options (#1440) 2023-09-04 00:19:40 +03:00
Fedor Lapshin
b51655404a
feat: add UpdateCustomStatus (#1425)
Add Session.UpdateCustomStatus, which allows to set and reset the custom status of a bot.
2023-09-02 01:38:18 +03:00
ozraru
ff9176adcc
feat(MessageSend): add flags (#1427)
Add Flags field to MessageSend struct
2023-08-16 16:46:54 +03:00
ozraru
a7ba2904ba
feat: add new message flags (#1428)
Add MessageFlagsSuppressNotifications and MessageFlagsIsVoiceMessage.
---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-08-16 10:19:57 +03:00
Denver Quane
58193fbfaa
fix(voice): session id deadlock on open (#1408)
* Unlock when checking voice connection sessionID to prevent deadlock

* Move lock to preserve concurrency safety, while allowing the sessionID to be populated

* style: formatting

Fix formatting of the documentation comment for VoiceConnection.Speaking function

* feat: reword explanatory comment

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-08-13 07:06:50 +03:00
Earlopain
393091b18c
fix(auditlog): use correct values for AuditLogOptionsType (#1413) 2023-07-29 04:38:16 +03:00
Muhammad Wildan Aldiansyah
e39e715086
feat: support new username system (#1387)
* Add support for new username system in User.String and User.AvatarURL
* Move default avatar index logic from EndpointDefaultUserAvatar into User.DefaultAvatarIndex

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-07-05 02:37:47 +03:00
Merlin
0b0ea10b47
fix(endpoints): remove duplicated slash in guild template endpoint (#1395) 2023-07-03 17:26:46 +03:00
Loghin Alexandru
a90485df0c
feat(ws): add toggle for voice reconnects on session reconnect (#1350)
* Add flag for voice reconnect on session reconnect

* Rename ShouldReconnectVoiceConnOnError toggle as suggested

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

* Fix indentaion for discord.go

* Change wording in docs

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-06-05 16:21:06 +03:00
Fedor Lapshin
af63880a0b
fix(ChannelEdit)!: omit empty Position (#1385)
Make Position field a pointer and add omitempty JSON option to avoid
setting it to 0 when it is not specified.
2023-06-05 16:07:40 +03:00
Earlopain
fc4a3ce97d
feat(auditlog): add application_id to AuditLogOptions (#1380) 2023-05-25 17:22:26 +03:00
Elliot Williams
dde7690782
fix(GuildDelete)!: stop returning guild (#1329)
Stop returning Guild from GuildDelete, since underlying endpoint returns 204 (No Content).
2023-05-25 16:10:06 +03:00
Earlopain
1252b71f38
feat(MessageReference): add fail_if_not_exists (#1376)
* Add fail_if_not_exists to MessageReference
* Add SoftReference function to Message

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-05-14 18:53:29 +03:00
Earlopain
160605c9c3
feat(auditlog): add auto moderation actions and options (#1371) 2023-05-14 18:42:41 +03:00
Ishan Goel
7c47cfc906
fix(WebhookEditWithToken): error shadowing (#1372)
* fix(WebhookEditWithToken): error shadowing

* fix: gofmt

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-05-11 17:43:05 +03:00
Fedor Lapshin
69f6c46a34
fix(AuditLogGuildScheduledEventUpdate): typo (#1370) 2023-04-24 04:29:04 +03:00
Victor Souza
7ec67b07d2
Add CommandType field to ApplicationCommandInteractionData (#1362)
* Add the CommandType field to ApplicationCommandInteractionData

* Remove unnecessary comment

* Change order of the fields

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-04-15 02:31:36 +03:00
Fedor Lapshin
6958472163
Implement Audit Log Entry Create event (#1314)
* Implement GUILD_AUDIT_LOG_ENTRY_CREATE event.
* Rename IntentGuildBans constant to IntentGuildModeration to match API documentation.
2023-04-07 16:19:12 +03:00
Yara McRobert
b7c431c368
Added stickers to type MessageSend (#1340)
* Added stickers to type MessageSend

* Update restapi.go

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

* Update message.go

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

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-04-04 18:30:57 +03:00
Fedor Lapshin
cd4f875097
feat(*): bump version to 0.27.1 2023-03-10 02:39:49 +03:00
Adam Snyder
1115a47c5d
fix: ThreadMember flags not serialized (#1335) 2023-03-10 02:31:46 +03:00
Adam Snyder
58ea3535b0
fix: WithContext had no effect (#1337)
Fix usage of an outdated request in RequestWithLockedBucket after applying WithContext option

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-03-10 02:13:09 +03:00
Fedor Lapshin
ba97131805
74 byte handshake (#1343)
* feat(voice): 74 byte udp handshake

Update the format of UDP handshake to use 74 byte packets.

* docs: use new positions in comments

* feat: document type and length fields

Add descriptions of type and length fields to the request packet documentation.
2023-03-10 00:33:26 +03:00
LightningDev1
916f693c00
Add GIF sticker format (#1330)
* Add GIF sticker format

* Replace tab with spaces
2023-02-21 01:36:18 +03:00
Fedor Lapshin
cbf9908143
feat(*): bump version to 0.27.0 2023-01-18 02:08:41 +03:00
Fedor Lapshin
d583fd1d1e
feat(GuildPreview.IconURL): add docs for size
Add documentation comment for size parameter of GuildPreview.IconURL
function.
2023-01-18 02:03:15 +03:00
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
345a9d6466
Options (#1299)
* feat: add options for request methods

Add functional options to request, RequestWithBucketID, RequestWithLockedBucket.
These options allow for request modification and overriding REST related Session fields,
such as Client, MaxRestRetries and ShouldRetryOnRateLimit.

* feat: add context and retries options

Implement WithContext and WithMaxRestRetries options.

* feat: add documentation

Add documentation to the options

* feat(rest): add options to methods

Add option arguments to all Session methods.

* feat: add missed forwarded options

* feat: reword documentation

* refactor(requestConfig): rename to newRequestConfig

Rename requestConfig to newRequestConfig to match other
constructor functions naming.

* style: manually revert documentation formatting

Manually revert the formatting of documentation in certain functions.

* feat(UserChannelPermissions): add description of fetchOptions

Add description for fetchOptions parameter of Session.UserChannelPermissions.

* feat(ChannelMessageSendEmbedReply): pass options

Pass options to ChannelMessageSendEmbedsReply call in ChannelMessageSendEmbedReply

* docs(InviteComplex): revert parameter descriptions removal
2023-01-16 01:50:44 +03:00
ikafly144
0a42ffa9da
Add nsfw option (#1310) 2023-01-14 23:42:05 +03:00
ikafly144
ae8894be67
Add Forum settings to Channel struct (#1306)
* Add DefaultRateLimitPerUser DefaultSortOrder DefaultForumLayout to Channel struct

* Add prefix

* Add prefix

* Fix typo

* Fix field name typo

* Add to ChannelEdit struct

* Fix order and name

* Fix name

* Apply suggestions from code review

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

* feat: cosmetic changes

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-01-03 19:19:08 +03:00
ikafly144
2daab506b2
Add Presence ClientStatus (#1303)
* Add ClientStatus struct

* Add ClientStatus struct

* Add comment

* Update structs.go

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

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-12-29 20:52:07 +03:00
Yannis Matezki
f184824b8c
Provide previous Member state for GuildMemberUpdate events (#1304) 2022-12-27 21:23:54 +03:00
ikafly144
5e7e320c89
Automod trigger metadata update (#1305)
* Add AllowList and MentionTotalLimit

* Add pointer

* Fix
2022-12-27 21:14:29 +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
ikafly144
4074561d23
Add MessageComponentInteractionDataResolved struct (#1302) 2022-12-23 23:41:48 +03:00
Fedor Lapshin
8a5201aae6
feat(GuildParams): make PremiumProgressBarEnabled pointer
Make PremiumProgressBarEnabled field of GuildParams a pointer to allow
for the false value.
2022-12-17 23:16:09 +03:00
Fedor Lapshin
2a22f54711
fix: typo in system channel flag constants
Fix typo in names of SystemChannelFlagsSuppressGuildReminderNotifications and SystemChannelFlagsSuppressJoinNotificationReplies constants.
2022-12-17 23:08:14 +03:00
Ringo Hoffmann
e741fc2790
Complement GuildParams struct to comply with Discord's API (#1255)
* complement `GuildParams` struct [fix #994]

* fix: naming and spelling

* fix: gofmt

* refactor: use Locale type for PreferredLocale

Co-authored-by: zekro <private@zekro.de>
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-12-17 23:03:18 +03:00
NonNonStop
9effc92908
Fix the problem of reconnecting when moved to another VC (#1271)
* Fix disconnection when moved to another VC

* Update voice.go

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

* Update voice.go

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

* Update voice.go

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

* feat: add VoiceServerUpdate todo

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-12-15 03:17:27 +03:00
Fedor Lapshin
b8188269f9
Auto populated select menus (#1269)
* feat(components): auto-populated selects

* Add component types for user, channel, role and mentionable selects
* Add MenuType field to SelectMenu for customization of select type
* Add basic example for auto-populated selects

* feat: implement SelectMenuType to restrict component types

Implement SelectMenuType to restrict component types that can be used
in MenuType field of SelectMenu structure.

* fix(SelectMenu): default type

Default to SelectMenuComponent type when MenuType is not specified.

* feat(examples/components): add ephemeral

Add ephemeral flag into response to match other component examples.

* feat(examples): option response and refactoring

* Add a response to the selected option.
* Refactor the command to match others.
* Remove showcase of multiple menu types.
2022-12-03 01:40:30 +03:00
Rick Staa
2998b2c67d
feat: add UpdateWatchStatus function (#1291)
This commit adds the UpdateWatchStatus method
2022-12-03 01:31:02 +03:00