Skip to content

Instantly share code, notes, and snippets.

@AlgorithmAlchemy
Last active June 29, 2023 10:45
Show Gist options
  • Save AlgorithmAlchemy/88d57ad6869141dda317701753ddc7af to your computer and use it in GitHub Desktop.
Save AlgorithmAlchemy/88d57ad6869141dda317701753ddc7af to your computer and use it in GitHub Desktop.
Aiogram 2.x chat member left | chat_member_on | ChatMemberUpdated
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import AllowedUpdates
import config
bot = Bot(token=config.API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'], chat_type='private')
async def start_cmd_message(message: types.Message):
print(666)
@dp.chat_member_handler()
async def chat_member(member: types.ChatMemberUpdated):
print(member)
if __name__ == '__main__':
executor.start_polling(dp, allowed_updates=AllowedUpdates.all())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment