Example #1
0
        private void UpdateDotaSub(bool onOff, SocketUser user)
        {
            var rotnBotUser = _rotnBotUserService.GetUser(user);

            rotnBotUser.DotaNotificationsOn = onOff;
            _rotnBotUserService.AddOrUpdateUser(rotnBotUser);
        }
Example #2
0
        public async Task OpenChestAsync()
        {
            RotnBotUser user = _rotnBotUserService.GetUser(Context.Message.Author);

            if (user.LastChestOpened.Date == DateTime.Now.Date)
            {
                await ReplyAsync($"{Context.Message.Author} you have already opened your free points chest today.");

                return;
            }


            Random rnd       = new Random();
            int    newPoints = PoinstChests[rnd.Next(0, PoinstChests.Length)];

            user.LastChestOpened = DateTime.Now;
            user.Points         += newPoints;
            _rotnBotUserService.AddOrUpdateUser(user);

            await ReplyAsync($"{Context.Message.Author}, you have recieved {newPoints} {(newPoints > 1 ? "points" : "point")}\nYou now have {user.Points} {(user.Points > 1 ? "points" : "point")}");
        }
Example #3
0
        public async Task SetMySteamId([Summary("The user's steam Id")] string steamId)
        {
            if (steamId.Length > 10)
            {
                long steamId64;
                if (long.TryParse(steamId, out steamId64))
                {
                    steamId = Convert64BitSteamID(steamId64);
                }
            }

            RotnBotUser rotnBotUser = _rotnBotUserService.GetUser(Context.Message.Author);

            rotnBotUser.SteamUserId = steamId;
            _rotnBotUserService.AddOrUpdateUser(rotnBotUser);

            await ReplyAsync("Steam ID set. For " + Context.Message.Author.ToString());
        }