From 65e077b397df513d96b62cb2929c04df0e47fe73 Mon Sep 17 00:00:00 2001 From: Antares Date: Fri, 3 Apr 2020 23:58:10 +0800 Subject: [PATCH] set timeout --- plugins_new/couplet/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins_new/couplet/plugin.py b/plugins_new/couplet/plugin.py index 4ff04f9..1fb4e06 100644 --- a/plugins_new/couplet/plugin.py +++ b/plugins_new/couplet/plugin.py @@ -22,7 +22,7 @@ class CoupletPlugin(Plugin): await self.bot.client_async.send(context, f"Error: {ex}") def on_enable(self): - self.aioclient = aiohttp.ClientSession() + self.aioclient = aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=30)) self.bot: CountdownBot self.register_command_wrapped( command_name="couplet", @@ -33,6 +33,7 @@ class CoupletPlugin(Plugin): is_async=True ) + def get_plugin_class(): return CoupletPlugin @@ -40,4 +41,4 @@ def get_plugin_class(): def get_plugin_meta(): return PluginMeta( "Antares", 1.0, "对联机" - ) \ No newline at end of file + ) -- Gitee