From 3d574ae8882ff087a8e9e55f94deb74194b54802 Mon Sep 17 00:00:00 2001 From: tema Date: Sat, 19 Mar 2022 00:21:10 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=20=D0=B3=D0=BE?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=D0=BA=D0=BE=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- database.sqlite3 | Bin 8192 -> 0 bytes handlers/private/register.py | 10 +++------- utils/timer.py | 1 + 4 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 database.sqlite3 diff --git a/.gitignore b/.gitignore index 4bd2a4d..8ae1423 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ venv/ !requirements.txt *.ini !example_config.ini -test.py \ No newline at end of file +test.py +*.sqlite3 \ No newline at end of file diff --git a/database.sqlite3 b/database.sqlite3 deleted file mode 100644 index 8b84140fb3636039b84e4fe306a8bcae21a088a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeI$O-lkn7y#fI5rU$&n@9-bmY@)_sFikVv&E#%YWx7{AY+ZT>=*2=NZ07nu|t2L zYnOgN&>^~Yuz%EOUzkAQ& z68*hl@e+O?i05$pQ;VVWp)xC?@Z19u7c>w60T2KI5C8!X009sH0T2KI5csXY**czz zL?ZaS8nCv-dp`I4(JfS@np)FHP2JQrB9G=|l9Y{OnUpIvt)x*>*{hLCUDwGzE$^zd zNp`g6@@s7CyEw7dF+4wLIn3rVX{fZgt9iP&6LJcx~zCesKMKIk+3#c6z3N>Ms_G zijr?AI^A)7+x4gC3RuK1phP@@F|YS7w#2!|u134e>9&qNE>0@E#b%>fD&#YYQng)^ MlTB_}yg$=^0gC8{F#rGn diff --git a/handlers/private/register.py b/handlers/private/register.py index d494bee..5e67301 100644 --- a/handlers/private/register.py +++ b/handlers/private/register.py @@ -51,13 +51,9 @@ async def token_set(message: types.Message, state: FSMContext): data = coc_api.verify_token(**info) #{'tag': '#TAG', 'token': 'TOKEN', 'status': 'ok'} - members = coc_api.clan_members() - - clan_member = False - for i in members['items']: - if data['tag'] in i['tag']: - clan_member = True - break + member = coc_api.get_player(data['tag']) + clan_member = member['clan']['tag'] == config['API']['clan_tag'] + if clan_member == False: await bot.send_message( diff --git a/utils/timer.py b/utils/timer.py index 30de344..ef8befd 100644 --- a/utils/timer.py +++ b/utils/timer.py @@ -23,6 +23,7 @@ class KickTimer: self._task = asyncio.ensure_future(self._job()) def execute_now(self): + self._task.cancel() self._task = asyncio.ensure_future(self._run_now()) def cancel(self):