aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
751 stars 160 forks source link

channel.send() is not working #905

Closed Karxfr closed 7 months ago

Karxfr commented 10 months ago

Which package has the bugs?

The core library

Issue description

this is my code it isnt either sending message or throwing error

Code sample

const { Client } = require('discord.js-selfbot-v13');
const client = new Client({

});

client.on('ready', async () => {
  console.log(`${client.user.username} is ready!`);
  const channelId = '1135090049311051850';

    // Define your message here
    const message = '!work';

    // Schedule the message to be sent every hour (3600000 milliseconds)

 // channel.send('hello!')
      sendMessage(channelId,message)

})
client.login("MTA3OTAwMDE5MjUxMjE2ODA3OA.GDWI7W.BSWW7KpUlSzfUwpkYDSe1eyrEtkedSz-aRzb-4");

async function sendMessage(channelId,message){

  const channel = await client.channels.cache.get(channelId);

      if(channel) {

        await channel.send(message)
        .then(message => console.log(`Sent message: ${message.content}`))
        .catch(console.error);

        console.log(channel)
      } else {
        console.log(`Channel with ID ${channelId} not found.`);
      }

  };

Package version

Discord.js-selfbot-v13 is up to date. Current: 2.14.12

Node.js version

Node.js v20.3.1

Operating system

windows

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

No response

TheDevYellowy commented 10 months ago

are you using replit

TheDevYellowy commented 10 months ago

also even if the token is invalid please don't put tokens in your code here

mastercuber55 commented 10 months ago

are you using replit

I'm using replit and having the same issue, and also have a pretty much same code

const { Client } = require('discord.js-selfbot-v13')
const client = new Client({
    checkUpdate: false
})

client.on('ready', () => {
    console.log(`Logged in as ${client.user.tag}!`);
});

client.on("messageCreate", (msg) => {
    if(!msg.mentions.has(client.user)) return;
    msg.reply("Hi")
    msg.channel.send("Hi")
})

client.login(process.env.TOKEN)
MohamadTaha1 commented 10 months ago

did you guys find a solution?

TheDevYellowy commented 10 months ago

Replit banned selfbots