Bot to retrieve information from another bots. #583
-
Currently I'm trying to develope a bot, that works like this image. I want to send a query for example "/buscar pikachu" on Channel1. I looked in discussions for things related to this, find somes but can't understand how to apply them to my code and I am getting a strange error message that I didn't find nothing. My code is this one: client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', async message => {
if (message.channel.id === CHANNEL1_ID && message.content.startsWith('/buscar')) {
const content = message.content.substring('/buscar'.length);
const channel2 = await client.channels.fetch(CHANNEL2_ID);
await channel2.sendSlash(BOT_ID, 'pokesearch query:', content);
}
});
client.on('messageCreate', async (msg) => {
if (msg.flags.has('EPHEMERAL') && msg.author.id === BOT_ID && msg.channel.id === CHANNEL2_ID) {
console.log(msg)
}
}); This code currently NOT working, and it gives me this error: C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\@sapphire\shapeshift\dist\index.js:1582
return regex.test(input) ? Result.ok(input) : Result.err(new ExpectedConstraintError(type, "Invalid string format", input, expected));
^
ExpectedConstraintError: Invalid string format
at Object.run (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\@sapphire\shapeshift\dist\index.js:1582:64)
at C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\@sapphire\shapeshift\dist\index.js:201:66
at Array.reduce (<anonymous>)
at StringValidator.parse (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\@sapphire\shapeshift\dist\index.js:201:29)
at validateName (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\discord.js-selfbot-v13\src\structures\interfaces\TextBasedChannel.js:21:6)
at TextChannel.sendSlash (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\discord.js-selfbot-v13\src\structures\interfaces\TextBasedChannel.js:507:7)
at Client.<anonymous> (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\lol.js:10:13)
at Client.emit (node:events:513:28)
at WebSocketManager.triggerClientReady (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketManager.js:399:17)
at WebSocketManager.checkShardsReady (C:\Users\grego\Documents\Visual Studio\Discord\JS-SELFBOT POKESEARCH\node_modules\discord.js-selfbot-v13\src\client\websocket\WebSocketManager.js:382:10) {
constraint: 's.string.regex',
given: 'query:',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}
Node.js v18.15.0 |
Beta Was this translation helpful? Give feedback.
?