Example #1
0
    async def send_group_help(self, group) -> None:
        group_help_embed = RPANEmbed(
            title="RPANBot Subcommands Help · " + group.qualified_name,
            description="Something went wrong.",
            url=Settings().links.site_base + "/commands",
            user=self.context.author,
            bot=self.context.bot,
            message=self.context.message,
        )

        filtered = await self.filter_commands(group.commands, sort=True)
        if filtered:
            description = dedent(f"""
                {group.description}

                **Info**
                Type ``{self.clean_prefix}{group.name} (command)`` to use a command listed here.
                Use ``{self.clean_prefix}help {group.name} (command)`` to get more info on commands here.
                [Click here to view a more in-depth description of the commands.]({Settings().links.site_base}/commands)

                **Argument Key**
                [argument] | optional argument
                <argument> | required argument
            """.strip())

            listing = ""
            for cmd in filtered:
                cmd_line = "\n\n" + cmd.name

                if cmd.signature:
                    cmd_line += " " + cmd.signature

                if cmd.help:
                    cmd_line += ":\n  · " + cmd.help

                listing += cmd_line
            listing = self.wrap_listing(listing)

            description += f"\n\n**Commands:**\n{listing}"

            group_help_embed.description = description
        else:
            group_help_embed.description = f"There are currently no commands for {group.qualified_name}."

        await self.send_help_message(
            channel=self.get_destination(),
            text="",
            embed=group_help_embed,
        )
Example #2
0
    async def send_command_help(self, cmd) -> None:
        cmd_help_embed = RPANEmbed(
            title="RPANBot Command Help",
            description="Something went wrong.",
            url=Settings().links.site_base + "/commands",
            user=self.context.author,
            bot=self.context.bot,
            message=self.context.message,
        )

        cmd_description = f"**Usage:** ``{self.clean_prefix}{cmd.name} {cmd.signature}``"

        if cmd.aliases:
            aliases = ", ".join([f"``{alias}``" for alias in cmd.aliases])
            cmd_description += f"\n\n**Also usable as:**\n{aliases}"

        if cmd.help:
            cmd_description += f"\n\n**Description:**\n``{cmd.help}``"

        cmd_help_embed.description = cmd_description

        await self.send_help_message(
            channel=self.get_destination(),
            text="",
            embed=cmd_help_embed,
        )
Example #3
0
    async def report(self, ctx, *, type: str = None) -> None:
        """
        Get information on how to report policy breaking content.
        """
        if type is not None:
            type = type.lower()

        report_tables = {
            "promoting hate based on identity or vulnerability":
            "https://www.reddit.com/report?reason=its-promoting-hate-based-on-identity-or-vulnerability",
            "spam":
            "https://www.reddit.com/report?reason=this-is-spam",
            "misinformation":
            "https://www.reddit.com/report?reason=this-is-misinformation",
            "targeted harassment":
            "https://www.reddit.com/report?reason=its-targeted-harassment",
            "violence or physical harm":
            "https://www.reddit.com/report?reason=it-threatens-violence-or-physical-harm",
            "rude, vulgar, or offensive":
            "https://www.reddit.com/report?reason=its-rude-vulgar-or-offensive",
            "abusing the report button":
            "https://www.reddit.com/report?reason=its-abusing-the-report-button",
            "copyright infringements":
            "https://www.reddit.com/report?reason=it-infringes-my-copyright",
            "trademark infringement":
            "https://www.reddit.com/report?reason=it-infringes-my-trademark-rights",
            "personal information":
            "https://www.reddit.com/report?reason=its-personal-and-confidential-information",
            "sexualizing minors":
            "https://www.reddit.com/report?reason=its-sexual-or-suggestive-content-involving-minors",
            "involuntary pornography":
            "https://www.reddit.com/report?reason=its-involuntary-pornography",
            "ban evasion":
            "https://www.reddit.com/report?reason=its-ban-evasion",
            "vote manipulation":
            "https://www.reddit.com/report?reason=its-vote-manipulation",
            "prohibited goods or services":
            "https://www.reddit.com/report?reason=its-a-transaction-for-prohibited-goods-or-services",
            "impersonation":
            "https://www.reddit.com/report?reason=it-impersonates-me",
            "netzdg report":
            "https://www.reddit.com/report?reason=report-this-content-under-netzdg",
            "self-harm or suicide":
            "https://www.reddit.com/report?reason=someone-is-considering-suicide-or-serious-self-harm",
            "appeal a suspension":
            "https://www.reddit.com/appeals",
            "appeal a subreddit ban":
            "https://www.reddit.com/message/compose?to=/r/reddit.com&subject=Subreddit+Ban+Appeal",
            "dmca":
            "https://www.redditinc.com/policies/user-agreement#text-content8",
        }

        if type is not None and type not in report_tables.keys():
            aliases = {
                "rude": "rude, vulgar, or offensive",
                "vulgar": "rude, vulgar, or offensive",
                "offensive": "rude, vulgar, or offensive",
                "copyright infringement": "copyright infringements",
                "copyright": "copyright infringements",
                "trademark": "trademark infringement",
                "dox": "personal information",
                "harassment": "targeted harassment",
                "discrimination":
                "promoting hate based on identity or vulnerability",
                "racism": "promoting hate based on identity or vulnerability",
                "hate": "promoting hate based on identity or vulnerability",
                "self-harm": "self-harm or suicide",
                "netzdg": "netzdg report",
                "violence": "violence or physical harm",
                "harm": "violence or physical harm",
            }

            if type in aliases.keys():
                type = aliases[type]

        embed = RPANEmbed(
            title="Click here to go to the report page.",
            description=dedent("""
                If you need to report a user, comment, or post, please go to https://reddit.com/report (or click above) and report the content there.

                If you cannot find a category for the content you want to report, then [send a message to r/reddit.com](https://reddit.com/message/compose/?to=/r/reddit.com) with the content.
            """.strip()),
            url="https://reddit.com/report",
            user=ctx.author,
        )

        if type in report_tables.keys():
            embed.url = report_tables[type]
            embed.description = dedent("""
                Visit the following link (or click above) to report for '{type}':
                {link}
            """.strip()).format(type=type.capitalize(), link=embed.url)

        await ctx.send("", embed=embed)