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 8b84140..0000000 Binary files a/database.sqlite3 and /dev/null differ 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):