skip to Main Content

python aiogram how to stop an asynchronous loop – Telegram API

Simple example import asyncio import logging from aiogram import Bot, Dispatcher, types logging.basicConfig(level=logging.INFO) token = 'token' bot = Bot(token=token) dp = Dispatcher(bot=bot) @dp.callback_query_handler(text='stoploop') async def stop_loop(query: types.CallbackQuery): # TODO how to stop test loop? await query.message.edit_text('stop') @dp.callback_query_handler(text='test') async def start_loop(query:…

VIEW QUESTION

Django AJAX call url not found – Jquery ajax

I want to pass data from an AJAX call to my django view. My html: <a href="javascript:" class="word_known btn btn-warning btn-sm" data-songpk="{{song_pk}}" data-userpk="{{user_pk}}">Yes</a> My jquery: $(document).ready(function() { var known_words = 0; $(".word_known").click(function() { known_words++; var reference = this; var songpk…

VIEW QUESTION
Back To Top
Search