Giter VIP home page Giter VIP logo

discord-user-bots's Introduction

Hello

Top Langs

discord-user-bots's People

Contributors

cobaltxii avatar gearintellix avatar imraj avatar lf94 avatar octo-kumo avatar rot4tion avatar sopur avatar steve-dusty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

discord-user-bots's Issues

captcha error in joining guilds

client.join_guild( String(link) // The Discord invite ).then(e => console.log(e));

error is
{ captcha_key: [ 'You need to update your app to join this server.' ], captcha_sitekey: '4c672d35-0701-42b2-88c3-78380b0db560', captcha_service: 'hcaptcha' }

Random disconnects

Currently the bot seems to randomly disconnect when running the following code and fails to autoreconnect

const Discord = require("discord-user-bots");
const client = new Discord.Client("TOKEN");

client.on.ready = function () {
    console.log("Client online!");
};

client.on.presence_update = function (user) {
        console.log(user);
};

"Switch" to a server

I have a couple of servers that appear to be on different nodes than others, and I have been using a tampermonkey script to sniff messages for a while. Problem is to listen to the "other" set of servers, I have to have to windows open. I want to use this instead to do what I've been doing, but I can't figure out how to get it to switch to a specific server/server(s) to be able to listen to those messages. Thanks!

refresh token

Is there any way to get a refresh token? , normally the tokens do not last more than 12 hours, and I need to re-inspect the requests to get the token, so I saw discord has a ws where the token is passed. access to start

Send message attachment files

Hi, it would be great if we can send message attachment as build-in module

something like this:

client.send(
    "794326789480120374", // Channel to send in
    {
        attachments: [
                "path/to/file1",
                {
                        "path": "path/to/file2",
                        "name": "Custom File Name",
                        "description": "File description"
                },
                ...
        ],
        ...
    }
);

Not able to send messages

const Discord = require("./node_modules/discord-user-bots/src/exports.js");
const client = new Discord.Client("blabla");
hey="hello"

client.on.ready = function() {
console.log("Client online!");
};

client.on.message_create = function(message) {
const guild = client.info.guilds.filter((guild) => guild.id == message.guild_id)[0];
const channel = guild.channels.filter((channel) => channel.id == message.channel_id)[0];

if(channel.id=="673488504524898304"){
console.log(message);
client.send(
"673488504524898304", // Channel to send in
{
content: "Hello",});
}
}

I have this code and i dont get why no message is being sent. console.log is working but me sending the message is not

Is there any replacement for join_guild function.

Hi,

The join_guild function is deprecated. Is there any replacement for it? I also send you a request on discord if you would accept. I am Thrall#7810. Really need to discuss this and need help with this.

Remove reaction

Hi, I am facing some cases that needs to remove an reaction
It would be nice when it provided in module as well!

How see messages from bots for me only

Hello everyone, I need to see the messages from bots that are showing for me only. I've tried all the listeners, I think, but most of them are not even catching them. The only one listener that can see it is only chat_input_command, but it can't look into them and shows the empty content. Can someone help me?

Is there a way to refresh the token?

Hello everyone, I need to refresh tokens when the discord is blocking me from sending messages. I have a couple of them and when it comes to the error with discord I need to refresh the token and the program should go on. How can I do this?

Ability to fetch users in guild

Unable to find a way to utilize this framework to fetch users in a guild.
Is this possible? If not is there any plans to add this functionality?

Error When User Invalid Token

When I use
client = new Discord.Client(token);

and when token is invalid got message

discord-user-bots\src\client\client.js:58 } else throw new DiscordAPIError(`Discord rejected token "${token}" (Not valid)`);
DiscordAPIError: Discord API Error: Discord rejected token "XXXXxxxxx" (Not valid)

How to handle this error?

Missing properties on channels

currently, {channel.name} and for {channel.id} for forum posts are undefined. i guess if someone would be good enough to add support for them i would be greatful

code :

client.on.message_create = function (message) {
       const guild = client.info.guilds.filter((guild) => guild.id == message.guild_id)[0];
       const channel = guild.channels.filter((channel) => channel.id == message.channel_id)[0];
      

       if (guild.name == "instaling fresh bot")
       console.log(`[${guild.name}] [#${channel.id}] ${message.author.username}: ${message.content}`);
   };

input :
image

expected output :
[instaling fresh bot] [(thread id) #1102685991933853746] rudy3: ur such a nerd 🤓
actual output :

console.log(`[${guild.name}] [#${channel.id}] ${message.author.username}: ${message.content}`);

TypeError: Cannot read properties of undefined (reading 'id')
    at client.on.message_create (C:\Users\mmax3\Downloads\NanaEmojiDecipher\main.js:16:49)
    at WebSocket.<anonymous> (C:\Users\mmax3\Downloads\NanaEmojiDecipher\node_modules\discord-user- 
    bots\src\client\client.js:374:37)

Send image with message.

How to send an image with a message? I want something like client.send(path_to_image, channel_id);

Slash commands to bots

Hello everyone! I'm trying to implement the using of the slash commands with this library, but I just can't. I can recieve an event of the creating the chat input commands, but I'd like to send them into the chat. For example, I'd like to send to the chat smt'h like this : "/ping msg: Pong?" And the bot should answer on that command. I just can't find what should I do except the filling the content in the chat.send() method.

Issue using IOS

I have a project that works for me on windows 10 and linux (ubuntu)
When I tried to run on MacOs, I got this error:

Reading configuration
(node:693) UnhandledPromiseRejectionWarning: FetchError: Invalid response body while trying to fetch https://discord.com/api/v9/users/@me: invalid distance too far back
    at Gunzip.<anonymous> (/snapshot/discord-marketing/node_modules/discord-user-bots/node_modules/node-fetch/lib/index.js:400:12)
    at Gunzip.emit (events.js:412:35)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use Discord_Bot-macos --trace-warnings ... to show where the warning was created)
