-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-single-channel-now.js
More file actions
36 lines (28 loc) · 1.21 KB
/
Copy pathtest-single-channel-now.js
File metadata and controls
36 lines (28 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require('dotenv').config();
const { exec } = require('child_process');
const util = require('util');
const execPromise = util.promisify(exec);
async function testC1OncallBot() {
console.log('🧪 Testing c1-oncall-bot post (WILL POST TO SLACK!)');
console.log('='.repeat(70));
console.log('This will post to #c1-oncall-bot channel using general-all-teams mode\n');
try {
// Temporarily set channel ID to c1-oncall-bot
process.env.SLACK_CHANNEL_ID = process.env.SLACK_CHANNEL_1_ID;
console.log(`📍 Target Channel ID: ${process.env.SLACK_CHANNEL_ID}`);
console.log(`📋 Mode: general-all-teams (uses post-general-oncall.js)`);
console.log('\n▶️ Running post-general-oncall.js...\n');
const { stdout, stderr } = await execPromise('node post-general-oncall.js');
console.log(stdout);
if (stderr) {
console.error('Errors:', stderr);
}
console.log('\n' + '='.repeat(70));
console.log('✅ Test complete! Check #c1-oncall-bot channel in Slack.');
console.log('='.repeat(70));
} catch (error) {
console.error('\n❌ Error:', error.message);
console.error('\nThis means the bot would fail when trying to post to c1-oncall-bot.');
}
}
testC1OncallBot();