So I am making a discord bot and I am making it for 2 servers so I made the bot message me and then I tried to make it wait for a response from me which is either "eb" or "guap" and depending on which one I pick it defines the channel. Heres what I have
client.once('ready', async () => {
// [beta]
const storedBalances = await Users.findAll();
storedBalances.forEach(b => currency.set(b.user_id, b));
console.log(`Logged in as ${client.user.tag}!`);
client.users.cache.get('461694991467544577').send('what server').then((msg) => {
console.log("are we making it this far")
msg.channel.awaitMessages({ filter: (m) => { return true }, max: 1 }).then((collected) => {
console.log(collected);
if (collected.first().content === "guap") {
client.channels.fetch("724610473982558221").then((c) => {
channel = c;
})
console.log("fetching guaps server");
}
if (collected.first().content === "eb") {
client.channels.fetch("961598555515158568").then((c) => {
channel = c;
})
console.log("fetching eb's server");
}
}).catch(()=>{
console.log("AwaitMessages Failed");
})
});
});