Commit graph

1555 commits

Author SHA1 Message Date
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
Tony Krueger
f73d3a2fd5
removed os.Kill from caught signals in pingpoing, dm_pingpong and airhorn (#1281) 2022-11-23 23:26:25 +03:00
Jordhan Carvalho
128f34bee6
chore: replace dca-rs (#1240)
* chore: replace dca-rs

* Update examples/airhorn/README.md

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

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-11-19 19:16:23 +03:00
Fedor Lapshin
e580734d0b
Regex patterns automod rule trigger (#1275)
* feat: add regex pattern automod trigger

Add regex patterns metadata to AutoModerationTriggerMetadata.

* feat: add regex pattern example

Add showcase of regex filter into auto_moderation example.

* feat: cosmetic changes

Add period to the end of RegexPatterns documentation comment.
2022-11-17 00:57:13 +03:00
Fedor Lapshin
4ba7062176
Add README.md to all examples (#1236)
* feat(examples/*): add readme

Add README.md to all examples.

* fix(examples): logo image link

* fix(examples): add fixed width to logo

* feat(examples): add titles

* fix(examples/*): make logo smaller

Make DiscordGo logo smaller to match description and title in size.

* fix(examples/avatar): correct avatar url

Use correct logo URL in avatar URL image example.

* fix(examples/slash_commands): wording

Fix wording of "step-by-step tutorial" note.
2022-11-09 22:19:23 +03:00
Fedor Lapshin
fb0566fac2
fix(EmojiRegex): longer ids (#1274)
Fix EmojiRegex to accept emojis with ids up to 20 characters long
2022-11-08 23:30:53 +03:00
Andrew Garvin
f36b5430a8
docs(UpdateStatusData): fix a typo (#1276) 2022-11-08 23:20:35 +03:00
Fedor Lapshin
afab84009b
Add missing fields to Ready (#1227)
* feat(Ready): add shard and application fields

Add missing Shard and Application fields to Ready event struct.

* feat(Ready): make Shard pointer

Make Shard field pointer to be consistent with the API.
2022-10-24 02:03:26 +03:00
ozraru
0c2b0eccf4
Continue to next packet if received broken packet (#1260)
Broken packet should be ignored and continue to next packet.
This goroutine should not exit until close.
2022-10-24 01:44:08 +03:00
BunnyTheLifeguard
86539504d9
fix: remove embedfield omitempty (#1262)
Remove omitempty from Name/value since the Discord API requires both to be submitted.

Fixes: #726
2022-10-24 01:30:03 +03:00
ozraru
20aaca3b40
Overwrite entire emoji list on GuildEmojiUpdate (#1261)
* Overwrite entire emoji list on GuildEmojiUpdate

deleted emoji should be deleted from cache

* Updating GuildEmojis inline
2022-10-24 01:22:53 +03:00
Dan Dryaev
410cf4fac5
Add files to MessageEdit (#1253)
* Add files to MessageEdit

* Remove files from json

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

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-10-07 14:47:55 +03:00
Fedor Lapshin
1ff58d47ef
fix(MultipartBodyWithJSON): form file field name format (#1256) 2022-10-07 14:42:57 +03:00