pyTelegramBotAPI icon indicating copy to clipboard operation
pyTelegramBotAPI copied to clipboard

How to retrieve all users who using a bot?

Open markolofsen opened this issue 8 years ago • 6 comments

How to retrieve all users who using a bot?

markolofsen avatar Nov 09 '18 14:11 markolofsen

The telegram API has no such methods. You can save users to the database.

art1415926535 avatar Jan 08 '19 10:01 art1415926535

So how we can save them to the database?

homfarnam avatar Mar 10 '19 21:03 homfarnam

So how we can save them to the database?

@bot.message_handler(commands=['start'])
def send_welcome(message):
    conn = psycopg2.connect(connection)
    cursor = conn.cursor()
    cursor.execute(insert_user_sql, (message.chat.id,))
    conn.commit()

    bot.reply_to(message, "Howdy, how are you doing?")

art1415926535 avatar Mar 11 '19 06:03 art1415926535

So how we can save them to the database?

@bot.message_handler(commands=['start'])
def send_welcome(message):
    conn = psycopg2.connect(connection)
    cursor = conn.cursor()
    cursor.execute(insert_user_sql, (message.chat.id,))
    conn.commit()

    bot.reply_to(message, "Howdy, how are you doing?")

Can I use Firebase for database storage? Is there are any other options?

ajhalili2006 avatar Sep 05 '19 09:09 ajhalili2006

So how we can save them to the database?

@bot.message_handler(commands=['start'])
def send_welcome(message):
    conn = psycopg2.connect(connection)
    cursor = conn.cursor()
    cursor.execute(insert_user_sql, (message.chat.id,))
    conn.commit()

    bot.reply_to(message, "Howdy, how are you doing?")

Can I use Firebase for database storage? Is there are any other options?

you can use any storage you want. even a txt file

olekshchavelev avatar Oct 04 '19 17:10 olekshchavelev

So, if this supports Firebase, how I can configure it?

Sent from my iPad

On Oct 5, 2019, at 1:52 AM, alexshavelev44 [email protected] wrote:

So how we can save them to the database?

@bot.message_handler(commands=['start']) def send_welcome(message): conn = psycopg2.connect(connection) cursor = conn.cursor() cursor.execute(insert_user_sql, (message.chat.id,)) conn.commit()

bot.reply_to(message, "Howdy, how are you doing?")

Can I use Firebase for database storage? Is there are any other options?

you can use any storage you want. even a txt file

― You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ajhalili2006 avatar Oct 05 '19 05:10 ajhalili2006