Skip to content

Commit c01bd4f

Browse files
authored
feat(bot): add /ping command to issue management bot (JhaSourav07#168)
## Description Fixes JhaSourav07#154 ## Pillar - [ ] 🎨 Pillar 1 β€” New Theme Design - [ ] πŸ“ Pillar 2 β€” Geometric SVG Improvement - [ ] πŸ• Pillar 3 β€” Timezone Logic Optimization - [x] πŸ› οΈ Other (Bug fix, refactoring, docs) ## Visual Preview N/A β€” no SVG changes ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have starred the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [ ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 64de669 + 8eecc48 commit c01bd4f

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

β€Ž.github/scripts/issue-management/main.jsβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ module.exports = async ({ github, context, core }) => {
4848
case 'claim':
4949
await handleClaim({ github, context });
5050
break;
51+
case 'ping':
52+
await github.rest.issues.createComment({
53+
owner,
54+
repo,
55+
issue_number: issueNumber,
56+
body: `πŸ“ **Pong!** CommitPulse Bot is online and fully operational.\n> UTC: ${new Date().toUTCString()}`,
57+
});
58+
break;
5159
}
5260
} catch (error) {
5361
core.error(`Error processing command /${parsed.command}: ${error.message}`);

β€Ž.github/scripts/issue-management/parse-command.jsβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function parseCommand(commentBody) {
1515
const claimMatch = line.match(/^\/claim\s*$/i);
1616
if (claimMatch) return { command: 'claim' };
1717

18+
const pingMatch = line.match(/^\/ping\s*$/i);
19+
if (pingMatch) return { command: 'ping' };
20+
1821
const addlabelMatch = line.match(/^\/addlabel\s+(.+)$/i);
1922
if (addlabelMatch) {
2023
const labels = parseLabels(addlabelMatch[1]);

0 commit comments

Comments
Β (0)