(node:693) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:693) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is there a way to fix this issue?

How to send a file?

I'm trying to send a .txt file but everytime I try it's return an error (which I don't understand).
Does someone know how to send a file?

Possible red flag.

wss://gateway.discord.gg/?encoding=json&v=9

Using the socket without ERLPACK, will probably flag and terminate the account at some instances, discord is checking everything when they are in full ban mode and also along the weekends.

Error: Cannot find module '../src/exports.js'

C:\Users\Admin\Desktop\Yeni klasör (2)>node clean-up.js
node:internal/modules/cjs/loader:1080
throw err;
^

Error: Cannot find module '../src/exports.js'
Require stack:

  • C:\Users\Admin\Desktop\Yeni klasör (2)\clean-up.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object. (C:\Users\Admin\Desktop\Yeni klasör (2)\clean-up.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'C:\Users\Admin\Desktop\Yeni klasör (2)\clean-up.js' ]
    }

Node.js v18.17.0

Random disconnects

I'm getting this error, but the problem is that it doesn't reconnect

2023-08-10T04:46:38: Error: WebSocket is not open: readyState 0 (CONNECTING)
2023-08-10T04:46:38:     at WebSocket.send (/home/ubuntu/---/node_modules/ws/lib/websocket.js:442:13)
2023-08-10T04:46:38:     at Timeout._onTimeout (/home/ubuntu/---/node_modules/discord-user-bots/src/client/client.js:84:37)
2023-08-10T04:46:38:     at listOnTimeout (node:internal/timers:564:17)
2023-08-10T04:46:38:     at process.processTimers (node:internal/timers:507:7)

Bot can't see messages that are marked as replies

I have tried the bot on multiple servers, It neves sees messages that are replies, whether it is a reply to bot's message or not.
I also mentioned that on some servers it cannot see any messages at all, mostly on big ones such as Homework Help

{ message: 'Unknown Channel', code: 10003 }

client.on.ready = async function() {
msg = await client.fetch_messages(1, "970308424422293504");
console.log(msg);
};

{ message: 'Unknown Channel', code: 10003 }

but id is correct

is there any way to contact you ?

Hello there,

Do you have an email address where i can contact you ?

I'd like to discuss a possible work offer with you if you might be interested.

Thanks in advance.

get users list

I didn't find how to get a list of friends, and I also didn't find sending messages by user id

Can't Accept Friend Requests

When trying to accept friend requests, I get this error:
{ code: 50109, message: 'The request body contains invalid JSON.' }

discord-user-bots does not support embeds

I tried to use both Discord.MessageEmbed and Discord.RichEmbed, but I cant get it to work. are embeds supported?

Heres my code:

if (message.content = "help") {
    const embed = new Discord.MessageEmbed;
    embed.setTitle('HelperBot - Help')
    embed.setDescription('This bot is a discord bot that is in a user account. Try me out!')
    message.channel.send(embed)
  }

about me edit

a function to update user description will be nice.

account-create.js not working

Hey, i wanted to create a discord account with the account-create.js example and encountered this error:

const factory = new Discord.AccountFactory()
TypeError: Discord.AccountFactory is not a constructor

This is the code i ran:

const Discord = require("discord-user-bots");

// captcha.guru is a capcha solving service.
// This is a wrapper I made for it.
// `npm i captchaguru` to install
const Guru = require("captchaguru");
const factory = new Discord.AccountFactory();

// Config
const proxy = "85.214.81.21:3128";
const proxyType = "HTTP";
const accountName = "tuismqgi";

// Solve captcha callback
async function solveCaptcha(captchaInfo) {
    const solver = new Guru("captcha.guru API token goes here.", captchaInfo.service, captchaInfo.siteKey, captchaInfo.siteURL, proxy, proxyType);
    return solver.solve();
}

void (async function main() {
    // Returns token on success
    const token = await factory.createAccount(accountName, solveCaptcha, `${proxyType.toLowerCase()}://${proxy}`);
    console.log("Created account: ", token);

    // Attempt to login to the newly created account
    const client = new Discord.Client(token);
    client.on.ready = function () {
        console.log("Created account online!");
    };
})();

I am using repl.it with node 18.12.1 and npm 8.19.2 .
I installed all npm packages.

(Im in holidays thats why i am using repl.it)

Bots don't answer on commands

Hey there, I'm sending commands to the bots, but they don't response. I'm using client.fetch_request() command to interact with the bot, throuth the POST request to /interactions, but I don't have an answer in chat. Discord returns 204 answer, but still nothing in chat. This works sometimes like about 1-2 times in 20-30 requests, but earlier it worked fine. I saw this reqeuests in browser and the only thing that is different from my code is the nonce string, because I don't use it and can't calculate it (and ofk sessionID is different too). Can someone help me resolve this?

Voice features

being able to join voice channels and play sound files or record and get a file from the sounds of the voice channel you could link it well with some text to speach / spech to text and make a good thing with it just a propostition

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.