Socket
Socket
Sign inDemoInstall

remotepn

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remotepn

Looking for a way to prompt users for a string or OTP while running a server bash script or scheduled server code? Look no further than Remote Prompt Notification! This npm package sends a Telegram notification where users can respond, and the answer will


Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Install size
21.7 kB
Created
Weekly downloads
 

Readme

Source

Remote Prompt Notification

Looking for a way to prompt users for a string or OTP while running a server bash script or scheduled server code? Look no further than Remote Prompt Notification! This npm package sends a Telegram notification where users can respond, and the answer will be received by your script. Plus, it supports thumbs-up 👍 and thumbs-down 👎 emojis to output a "Y" or "N" string for easy interaction.

  • Lightweight (less than 10kb)
  • Zero external depedencies
  • Uses Telegram APIs with native node fetch

How to use it

  1. Create a BOT on Telegram with Bothfather and take note of the bot TOKEN
  2. Start a chat with your bot on Telegram (Important in order to allow the BOT to send messages to you)
  3. Retrieve your Telegram User ID in telegram by starting a chat with @userinfobot you will receive your user id number (eg. 101111333)

Bash / Shell

Command:

npx remotepn --telegramToken=6953209111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --telegramUser=101111333 --message="How are you?"

Output: Message answer string or "Y"/"N" in case of thumbs-up or thumbs-down reaction.

Javascript / Typescript

npm i remotepn
import RemotePN from "remotepn";
const client = new RemotePN({
  telegramToken: "6953209111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  telegramUser: 101111333,
});
const answer = await client.prompt("Hello World");
console.log(answer); // Message answer string or "Y"/"N" in case of thumbs-up or thumbs-down reaction.

Answering the prompt

You must reply directly to the message, rather than simply sending a message to the bot. Alternatively, you can use the thumbs-up or thumbs-down reaction.

FAQs

Last updated on 09 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc