Coder Social home page Coder Social logo

dcdunkan / pastebin-bot Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 11.0 322 KB

[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.

Home Page: https://telegram.me/pstbinbot

License: MIT License

JavaScript 100.00%
telegram bot telegram-bot telegraf pastebin dcbots pastebin-bot pastebin-api

pastebin-bot's Introduction

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 ^

pastebin-bot's People

Contributors

dcdunkan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pastebin-bot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.