Conversation
|
@halsk I confirmed this on dev environment, so could you check this ? |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the issue of an unexpected bye by ensuring that emoji are removed from messages before commands are identified. It also adds a test case to cover messages that include emojis.
- Removes emojis from the input message using a regular expression.
- Updates command matching logic to use the emoji-stripped message.
- Adds a test case to verify that messages with emoji are handled correctly.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/timesheets.js | Removes emoji from messages for command detection |
| tests/timesheets_test.js | Adds a test case to verify functionality with emoji |
Comments suppressed due to low confidence (1)
scripts/timesheets.js:43
- Review the regex used for emoji removal to ensure it doesn't unintentionally strip parts of valid commands containing colons. Consider adding unit tests for edge cases.
var emojiRemovedMessage = message.replace(/:[^:\s]*(?:::[^:\s]*)*:/g, '');
tests/timesheets_test.js
Outdated
| }); | ||
|
|
||
| // 休憩時間(稼働中、絵文字付き) | ||
| test1 = {}; |
There was a problem hiding this comment.
Declare 'test1' using let or const to avoid polluting the global scope and prevent potential unintended side effects.
There was a problem hiding this comment.
In the upper part (line 168 and 176), var test1 = {}; are used.
Is it okay to replace this line to var test1 = {}; ?
line 183 and 197 are also same.
There was a problem hiding this comment.
Well, I used var test1 = {}; in commit 43dc8f8.
|
I missed to set target branch. I already merged 3 commits from this PR branch to develop branch, |
Fixes #61.
Changes proposed in this pull request:
@Georepublic/maintainer