Ejemplo n.º 1
0
        /// <summary>
        /// Gives one reputation point to a user
        /// </summary>
        /// <param name="from">The user giving the reputation point</param>
        /// <param name="to">The user recieving the reputation point</param>
        /// <returns>True if the donor can give a rep point, false otherwise.</returns>
        public static async Task <bool> AddRep(SocketGuildUser from, SocketGuildUser to)
        {
            AddUserIfNotExists(from);
            AddUserIfNotExists(to);

            if (UserData[from.Id].ReputationToGive <= 0)
            {
                return(false);
            }

            GetUserData(from).ReputationToGive--;
            GetUserData(to).Reputation++;

            GetUserData(from).RepGiven++;

            await AchievementManager.OnRep(from, to);

            SaveUserData();

            return(true);
        }
Ejemplo n.º 2
0
 public static bool HasTitle(SocketGuildUser user, int title)
 {
     return(AchievementManager.HasTitleUnlocked(user, title));
 }