Commit Graph

424 Commits

Author SHA1 Message Date
RogueException
63d3b93975 Removed Discord.Commands.Attributes.Preconditions namespace 2016-08-09 23:44:10 -03:00
RogueException
dcb603acd7 Cleaned up permission checks, added Permissions.Has(enum) methods 2016-08-09 18:18:50 -03:00
RogueException
e452aa9662 Cleaned up Command Result structs 2016-08-09 17:53:08 -03:00
RogueException
0b9f9b16a9 Merge pull request #178 from DigiTechs/command_tweaks
Command tweaks
2016-08-09 17:31:10 -03:00
RogueException
2b9600686f Merge pull request #179 from DigiTechs/feature/172
Preconditions for commands
2016-08-09 17:30:25 -03:00
Finite Reality
f7633ea3d7 Revert 3856d43 & rename CommandParameter.Description to Summary 2016-08-09 16:37:56 +01:00
Finite Reality
f2d80de343 Fix error with RequirePermission precondition 2016-08-07 17:23:26 +01:00
Finite Reality
c77c84bec7 Remove ContextType.Invalid 2016-08-06 00:43:11 +01:00
Finite Reality
6db3f52ac1 eplace DM/Guild preconditions with context
The new RequireContextAttribute works just like RequireDM/RequireGuild,
but is more powerful as developers can specify multiple 'contexts' for
their command to require using the ContextType flags.
2016-08-06 00:15:11 +01:00
RogueException
f6931d4b8a Ignore doc warnings during Release build 2016-08-05 16:29:08 -03:00
Joe4evr
911faaf29e Include XML Docs when building. 2016-08-05 19:13:26 +02:00
Finite Reality
86092f9253 Rename Synopsis to Summary to improve clarity 2016-08-05 00:17:29 +01:00
Finite Reality
11f1163ec2 Add Command and module instance parameters to CheckPermissions
After a small discussion with Joe4evr on discord, a way of retrieving the
state of a module appeared to be needed. The new override should provide
enough context to a bot dev to allow them to do what they want.
2016-08-04 23:31:21 +01:00
Finite Reality
1e72eca34a Remove Preconditions check from Command.Execute
Preconditions are still handled by CommandService.Execute
2016-08-04 21:48:44 +01:00
Finite Reality
046d56cab5 Add module-level preconditions and precondition for individual permissions 2016-08-04 19:36:14 +01:00
Finite Reality
0e920da21f Complete Preconditions implementation 2016-08-03 17:21:38 +01:00
Finite Reality
a5393dc937 Rename Permission to Precondition 2016-08-03 16:50:51 +01:00
Finite Reality
023703c996 Add logic to CommandService.Execute to handle basic permissions checks 2016-08-03 16:43:25 +01:00
Finite Reality
47089448dd Fix Synopsis/Description mix-up 2016-08-03 16:33:26 +01:00
Finite Reality
757c36ccd1 Rename and move things about 2016-08-03 16:09:58 +01:00
Finite Reality
8c0d4b6123 Improve command documentation features 2016-08-02 23:08:33 +01:00
Finite Reality
3856d43587 Remove Modules enumerable, change Commands to ILookup 2016-08-02 23:08:32 +01:00
Finite Reality
eb38bdd437 Fix indentation 2016-08-02 17:54:52 +01:00
Finite Reality
772fd97080 Implement initial command permissions system
After our initial discussion on the matter (see #172) this is the system
that we all seem to have agreed on. As a result, I have implemented a
simple system which effectively implements permissions, while being
extensible and tweakable so bot devs can decide what they want to do for
permissions.

As for default 'permissions', I'm not sure what the best approach would be
here; bot devs are likely to implement their own permissions 'levels' and
use those. I think the most we could do for now is add attributes to
require certain users (by id) and certain roles (by id and possibly by
name?) This would probably be the best option for now as it requires less
work from us, nor do we know the *exact* approach bot devs want to take
with permissions.
2016-08-02 17:29:39 +01:00
RogueException
75b864bfe7 Merge pull request #164 from RogueException/issues/160
Don't load modules that are already loaded
2016-07-30 23:18:58 -03:00
Christopher F
4c200c94ec Key the ModuleMap based on Type rather than instance 2016-07-30 21:44:14 -04:00
RogueException
a04cf5201a Cleaned up params implementation 2016-07-30 22:25:17 -03:00
Finite Reality
6732e256fb Clean up a little 2016-07-30 22:25:16 -03:00
Finite Reality
5ce609c323 Fix small typo 2016-07-30 22:25:16 -03:00
Finite Reality
c8fc0ffa33 Add support for 'params' arguments 2016-07-30 22:25:16 -03:00
Christopher F
9348e087b0 Don't load modules that are already loaded
Previously, if a user autoloaded commands more than once, commands that were already in the command map would be readded. 

If the module list already contains a module with the same type as the module being loaded, it will not load the new instance of this module.
2016-07-30 18:23:12 -04:00
Khionu Terabite
846a1746a2 Added Command.Synopsis for seperation of short and long descriptions, this being intended for long. 2016-07-30 18:09:38 -04:00
RogueException
15dd6016e7 Fixed several CommandParameter nullrefs 2016-07-30 15:13:06 -03:00
RogueException
02d5fc4a8e Exposed CommandParameter's Type 2016-07-30 15:10:50 -03:00
RogueException
3077249705 Fixed parsing errors when the first argument is on a new line 2016-07-30 00:29:25 -03:00
RogueException
c5569a44ea Renamed Unparsed -> Remainder. Fixed non-string remainder parameters. 2016-07-29 23:10:13 -03:00
RogueException
ff017bd51f Remove string check for unparsed 2016-07-28 23:20:36 -03:00
Finite Reality
2f0881460c Ignore static constructors when creating types 2016-07-27 21:40:45 +01:00
RogueException
6fe02bf033 Added a few missing primitive parsers 2016-07-26 19:10:57 -03:00
RogueException
4a06753990 Cleaned up TypeReaders 2016-07-26 19:01:51 -03:00
RogueException
f0a6899bc7 Cleaned up WebSocket entities. Renamed CachedXXX -> SocketXXX. 2016-07-26 17:26:58 -03:00
RogueException
e179c85896 Increased LogMessage's default source padding 2016-07-21 17:52:27 -03:00
Khionu Terabite
ae2ef74b14 Variable rename
Changed name to be more context appropriate
2016-07-21 14:38:30 -04:00
RogueException
b029725bb1 Cleaned up new DependencyMap system 2016-07-20 23:34:32 -03:00
RogueException
751c28a87e Merge pull request #139 from DigiTechs/feature-128
Add Dependency Injection and Autoloading to the Commands service
2016-07-20 23:16:44 -03:00
RogueException
b407c71567 Added support for non-int enums 2016-07-20 23:16:06 -03:00
Finite Reality
b546ba919b Simplify exception 2016-07-21 02:49:27 +01:00
RogueException
c101c44c04 Merge pull request #140 from RogueException/khio-enumpatch
Enum TypeReader
2016-07-20 22:45:34 -03:00
RogueException
c191f65c63 Fixed Mention prefix detection 2016-07-20 22:13:58 -03:00
Khionu Terabite
523b862525 Added Dynamic Enum TypeParsing, to support all enums 2016-07-20 20:54:29 -04:00