mirror of
https://github.com/yawaflua/PL_JusticeBot.git
synced 2025-12-09 20:09:31 +02:00
hotfixes
This commit is contained in:
@@ -17,7 +17,7 @@ namespace DiscordApp.Discord.Commands
|
|||||||
[DefaultMemberPermissions(GuildPermission.Administrator)]
|
[DefaultMemberPermissions(GuildPermission.Administrator)]
|
||||||
public async Task addAutoBranches(IChannel channel, string branchName = "Обсуждение")
|
public async Task addAutoBranches(IChannel channel, string branchName = "Обсуждение")
|
||||||
{
|
{
|
||||||
//await DeferAsync(true);
|
await DeferAsync(true);
|
||||||
Autobranches autobranches = new()
|
Autobranches autobranches = new()
|
||||||
{
|
{
|
||||||
ChannelId = channel.Id,
|
ChannelId = channel.Id,
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ namespace DiscordApp.Justice.Interactions
|
|||||||
[ModalInteraction("newIndividualEterpreneurModal")]
|
[ModalInteraction("newIndividualEterpreneurModal")]
|
||||||
public async Task newIndividualEterpreneur(INewIndividualEntrepreneur modal)
|
public async Task newIndividualEterpreneur(INewIndividualEntrepreneur modal)
|
||||||
{
|
{
|
||||||
|
await DeferAsync(true);
|
||||||
Passport? applicant = await Startup.appDbContext.Passport.FindAsync(int.Parse(modal.passportId));
|
Passport? applicant = Startup.appDbContext.Passport.FirstOrDefault(k => k.Id == int.Parse(modal.passportId));
|
||||||
|
await Console.Out.WriteLineAsync(applicant.ToString());
|
||||||
if (applicant == null)
|
if (applicant == null)
|
||||||
{
|
{
|
||||||
await FollowupAsync("Ошибка! Такого паспорта не существует. Попробуйте старого бота.", ephemeral: true);
|
await FollowupAsync("Ошибка! Такого паспорта не существует. Попробуйте старого бота.", ephemeral: true);
|
||||||
|
|||||||
@@ -47,11 +47,17 @@ namespace DiscordApp
|
|||||||
await handler.RegisterCommandsGloballyAsync(true);
|
await handler.RegisterCommandsGloballyAsync(true);
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var request = await http.GetAsync("https://api.mcsrvstat.us/3/pl.spworlds.ru");
|
try
|
||||||
JsonNode responseAboutPL = JsonNode.Parse(request.Content.ReadAsStringAsync().Result);
|
{
|
||||||
if (responseAboutPL["online"].Equals("false")) await client.SetGameAsync($"выключенный PL", "https://yaflay.ru/", ActivityType.Watching);
|
var request = await http.GetAsync("https://api.mcsrvstat.us/3/pl.spworlds.ru");
|
||||||
else await client.SetGameAsync($"онлайн на PL: {responseAboutPL["players"]["online"]}", "https://yaflay.ru/", ActivityType.Watching);
|
JsonNode responseAboutPL = JsonNode.Parse(request.Content.ReadAsStringAsync().Result);
|
||||||
await Task.Delay(30000);
|
if (responseAboutPL["online"].Equals("false")) await client.SetGameAsync($"выключенный PL", "https://yaflay.ru/", ActivityType.Watching);
|
||||||
|
else await client.SetGameAsync($"онлайн на PL: {responseAboutPL["players"]["online"]}", "https://yaflay.ru/", ActivityType.Watching);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
await Task.Delay(30000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user