for user in users.updates[0].peers:
if hasattr(user, 'peer') and hasattr(user.peer, 'user_id'):
if user.peer.distance != 1000: pass
else:
async with TelegramClient(f'+254772755154.session', API_ID, API_HASH) as client:
await client.connect()
full_user = await client.get_entity(user.peer.user_id)
await bot.send_message(message.chat.id,
f"User ID: {full_user.id}, First Name: {full_user.first_name}, username @{full_user.username}, phone {full_user.phone}")
import sqlite3
con = sqlite3.connect("//connect")
cur = con.cursor()
row = cur.execute("SELECT balance FROM users WHERE user_id ='message.from_user.id'")
if row > str(50):
bot.send_message(message.chat.id, text='True')
elif row < str(50):
bot.send_message(message.chat.id, text='False')
import pysftp
with pysftp.Connection('hostname', username='me', password='secret') as sftp:
with sftp.cd('public'): # temporarily chdir to public
sftp.put('/my/local/filename') # upload file to public/ on remote
sftp.get('remote_file') # get a remote file