Q
Q
qwwwwwty2021-11-05 19:55:24
Python
qwwwwwty, 2021-11-05 19:55:24

How to connect to a database (SQlite3) to use it to send messages to Aiogram, Python groups?

How to connect to a database (SQlite3) to use it to send messages to Aiogram, Python groups?
In my database, suppose there are 3 group IDs:
1) 100200300
2) 300200100
3) 109876543

you need to read these IDs in order to send messages via these IDs (conversations), for example, "hello world". I already have a code that connects to my table, but I don't know how to send messages to these ids. Help! here is the code:

@dp.message_handler(is_admin=True, commands=["рассылка2"],commands_prefix="!/")
async def rasilka (message: types.Message):
    connect = sqlite3.connect('chatIDnames.dp')
    cursor = connect.cursor()
    select_all_rows = "SELECT * FROM 'chatsID'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question