Exemplo n.º 1
0
 async def on_emocre_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.CommandOnCooldown):
         ctx.handled = True
         await self.bot.send_cooldown_error(ctx, error, 5, 1)
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "引数が不足しています!", "このコマンドを動かすには最低限引数として絵文字化したい文字列を入力してください")
Exemplo n.º 2
0
 async def on_report_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(ctx, "引数が不足しています!",
                                   "バグ内容など報告したい内容を引数に入力してください")
     if isinstance(error, commands.CommandOnCooldown):
         ctx.handled = True
         await self.bot.send_cooldown_error(ctx, error, 1, 3)
Exemplo n.º 3
0
 async def on_shellgei_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.CommandOnCooldown):
         ctx.handled = True
         await self.bot.send_cooldown_error(ctx, error, 20, 10)
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "引数が不足しています!", "このコマンドを動かすには引数として言語とソースコードを入力してください\n\n" +
             "例: `run python print('Hello')`")
Exemplo n.º 4
0
 async def on_translate_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.CommandOnCooldown):
         ctx.handled = True
         await self.bot.send_cooldown_error(ctx, error, 10, 2)
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "引数が不足しています!", "`translate JA Hello!`のように翻訳先の言語を第一引数にして" +
             "翻訳対象の文字列をそれに続いて入力してください\n\n" + "対応している言語は以下の通りです:\n" +
             ", ".join([f"`{l}`" for l in supported_langs]))
Exemplo n.º 5
0
 async def on_dice_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         return await self.bot.send_error(
             ctx, '引数が不足しています!',
             '`dice`コマンドは6面体サイコロを何回振るかを引数に与える必要があります'
         )
     if isinstance(error, commands.BadArgument):
         ctx.handled = True
         return await self.bot.send_error(
             ctx, '引数が不正です!',
             '`dice`コマンドの`num`引数は1以上10以下の整数である必要があります'
         )
Exemplo n.º 6
0
 async def on_vc_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, '引数が不足しています!',
             '投票を作成する場合は投票に関する説明を引数に取る必要があります'
         )
Exemplo n.º 7
0
 async def on_members_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "引数が不足しています!",
             "引数に対象となるロールを指定してください"
         )
Exemplo n.º 8
0
 async def on_delete_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "引数が不足しています!", "このコマンドを動かすには引数としてリマインダーのIDを入力してください\n\n" +
             "IDは`reminder list`コマンドで調べることができます.")
Exemplo n.º 9
0
 async def on_rec_error(self, ctx: commands.Context, error: Exception):
     if isinstance(error, commands.errors.CheckFailure):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "権限がありません", f"`{ctx.command.name}`を実行するにはメッセージ管理の権限が必要です")
Exemplo n.º 10
0
 async def on_va_error(self, ctx: commands.Context, error: Exception):
     if isinstance(error, commands.CommandOnCooldown):
         ctx.handled = True
         await self.bot.send_cooldown_error(ctx, error, 3, 1)
Exemplo n.º 11
0
 async def on_all_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.CommandOnCooldown):
         ctx.handled = True
         await self.bot.send_cooldown_error(
             ctx, error, 1, 10
         )
Exemplo n.º 12
0
 async def on_user_error(self, ctx: commands.Context, error: Exception):
     if isinstance(error, commands.BadArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "ユーザーが見つかりませんでした!",
             f"`{ctx.message.content.split()[1]}`というユーザーは見つかりませんでした...")
Exemplo n.º 13
0
 async def on_remove_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(
             ctx, "引数が足りません!",
             "絵文字を削除するReaction Role PanelのIDと,対象の絵文字を" + "引数として与えてください")
Exemplo n.º 14
0
 async def on_delete_error(self, ctx: commands.Context, error):
     if isinstance(error, commands.MissingRequiredArgument):
         ctx.handled = True
         await self.bot.send_error(ctx, "引数が足りません!",
                                   "削除するメッセージのIDを指定してください")