Commit graph

1515 commits

Author SHA1 Message Date
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
Tsvetomir Bonev
bb321271cd
fix(structs): fix type of GuildScheduledEvent* enum values (#1254) 2022-10-07 14:41:27 +03:00
Nils Ponsard
bd58eb717e
fix(interactions): incorrect call of State.Role in RoleValue (#1237)
The gID parameter was passed to State.Role as roleID
and roleID was passed as guildID.
This commits inverts the arguments order to fix the issue.
2022-10-07 14:21:30 +03:00
Fedor Lapshin
e57064892a
Forum channels (#1246)
* feat: forums

Initial implementation of forum channels REST API

* fix: linter

* feat: cosmetic changes

Added periods in the end of all documentation comments

* fix(ChannelFlagRequireTag): incorrect value

Fix incorrect value of ChannelFlagRequireTag.

* refactor(DefaultReaction): rename to ForumDefaultReaction

Rename DefaultReaction to ForumDefaultReaction.

* fix(Channel): use ForumDefaultReaction

Use ForumDefaultReaction instead of DefaultReaction in DefaultReactionEmoji field.

* fix: gofmt

* feat: cosmetic changes

* Change "GUILD_FORUM" to "forum" in comment to ForumTag
* Fix spacing for documentation of embeds parameter in ForumThreadStartEmbeds

* docs(ForumThreadStartComplex): align parameters

Align documentation for parameters of ForumThreadStartComplex.
2022-09-29 23:24:27 +03:00
Fedor Lapshin
fea3d77574
feat(*): bump version to 0.26.1 2022-08-29 18:10:38 +03:00
Fedor Lapshin
aa9af1488f
feat(*): bump version to 0.26.0 2022-08-17 20:56:19 +03:00
Fedor Lapshin
622a7d8902
chore(GuildEdit)!: use a pointer for GuildParams (#1228) 2022-08-17 20:22:00 +03:00
Fedor Lapshin
576ecf0003
REST methods cleanup (#1217)
* refactor(GuildRoleEdit)!: use struct params

Refactor GuildRoleEdit to accept parameters using a Params struct.
Therefore also allow partial edits.

* feat(GuildRoleCreate): initial parameters

Make GuildRoleCreate accept a struct with initial parameters for a role

* refactor(ChannelEdit)!: replace ChannelEditComplex

Move funcitonality of ChannelEditComplex to ChannelEdit

* chore: deprecate ChannelEditComplex

* feat(GuildEmbed)!: allow partial edits

* Make fields omitempty
* Make `Enabled` field a pointer

* refactor(GuildEmbedEdit)!: use params struct

Refactor GuildEmbedEdit to accept parameters through GuildEmbed struct

* refactor(GuildMemberEdit)!: replace GuildMemberEditComplex

Move functionality fo GuildMemberEditComplex to GuildMemberEdit

* chore: deprecate GuildMemberEditComplex

* refactor(GuildEmojiCreate)!: use struct params

Refactor GuildEmojiCreate to take parameters using EmojiParams struct.

* refactor(GuildEmojiEdit)!: use struct params

Refactor GuildEmojiEdit to take parameters using EmojiParams struct.

* refactor(GuildMemberAdd)!: use struct params

Refactor GuildMemberAdd to take parameters using GuildMemberAddParams struct.

* refactor(GuildTemplateEdit)!: use struct params

Refactor GuildTemplateEdit to take parameters using GuildTemplateParams struct.

* refactor(GuildTemplateCreate)!: use struct params

Refactor GuildTemplateCreate to take parameters using GuildTemplateParams struct.

* chore(rest)!: use pointers for Params structs

Refactor methods with Params struct to use pointers

* chore: grammar and style fixes in comments
2022-08-17 18:41:11 +03:00
Fedor Lapshin
eee9bcb196
Remove remaining undocumented structs and fields (#1225)
* feat(events)!: drop undocumented structs and fields

* feat(structs)!: drop undocumented structs and fields

* fix(eventhandlers): regenerate event handling code

* fix(Ready): add PrivateChannels back
2022-08-17 17:50:21 +03:00
Fedor Lapshin
3cee831e8b
Add missing fields to GuildMemberParams (#1226)
* feat(GuildMemberParams): add missing fields

Add the following fields to GuildMemberParams
* channel_id

* mute

* deaf

* communication_disabled_until

* fix(GuildMemberParams): null values

Fix null values on omitted fields
2022-08-17 17:17:30 +03:00
Alfonso
73ebf67335
GuildFeatures added to UserGuild (#1223)
* GuildFeatures added to UserGuild

* Better comment phrasing

* Added GuildFeature type to Guild
2022-08-15 20:52:49 +03:00
Fedor Lapshin
7c87035a71
feat(voice): use Dialer for connections (#1220)
Use Session.Dialer for WebSocket connections.
2022-08-14 00:04:52 +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
Wynell
262e8ba52b
Add dialer property in config (#1179)
Co-authored-by: eeWynell <eewynell@gmail.com>
2022-08-13 23:42:42 +03:00
Corbett
c0803d021f
Add omitempty to channel_id in MessageReference struct (#1002) 2022-08-04 21:51:19 +03:00
Fedor Lapshin
f60fb54c52
feat: add contributing.md
Add CONTRIBUTING.md doc to set guidelines for new contributions.
2022-08-01 18:50:50 +03:00
David G
8b18bf4dc7
Allow setting bool properties of ChannelEdit to false (#1199)
Setting e.g. ChannelEdit.Archived = false is currently not possible
as go will treat a false as empty and will omit the property
from the JSON object.
2022-07-29 18:45:18 +03:00
plally
039e6855ed
fix typo in InviteTargetEmbeddedApplication and in some comments (#1211) 2022-07-29 18:42:40 +03:00
Fedor Lapshin
0feaae8f1b
feat(ApplicationCommandOption): min and max length (#1208)
Implement min_length and max_length for string option type.
2022-07-15 00:40:21 +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
Fedor Lapshin
f697ccae8c
feat(ApplicationCommand): guild id (#1207)
Add missing guild_id field to ApplicationCommand structure
2022-07-02 23:27:27 +03:00
Fedor Lapshin
033c07d89d
feat(interactions): application permissions (#1206) 2022-07-02 23:24:07 +03:00
Zachinquarantine
f446e069a1
Remove deprecated GuildChannel and PrivateChannel methods (#1203)
First deprecated in 2016 with #163
2022-07-01 00:49:29 +03:00
plally
a7f0378623
add GET prefix for ApplicationCommands bucketID (#1193)
* add GET prefix for ApplicationCommands bucketID

* dont use local variable for bucketID

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

* format code

* remove newline

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-06-19 21:20:11 +03:00
Riley
5da28ed4b9
Fix GuildTemplate struct and documentation (#1191)
* fix(structs.go): fix GuildTemplate struct and documentation

* revert(structs.go): change description from a string ptr to a string

* fix(structs.go): make name and description a pointer and omitempty

* fix(structs.go): made Name field not a string pointer. removed extra files

* fix(structs.go): fix Name field not having a type
2022-06-19 18:47:03 +03:00
Elias*
a7b7eaa2af
Use with_localizations flag (#1196)
* Improve support for application command localizations

Signed-off-by: GitHub <noreply@github.com>

* Remove query string from bucket name

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

* Fix formatting

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-06-19 18:43:00 +03:00
Aderlx
e030c5fff8
Add Invite ExpiresAt field (#1198) 2022-06-14 23:23:32 +03:00
Andre Cesar Gomes
c8c153872c
feat: add missing fields to VoiceState struct (#1190) 2022-06-03 15:58:53 +03:00
wass88
414e505c56
Use MakeIntent in voice_recieve example (#1182) 2022-05-23 21:23:09 +03:00
Andres Perez
d7b4a482b5
Use MessageFlags in InteractionResponseData and WebhookParams (#1178) 2022-05-23 01:14:28 +03:00
Andrey Dudin
e455362760
Add ability to reply with embeds (#1160)
* Add ability to reply with embeds

* Fix typo in method comment
2022-05-14 22:56:30 +03:00
Andrei Khodko
fa14e19ad5
fix: check if opus created (#1166)
* fix: check is opus created

* fix: careful concurrency fixes
2022-05-14 22:52:33 +03:00
plally
c29e0d740f
make WebhookEdit fields pointers (#1174)
* make WebhookEdit fields pointers

* fix examples
2022-05-14 22:43:50 +03:00
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