Adding default diceRecipe
This commit is contained in:
parent
01d504c077
commit
345304537a
@ -23,14 +23,19 @@ namespace ChaosBot.Discord.Modules.User
|
||||
{
|
||||
try
|
||||
{
|
||||
string diceRecipe = Strings.Join(args, " ");
|
||||
string diceRecipe = null;
|
||||
|
||||
if (args.Length > 1)
|
||||
diceRecipe = Strings.Join(args, " ");
|
||||
else
|
||||
diceRecipe = "1d20";
|
||||
|
||||
var sb = new StringBuilder();
|
||||
var embed = new EmbedBuilder();
|
||||
|
||||
RollResult rollResult = Roller.Roll(diceRecipe);
|
||||
|
||||
embed.WithColor(new Color(255, 255,0));
|
||||
embed.WithColor(new Color(255, 255, 0));
|
||||
// embed.Title = $"Dice Roll";
|
||||
sb.AppendLine($"{Context.User.Mention} :game_die:");
|
||||
sb.AppendLine($"Result: {diceRecipe} ({DiceOutput(rollResult)})");
|
||||
@ -48,9 +53,11 @@ namespace ChaosBot.Discord.Modules.User
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error($"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>.");
|
||||
_logger.Error(
|
||||
$"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>.");
|
||||
}
|
||||
}
|
||||
|
||||
private string DiceOutput(RollResult rollResult)
|
||||
{
|
||||
if (rollResult.RollRoot == null) return "";
|
||||
@ -104,7 +111,7 @@ namespace ChaosBot.Discord.Modules.User
|
||||
return "";
|
||||
}
|
||||
|
||||
private string DieFormatting(DieFlags flags, bool reverse=false)
|
||||
private string DieFormatting(DieFlags flags, bool reverse = false)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if ((flags & (DieFlags.Critical ^ DieFlags.Success ^ DieFlags.Failure ^ DieFlags.Fumble)) != 0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user