Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable To Use dmChannel.call(); #1482

Closed
3 tasks done
MukuJhansi opened this issue Jan 30, 2025 · 3 comments
Closed
3 tasks done

Unable To Use dmChannel.call(); #1482

MukuJhansi opened this issue Jan 30, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@MukuJhansi
Copy link

MukuJhansi commented Jan 30, 2025

Which package has the bugs?

The core library

Issue description

I Started Viewing Old Issue and Found a Link to a solution but that file was not longer there. HELP!
https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/VoiceCall.md#setup <- OLD NOT WORKING LINK

Code sample

const { Client } = require("discord.js-selfbot-v13");
const { exec } = require('child_process'); // Add child_process to execute PlayAudio.js
const playAudio = require('./examples/VoiceChannel/PlayAudio'); // Import PlayAudio module

const client = new Client({
    checkUpdates: false,
    patchVoice: true // Enable voice capabilities
});

client.on("ready", async () => {
    console.log(`${client.user.username} is Ready!`);
});

client.on('messageCreate', async message => {
    if (message.content.toLowerCase() === "call") {
        try {
            await message.channel.send("Whom To Call?");
        } catch (error) {
            console.error("Failed to send message:", error);
        }
    }

    if (message.content.startsWith("call ")) {
        const user = message.mentions.users.first();
        if (user) {
            try {
                const dmChannel = await user.createDM();
                await dmChannel.send("You have been called!");
                // Start a DM call
                const connection = await dmChannel.call();
                if (connection) {
                    await message.channel.send(`Started a call with ${user.username}`);
                } else {
                    await message.channel.send(`Failed to start a call with ${user.username}`);
                }
            } catch (error) {
                console.error("Failed to send DM or start call:", error);
            }
        } else {
            try {
                await message.channel.send("Please mention a user to call.");
            } catch (error) {
                console.error("Failed to send message:", error);
            }
        }
    }

    if (message.content.startsWith("rkrl")) {
        try {
            await message.channel.send("Coming in at the Count of 3");
            // Call PlayAudio module with the voice channel ID and message channel ID
            const voiceChannelId = message.member.voice.channelId;
            const messageChannelId = message.channel.id;
            playAudio(voiceChannelId, messageChannelId);
        } catch (error) {
            console.error("Failed to send message:", error);
        }
    }
});

client.login("token").catch(error => {
    console.error("Failed to login:", error);
});

Package version

3.5.1

Node.js version

v20.18.2

Operating system

Windows 11

Priority this issue should have

Medium (should be fixed soon)

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

@MukuJhansi MukuJhansi added the bug Something isn't working label Jan 30, 2025
@aiko-chan-ai
Copy link
Owner

What error

@MukuJhansi
Copy link
Author

i am unable to Start a Voice Call

@aiko-chan-ai
Copy link
Owner

#555 (comment)

@aiko-chan-ai aiko-chan-ai closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants