Giter Site home page Giter Site logo

picsearchbot's Introduction

PicSearchBot

Telegram bot for inline photo searching :)

How to use

First of all, you need start chating with your bot. Type or click 'Start' button and then you can search pictures in inline mode typing yourBotUserName + ' ' + yourQuery

Installation

First things first...

You will need to generate a Telegram bot API key and that it's easy, just follow this step-by-step.

Now the environment part...

Install npm and Node.js on your machine, open a terminal then navigate to the folder where you want your project to be then run this command:

git clone https://github.com/JRakhimov/picSearchBot.git

You should see something like this:

Cloning into 'picSearchBot'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.

Installing

Just run the following command at your root project folder:

npm install

Now it is a good time to create your environment variables file to save the API keys that was granted to you by BotFather. To create the file just run still at the root project folder:

touch .env

Once the file is created, just open it and past the following environment variables with their respective values that you own, just remember that those keys are related to you and must not be shared with anyone else, remember to always have this file in your .gitignore so that way you do not push it accidentally. Your .env file must be something like this:

BOT_TOKEN = "123456789:ABC_****"; // Your telegram bot token
PORT = 1234; // Port for your webhook server. P.s. Telegram supports only ports: 443, 80, 88, 8443, 3000
URL = "https://your.domain"; // Pay attention that your server must have SSL certificate and provide https connection!
BOT_NAME = "userNameOfBot"; // Without "@"
CUSTOM_SEARCH_KEY = "yourKeyProvidedByGoogle" // https://goo.gl/WNVsqi - Good insturction in Russian
CX = "yourCXKey" // http://www.google.com/cse/manage/all - Here you can find your CX ID

Running

After all of this setting up, just run your bot with:

npm run start

All of your bot's requests will be logged in your terminal.

picsearchbot's People

Contributors

jrakhimov avatar

Watchers

James Cloos avatar

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.