Skip to content
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

Merged
merged 8 commits into from
Mar 3, 2023

Conversation

Shape6253
Copy link
Contributor

@Shape6253 Shape6253 commented Mar 1, 2023

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.

Copy link

@github-actions github-actions bot left a 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 :)

Copy link
Owner

@bostrot bostrot left a 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) {
Copy link
Owner

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.

Copy link
Contributor Author

@Shape6253 Shape6253 Mar 1, 2023

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.

Copy link
Owner

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 :)

@Shape6253 Shape6253 requested a review from bostrot March 1, 2023 23:46
@Shape6253
Copy link
Contributor Author

Hashtags for categories related to the issue #125

Copy link
Owner

@bostrot bostrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :)

@bostrot bostrot linked an issue Mar 3, 2023 that may be closed by this pull request
@bostrot bostrot merged commit ffe71b6 into bostrot:master Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add hashtag to ticket
2 participants