Commit Graph

82 Commits

Author SHA1 Message Date
Mihail Gribkov
5ca5aa51c4 rename the new precondition + remove obsolete from the old one (#2988) 2024-08-29 00:04:54 +03:00
Mihail Gribkov
5407e1780b i think im getting scuffed myself (#2977) 2024-08-08 00:56:30 +03:00
Mihail Gribkov
1f252a3aa9 add an unscuffed precondition attribute (#2976)
* fix lul

* why does v3 has to be so scuffed
2024-08-07 14:26:59 +03:00
Mihail Gribkov
85a13e9fff Hotfix 3.15.2 (#2946) 2024-06-18 22:16:33 +03:00
Mihail Gribkov
35b102a7c0 [Feature] Generic autocomplete (#2935) 2024-06-14 11:22:40 +03:00
enonibobble
aa424f6f37 Enable nuget debug symbols. (#2929) 2024-05-12 22:17:52 +03:00
Alex Thomson
a59f4ba62e Add missing PollProperties (#2927) 2024-05-12 11:37:47 +03:00
zobweyt
1a5cba875d [Feature] Parameter precondition attribute for simplifying performing hierarchical operations within a guild (#2906)
* Support interaction framework and update bundled preconditions docs

* Support text commands and update bundled preconditions docs

* Fix example

* Move hierarchy util to `PermissionUtils`

* Refactoring
2024-05-12 01:27:15 +03:00
Mihail Gribkov
476ec068f1 [Feature] Polls (#2902)
no breakings hopefully
2024-05-11 20:34:12 +00:00
Zach Goodson
753724d15c Create RequireTeamAttribute.cs (#2903)
* Create RequireTeamAttribute.cs

* Fix Attribute Doc

* Attempt to Fix NULL Cases.

* Fix NULL check (oops).

* Add RequireTeamAtttribute to preconditions.md

* Fix Typo
2024-05-11 23:24:38 +03:00
Nora
54d2fe5773 Remove generic exceptions. (#2913)
* Replace instances of Exception with better ones in reflection utils.

* Replace instances of Exception with better ones in the websocket project.

* Finish replacing generic exceptions.

* Tiny tweak to reflection utils for consistency with the .NET library.
2024-05-11 23:23:08 +03:00
Quin Lynch
a2f624e6de Fix: Don't depend on WebSocket for Interaction service (#2912)
* unfuck interaction service to not depend on WS

* Add XML docs

* fix summary refs
2024-04-16 00:57:10 -03:00
Mihail Gribkov
24a69785fe [Feature] Initial user apps support (#2883)
* omg it kinda works somehow

* more things added

* a bit of xmldocs

* added interaction framework support

* working? IF

* more builder stuff

* space

* rename attribute to prevent conflict with `ContextType` enum

* context type

* moar features

* remove integration types

* trigger workflow

* modelzzzz

* `InteractionContextType`

* allow setting custom status with `SetGameAsync`

* bugzzz

* app permissions

* message interaction context

* hm

* push for cd

* structs lets goooo

* whoops forgot to change types

* whoops x2

* tweak some things

* xmldocs + missing prop + fix enabled in dm

* moar validations

* deprecate a bunch of stuffz

* disable moar obsolete warnings

* add IF sample

* Apply suggestions from code review

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

* Update src/Discord.Net.Rest/Entities/RestApplication.cs

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

---------

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
2024-03-18 21:24:05 +00:00
Mihail Gribkov
bfc8dc229e Update library dependencies (#2806)
* bump dependencies

* sealed class

* forgot to push

* downgrade `IDisposableAnalyzers` to `4.0.2`

* also forgot to push

* Update docs.yml

* samples => `net8.0` | deps more up to date

* mark as non-trimmable & remove some cringe conditions

* format for beauty
2024-03-19 00:23:01 +03:00
Mihail Gribkov
2787db3eaa [Fix] InteractionService.AddModulesXAsync command duplication (#2867) 2024-02-27 14:14:59 +03:00
Mihail Gribkov
9a7bd05c28 [CI] New build action + Build framework on linux (#2848)
* Create dotnet.yml

* Update dotnet.yml

* Update dotnet.yml

* Update dotnet.yml

* pragma disable some obsolete warnings

* Update dotnet.yml

* Update dotnet.yml

* Update dotnet.yml

* update vars for windows

* cache? dotnet

* oops forgot to save

* add concurrency

* test deploy

* fix?

* disable caching

* Update dotnet.yml

* Update dotnet.yml

* Update dotnet.yml

* ...

* Update dotnet.yml

* it should build now. maybe. probably

* huh?

* huh x2

* disable deploy on PRs / enable cache

* publish test results

* Update dotnet.yml

* remove cache cuz it's useless

* Update dotnet.yml

* push to github packages cuz why not

* add toggle vars for pushes

* Update dotnet.yml

* uncomment release since there's a toggle now
2024-02-23 23:31:04 +03:00
Mihail Gribkov
30ccb2c83b Revert pr (Revert 12179a93d7) (#2826) 2024-01-16 22:25:57 +00:00
Cenk Ergen
0f0f3f7614 Log InteractionCommand execution exceptions in Wrapped Exception (#2584)
* log command execution exceptions in wrapped obj

* actually log the wrapped exception

---------

Co-authored-by: Misha133 <mihagribkov133@gmail.com>
2024-01-16 22:06:29 +00:00
Cenk Ergen
12179a93d7 Add generic [AutocompleteAttribute] (#2611)
* add generic AutocompleteAttribute

* fancy syntax

* it didn't work -_-

---------

Co-authored-by: Misha133 <mihagribkov133@gmail.com>
2024-01-17 00:11:29 +03:00
Dmitry
86655a8157 [Refactor] Remove some unnecessary async/await (#2739)
* Remove some unnecessary async/await

* More not-so-async stuff

* More not-so-async stuff

* Fix merge issue
2023-11-18 21:29:14 +00:00
Mihail Gribkov
e3cd340dcc [Feature] Media channel support (#2725)
* initial commit

* oops

* another typo -_-

* Update AttachmentFlags.cs

Made this on my phone lol

* Update AttachmentFlags.cs

* -line

* initial impl

* some guild methods for media (and forum) channels

* file attachment can be a thumbnail

* can't edit media channel layout

* updatess

* Update ChannelPermissions.cs

* typo
2023-11-18 15:56:14 -05:00
Markus Oppmann
8d5022acb8 Fix Slash Command Localizations lost after AddCommandsToGuildAsync and deleteMissing = false (#2758)
fetch localizations when adding commands with `deleteMissing` = `false`

fixes #2757
2023-11-18 15:51:54 -05:00
zobweyt
4e78aec2d0 [Fix] Add missing parameters to RespondWithModalAsync methods and implement missing overloads (#2769)
* Added missing modifyModal parameters to RespondWithModalAsync methods

* Fix typo

* Remove unnecessary parts

* Add missing `options` parameter

* Add missing overload

* Use `.Invoke` with `null` check to simplify

* Remove code duplication

* Remove code duplication

* Add missing payload to `RestInteractionModuleBase`
2023-10-18 00:31:56 +03:00
Mihail Gribkov
7723f61072 [Feature] Premium subscriptions (#2781)
* what a big commit lel, add app sub enums

* work

* ah yup lol

* `?`

* events 1

* typo

* `list` => `get` | remaining events

* add `RespondWithPremiumRequiredAsync` to interaction module base
2023-09-30 09:39:28 -04:00
Misha133
56769cba37 [Fix] some ReplyAsync methods missing MessageFlags parameter (#2713)
* fix

* fix x2

* dot

* xmldocs
2023-08-10 15:54:37 +03:00
Misha133
9ddd922d2f [Refactor] Refactor some stuff (#2688)
* fix some `internal` classes being exposed

* update xmldoc comments to use `<see langword>`

* bump library version in samples

* fix possible oversight
2023-06-27 11:11:16 -03:00
Cenk Ergen
fe9657a0ee replace duplicate InvokeAndReturn wit return statement (#2662) 2023-04-12 08:14:10 +02:00
Florian Pabst
75ae48830e Update EnumConverter and ApplicationCommandOption to register localizations (#2651) 2023-04-02 22:03:05 +02:00
Ge
ee617d8ef3 Fix typos in comments and documentation (#2608)
* Fix typos in comments and documentations

* Fixes more typo
2023-02-26 20:49:16 +01:00
Dedmen Miller
50e0e5941a Add ModalBuilder.AddModalCommand with option to specify callback (#2599)
Fixes: #2597
2023-02-14 22:31:50 +01:00
NaN
257f246d1d Format the project with 'dotnet format' (#2551)
* Sync and Re-Format

* Fix Title string.

* Fix indentation.
2023-02-13 18:45:59 +01:00
Christopher Bonnell
274be5df9e Fix permissions on deleteMissing=false (#2532) 2023-02-09 16:36:17 +01:00
Cenk Ergen
1602437c31 Update customId template generator to escape regex metachars used in … (#2557)
* update customId template generator to escape regex metachars used in template literals

* add clarification to TreatAsRegex prop documentation.

* Implement channel ApplicationCommandPermissionTarge

* implement channel target in ApplicationCommandPermission and add static methods for targeting @everyone and all channels

* Revert "add clarification to TreatAsRegex prop documentation."

This reverts commit 6eab5878a7ddff4e949a90d446f2e3dfe2e9c506.

* fix oopsie
2023-02-06 13:27:42 +01:00
Cenk Ergen
e7bda0f8a5 [Feature] RespondWithModal() which accepts an IModal instance as template (#2564)
* introduce overload for responding to an interaction with an instatiated IModal obj

* add inline docs to ModalInfo.PropertyInfo

* Apply suggestions from code review

Co-authored-by: Casmir <68127614+csmir@users.noreply.github.com>

---------

Co-authored-by: Casmir <68127614+csmir@users.noreply.github.com>
2023-02-06 13:52:16 +03:00
Gradyn Wursten
7acbcfdfa5 #2536 Add RemoveModulesFromGuildAsync (#2537)
* Add RemoveModulesFromGuildAsync

* fix RemoveModulesFromGuildAsync

* add docs

* fix parameter name
2023-01-21 11:52:37 +01:00
Misha133
48fb1b5df4 [Feature] Selects v2 support (#2507)
* Initial support for new select types

* Merge branch 'dev' of https://github.com/discord-net/Discord.Net into dev

* some component&action row builder additions

* remove redundant code

* changes1

* maybe working rest part?

* working-ish state?

* fix some xml docs & small rework

* typos

* fix `ActionRowBuilder`

* update DefaultArrayComponentConverter to accomodate new select-v2 types

* now supports dm channels in channel selects

* add a note to IF docs

* add notes about nullable properties

* <see langword="null"/>

* update Modal.cs

Co-authored-by: cat <lumitydev@gmail.com>
Co-authored-by: Cenngo <cenk.ergen1@gmail.com>
2022-12-25 13:41:15 +01:00
Misha133
56b1a930e7 [Feature] Age restricted (NSFW) application commands support (#2531)
* add `nsfw` to data model & internal methods; add missing property

* add `nsfw` prop to command builders

* add `NsfwCommandAttribute` to Interaction Framework

* working state

* docs?
2022-12-20 01:00:56 +03:00
Cenk Ergen
3b107c2d01 implement wildcard lenght quantifiers, TreatAsRegex property and solve catastrpohic backtracking (#2528) 2022-12-14 17:06:57 +03:00
Cenk Ergen
6869817184 Command execution code rework and TypeConverters auto-scope fix (#2306)
* command execution rework and sync service scopes for typeconverters

* replace ValueTask with Task

* fix implementation bugs

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
2022-11-22 14:05:26 +03:00
Damian Kraaijeveld
376a812b6a Return a list instead of an array (#2451) 2022-09-02 14:04:53 -07:00
Kuba_Z2
0aa381d468 Fix typos of word length (#2443) 2022-08-29 11:24:32 +02:00
Cenk Ergen
39bbd298c3 Interactions Command Localization (#2395)
* Request headers (#2394)

* add support for per-request headers

* remove unnecessary usings

* Revert "remove unnecessary usings"

This reverts commit 8d674fe4faf985b117f143fae3877a1698170ad2.

* remove nullable strings from RequestOptions

* Add Localization Support to Interaction Service (#2211)

* add json and resx localization managers

* add utils class for getting command paths

* update json regex to make langage code optional

* remove IServiceProvider from ILocalizationManager method params

* replace the command path method in command map

* add localization fields to rest and websocket application command entity implementations

* move deconstruct extensions method to extensions folder

* add withLocalizations parameter to rest methods

* fix build error

* add rest conversions to interaction service

* add localization to the rest methods

* add inline docs

* fix implementation bugs

* add missing inline docs

* inline docs correction (Name/Description Localized properties)

* add choice localization

* fix conflicts

* fix conflicts

* add missing command props fields to ToApplicationCommandProps methods

* add locale parameter to Get*ApplicationCommandsAsync methods for fetching localized command names/descriptions

* Apply suggestions from code review

Co-authored-by: Armano den Boef <68127614+Rozen4334@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Armano den Boef <68127614+Rozen4334@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Guilds/IGuild.cs

Co-authored-by: Armano den Boef <68127614+Rozen4334@users.noreply.github.com>

* add inline docs to LocalizationTarget

* fix upstream merge errors

* fix command parsing for context command names with space char

* fix command parsing for context command names with space char

* fix failed to generate buket id

* fix get guild commands endpoint

* update rexs localization manager to use single-file pattern

* Upstream Merge Localization Branch (#2434)

* fix ci/cd error (#2428)

* Fix role icon & emoji assignment. (#2416)

* Fix IGuild.GetBansAsync() (#2424)

fix the problem of not being able to get more than 1000 bans

* [DOCS] Add a note about `DontAutoRegisterAttribute`  (#2430)

* add a note about `DontAutoRegisterAttribute`

* Remove "to to" and add punctuation

Co-authored-by: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>

* fix: Missing Fact attribute in ColorTests (#2425)

* feat: Embed comparison (#2347)

* Fix broken code snippet in dependency injection docs (#2420)

* Fixed markdown formatting to show code snippet

* Fixed constructor injection code snippet pointer

* Added support for lottie stickers (#2359)

Co-authored-by: Armano den Boef <68127614+Rozen4334@users.noreply.github.com>
Co-authored-by: BokuNoPasya <49203428+1NieR@users.noreply.github.com>
Co-authored-by: Misha133 <61027276+Misha-133@users.noreply.github.com>
Co-authored-by: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>
Co-authored-by: Ge <gehongyan1996@126.com>
Co-authored-by: Charlie U <52503242+cpurules@users.noreply.github.com>
Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com>

* remove unnecassary fields from ResxLocalizationManager

* update int framework guides

* remove space character tokenization from ResxLocalizationManager

Co-authored-by: Armano den Boef <68127614+Rozen4334@users.noreply.github.com>
Co-authored-by: BokuNoPasya <49203428+1NieR@users.noreply.github.com>
Co-authored-by: Misha133 <61027276+Misha-133@users.noreply.github.com>
Co-authored-by: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>
Co-authored-by: Ge <gehongyan1996@126.com>
Co-authored-by: Charlie U <52503242+cpurules@users.noreply.github.com>
Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com>
2022-08-26 18:45:27 +03:00
Cenk Ergen
500e7b44ca Using RespondWithModalAsync<IModal>() without prior IModal declaration (#2369)
* add RespondWithModalAsync method for initializing missing ModalInfos on runtime

* update method name and add inline docs
2022-08-10 11:37:40 +03:00
Cenk Ergen
e551431d72 Max/Min length fields for ApplicationCommandOption (#2379)
* implement max/min length fields for ApplicationCommandOption

* fix badly formed xml comments
2022-08-03 16:44:30 +03:00
Armano den Boef
b0b8167efb fix: Remove group check from RequireContextAttribute (#2409) 2022-08-03 10:54:30 +02:00
Armano den Boef
902326d1f3 fix: Range of issues presented by analyzer (#2404) 2022-08-01 18:53:22 +02:00
d4n
0fad3e8b37 feat: Add method overloads to InteractionService (#2328) 2022-06-02 10:12:49 -03:00
Cenk Ergen
b465d609f0 fix: Application commands are disabled to everyone except admins by default (#2293) 2022-05-18 04:52:14 -03:00
Cenk Ergen
6fbd396832 Add Nullable ComponentTypeConverter and TypeReader (#2307)
* add nullable ComponentTypeConverter and TypeReader

* add converter and reader to interactionservice
2022-05-18 04:45:18 -03:00
Quin Lynch
e136759073 feature: Treat warnings as errors and set warning level to 5 (#2270) 2022-05-09 22:56:22 -03:00