added needed rights for slash commands

added functions for account select in the bot
This commit is contained in:
Sarah Faey 2022-11-29 00:04:22 +01:00
parent 62bacb5ad7
commit dc2563e16c
11 changed files with 876 additions and 13 deletions

View file

@ -118,14 +118,7 @@
{
if (_user != null)
{
if (_raid.RaidType == RaidType.Planned)
{
_usableAccounts = _user.GuildWars2Accounts.ToList();
}
else
{
_usableAccounts = _user.GuildWars2Accounts.Where(a => a.EquippedBuilds.Count > 0).ToList();
}
_usableAccounts = UserService.GetAllUsableAccounts(_user.Id, _raid.RaidType);
_liebUserId = _user.Id;
}
_expandableRoles = new List<ExpandableRole>();
@ -147,6 +140,10 @@
else
{
int gw2AccountId = UserService.GetMainAccount(_liebUserId).GuildWars2AccountId;
if(!_usableAccounts.Where(a => a.GuildWars2AccountId == gw2AccountId).Any())
{
gw2AccountId = _usableAccounts.FirstOrDefault().GuildWars2AccountId;
}
await RaidService.SignUp(_raid.RaidId, _liebUserId, gw2AccountId, role.RaidRoleId, signUpType);
}
_Parent.HasChanged();