// Simple check of bot access
import dotenv from 'dotenv';
dotenv.config();
import { WebClient } from '@slack/web-api';
const client = new WebClient(process.env.SLACK_TEST_TOKEN);
async function simpleCheck() {
console.log('Bot Name: information-assist');
console.log('Token: xoxb-...' + process.env.SLACK_TEST_TOKEN.slice(-10));
console.log('\n' + '='.repeat(60));
// Check what conversations bot is in
console.log('\nπ Channels this bot IS a member of:');
try {
const convos = await client.users.conversations({ types: 'public_channel,private_channel' });
if (convos.channels.length > 0) {
convos.channels.forEach(ch => {
console.log(` β
#${ch.name}`);
});
} else {
console.log(' β NONE - Bot is not in any channels!');
}
} catch (err) {
console.log(' β Error:', err.data?.error || err.message);
}
// List all channels to see #testing
console.log('\nπ All channels in workspace:');
try {
const allChannels = await client.conversations.list({ types: 'public_channel' });
allChannels.channels.forEach(ch => {
const isMember = ch.is_member ? 'β
BOT IS IN' : 'β bot not in';
console.log(` ${isMember} - #${ch.name} (${ch.id})`);
});
} catch (err) {
console.log(' β Error:', err.data?.error || err.message);
}
// Try direct access to #testing
console.log('\nπ― Trying to access #testing directly:');
try {
const testChannel = await client.conversations.info({ channel: 'C09Q6LSA0TE' });
console.log(` β
Found: #${testChannel.channel.name}`);
console.log(` Is member: ${testChannel.channel.is_member ? 'YES β
' : 'NO β'}`);
} catch (err) {
console.log(' β Error:', err.data?.error || err.message);
}
console.log('\n' + '='.repeat(60));
console.log('\nπ‘ TO FIX: In Slack, go to #testing and type:');
console.log(' /invite @information-assist');
console.log('\n');
}
simpleCheck();