[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
/ pastebin-bot Public archive

[NOT MAINTAINED] Advanced functional Pastebin Telegram Bot made using better-pastebin and TelegrafJS. This bot will help you to create pastes (Texts) on Pastebin which is a text cloud.

License

Notifications You must be signed in to change notification settings

dcdunkan/pastebin-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I know that this code is not perfect. Even good. I am a total beginner, so please forgive the mistakes that have been made. I will be correcting them while i go forward. Please star this if you liked it.

$ pastebin-bot.js V2

Version 2 of Pastebin Bot

Advanced functional Pastebin Telegram Bot made using better-pastebin and TelegrafJS. This bot will help you to create pastes (Texts) on Pastebin [1] which is a text cloud. Here is a running example of the bot @pstbinbot on telegram.

Packages used : telegraf, firebase, better-pastebin, node-fetch, dotenv

contents

How to use? | Deploy | To-Do | Any Ideas?

ADDED features

  • Now send a text kind file to start pasting from that file.
  • Download the created paste as a file.
  • Help command, About command.
  • Firebase userid logging.
  • Paste logging inside telegram.

$ how to use? (BASIC)

  • Go to @pstbinbot
  • Send a Text you want to paste.
  • Send the Title for the paste when the bot asks.
  • Then when the bot asks for A method to paste, choose an option from them. Either login and paste, or paste as guest.
  • Customize the optional options if you want to. Such as Paste Expiry, Paste exposure (Public/Private/Unlisted), and the syntax.
  • Then the bot will ask you to confirm the paste if you are pasting as a guest. Or it will ask for username and password to login and paste. We won't be either storing or logging your both username and password. The bot will save them to it's session storage, and delete your messages after you send them. Also, the bot will set the values to undefined after pasting.
  • After pasting, you will get a link for the paste. Also you can generate embed links for the paste.

$ deploy

Simply deploy the application to heroku by clicking the button below. You will need a telegram bot token, a pastebin developer key, and your application's subdomain or the domain you are using. Read below to find how to get all the values.

Deploy

  • BOT_TOKEN : Get this value from BotFather on telegram by creating a new bot.
  • BOT_USERNAME : Your bot's username. This will be used to create deep linking which is used to embed code, download paste as file features. Enter without@
  • PASTE_DEVKEY : You can get this value from here after logging into pastebin.
  • BOT_DOMAIN : Set this value to <yourappname>.herokuapp.com. Or if you are using a custom domain, enter it without https:// or slash '/' at the end.
  • LOG_CHANNEL : To log user actions, provide a chat ID, or channel ID where the bot is an admin.
  • FIREBASE : Set to true if you want to log users in firebase' realtime database. You have to set the other required parameters to activate this features completely. Required Parameters for firebase feature.
    • FB_APIKEY : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_AUTHDOMAIN : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_DATABASEURL : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_PROJECTID : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_STORAGEBUCKET : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_MESSAGINGSENDERID : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_APPID : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.
    • FB_MEASUREMENTID : ONLY NEEDED IF FIREBASE IS SET TO TRUE. Get this value while creating a firebase app.

The firebase project parameters should look like

var firebaseConfig = {
  apiKey: "AIzaSyDOCAbC123dEf456GhI789jKl01-MnO",
  authDomain: "myapp-project-123.firebaseapp.com",
  databaseURL: "https://myapp-project-123.firebaseio.com",
  projectId: "myapp-project-123",
  storageBucket: "myapp-project-123.appspot.com",
  messagingSenderId: "65211879809",
  appId: "1:65211879909:web:3ae38ef1cdcb2e01fe5f0c",
  measurementId: "G-8GSGZQ44ST"
};

Get the required values from there.

$ to-do

  • Log in and paste mode.
  • Option to customize the optional values such as expiry, exposure, syntax.
  • Get the embed code.
  • Download the paste as a file.
  • Create a paste from file.
  • Characters more than 4096 (Telegram's limit).
  • More commands.
  • List a user's paste. And list command to list the pastes made with the bot.
  • Settings tab for setting default values to the optionals.
  • Getting a paste's content.

$ contribute

Please make an issue or pull a request if you got any ideas. Also, this project is completely open-source. You can fork it and edit as you want. Also, do not forget to give it a star.

[1]: Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Go back to top ^

About

[NOT MAINTAINED] Advanced functional Pastebin Telegram Bot made using better-pastebin and TelegrafJS. This bot will help you to create pastes (Texts) on Pastebin which is a text cloud.

Topics

Resources

License

Stars

Watchers

Forks