|
25 | 25 | if debug_mode == True: logging.basicConfig(level=logging.DEBUG) |
26 | 26 |
|
27 | 27 | #### Infos |
28 | | -version = "5.11" |
| 28 | +version = "5.12" |
29 | 29 | author = "Wonderfall" |
30 | 30 | name = "A.T.O.S." |
31 | 31 |
|
| 32 | +### Cogs |
| 33 | +initial_extensions = ['cogs.dev_commands'] |
| 34 | + |
| 35 | + |
32 | 36 | ### Init things |
33 | 37 | bot = commands.Bot(command_prefix=commands.when_mentioned_or(bot_prefix)) # Set prefix for commands |
34 | 38 | bot.remove_command('help') # Remove default help command to set our own |
@@ -1638,18 +1642,25 @@ async def send_desync_help(ctx): |
1638 | 1642 | ### On command error : invoker has not enough permissions |
1639 | 1643 | @bot.event |
1640 | 1644 | async def on_command_error(ctx, error): |
1641 | | - if isinstance(error, (commands.CheckFailure, commands.MissingRole)): |
| 1645 | + if isinstance(error, (commands.CheckFailure, commands.MissingRole, commands.NotOwner)): |
1642 | 1646 | await ctx.message.add_reaction("🚫") |
1643 | 1647 | elif isinstance(error, (commands.MissingRequiredArgument, commands.ArgumentParsingError, commands.BadArgument)): |
1644 | 1648 | await ctx.message.add_reaction("💿") |
1645 | 1649 | elif isinstance(error, commands.CommandOnCooldown): |
1646 | 1650 | await ctx.message.add_reaction("❄️") |
1647 | 1651 | elif isinstance(error, commands.CommandNotFound): |
1648 | 1652 | await ctx.message.add_reaction("❔") |
| 1653 | + elif isinstance(error, commands.CommandInvokeError): |
| 1654 | + await ctx.message.add_reaction("⚠️") |
1649 | 1655 |
|
1650 | 1656 |
|
1651 | 1657 | #### Scheduler |
1652 | 1658 | scheduler.start() |
1653 | 1659 |
|
| 1660 | +### Add base cogs |
| 1661 | +if __name__ == '__main__': |
| 1662 | + for extension in initial_extensions: |
| 1663 | + bot.load_extension(extension) |
| 1664 | + |
1654 | 1665 | #### Lancement du bot |
1655 | 1666 | bot.run(bot_secret, bot = True, reconnect = True) |
0 commit comments