Commit Graph

19 Commits

Author SHA1 Message Date
Régis Hanol d234e0f922 SPEC: add spec to ensure discobot works in French
PERF: memoize cooked triggers

Follow-up to 3c31884b
2020-06-26 12:48:11 +02:00
Régis Hanol 3c31884b79 FIX: match discobot triggers on cooked version
In French, the help trigger has a raw content of "afficher l'aider" which is then cooked into "afficher l’aide" (note the different quote character).
Since we were checking the raw content of the trigger against the cooked version of the post, this trigger never worked in French.

This changes so that we cook the trigger before checking in against the cooked version of the post.

DEV: new 'discobot_username' method that is used everywhere instead of 'discobot_user.username' / 'discobot_user.username_lower'
2020-06-25 13:29:55 +02:00
Joffrey JAFFEUX 0d3d2c43a0
DEV: s/\$redis/Discourse\.redis (#8431)
This commit also adds a rubocop rule to prevent global variables.
2019-12-03 10:05:53 +01:00
Robin Ward a37dafdd4d FIX: Use the quote generator in the example text
This way if a plugin customizes the quotes the example will match.
2019-10-16 13:40:44 -04:00
Rafael dos Santos Silva 45ff119f27 FIX: Try to match advanced tutorial reset first (#8048)
Advanced trigger is currently broken on:

    ca
    es
    et
    fr
    he
    it
    pt_BR

And that is because the translation levels for the plugin are kinda low, so I would guess it's broken for half the languages.

Since we have only two tracks for a while now, a quick fix to me is inverting the selectors.

This patch works because the advanced key is "larger" than the new user one.
2019-10-02 11:55:47 +10:00
Guo Xiang Tan 636b6c3a5a FIX: Wrong discobot tutorial started for certain locales.
If a locale has triggers that start with the same word, our regexp will
always end up matching the first trigger. For example,

`start tutorial` and `start tutorial advanced`

To support the change, we have to make the match on triggers more
restrictive. `@discobot quote here` will no longer work like `@discobot
quote`.
2019-08-08 10:53:58 +08:00
Guo Xiang Tan 1267185a07 DEV: Remove unused option.
Follow up to 18ed03e044.
2019-07-30 21:12:13 +08:00
Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
Robin Ward b58867b6e9 FEATURE: New 'Reviewable' model to make reviewable items generic
Includes support for flags, reviewable users and queued posts, with REST API
backwards compatibility.

Co-Authored-By: romanrizzi <romanalejandro@gmail.com>
Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
2019-03-28 12:45:10 -04:00
Gerhard Schlager 24e5be3f0c FIX: Relative links in translations should work with subfolder 2018-11-08 23:31:05 +00:00
Guo Xiang Tan 950fa9e3a8 FIX: Skip trigger match should be case insensitive.
https://meta.discourse.org/t/discobot-not-skipping-tutorial/68498
2017-08-22 07:45:46 +09:00
Guo Xiang Tan a7ed6bd9e1 Use `User#username_lower` instead. 2017-06-12 10:58:31 +09:00
Guo Xiang Tan 977bbb1f45 FIX: Bot mentioned check should be case insensitive. 2017-06-08 19:00:07 +09:00
Guo Xiang Tan c1dc6f6cd7 FIX: Track should only continue if user is alone with bot in a PM. 2017-06-06 09:47:00 +09:00
Guo Xiang Tan 30f2758404 FIX: Ensure that we cancel any timeout jobs when terminating a track. 2017-06-05 16:23:25 +09:00
Guo Xiang Tan 3621647fb5 FIX: Bot should only respond to regular posts. 2017-06-05 15:21:19 +09:00
Guo Xiang Tan 18dac4ce9f UX: Remove restrictions on advanced user track. 2017-05-26 11:05:09 +08:00
Guo Xiang Tan 7028bdceed FIX: Allow users to rename discobot without having to rebuild. 2017-05-26 10:09:42 +08:00
Guo Xiang Tan 7f0561b621 Merge discourse-narrative-bot into core plugins. 2017-05-24 15:28:34 +08:00