sopur / discord-user-bots Goto Github PK
View Code? Open in Web Editor NEWWorking discord user bots library.
License: MIT License
Working discord user bots library.
License: MIT License
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' }
FIXED
The server do not have welcome channel, so is there any event listener to know new member join the server(not server owner, just one of the member on that server)?
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);
};
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!
Discord-user-bots/src/auth/fetch.js
Lines 78 to 86 in ad04e83
The fetchRequest
was in fact, not returned, resulting in an undefined options being passed to the fetch function.
This only affect proxies, normal usage is probably not affected.
After adding in a return statement, my proxy worked.
The title says it all, btw I can help you with this if you want @Sopur 😄
I work on a discord list, and for automating joining server or testing bot, I really need this package :)
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
When I use the normal way of reading with discord.js it fails, How do I read a message?
Is there any type of way to fetch messages from threads?
audio support would be nice!
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"
},
...
],
...
}
);
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
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.
Hi, I am facing some cases that needs to remove an reaction
It would be nice when it provided in module as well!
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?
It seems that client.send can only sed message to a channel.
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?
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?
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?
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}`);
};
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)
How to send an image with a message? I want something like client.send(path_to_image, channel_id);
is there a way to send a friend request to a user
thanks
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.
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?
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?
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.
when i try running an example i get this error
Please tell how to get token on Readme.md
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:
Node.js v18.17.0
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)
Hi.
I need to get a list of people that have a role in some guild(not @everyone), but I couldn't find any function to do so.
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
I made an invite link for those new game activity feature, i.e. YouTube Together and I want the user account to join the voice channel using that specific invite.
client.on.ready = async function() {
msg = await client.fetch_messages(1, "970308424422293504");
console.log(msg);
};
{ message: 'Unknown Channel', code: 10003 }
but id is correct
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.
I didn't find how to get a list of friends, and I also didn't find sending messages by user id
When trying to accept friend requests, I get this error:
{ code: 50109, message: 'The request body contains invalid JSON.' }
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)
}
a function to update user description will be nice.
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)
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.