fix: reformat using C# rules
This commit is contained in:
@@ -9,4 +9,4 @@ public class BotDbContext : DbContext
|
||||
}
|
||||
|
||||
public DbSet<User> Users { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,4 @@ public class User
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string LastMessage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,12 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.9"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\TelegramBotBase\TelegramBotBase.csproj" />
|
||||
<ProjectReference Include="..\..\TelegramBotBase\TelegramBotBase.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -10,14 +10,15 @@ var serviceCollection = new ServiceCollection()
|
||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
|
||||
var bot = BotBaseBuilder.Create()
|
||||
.WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ?? throw new Exception("API_KEY is not set"))
|
||||
.DefaultMessageLoop()
|
||||
.WithServiceProvider<StartForm>(serviceProvider)
|
||||
.NoProxy()
|
||||
.NoCommands()
|
||||
.NoSerialization()
|
||||
.DefaultLanguage()
|
||||
.Build();
|
||||
.WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ??
|
||||
throw new Exception("API_KEY is not set"))
|
||||
.DefaultMessageLoop()
|
||||
.WithServiceProvider<StartForm>(serviceProvider)
|
||||
.NoProxy()
|
||||
.NoCommands()
|
||||
.NoSerialization()
|
||||
.DefaultLanguage()
|
||||
.Build();
|
||||
|
||||
bot.Start();
|
||||
await Task.Delay(-1);
|
||||
await Task.Delay(-1);
|
||||
@@ -33,4 +33,4 @@ public class StartForm : FormBase
|
||||
user.LastMessage = string.IsNullOrWhiteSpace(message.MessageText) ? "<unknown>" : message.MessageText;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user