Created
August 24, 2019 13:20
-
-
Save Birdi7/61190b0543fa9e4d590cc811ea35a800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aiogram import Bot, Dispatcher, executor | |
import logging | |
from aiogram.contrib.fsm_storage.memory import MemoryStorage | |
logging.basicConfig(level=logging.INFO) | |
token = 'BOT_TOKEN_HERE' | |
bot = Bot(token) | |
dp = Dispatcher(bot, storage=MemoryStorage()) | |
@dp.message_handler(lambda m: True) | |
async def ha(msg): | |
is_throttled = await dp.throttle(key='ha', no_error=True, user=123) | |
if is_throttled: | |
pass | |
else: | |
pass | |
if __name__ == '__main__': | |
executor.start_polling(dp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment