Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on February 9, 2021 at 07:29 PM

New Paste 1 (Auto Detect)

import requests
import time
import telebot
import threading

remnote_token=""
remnote_userid=""
remnote_parent=""
telegram_token = ""




bot = telebot.TeleBot(telegram_token)

par={
"apiKey":remnote_token,
"userId":remnote_userid,
"text":"",
"positionAmongstSiblings":0,
"parentId":remnote_parent}

url="https://api.remnote.io/api/v0/create"

        
def handle_messages(messages):
    for message in messages:
        content_type=message.content_type
        username = message.from_user.username
        chat_id = message.chat.id
        user_id = message.from_user.id
        suser_id = str(user_id)
        if content_type=="text":
            msg = message.text
            print(f"({chat_id}) {username}: {msg}")
            par["text"]=msg
            requests.post(url,data=par)


def bot_polling():
    print("Bot started!")
    while True:
        bot.polling(none_stop=True)

        

bot.set_update_listener(handle_messages)

polling_thread = threading.Thread(target=bot_polling)
polling_thread.daemon = True
polling_thread.start()

while True:
  time.sleep(1)