Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

CommandsHelper.cs 806 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  1. namespace TestBot.Helpers
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using Autofac;
  7. using Scorables;
  8. public static class CommandsHelper
  9. {
  10. public static IEnumerable<Type> GetRegistrableTypes()
  11. {
  12. return typeof(TriggerScorable)
  13. .Assembly
  14. .GetTypes()
  15. .Where(t => !t.IsAbstract && typeof(TriggerScorable).IsAssignableFrom(t))
  16. .OrderBy(t => t.Name);
  17. }
  18. public static IEnumerable<string> GetValidTriggers(ILifetimeScope scope)
  19. {
  20. return CommandsHelper
  21. .GetRegistrableTypes()
  22. .Select(t => scope.ResolveKeyed(t.Name, t) as TriggerScorable)
  23. .Select(c => c.Trigger);
  24. }
  25. }
  26. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...