BangleApps/apps/reply
Brian Whelan a70030c32e
Update metadata.json to support Bangle JS 1
2024-11-04 09:44:11 +00:00
..
ChangeLog Support Gadgetbridge canned responses 2024-09-03 22:57:35 +01:00
README.md Add new module "reply" for canned responses 2024-06-21 18:44:44 +01:00
app.png Add new module "reply" for canned responses 2024-06-21 18:44:44 +01:00
interface.html PR fixes 2024-06-27 08:23:36 +01:00
lib.js Tweak slightly confusing coee that tries to set Object property name to an array 2024-09-25 09:23:03 +01:00
metadata.json Update metadata.json to support Bangle JS 1 2024-11-04 09:44:11 +00:00

README.md

Canned Replies Library

A library that handles replying to messages received from Gadgetbridge/Messages apps.

Replying to a message

The user can define a set of canned responses via the customise page after installing the app, or alternatively if they have a keyboard installed, they can type a response back. The requesting app will receive either an object containing the full reply for GadgetBridge, or a string with the response from the user, depending on how they wish to handle the response.

Integrating in your app

To use this in your app, simply call

require("reply").reply(/*options*/{...}).then(result => ...);

The options object can contain the following:

  • msg: A message object containing a field id, the ID to respond to. If this is included in options, the result of the promise will be an object as follows: {t: "notify", id: msg.id, n: "REPLY", msg: "USER REPLY"}. If not included, the result of the promise will be an object, {msg: "USER REPLY"}
  • shouldReply: Whether or not the library should send the response over Bluetooth with Bluetooth.println(.... Useful if the calling app wants to handle the response a different way. Default is true.
  • title: The title to show at the top of the menu. Defaults to "Reply with:".
  • fileOverride: An override file to read canned responses from, which is an array of objects each with a text property. Default is replies.json. Useful for apps which might want to make use of custom canned responses.

Known Issues

Emojis are currently not supported.