Code Monkey home page Code Monkey logo

node-wallhaven-bot's Introduction

What is this bot about?

A telegram bot to download wallpapers from Wallhaven based on NodeJS by Me and Barun.

wallhaven image

Limitations

This bot should not be spammed with commands as Wallhaven API allows only 45 requests per minute, if you hit this limit you will receive a 429 - Too many requests error.

Bot Commands

  • /random : Provides a random image from the wallhaven database
  • /search <keyword> : Provides a random image related to the keyword
  • /nsfw : Provides a random NSFW (not safe for work) image
  • /getwall <id> : Provides the specific wall requested by matching the id provided by user
  • /top <1d/3d/1w/1M/3M/6M/1y> : Provides 5 images from the toplist based on the topRange specified by user
  • /ping : Checks the response time of bot by requesting to telegram api

NOTE : Image previews are not shown in toplist command to prevent API spam

How to deploy?

Installing requirements

  • Clone this repo :
git clone https://github.com/Yash-Garg/node-wallhaven-bot
cd node-wallhaven-bot

Make sure NodeJS and npm is installed

  • Install required npm packages :
npm install

Setting up config file

  • Copy example config as config.js : cp example_config.js config.js

Fill up all the fields. Meaning of each fields are discussed below:

  • TOKEN : The telegram bot token that you get from @BotFather
  • API_WALLHAVEN : Your wallhaven API which you can get by making up an account on Wallhaven. API can be found under the Settings > Account tab
  • AUTH_USERS : Telegram ID of users whom u want to allow access to use this bot
  • AUTH_CHATS : Telegram ID of the chat where u want to allow access of bot by anyone in that particular chat

NOTE : AUTH_CHATS is optional, u can leave it blank or as it is.

Deploying

  • Start the bot by using this command : npm start

node-wallhaven-bot's People

Contributors

yash-garg avatar daemon1024 avatar fforius 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.