Bug or something
Wreaking opened this issue · 3 comments
hey so i was just testing my bot whether it detects phishing links or not. well it was working fine when i send the scam link second time it sends 2 message at the same time, i tried to search what was the error I couldn't find it so i tried to debug the error by using
console.log(data)
1)I've send the scan link in the channel and saw the terminal it looks fine
2)
i send the scam link again and saw the terminal it sends the data twice at the same time
so its probably the package problem so can you quickly fix it please?
thanks...
I've tested this locally and I have been unable to recreate the bug without changing anything. Feel free to send me your code, I'd be happy to look at it!
The code I was using:
const { Client, version } = require('discord.js');
const { Fish } = require('../lib/index'); //fancy imports
const client = new Client({ intents: ['GUILD_MESSAGES', 'GUILDS',] }); //create client, requires guild and guild messages to function.
const fish = new Fish(); //create fish
client.on("phishingMessage", (message, data) => {
console.log(message, data); //"message" is the Message object containing the link, and "data" is the data returned by the api
message.channel.send(`Phishing link detected by ${message.author}. Clicking this link may put your account at risk.`);
});
fish.init(client, version); //initialize fishing client, DO THIS BEFORE YOU LOGIN.
client.login('TOKEN'); //login to discord.
(It's the code in the test folder)
im sorry i just realized that i have added
fish.init(client, version);
twice at the time in index.js so thats why its sends two msgs and datas at the same time.... i haven't noticed. I genuinely sorry for making a false bug report
no worries man, glad you found the bug!