Skip to content

Commit

Permalink
v2.0.1.0 Bot (Re-upload)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlebushek2020 committed Dec 9, 2021
1 parent 66ec761 commit 10d1532
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ban-reason|reason|Причина бана на текущем сервере|:he
member-ban-reason|m-reason|Причина бана участника сервера|:heavy_check_mark:|:heavy_check_mark:|:x:
password-reset|password|Сброс пароля|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
register|reg|Регистрация|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
set-app|-|Устанавливает новую ссылку для команды: app|:heavy_check_mark:|:x:|:x:
settings|-|Данные для подключения|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
shutdown|sd|Выключить бота|:heavy_check_mark:|:x:|:x:
unban|-|Удаляет пользователя из забаненых (пользователю снова разрешено скачивать с этого сервера (гильдии))|:heavy_check_mark:|:heavy_check_mark:|:x:
Expand Down
8 changes: 8 additions & 0 deletions YukoBot/Commands/OwnerCommandModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,13 @@ public async Task ActiveTime(CommandContext commandContext)
// await commandContext.RespondAsync("Такой таблицы не существует");
// }
//}

[Command("set-app")]
[Description("Устанавливает новую ссылку для команды: app")]
public async Task SetApp(CommandContext commandContext, string newlink)
{
YukoSettings.Current.ClientActualApp = newlink;
await commandContext.RespondAsync("Ok");
}
}
}
4 changes: 2 additions & 2 deletions YukoBot/YukoBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RootNamespace>YukoBot</RootNamespace>
<Authors>Sergey Govorunov</Authors>
<Copyright>Sergey Govorunov</Copyright>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<AssemblyVersion>2.0.1.0</AssemblyVersion>
<FileVersion>2.0.1.0</FileVersion>
<AssemblyName>YukoBot</AssemblyName>
</PropertyGroup>

Expand Down
18 changes: 16 additions & 2 deletions YukoBot/YukoSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ namespace YukoBot
{
public class YukoSettings
{
[JsonIgnore]
#region Fields
private static YukoSettings settings;
private string clientActualApp = null;
#endregion

#region Propirties
public string DatabaseHost { get; set; }
Expand All @@ -19,7 +21,19 @@ public class YukoSettings
public string ServerAddress { get; set; }
public string ServerInternalAddress { get; set; }
public int ServerPort { get; set; }
public string ClientActualApp { get; set; }
public string ClientActualApp
{
get { return clientActualApp; }
set
{
clientActualApp = value;
string settingsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "settings.json");
using (StreamWriter streamWriter = new StreamWriter(settingsPath, false, Encoding.UTF8))
{
streamWriter.Write(JsonConvert.SerializeObject(this, Formatting.Indented));
}
}
}
public int DiscordMessageLimit { get; set; } = 100;
public int DiscordMessageLimitSleepMs { get; set; } = 1000;
[JsonIgnore]
Expand Down

0 comments on commit 10d1532

Please sign in to comment.