diff --git a/DiscordBot/Messages/ExternalRoleSelectionMessage.cs b/DiscordBot/Messages/ExternalRoleSelectionMessage.cs index 7936fee..510e3ad 100644 --- a/DiscordBot/Messages/ExternalRoleSelectionMessage.cs +++ b/DiscordBot/Messages/ExternalRoleSelectionMessage.cs @@ -16,7 +16,17 @@ namespace DiscordBot.Messages foreach(ApiRole role in roles) { if(role.IsSignUpAllowed) - signUpSelect.AddOption(role.Name, role.roleId.ToString(), role.Description); + { + if(!string.IsNullOrEmpty(role.Description)) + { + string description = role.Description.Length <= 100 ? role.Description : role.Description.Substring(0, 100); + signUpSelect.AddOption(role.Name, role.roleId.ToString(), description); + } + else + { + signUpSelect.AddOption(role.Name, role.roleId.ToString(), role.Name); + } + } } var builder = new ComponentBuilder() diff --git a/Lieb/Data/RaidRandomizerService.cs b/Lieb/Data/RaidRandomizerService.cs index 153dadb..789612c 100644 --- a/Lieb/Data/RaidRandomizerService.cs +++ b/Lieb/Data/RaidRandomizerService.cs @@ -110,7 +110,7 @@ namespace Lieb.Data signUp.RaidRole = randomRole; } - int noGroups = (int)Math.Ceiling((double)(raid.SignUps.Where(s => s.SignUpType == SignUpType.SignedUp).Count() / 5)); + int noGroups = (int)Math.Ceiling(raid.SignUps.Where(s => s.SignUpType == SignUpType.SignedUp).Count() / 5.0); HashSet signedUpAccounts = raid.SignUps.Where(s => s.GuildWars2Account != null && s.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.UseInRandomRaid).Count() > 0 && s.SignUpType == SignUpType.SignedUp)