Exemple #1
0
        public async Task RSetup(params string[] _)
        {
            var x = "";

            x += $"Admin:        {(Context.Guild.CurrentUser.GuildPermissions.Administrator ? "✅" : "❌")}\n";
            x += $"Kick:         {(Context.Guild.CurrentUser.GuildPermissions.KickMembers ? "✅" : "❌")}\n";
            x += $"Ban:          {(Context.Guild.CurrentUser.GuildPermissions.BanMembers ? "✅" : "❌")}\n";
            x += $"Mention:      {(Context.Guild.CurrentUser.GuildPermissions.MentionEveryone ? "✅" : "❌")}\n";
            x += $"Manage Guild: {(Context.Guild.CurrentUser.GuildPermissions.ManageGuild ? "✅" : "❌")}\n";
            x += $"Messages:     {(Context.Guild.CurrentUser.GuildPermissions.ManageMessages ? "✅" : "❌")}\n";
            x += $"Channels:     {(Context.Guild.CurrentUser.GuildPermissions.ManageChannels ? "✅" : "❌")}\n";
            x += $"Roles:        {(Context.Guild.CurrentUser.GuildPermissions.ManageRoles ? "✅" : "❌")}\n";
            x += $"Webhooks:     {(Context.Guild.CurrentUser.GuildPermissions.ManageWebhooks ? "✅" : "❌")}\n";
            await ReplyAsync("", false, new EmbedBuilder
            {
                Title        = "Setting Up Hermes",
                ThumbnailUrl = Context.Client == null ? "" : Context.Client.CurrentUser.GetAvatarUrl(),
                Description  = await SqliteClass.PremiumOrNot(Context.Guild.Id)
                        ? "Whoa you're premium 🤩"
                        : "Hermes is a bot that requires various permissions to do various tasks.",
                Fields =
                {
                    new EmbedFieldBuilder
                    {
                        Name  = "Permissions",
                        Value = $"```{x}```"
                    }
                },
                Color = Context.Guild.CurrentUser.GuildPermissions.Administrator ? Color.Green :
                        x.Count(k => k == '✅') == 7 ? Color.Green : Color.Red,
                Footer = new EmbedFooterBuilder
                {
                    Text = "Command Inspired from LuminousBot (ID: 722435272532426783)"
                }
            }.WithCurrentTimestamp()
                             );
        }
Exemple #2
0
        public async Task EMDEL(params string[] args)
        {
            if (args.Length < 2)
            {
                await ReplyAsync("", false, new EmbedBuilder
                {
                    Title       = "What emoji to steal?",
                    Description =
                        $"Command Syntax: `{await SqliteClass.PrefixGetter(Context.Guild.Id)}emsteal server_id <emoji_id>, <emoji2_id>, <emoji3_id>...`",
                    Color = Color.Red
                }.WithCurrentTimestamp());

                return;
            }

            var fax = ulong.TryParse(args[0], out var gid);

            if (!fax)
            {
                var gg = Program.Client.GetGuild(gid);
                if (gg != null)
                {
                    await gg.DownloadUsersAsync();
                }
                if (gg?.GetUser(Context.User.Id) == null)
                {
                    await ReplyAsync("", false, new EmbedBuilder
                    {
                        Title       = "What server do I steal from?",
                        Description = "Enter the server ID, and ensure Hermes is in the server",
                        Color       = Color.Red
                    }.WithCurrentTimestamp());

                    return;
                }
            }

            var joined = string.Join(' ', args.Skip(1)).Replace(" ", "");
            var emojis = joined.Split(',');
            var ems    = await ReplyAsync("Starting the process of stealing emojis...");

            if (emojis.Length > 14 && !await SqliteClass.PremiumOrNot(Context.Guild.Id))
            {
                await ReplyAsync("", false, new EmbedBuilder
                {
                    Title       = "Too many emotes!",
                    Description =
                        "Because your server isn't [premium](https://rolex.gitbook.io/rolex/rolex-premium), you're limited to 15 emotes.",
                    Color = Color.Red
                }.WithCurrentTimestamp());

                return;
            }

            if (emojis.Length > 29)
            {
                await ReplyAsync("", false, new EmbedBuilder
                {
                    Title       = "Too many emotes!",
                    Description =
                        "Thank you for supporting Hermes by using Premium, but you're limited to 30 emotes (compared to 15 for non-Premium).\n Thanks again!",
                    Color = Color.Red
                }.WithCurrentTimestamp());

                return;
            }

            WebClient wc = new();

            foreach (var emoji in emojis)
            {
                var emote = await GetEmote(emoji, Program.Client.GetGuild(gid));

                if (emote == null)
                {
                    await ems.ModifyAsync(k => k.Content = ems.Content + $"\nSkipped {emoji}");

                    continue;
                }

                var dd = await wc.DownloadDataTaskAsync(emote.Url);

                var ms = new MemoryStream(dd);
                var ae = await Context.Guild.CreateEmoteAsync(emote.Name, new Image(ms));

                await ems.ModifyAsync(k => k.Content = ems.Content + $"\nSuccessfully added {ae}");

                // Never be in a hurry
                await Task.Delay(200);

                await ms.DisposeAsync();
            }

            await ems.ModifyAsync(k => k.Content = ems.Content + "\nFinished successfully!");
        }
Exemple #3
0
        public async Task GPe(ulong a, params string[] _)
        {
            if (devids.Any(x => x == Context.User.Id))
            {
                var guild = Program.Client.Guilds.First(al => al.Id == a);
                if (guild == null)
                {
                    await ReplyAsync("Why are you like this <:noob:756055614861344849>");

                    return;
                }

                if (await SqliteClass.PremiumOrNot(guild.Id))
                {
                    await ReplyAsync("Making a server premium 2 times gets u nothing so shut up and die");

                    return;
                }

                await SqliteClass.NonQueryFunctionCreator(
                    $"UPDATE prefixes SET Premium = 1 WHERE guildid = {Context.Guild.Id};");
                await ReplyAsync($"Made the server {guild.Name} premium, will DM owner with the good news!");

                var embed = new EmbedBuilder
                {
                    Title       = "This server is now Premium!",
                    Description =
                        "Thank you for supporting Hermes.\nWe are able to develop our bot due to supportive servers like yours!",
                    Color = Blurple
                }.WithCurrentTimestamp().Build();
                try
                {
                    await guild.Owner.SendMessageAsync(embed : embed);
                }
                catch
                {
                    // let it be, let it beeee
                }

                try
                {
                    var sc = guild.SystemChannel;
                    if (sc != null)
                    {
                        await sc.SendMessageAsync(embed : embed);
                    }
                    else
                    {
                        await guild.DefaultChannel.SendMessageAsync(embed : embed);
                    }
                }
                catch
                {
                    // let it be, let it beee
                }

                devids.ForEach(id =>
                               Program.Client.GetUser(id)
                               .SendMessageAsync($"The server {guild.Name} just went premium <a:vibing:782998739865305089>"));
            }
        }