Ejemplo n.º 1
0
        private Task MemberUpdated(SocketGuildUser x, SocketGuildUser y)
        {
            if (y.IsBot)
            {
                return(Task.CompletedTask);
            }

            string newTeam = "-";

            if (y.Guild.Id != UNO_SERVER_ID)
            {
                return(Task.CompletedTask);
            }
            else
            {
                newTeam = UnoTeamChange(x, y);
            }
            bool newAccount = SaveFiles_Mapped.CreateUserSaveFolder(y);

            if (!newAccount && newTeam != "")
            {
                string saveFileDirectory = Defs.USER_SAVE_DIRECTORY + "\\" +
                                           y.Id.ToString() + "\\" + Defs.DEFAULT_SAVE_FILE_NAME;
                SaveFiles_Mapped.ModifyFieldValue("UNOTeam", saveFileDirectory, newTeam);
            }
            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        public async Task Setcolor([Remainder] string args = "")
        {
            Uno_Score_Tracking.GuildCache.IncrementCMD();
            if (args == null)
            {
                await ReplyAsync("Please specify the color in hexadecimal."); return;
            }
            if (args.Trim().ToLower() == "default")
            {
                string patho = USER_SAVE_DIRECTORY + "\\" + Context.User.Id + "\\" + UNO_SAVE_FILE_NAME;
                try {
                    SaveFiles_Mapped.ModifyFieldValue("LIT-CUSTOMCOLOR", patho, "-");
                    await ReplyAsync("Success! Your new profile color is your team's color! Check it out with `p*profile`.");
                } catch (Exception e) {
                    await ReplyAsync(e.Message);
                }
            }
            args = args.Replace("0x", "");
            args = args.Replace("#", "");
            args = args.Trim();
            if (!Int32.TryParse(args, System.Globalization.NumberStyles.HexNumber, null, out int ignore))
            {
                await ReplyAsync("Please specify a hex value between 0x000000 and 0xFFFFFF."); return;
            }
            int hexValue = Int32.Parse(args, System.Globalization.NumberStyles.HexNumber);

            if (hexValue > 0xFFFFFF)
            {
                await ReplyAsync("Please specify a hex value between 0x000000 and 0xFFFFFF."); return;
            }
            string path = USER_SAVE_DIRECTORY + "\\" + Context.User.Id + "\\" + UNO_SAVE_FILE_NAME;

            try {
                SaveFiles_Mapped.ModifyFieldValue("LIT-CUSTOMCOLOR", path, hexValue.ToString("X6"));
                await ReplyAsync("Success! Your new profile color is " + args + "! Check it out with `p*profile`.");
            }catch (Exception e) {
                await ReplyAsync(e.Message);
            }
            return;
        }