summaryrefslogtreecommitdiff
path: root/DiscoBot/DSA_Game
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-09-25 21:36:25 +0200
committerTrueDoctor <d-kobert@web.de>2018-09-25 21:36:25 +0200
commitee0202042aafc76eb4339b3a04d06d06921ccdc2 (patch)
treeba5a41be5c4e61cbf759f3252d1562b649023d69 /DiscoBot/DSA_Game
parentfe1af24f3cda4b94d02e3b2aad68a6c4398362b0 (diff)
minor error fixes and functional improvements
Diffstat (limited to 'DiscoBot/DSA_Game')
-rw-r--r--DiscoBot/DSA_Game/Save/SaveCommand.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/DiscoBot/DSA_Game/Save/SaveCommand.cs b/DiscoBot/DSA_Game/Save/SaveCommand.cs
index cd44534..1f160ec 100644
--- a/DiscoBot/DSA_Game/Save/SaveCommand.cs
+++ b/DiscoBot/DSA_Game/Save/SaveCommand.cs
@@ -18,6 +18,7 @@ namespace DiscoBot.DSA_Game.Save
public class SaveCommand : ModuleBase
{
[Command("load"), Summary("Load Session")]
+ [Alias("session")]
public async Task LoadSessionAsync([Remainder, Summary("Session Name")] string name = "")
{
if (name.Equals("?") || name.Equals(string.Empty))
@@ -39,7 +40,7 @@ namespace DiscoBot.DSA_Game.Save
[Command("save", RunMode = RunMode.Async), Summary("Save Session")]
public async Task SessionSaveAsync([Remainder, Summary("Session Name")] string name = "")
{
- var sendFile = this.Context.Channel.SendWebFile("https://cdn.discordapp.com/attachments/377123019673567232/465615882048110603/giphy.gif");
+ //var sendFile = this.Context.Channel.SendWebFile("https://cdn.discordapp.com/attachments/377123019673567232/465615882048110603/giphy.gif");
if (name.Equals("?") || name.Equals(string.Empty))
{
@@ -53,16 +54,18 @@ namespace DiscoBot.DSA_Game.Save
{
var files = Directory.GetFiles(path);
int current = files.Max(x => Convert.ToInt32(x.Split('-').Last().Split('.').First()));
+ Dsa.Session.SessionName = name;
Dsa.Session.Save(path + "\\" + name + $"-{++current}.json");
}
else
{
Directory.CreateDirectory(path);
+ Dsa.Session.SessionName = name;
Dsa.Session.Save(path + "\\" + name + $"-0.json");
}
await this.ReplyAsync($"{name} wurde gespeichert");
- await sendFile;
+ //await sendFile;
}
private string[] ListSessions()