Commit Graph

549 Commits

Author SHA1 Message Date
Joe4evr
34917a35de In my defense, it was 2:40 AM 2017-06-24 02:50:30 +02:00
Joe4evr
444868b22d Fix attempting to inject into static properties 2017-06-24 02:39:15 +02:00
Joe4evr
36ed2b49f0 PreconditionGroup quick fix
It didn't make much sense
2017-06-23 20:46:59 +02:00
Finite Reality
cce572c600 Include names in command builder exceptions (#663) 2017-06-23 11:28:30 -03:00
Joe4evr
4a9c8168a9 Add grouping of preconditions to allow for flexible precondition logic. (#672)
* Add grouping of preconditions to allow for flexible precondition logic.

* Fix checking Module Preconditions twice (and none of the command's own)

* Fix command preconditions group 0 looping over every other precondition anyway #whoopsies

* Use custom message when a non-zero Precondition Group fails.

* Fix doc comment rendering.

* Refactor loops into local function

* Considering a new result type

* Switch to IReadOnlyCollection<T> and fix compiler errors

* Revert PreconditionResult -> IResult in return types - Change PreconditionResult to a class that PreconditionGroupResult inherits.

* Feedback on property name.

* Change grouping type int -> string

* Explicitly use an ordinal StringComparer

* Full stops on error messages

* Remove some sillyness.

* Remove unneeded using.
2017-06-23 11:28:22 -03:00
FiniteReality
0550006d56 Change wording of permission preconditions
Also fix an issue where RequireBotPermission may throw if used in a
non-guild channel which required guild permissions.
2017-06-17 15:10:35 +01:00
RogueException
285a0e5817 Updated deps, cleaned csprojs 2017-05-09 20:51:00 -03:00
FiniteReality
1e888cde24 Fix CheckPreconditions giving empty service provider
Parameter preconditions were always getting the empty service provider,
even when a custom one was provided in ExecuteAsync, which means that
preconditions which use services cannot work properly.
2017-05-08 22:15:47 +01:00
FiniteReality
00895b1227 Remove CommandService.BuildServiceCollection
💥
2017-05-06 18:25:44 +01:00
Finite Reality
112a434424 Allow for case-insensitive HasStringPrefix (#644)
This was 👍'd in the dev chat, I forgot to make a PR for it (whoops!)
2017-05-06 02:39:46 -03:00
RogueException
870dc50a68 Fixed RequireNsfwAttribute definition 2017-05-04 13:15:51 -03:00
RogueException
ba1982a3f9 Replaced DependencyMap with ServiceCollection and IServiceProvider (#625) 2017-05-04 12:52:26 -03:00
Christopher F
7f1fc286cf Add IChannel.Nsfw, RequireNsfw precondition (#633)
* Add IChannel.Nsfw, RequireNsfw precondition

* Refactored IChannel.Nsfw to IsNsfw, removed NsfwUtils

Per pull-request feedback

* proper nsfw channel check
2017-05-04 12:49:32 -03:00
Bond-009
cb4f6e37f6 Overloaded AddModuleAsync with Type (#581)
* Overloaded AddModuleAsync with Type

* Overloaded RemoveModuleAsync with Type

* Use expression-bodied method for consistency
2017-04-29 04:42:47 -03:00
Confruggy
3365bbb043 Fixes ChannelTypeReader (#630) 2017-04-28 11:49:59 -03:00
Confruggy
4ca273dd4a Fixes RoleTypeReader (#631) 2017-04-28 11:49:50 -03:00
RogueException
f8b9acc4a1 Use implicit package references (#626) 2017-04-26 10:03:23 -03:00
Christopher F
6000b15c4d C#7 TODOs 2017-04-23 15:13:31 -04:00
RogueException
1c6eebf875 Ensure command completes before cleaning up 2017-04-22 08:04:33 -03:00
RogueException
aca8def0cb ModuleBase should map to ICommandContext 2017-04-08 18:38:58 -03:00
RogueException
a6469e9021 Add support for void-returning commands 2017-04-07 05:48:33 -03:00
RogueException
bceb72dd92 Typo 2017-04-06 20:57:46 -03:00
RogueException
17ba8fe4d0 Better handle the primary alias. 2017-04-06 20:50:48 -03:00
RogueException
33cd1a6c9f Scan base types during DI injection 2017-04-06 20:29:42 -03:00
RogueException
14f0535a43 Improved typereader not found message 2017-04-05 23:53:20 -03:00
RogueException
b5d817f171 Cleaned up csprojs, added support for tag builds. 2017-04-01 11:11:09 -03:00
Christopher F
2b4a1249f4 Restrict DependencyMap#Get to reference types
It's impossible to add non-reference types to the map, so why allow pulling them out of it.
2017-03-25 17:08:45 -04:00
RogueException
bbd45a6f4b Fixed CommandException 2017-03-25 11:19:31 -03:00
Finite Reality
ca18eb0eb4 Replace TryGetValue call with TryRemove call (#586)
Resolves #584
2017-03-23 11:03:06 -03:00
RogueException
0c8d643519 Minor doc/exception edits 2017-03-18 23:22:39 -03:00
RogueException
3fb21e06c2 Fixed RunMode.Sync running Async. Added ThrowOnError option. 2017-03-18 21:38:28 -03:00
RogueException
ba07484fe9 Removed Mixed RunMode 2017-03-18 12:23:51 -03:00
RogueException
a2b12520b2 Added CommandService logging 2017-03-18 12:14:14 -03:00
Finite Reality
2160e5dac8 Improve parameter precondition type safety (#532)
* Improve parameter precondition type safety

Also removes some terrible code which was left over when I first
implemented parameter preconditions. I don't know why that was there.

With this commit, parameter preconditions should be much safer as they
use generic methods instead of janky casting of objects.

* Remove generic CheckPreconditions method
2017-03-18 09:55:53 -03:00
Finite Reality
3ddb01a5a2 Fix order of iteration in ExecuteAsync (#534) 2017-03-18 08:55:56 -03:00
RogueException
11ba30c6fa Cleaned up DepMap type checks 2017-03-18 08:48:18 -03:00
RogueException
334ceacdbf Merge pull request #546 from khionu/dev
Fix detection of IDependencyMap impl
2017-03-18 08:42:57 -03:00
RogueException
683541ba24 Added RequireOwner support for User tokens 2017-03-18 08:38:24 -03:00
Flamanis
94ea80b45e Modified User#Discrim check to properly check guild 2017-03-08 00:51:10 -06:00
Flamanis
dc2230de86 guildUsers instantiated to empty collection, removed added nullchecks
A null conditional operator was required at line 70 to avoid a nullref.
2017-03-08 00:48:18 -06:00
Flamanis
c643ceaa47 Add space after if and before ( 2017-03-07 18:41:31 -06:00
Flamanis
b5f80a7a6c Should fix Linq ArgumentNullException 2017-03-07 18:29:53 -06:00
Khionu Sybiern
ba406bb646 Split typechecks into their own conditions 2017-03-02 01:39:45 -05:00
Khionu Sybiern
4274900d43 Implimented discussed changes 2017-03-01 14:19:28 -05:00
Khionu Sybiern
c350debdba Better implimentation of detection 2017-03-01 08:08:07 -05:00
Khionu Sybiern
df6579260e Fix detection of IDependencyMap impl
Not pretty, but it works.
2017-03-01 07:13:38 -05:00
Christopher F
3c9704c822 Merge pull request #520 from james7132/property-injection
Conflicts:
	docs/guides/samples/dependency_module.cs
	src/Discord.Net.Commands/Utilities/ReflectionUtils.cs
2017-02-23 15:51:24 -05:00
Christopher F
7476c4ca38 Cleanup property injection 2017-02-23 15:47:46 -05:00
Christopher F
6fd834f326 Merge pull request #417 from RogueException/feature/better-di
Enhance Dependency Injection
2017-02-21 16:56:25 -05:00
RogueException
1070feafa8 Merge pull request #509 from aequasi/patch-2
Typo
2017-02-20 18:32:02 -04:00