-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using 'msg' and 'group_id' at the same time. Some /clear and /close fixes. #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there! As you are a first time Contributor please make sure that you are using the predefined eslint guidelines for your code formatting. Thank you! Now continue :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Could you check my comments?
src/commands.ts
Outdated
@@ -105,7 +108,7 @@ function closeCommand(ctx: Context) { | |||
if (cache.config.categories) { | |||
cache.config.categories.forEach((element: any, index: number) => { | |||
// No subgroup | |||
if (cache.config.categories[index].subgroups.length > 0) { | |||
if (cache.config.categories[index].subgroups == undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
length > 0
would mean if there is at least one subgroup while subgroups == undefined
would mean there is no subgroup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. However, if no subgroups
are specified, an error occurs. If it has a length of 0, forEach
will be ignored. cache.config.categories[index].subgroups == undefined || cache.config.categories[index].subgroups.length == 0
perhaps it would be more correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please update it with cache.config.categories[index].subgroups == undefined && cache.config.categories[index].subgroups.length > 0
:)
Hashtags for categories related to the issue #125 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :)
Remove tickets from cache on /clear and /close. Otherwise, the user will not receive a notification about sending a message if the previous ticket was closed. It may also be related to the issue #121.
Allow to use 'msg' and 'group_id' at the same time. It is convenient if additional information is always needed to answer a question. Also, it looks like a solution for issue #99.