GithubHelp home page GithubHelp logo

grmrgecko / canned-responses Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 3.0 361 KB

Rocket.Chat Canned Responses App

License: BSD 3-Clause "New" or "Revised" License

TypeScript 16.64% PHP 69.26% JavaScript 14.10%

canned-responses's Introduction

Canned Responses

This is a Rocket.Chat App which is designed to add Canned Responses via the /can slash command. The app requires a helper which can be installed on a standard LAMP or LEMP stack with SQLite3 or MySQL/MariaDB support.

Installation

First, install the helper under the web-api folder on your server.

  1. Configure the options at the top of the index.php to fit your needs.
  2. Upload to your LAMP/LEMP service provider, it can be under a sub directory if needed or a sub domain/primary domain.
  3. Visit the URL under which the helper app resides.
  4. Create your first user account which will become your administrator account.
  5. Start adding canned responses.

Next, you will need to add the Canned Responses app to your Rocket.Chat instance.

  1. Under Rocket.Chat administration, go to General -> Apps and enable development mode to allow apps to be installed which are not in the market place.
  2. Follow instructions at https://rocket.chat/docs/developer-guides/developing-apps/getting-started/ to install the apps-cli.
  3. Change directory to the Canned Responses directory and install needed modules.
npm install
  1. Deploy the app to your Rocket.Chat instance.
rc-apps deploy --url=https://rocket.domain.com -u USER_ACCOUNT -p "PASSWORD"

If you are modifying the code, you can run the following to update the App after you have installed it.

rc-apps deploy --url=https://rocket.domain.com -u USER_ACCOUNT -p "PASSWORD" --update
  1. In the Rocket.Chat administration, go the Apps -> Canned Responses and enable/set the API URL to your helper's URL with /api/ added to the end.

canned-responses's People

Contributors

grmrgecko avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

canned-responses's Issues

Failing in MariaDB installation

Hi,

I was trying to implement this feature on our test RocketChat using MySQL, and is failing due to SQL syntax errors in MariaDB. As far as, I filled the index.php as below:

$_MGM = array();
$_MGM['version'] = "1";
$_MGM['title'] = "Canned Response";
$_MGM['author'] = "James Coleman";
$_MGM['DBType'] = "MYSQLPDO"; // MYSQL, POSTGRESQL, SQLITE.
$_MGM['DBPersistent'] = false;
$_MGM['DBHost'] = "localhost";
$_MGM['DBUser'] = "test_cann";
$_MGM['DBPassword'] = "v)4d5K@RGN,J";
$_MGM['DBName'] = "test_cann"; // File location for SQLite.
$_MGM['DBPort'] = 3306; // 3306 = MySQL Default, 5432 = PostgreSQL Default.
$MGM['DBPrefix'] = "can";

While inputting the details on the frontend, I'm getting an email with the errors:

Error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' email TEXT, password TEXT, time INTEGER, level INTEGER)' at line 1:

My server running MariaDB 10.2.25, so it could be a SQL version issue. I tried troubleshoot this further, and see the settings table is getting created with the db_version raw each time when trying to register the new user. The later queries seems to be not running as intended on code/setup.php file

if ($result==NULL) {
databaseQuery("CREATE TABLE {$_MGM['DBPrefix']}settings (name TEXT, value TEXT)");
databaseQuery("INSERT INTO {$_MGM['DBPrefix']}settings (name, value) VALUES ('db_version',%s)", $_MGM['version']);
databaseQuery("CREATE TABLE {$_MGM['DBPrefix']}responses (docid INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, message TEXT)");
databaseQuery("CREATE TABLE {$_MGM['DBPrefix']}users (docid INTEGER PRIMARY KEY AUTOINCREMENT, email TEXT, password TEXT, time INTEGER, level INTEGER)");

Can you please review this, and let me know what went wrong or patch it to support this MariaDB version there

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.