Code Monkey home page Code Monkey logo

fbot's Introduction

turdle

me irl

fbot's People

Contributors

codeize avatar judev1 avatar justscreamy avatar linesguy avatar tonyg433 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fbot's Issues

Improved error handler

Is your feature request related to a problem? Please describe.
Your error handler is just kinda bad. If a user is spamming a command, your error handler will spam too.
You're also not instancing the error, you're checking the types which is kinda weird and really unheard of.

Heres the code you should use, as well as the create embed part since embeds are nice and easier to ratelimit:

class Errorhandler(commands.Cog):

    def __init__(self, bot):
        self.bot = bot
        self.errorlogs = bot.get_channel(743392645228920882)
        self.message_cooldown = commands.CooldownMapping.from_cooldown(
            1.0, 3.0, commands.BucketType.user)

    async def create_embed(self, ctx, error):
        embed = discord.Embed(title=f"Error Caught!",
                              color=discord.Colour.red(), description=f"{error}")
        embed.set_thumbnail(
            url=self.bot.user.avatar_url_as(static_format="png"))
        bucket = self.message_cooldown.get_bucket(ctx.message)
        retry_after = bucket.update_rate_limit()
        if retry_after:
            return
        else:
            try:
                await ctx.send(embed=embed, delete_after=5)
                await ctx.message.add_reaction('\u274C')
            except:
                await ctx.send(f"`{error}`\n***Enable Embed permissions please.***", delete_after=5)
                await ctx.message.add_reaction('\u274C')
                return

   @commands.Cog.listener()
    async def on_command_error(self, ctx, error):
        error = getattr(error, "original", error)
        if hasattr(ctx.command, "on_error"):
            return
        else:
            pass

        if isinstance(error, errors.MissingRequiredArgument) or isinstance(error, errors.BadArgument):
            helper = str(ctx.invoked_subcommand) if ctx.invoked_subcommand else str(
                ctx.command)
            await ctx.send_help(helper)
            await self.create_embed(ctx, error)

        elif isinstance(error, errors.CommandInvokeError):
            error = default.traceback_maker(error.original)
            if "2000 or fewer" in str(error) and len(ctx.message.clean_content) > 1900:
                return await ctx.send(
                    "You attempted to make the command display more than 2,000 characters...\n"
                    "Both error and command will be ignored."
                )
            await ctx.send(f"There was an error processing the command\n{error}")
            

        elif isinstance(error, errors.BotMissingPermissions):
            await self.create_embed(ctx, error)

fn.server instead of Patreon in help cmd.

Describe the bug
In the help command the Support Us Link uses fn.server instead of a patreon link function

To Reproduce
Look at the code 4Head

Expected behaviour
Links to Patreon.

FBot respects doesn't send message after short period of time

Describe the bug
After using fbot respects ScreaMyho Doupě, it creates new message with reaction on it.
When I react with regional_indicator_f under short period of time, it sends message who payed respects.
After some time this feature will stop working

To Reproduce

  1. fbot respects test
  2. wait approximatly 1 - 2 minutes
  3. react and nothing will happen

Expected behaviour
react and bot responds with who reacted

Screenshots
image
No messages after reacting

Additional context
This can be fixed with using on_raw_message_add()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.