Commit Graph

208 Commits

Author SHA1 Message Date
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
757c36ccd1 Rename and move things about 2016-08-03 16:09:58 +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
Finite Reality
39d8e3c159 Allow users to get IDependencyMap if they follow a strict format 2016-07-21 01:44:14 +01:00
RogueException
77589cc758 Fixed Discord.Net.Commands warning 2016-07-20 21:15:28 -03:00
Finite Reality
f7455c389b Improve DI system 2016-07-21 00:23:49 +01:00
Christopher F
e266fa8b32 Cleaned up bugs in DependencyMap and ReflectionUtils 2016-07-20 18:04:18 -04:00
Christopher F
bbe51012cf Add Dependency Map, Update Assembly Crawler
[Untested] Assembly Crawler will now accept constructors matching: new(), new(CommandService), new(IDependencyMap).

Add IDependencyMap

Add DependencyMap
2016-07-20 17:50:52 -04:00
Christopher F
6e42acba68 Add Autoload to Module Attribute
[UNTESTED] Adds an optional parameter to the Module attribute, "autoload", which defaults to true.

Specifies whether or not the assembly crawler should load this module.
2016-07-20 17:20:37 -04:00
Khionu Terabite
63fdd67413 Initial Plan for allowing custom Enum Type Readers 2016-07-20 15:17:22 -04:00
RogueException
a9bfa958dc Reference Discord.Net with a wildcard version 2016-07-20 16:03:54 -03:00
RogueException
e2f15c96cd Added template version for dotnet pack --version-suffic 2016-07-19 15:55:13 -03:00
RogueException
53e1c79848 Cleaned up mention logic, removed User.NicknameMention 2016-07-19 15:55:00 -03:00
RogueException
da2002b520 Renamed Message.Text -> Message.Content 2016-07-15 22:34:27 -03:00
RogueException
efc87ef06d Removed IMessage.Text, renamed RawText -> Text, added Resolve 2016-07-13 13:07:24 -03:00
RogueException
0eb869211c Fixed escapes for unparsed parameters 2016-07-13 08:09:23 -03:00
RogueException
079d9d487d Forwarded the parse error if a command search has only one match 2016-07-12 07:39:27 -03:00
Khionu Terabite
3ad3912606 We all do it now and then <3 2016-07-07 20:35:46 -04:00
RogueException
7723130713 Implemented new CommandMap 2016-06-29 07:03:44 -03:00