コード例 #1
0
 public override bool PreconditionCheck(IDMCommandContext context, out string message)
 {
     if (MinecraftGuildModel.TryGetGuildOfUser(context.User.Id, out MinecraftGuild userGuild, true))
     {
         if (userGuild.Active)
         {
             if (userGuild.GetMemberRank(context.User.Id) >= RequiredRank)
             {
                 message = null;
                 return(true);
             }
             else
             {
                 message = $"You do not have the required rank of `{RequiredRank}` in {userGuild.Name}";
                 return(false);
             }
         }
         else
         {
             message = $"Your guild {userGuild.Name} is inactive!";
             return(false);
         }
     }
コード例 #2
0
 public Task ExecuteAsync()
 {
     Guild.MemberIds.Add(UserId);
     return(MinecraftGuildModel.SaveAll());
 }
コード例 #3
0
 public Task ExecuteAsync()
 {
     return(MinecraftGuildModel.DeleteGuildDatasetAsync(Guild));
 }