mirror of
https://github.com/Jetsparrow/karmabot.git
synced 2026-01-21 09:06:09 +03:00
Update to new Perfusion
This commit is contained in:
parent
7291318dcc
commit
86ab927005
@ -17,7 +17,7 @@ namespace JetKarmaBot
|
|||||||
public class JetKarmaBot : IDisposable
|
public class JetKarmaBot : IDisposable
|
||||||
{
|
{
|
||||||
[Inject] Config Config { get; set; }
|
[Inject] Config Config { get; set; }
|
||||||
[Inject] Container Container { get; set; }
|
[Inject] IContainer Container { get; set; }
|
||||||
[Inject] KarmaContextFactory Db { get; set; }
|
[Inject] KarmaContextFactory Db { get; set; }
|
||||||
|
|
||||||
TelegramBotClient Client { get; set; }
|
TelegramBotClient Client { get; set; }
|
||||||
@ -70,7 +70,7 @@ namespace JetKarmaBot
|
|||||||
Task.Run(() => Commands.Execute(sender, messageEventArgs));
|
Task.Run(() => Commands.Execute(sender, messageEventArgs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitCommands(Container c)
|
void InitCommands(IContainer c)
|
||||||
{
|
{
|
||||||
Commands = c.ResolveObject(new ChatCommandRouter(Me));
|
Commands = c.ResolveObject(new ChatCommandRouter(Me));
|
||||||
Commands.Add(c.ResolveObject(new HelpCommand(Commands)));
|
Commands.Add(c.ResolveObject(new HelpCommand(Commands)));
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFrameworks>netcoreapp2.1;net47;</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.1;</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.4">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.4">
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace JetKarmaBot.Services
|
|||||||
{
|
{
|
||||||
public class KarmaContextFactory
|
public class KarmaContextFactory
|
||||||
{
|
{
|
||||||
[Inject] Container C { get; set; }
|
[Inject] IContainer C { get; set; }
|
||||||
|
|
||||||
public KarmaContext GetContext() => C.GetInstance<KarmaContext>();
|
public KarmaContext GetContext() => C.GetInstance<KarmaContext>();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ namespace JetKarmaBot
|
|||||||
private Dictionary<string, Locale> locales = new Dictionary<string, Locale>();
|
private Dictionary<string, Locale> locales = new Dictionary<string, Locale>();
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
public Localization(Container c)
|
public Localization(IContainer c)
|
||||||
{
|
{
|
||||||
c.ResolveObject(this);
|
c.ResolveObject(this);
|
||||||
log.Info("Initializing...");
|
log.Info("Initializing...");
|
||||||
|
|||||||
@ -7,7 +7,7 @@ namespace JetKarmaBot
|
|||||||
{
|
{
|
||||||
public class LogInfo : ObjectInfo
|
public class LogInfo : ObjectInfo
|
||||||
{
|
{
|
||||||
public override object GetInstance(Type requester = null)
|
public override object GetInstance(IContainer c, Type requester = null)
|
||||||
{
|
{
|
||||||
return LogManager.GetLogger(requester != null ? getTypeName(requester) : "<type unspecified>");
|
return LogManager.GetLogger(requester != null ? getTypeName(requester) : "<type unspecified>");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit a9503a6b2cfa9166d4904ad995bc81d39ec9b2b7
|
Subproject commit 834e1a25e96cbe120789457960c46afdea11f5bc
|
||||||
Loading…
Reference in New Issue
Block a user