Skip to content

yykcool/botjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

botjs

handy, lazily written, super basic feature pack for mongodb logging and api key management for scripts running in the background

setup

  • clone into server that has access to your mongodb database
  • get telegram api key, set api key as BOT_KEY env variable
    • optionally, either set OWNER_CHAT_ID or remove last line of index.js to disable startup notifs
  • set up webhook and point to server
  • npm i
  • ???
  • profit

for current list of bot functionalities exposed on telegram, check bot/webhook/index.js to see how it works

webhook

bot is configured to operate on telegram's webhook feature
curretly used endpoint is wwww.website.com/bot/<BOT_KEY>

Server Specific Features

these features are for scripts running in the same instance to execute via localhost requests
all requests to this bot should begin with 127.0.0.1/

/keys/invalidate

invalidates api key and informs owner in telegram
useful when an api call fails due to key expiry parameters:

  • name

example: `curl -d "name=yincredulous" 127.0.0.1/keys/invalidate`

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published