예제 #1
0
        internal async Task <(string, Embed)> SendSuggestion(string content, IUser author)
        {
            sendSuggestions = sendSuggestions ?? (ISocketMessageChannel)LoadSuggestionSettings();
            if (sendSuggestions == null)
            {
                throw NeitsilliaError.ReplyError("Bot suggestions are currently deactivated.");
            }

            EmbedBuilder embed = DUtils.BuildEmbed(null,
                                                   content, author.Id.ToString(), new Color(Program.rng.Next(256),
                                                                                            Program.rng.Next(256), Program.rng.Next(256)),
                                                   DUtils.NewField("Status", "Pending"));

            embed.WithAuthor(author);

            Embed e = embed.Build();

            var reply = await sendSuggestions.SendMessageAsync(embed : e);

            await reply.ModifyAsync(x =>
            {
                x.Content = $"Use `suggest` in my DMs or in the support server to make a suggestion to the support server."
                            + Environment.NewLine + $"Id: `{reply.Id}`";
            });

            await reply.AddReactionsAsync(new[] { EUI.ToEmote(EUI.ok),
                                                  EUI.ToEmote(EUI.cancel) });

            return(reply.GetJumpUrl(), e);
        }
예제 #2
0
        internal async Task <(string, Embed)> SendSuggestion(string content, IUser author, IGuild guild)
        {
            EmbedBuilder embed = DUtils.BuildEmbed(null,
                                                   content, author.Id.ToString(), new Color(Program.rng.Next(256),
                                                                                            Program.rng.Next(256), Program.rng.Next(256)),
                                                   DUtils.NewField("Status", "Pending"));

            embed.WithAuthor(author);
            ITextChannel sendSuggestions = (ITextChannel)await guild.GetChannelAsync(suggestionChannel.id);

            Embed e     = embed.Build();
            var   reply = await sendSuggestions.SendMessageAsync(guildID == 637709809671471118? "<@&717444744812167239>" : null, embed : e);

            await reply.AddReactionsAsync(new[] { EUI.ToEmote(EUI.ok),
                                                  EUI.ToEmote(EUI.cancel) });

            System.Threading.Thread.Sleep(500);

            await reply.ModifyAsync(x =>
            {
                x.Content = $"Use `{prefix}suggest` in any channel to make a suggestion to this server, " +
                            $"or in my DMs to make a suggestion to my support server."
                            + Environment.NewLine + $"Id: `{reply.Id}`";
            });

            return(reply.GetJumpUrl(), e);
        }
예제 #3
0
        //Bug Report

        internal async Task <(string, Embed)> SendBugReport(string content, IUser author)
        {
            if (BugReportChannel == null)
            {
                throw NeitsilliaError.ReplyError("Bot bug report are currently deactivated.");
            }

            EmbedBuilder embed = DUtils.BuildEmbed(null,
                                                   content, author.Id.ToString(), new Color(Program.rng.Next(256),
                                                                                            Program.rng.Next(256), Program.rng.Next(256)),
                                                   DUtils.NewField("Status", "Pending"));

            embed.WithAuthor(author);

            Embed e = embed.Build();

            var reply = await BugReportChannel.SendMessageAsync(embed : e);

            await reply.ModifyAsync(x =>
            {
                x.Content = $"Use `BugReport` to report the a bug to the support server."
                            + Environment.NewLine + $"Id: `{reply.Id}`";
            });

            await reply.AddReactionsAsync(new[] { EUI.ToEmote(EUI.ok), EUI.ToEmote(EUI.cancel) });

            return(reply.GetJumpUrl(), e);
        }