https://github.com/yash-garg/node-wallhaven-bot
A telegram bot to download wallpapers from Wallhaven based on NodeJS
https://github.com/yash-garg/node-wallhaven-bot
bot javascript node-telegram-bot-api nodejs npm telegram wallhaven
Last synced: 8 months ago
JSON representation
A telegram bot to download wallpapers from Wallhaven based on NodeJS
- Host: GitHub
- URL: https://github.com/yash-garg/node-wallhaven-bot
- Owner: Yash-Garg
- License: gpl-3.0
- Created: 2020-04-24T17:50:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-23T16:57:19.000Z (about 3 years ago)
- Last Synced: 2025-04-08T01:42:43.738Z (12 months ago)
- Topics: bot, javascript, node-telegram-bot-api, nodejs, npm, telegram, wallhaven
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 8
- Watchers: 1
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What is this bot about?
A telegram bot to download wallpapers from Wallhaven based on NodeJS by [Me](https://github.com/Yash-Garg) and [Barun](https://github.com/daemon1024).

## Limitations
This bot should not be spammed with commands as [Wallhaven API](https://wallhaven.cc/help/api#limits) 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 ` : Provides a random image related to the keyword
* `/nsfw` : Provides a random NSFW (not safe for work) image
* `/getwall ` : 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
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 :
```node
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](https://t.me/botfather)
* **API_WALLHAVEN** : Your wallhaven API which you can get by making up an account on [Wallhaven](https://wallhaven.cc). 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`