Skip to content

Commit

Permalink
don't delete commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxinal committed Nov 23, 2020
1 parent ab368a6 commit 75a35d4
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions bot/commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public async Task join(CommandContext ctx,[Description("a color from red, blue,

await ctx.RespondAsync($"{ctx.Member.Mention} joined `{game.Key}` as {Bot.EmojiList[colorIndex]}*{Bot.InGameColors[colorIndex]}* himself");
await game.Value.startMessage.ModifyAsync(null, Bot.buildMessage(game.Key, game.Value.voiceChannel.Name, game.Value.players));
ctx.Message.DeleteAsync();
break;
}
}
Expand Down Expand Up @@ -66,7 +65,6 @@ public async Task newgame(CommandContext ctx,[Description("your game code i.e. `
game.voiceChannel = ctx.Member.VoiceState.Channel;
game.gameStartingChannel = ctx.Channel;

ctx.Message.DeleteAsync();
game.startMessage = await ctx.RespondAsync(null, false, Bot.buildMessage(code, game.voiceChannel.Name, game.players));

foreach(var emoji in Bot.EmojiList)
Expand Down Expand Up @@ -112,7 +110,6 @@ public async Task endgame(CommandContext ctx,[Description("your game code i.e. `
await game.startMessage.DeleteAsync();
game.startMessage = null;
await ctx.RespondAsync($"ended game `{code}` by {ctx.Member.Mention}");
ctx.Message.DeleteAsync();
}
else
{
Expand Down Expand Up @@ -154,7 +151,6 @@ public async Task forcejoin(CommandContext ctx,[Description("A color")] string c

await ctx.RespondAsync($"{member.Mention} joined `{game.Key}` as {Bot.EmojiList[colorIndex]}*{Bot.InGameColors[colorIndex]}* by {ctx.Member.Mention}");
await game.Value.startMessage.ModifyAsync(null, Bot.buildMessage(game.Key, game.Value.voiceChannel.Name, game.Value.players));
ctx.Message.DeleteAsync();
break;
}
}
Expand Down Expand Up @@ -202,7 +198,6 @@ public async Task kick(CommandContext ctx, string color)
await ctx.RespondAsync($"In `{game.Key}` {Bot.EmojiList[colorIndex]}*{Bot.InGameColors[colorIndex]}* is already free");
}

ctx.Message.DeleteAsync();
break;
}
}
Expand Down

4 comments on commit 75a35d4

@Mr-VIT
Copy link
Contributor

@Mr-VIT Mr-VIT commented on 75a35d4 Nov 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe should make this behavior configurable?

@tuxinal
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not a bad idea

@tuxinal
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also is there a specific reason for not awaiting it?

@Mr-VIT
Copy link
Contributor

@Mr-VIT Mr-VIT commented on 75a35d4 Nov 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no any reason for awaiting, deleting the message is a desirable action but not required
also if await it need use try/catch for no permission exception

Please sign in to comment.