diff options
author | RaindropsSys <contact@minteck.org> | 2023-07-15 15:27:53 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-07-15 15:27:53 +0200 |
commit | d9156eb4cfe53991a2e866e6281342417dd1c772 (patch) | |
tree | 0bd8439fd091bc1292a4b87c1765573f0ce5b70b | |
parent | 82c6423bd99ca042fa009c786cb3a959501cafd2 (diff) | |
download | signal.js-d9156eb4cfe53991a2e866e6281342417dd1c772.tar.gz signal.js-d9156eb4cfe53991a2e866e6281342417dd1c772.tar.bz2 signal.js-d9156eb4cfe53991a2e866e6281342417dd1c772.zip |
Updated 2 files (automated)
-rw-r--r-- | README.md | 84 | ||||
-rw-r--r-- | ROADMAP.md | 2 |
2 files changed, 72 insertions, 14 deletions
@@ -1,20 +1,78 @@ -# Signal.js, an easy-to-use Node.js library for Signal +# Signal.js -> **Warning:** Signal.js is currently a work in progress. Expect breaking changes, missing features, bugs, unexpected behavior and data loss. We do not recommend you use this library in a production environment for the time being. +Signal.js is a [Node.js](https://nodejs.org) library that allows you to easily interact with the [Signal Messenger](https://signal.org). -Signal.js makes it easy to create bots or other automated applications for Signal using Node.js, with a fully object-oriented, typed and aims to cover all of Signal's features in the future. +It is: +* object-oriented +* event-driven +* statically typed and compatible with TypeScript +* it aims to cover 100% of Signal's features (in a future version) ## Installation -* Download [signal-cli](https://github.com/AsamK/signal-cli) -* Install it either in a folder that's in your `$PATH` or in a place where it can be executed. -* Follow the instructions from the signal-cli documentation to connect to Signal - * If you want to link signal-cli to an installation of Signal on your phone (that means using the same phone number): https://github.com/AsamK/signal-cli/wiki/Linking-other-devices-(Provisioning) - * If you want to use signal-cli as a primary device (that means you won't be able to use this phone number with Signal on your phone): https://github.com/AsamK/signal-cli/wiki/Quickstart#set-up-an-account -* Run `npm install --save @equestria.dev/signal.js` -* You are now ready to work with Signal.js - -## Getting started -Soon™ +Node.js 16.9.0 or newer is required. + +If you want to install the latest stable version: +```plaintext +npm install --save @equestria.dev/signal.js +``` + +> **Notice:** The current (`0.x.x`) versions are work-in-progress and are not yet suitable for production use. They may have missing features, bugs, and breaking changes. If you want to use Signal.js in a production environment, we recommend you wait until version `1.x.x` is released. + +If you want to install the latest development version: +```plaintext +npm install --save @equestria.dev/signal.js@dev +``` + +> **Warning:** Development versions are unstable and may change at any time without warning. + +You will also need to install [signal-cli](https://github.com/AsamK/signal-cli) and register on Signal: +* If you want to link signal-cli to an installation of Signal on your phone (that means using the same phone number): https://github.com/AsamK/signal-cli/wiki/Linking-other-devices-(Provisioning) +* If you want to use signal-cli as a primary device (that means you won't be able to use this phone number with Signal on your phone): https://github.com/AsamK/signal-cli/wiki/Quickstart#set-up-an-account + +## Example usage +After Signal.js is installed, we can create a simple example bot with this code: + +{% tabs %} +{% tab title="JavaScript" %} +```javascript +const { Client } = require('@equestria.dev/signal.js'); + +const client = new Client({ + account: "your phone number here", + signalCli: "/path/to/signal-cli" +}); + +client.on('message', async (message) => { + if (message.content === "!ping") { + await message.reply("Pong!"); + } +}); +``` +{% endtab %} + +{% tab title="TypeScript" %} +```typescript +import { Client, GroupDataMessage, DMDataMessage } from '@equestria.dev/signal.js'; + +const client: Client = new Client({ + account: "your phone number here", + signalCli: "/path/to/signal-cli" +}); + +client.on('message', async (message: GroupDataMessage|DMDataMessage) => { + if (message.content === "!ping") { + await message.reply("Pong!"); + } +}); +``` +{% endtab %} +{% endtabs %} + +## Links +* [Website and documentation](https://signaljs.equestria.dev) +* [Source code (Gitea)](https://git.equestria.dev/equestria.dev/signal.js) +* [npm](https://npmjs.com/package/@equestria.dev/signal.js) +* [Report a bug](https://bugs.equestria.dev/issues/SGJS), or [email us](mailto:hello@equestria.dev) ## Develop responsibly Signal is run by a non-profit and moderating it is almost impossible due to the encrypted nature of the application. The Signal.js developers do not encourage using Signal.js for abusive purposes. @@ -31,7 +31,7 @@ * [x] <s>Adding to contacts</s> * [x] <s>Removing from contacts</s> * [x] <s>Change disappearing messages time</s> -* [ ] Groups +* [x] <s>Groups</s> * [x] <s>Creating</s> * [x] <s>Updating</s> * [x] <s>Leave</s> |