код:
@bot.channel_post_handler(content_types=['video', 'photo', 'audio', 'document'])
def post_change(message):
# try:
con = sql.connect('user.db')
cur = con.cursor()
t = cur.execute("SELECT post_text FROM user WHERE user_id = (?)", (message.from_user.id,))
ch = cur.execute("SELECT channel_id FROM user WHERE user_id = (?)", (message.from_user.id,))
post_text = t.fetchone()
channel = ch.fetchone()
con.commit()
con.close()