0

My code worked and send messages to all users, but when i send message with font or in text links, aiogram fsm machine don't seen that. What i need to do?

import logging

from aiogram import Bot, Dispatcher, executor, types

from aiogram.contrib.fsm_storage.memory import MemoryStorage

from aiogram.dispatcher import FSMContext

from aiogram.dispatcher.filters.state import State, StatesGroup

from aiogram.dispatcher.filters import Text

bot = Bot(token)

storage = MemoryStorage()

dp = Dispatcher(bot, storage=storage)

logging.basicConfig(level=logging.INFO)

class FsmClass(StatesGroup):

    message = State() 

    

@dp.message_handler(commands='sendall')

async def send_all(message: types.Message):

    await FsmClass.message.set()

    await message.reply("Write message now to started")

    
@dp.message_handler(state=FsmClass.message)

async def process_city(message: types.Message, state: FSMContext):

    mes = message.text

    for i in user_list: #user_list pasted in database

        await bot.send_message(i, mes)

    await state.finish()

    

if __name__ == "__main__":

    executor.start_polling(dp, skip_updates=True)

I always tryed to make this function with use command with get_arg, but it work same

RaY
  • 1
  • 1

0 Answers0