#development
1 messages · Page 1792 of 1
lol
yeah, most people here don't actually have enough experience to do the most basic stuff, you'd be better off just hiring someone on fiverr or on freelancer
And fiver and freelancer have built in ways to protect the buyers and sellers, you don't know what might happen here 
That's so 2019
Did you run the repl?
yup
Nice
what's nice about it
Don't know, I'm just going through random repl apps
Kinda hate the fact that you need to find the typings for each thing honestly
thats the whole point of it
you dont need to find the types
u make ur own
then hover on it, and you know its shape
Why not just use a statically typed language at this point if you don't have to compile for the web, I don't see a point for it
you use js' ecosystem and packages
Ig that's the only real benefit
But for Discord bots imo it's not that needed most of the times
pog
.ping
.pong
just add a .catch block onto your promise
wat thing u guys use to host ur bot
show ur code
lmao
When NextJS is rendering a string that has line breaks (\n), it ofc does not show the line breaks, but also doesn't go to a new line? Any ideas?
u need to pass in a function
@earnest phoenixhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
The catch() method returns a Promise and
deals with rejected cases only. It behaves the same as calling Promise.prototype.then(undefined, onRejected) (in fact, calling
obj.catch(onRejected) internally calls
obj.then(undefined, onRejected)). This means that you have to provide an
onRejected function even if you want to fall back to an
u...
read that
Np

you trying to edit a message that doesnt exist
or react to one
or something
the message has been deleted already
and you trying to do something to it
if(!msg.deleted) rest...
I got it thnq
i assume djs has handlers for that
white-space: pre-line
css doesn't render newlines by default
aight
bot.on('presenceUpdate', (oldMember, newMember) => {
console.log(oldMember.user.presence.status + " " + newMember.user.presence.status)
});``` when changing my status from dnd to online the status of oldMember and newMember both say online. am i doing something wrong?
Normally "oldMember" and "newMember" will be "oldPresence" and "newPresence" , but that shouldn't effect anything
yea i just saw that on stack overflow and tried it for the fun of it
didnt work
obviously
Do you have the correct perms to track presence? It would normally be on developer page
Right
Just done some testing
You have your things wrong
console.log(oldPresence.status + " " + newPresence.status);
This is it
No worries
I finally found out how to make an inline reply:
//FILE NAME: inlineReply.js
const { Message } = require("discord.js");
Message.prototype.inlineReply = async function(content = String()) {
return this.client.api.channels[this.channel.id].messages.post({
data: {
content: content,
message_reference: {
message_id: this.id,
channel_id: this.channel.id,
guild_id: this.guild.id
}
}
})
}
And to require it, I just do this:
//...
require('./inlineReply');
//... and now just do <Message>.inlineReply("content") and it works!
Hi is there any way that where i can send all the collected messages from message collector at once in an embed ?
<MessageCollector>.then(messages => {
const joinedMsgs = messages.array().map(m => m.content).join("\n") //or instead of \n you can choose something else to separate them by
})
//I think this works
Ohhk i will try and tell you
You can use the end event, it gives you a collection with all the messages.
🤔ohkk will try and tell you
Thanks
Hey does anyone know how to turn off the mention in this?
is there a way to hide/remove a message attachement when editing?
Once an attachment is sent through a message, it cannot be edited nor removed unless you just delete the message
mhm I see
cuz I'm using a base64 image from an API and saving that as a temporary image and using that as thumbnail for the embed, would it be better for me to make an express server and get the image through there then?
What you can is upload the (for example) image to an image host or something and set the image in the embed
Those can be edited/removed
Perhaps
how would I "send" an image through the express server?
res.sendFile()
ty
it can be removed
wait how
I meant through a message, not an embed; it can be removed from embeds
not sure if you can upload new attachments when editing
I want to remove the attachment
huh, that's strange; that wasn't possible before
it's possible now that you can delete attachments for existing messages
and it wasn't possible for embeds before either, what are you talking about? the uploaded attachment would be outside the embed
It only worked for URLs
Hey, How can I save a user who voted for my bot in last 12 hrs in discord.js?
how do I delete it?
You can save them in a database or in memory
For 12 hours personally I think an in-memory cache is good enough, as long as your bot doesn't restart every hour or something
It does work
Oh Ok thanks
give attachments property an empty array on edit
and then upload the file on edit also
messages do
oh
you can also just upload new attachments on edit without setting the attachments property an empty array (it'll just add a new attachment to the message)
What library are you using?
djs
Hmm
since this is a new feature, I'm not sure if they implemented it yet on stable
maybe on master branch
I'll just use the express server
1 issue tho
I always get this error Error: listen EACCES: permission denied :::8923
and can never fix it
Functions
frick slash commands
go tell him to improve it
he doesn't listen to me about it
F
he thinks "they should be exactly the same"
so "you don't rewrite your commands"
yes how are you supposed to do aeon spin ^ with slash commands
like wtf?
anyone knows how to solve? Error: listen EACCES: permission denied :::45010 I get this error for every single port
If its your network port, make sure if its open
with netstat -a?
No, 192.168.1.1
wait how
You have to sign into your network router
I just go to 192.168.1.1 in my browser?
Indeed
yeah
But you need to know your root login of the router
aha found it
Doesnt work either
And I also don't know the root login of the router
Well, how the fuck do you change your router settings then lmao
mostly it defaults to admin admin
idk the technician does prob
or its on the back of the router
Depends on the model
but ye that ip doesn't work either
I literally had to call my ISP because their routers had different default password

someone help me
ytdl is giving 404 error
but the link exists
was it working before yesterday?
yep
I have now updated the YTDL
before i update the error was still active
ytdl seemed to break for everyone yesterday
don't have a day to go back?
seems youtube might be updating stuff, or even intentionally breaking these scraping programs
Does someone know any guide to implement a Discord login in a website
google does
Didn't find that much honestly
I'm trying to make a calculation with 2 values, I have saved in mongoDB. However the console log returns both values as 'undefined'. Any clues?
const checkAuthor = await classSchema.findOne({userID: authorId});
if(!checkAuthor) return message.reply("You don't have a class yet! Choose one in `!class`")
const checkUser = await classSchema.findOne({userID: userId});
if(!checkUser) return message.reply("The mentioned user does not have a class!")
console.log(checkUser.chosenClass.physicalDEF, checkAuthor.chosenClass.physicalATK)
let damage = Math.round(checkUser.chosenClass.physicalDEF - Math.floor(Math.random() * checkAuthor.chosenClass.physicalATK));
@lament stump What I would do is console log the entire checkuser and checkAuthor object to see everything they contain. Maybe thats gives you more information.
C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js:6
require(dotenv).config();
^
ReferenceError: dotenv is not defined
at Object.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js:6:9)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
how to define
This is what it returns, should I do checkAuthor.chosenClass[physicalATK]?
chosenClass[0].physicalATK
oh
node:internal/validators:119
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received an instance of Object
at new NodeError (node:internal/errors:363:5)
at validateString (node:internal/validators:119:11)
at Module.require (node:internal/modules/cjs/loader:1006:3)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\database\mongoose.js:3:1)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14) {
code: 'ERR_INVALID_ARG_TYPE'
}
I would advise to look at how to code with node.js
You cant just "define" something. It has to be defined in a certain way depending on what its going to be used
i know but facing error while using in slappey
Looking at, you don't have speech marks
This is what you have, require(dotenv).config();
This is what you need, require('dotenv').config();
Didn’t ask
@smoky kestrel
(node:1520) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(Use node --trace-deprecation ... to show where the warning was created)
C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongoose\lib\index.js:180
if (VALID_OPTIONS.indexOf(key) === -1) throw new Error(\${key}` is an invalid option.`);
^
Error: userFindAndModify is an invalid option.
at Mongoose.set (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongoose\lib\index.js:180:48)
at Object.init (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\database\mongoose.js:18:10)
at C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js:14:12
at Object.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js:18:3)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
what is this now
Thats as much as I can help you with. Since I don't use dotenv
ok lemme check
await mongoose.connect(uri, {useNewUrlParser: true, useUnifiedTopology: true})
Use this
msg not editing
ok
can you only show the part that you are having the problem in?
where
The Bot is disconnect from The Database
C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\topologies\server.js:438
new MongoNetworkError(
^
MongoNetworkError: failed to connect to server [cluster0-shard-00-01.2vmrj.mongodb.net:27017] on first connect [MongoError: bad
auth : Authentication failed.
at Connection.messageHandler (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:359:19)
at Connection.emit (node:events:394:28)
at processMessage (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:451:10)
at TLSSocket.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:620:15)
at TLSSocket.emit (node:events:394:28)
at addChunk (node:internal/streams/readable:312:12)
at readableAddChunk (node:internal/streams/readable:287:9)
at TLSSocket.Readable.push (node:internal/streams/readable:226:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
ok: 0,
code: 8000,
codeName: 'AtlasError'
}]
at Pool.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\topologies\server.js:438:11)
at Pool.emit (node:events:394:28)
at C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\pool.js:562:14
at C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\pool.js:1009:9
at callback (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connect.js:75:5)
at C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connect.js:147:27
at C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\auth\scram.js:185:14
at _callback (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:328:7)
at Connection.messageHandler (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:359:9)
at Connection.emit (node:events:394:28)
at processMessage (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:451:10)
at TLSSocket.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\mongodb\lib\core\connection\connection.js:620:15)
at TLSSocket.emit (node:events:394:28)
at addChunk (node:internal/streams/readable:312:12)
at readableAddChunk (node:internal/streams/readable:287:9)
at TLSSocket.Readable.push (node:internal/streams/readable:226:10)
Where ever you put your mongoose.connect(), replace it with that
then where shouldi paste url instead of uri 😦
uri is the variable for the mongodb://... or whatever
Say var uri = that
ok
Every one can access your db so delete this
why db is not connecting
please use code blocks
how
surround your code in ```
ok
ok tell me now ``` const mongoose = require('mongoose');
const config = require('../../slappey.json');
module.exports={
init:() =>{
const dbOptions = {
useNewUrlParser : true ,
useUnifiedTopology : true ,
autoIndex : false ,
poolSize : 5,
connectTimeoutMS:1000,
family : 4
};
(async ()=>{
const uri = "";
await mongoose.connect(uri, {useNewUrlParser: true, useUnifiedTopology: true})
mongoose.set('useFindAndModify' , false);
mongoose.Promise = global.Promise;
mongoose.connection.on('connected' , () =>{
console.log('The Bot is connect To The Database');
});
mongoose.connection.on('disconnected' , () =>{
console.log('The Bot is disconnect from The Database');
});
mongoose.connection.on('err' , (err) =>{
console.log('There is an error in connection to the database' + err);
});
})
}
}```
why db is not connecting
tell me
ohnow i make a betterway to connect
Slappey?
yes
you are adding the uri right?
any one know why i cant host my bots in a server while I can run it on a local host (my PC)?
question
If I make a hack command with random things like, his ip is lol-lol
the bot can be banned?
MAYBE but I'd not risk it
node:internal/fs/utils:343
throw err;
^
Error: ENOENT: no such file or directory, scandir './events'
at Object.readdirSync (node:fs:1380:3)
at Object.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js:13:23)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47 {
errno: -4058,
syscall: 'scandir',
code: 'ENOENT',
path: './events'
}
how to solve
don't read a directory that doesn't exist in the right context
./events doesn't exist in the src directory
but events exist
can you show your directory structure
name: 'message',
execute(message , client) {
if(message.author.bot) return;
if(message.channel.type === 'dm') return;
if(!message.content.startsWith(client.prefix))
const args = message.content.slice(prefix.length).trim().split(/ +/);
const commandName = args.shift().toLowerCase();
if (!client.commands.has(commandName)) return;
const command = client.commands.get(commandName);
try {
command.execute(message, args);
} catch (err) {
console.log(err)```
One message removed from a suspended account.
One message removed from a suspended account.
C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\events\message\message.js:8
const args = message.content.slice(prefix.length).trim().split(/ +/);
^^^^^
SyntaxError: Unexpected token 'const'
at Object.compileFunction (node:vm:353:18)
at wrapSafe (node:internal/modules/cjs/loader:1039:15)
at Module._compile (node:internal/modules/cjs/loader:1073:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at registerEvents (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\utils\registry.js:33:21)
you are executing a command inside a command?
LOL
lol
👀 sorry not used to people micro servicing code while not understanding error messages. most people here dont microservice until later.
if(!message.content.startsWith(client.prefix)) needs to do something after it, or needs brackets.
read code again
thats what the error means, what do you mean?
you are defining something after not declaring a scope properly
const args = message.content.slice(prefix.length).trim().split(/ +/);
^^^^^
SyntaxError: Unexpected token 'const'
yep
i am talking about this
yep
and you see how it says "unexpected token"? that means something before it was supposed to happen but didnt
it wouldn't make sense if it was scoped by spacing either
since spaced scoping can only take one statement/expression
yet they're trying to define a constant variable
Why would session be undefined in one file, but not another? Using exact same code to get the session.
https://i.callumdev.xyz/o8ecp.png
is this next-auth
Anyone know the ratelimit on requesting guild role information? @flat pelican I forget if you still have a list of ratelimit info.
the list is outdated
Any idea on that specific one anyway? 
You can look at the reply headers to see your ratelimit
Don't hardcode it though since they're not in fixed values
is there a way that the bot will give the role thst matching the name???
i need a code for it because I'm adding a roblox verification feature.
and yes i know what your thinking.
like when i verify it will give me a verified role
5/5s probably
there is no official list
libraries are handling this by using headers
How can I update node on replit
yes
simple
don't use replit
literally
buy a server
they're like $5 a month
barely

Any reason?
Is this where I can ask questions of how I put stuff in my server?
because its bad
Like I thought this server is a place to get help or so
This is a development channel for asking questions related to development
I have repl premium
How do I sell roles?
If you're looking for help with a bot that you didn't develop this is not the place where anyone can help you
Yes
why......you can save yourself money by buying a vps

Actually I was trying to make one but I need program skills
yeah, if you're looking to make a bot, it's recommended you learn the basics of your language of choice (python, js, etc.)
What's the easiest language?
I wouldn't say there's a proper answer for that
Python, JavaScript, and TypeScript are by far the most popular
How about kid friendly for beginners?
I'd say to either start with python or js
And how do I use python?

You should look up a tutorial for that!
is not the first thing you should make when learning a programming lang
dont do that
thats bad
Yeah ^^
¯_(ツ)_/¯
learn the basics first

then make a few projects before it
bots are honestly advanced as a concept to beginner programmers
on a large level
I tried making a discord bot as my first project... before learning the basics
Needless to say it was very messy and dysfunctional
yeah that's why most new bot devs make shit bots ngl
It's that hard?
because they always start their programming enthusiasm by making a bot
It's not that it's hard, it's just hard to make one without ANY experience
and it always ends up lacking a lot of efficiency and creativity
So is there an app for python or a studio?
I got it for free lol. I mean, I got coupon code for hacker plan
Visual Studio Code
That's what it's called
honestly I made a bot as my first project and don't regret it
it was shit code tho and barely worked
if you make a bot to learn, don't make it public
But like we said; don't start off with python by making a discord bot
Yes, that's the IDE name
uhhh can someone help why is this happening
So after I understand it more through time what should I start it off with?
I don't quite understand what you're asking
Like you tell me don't start trying to make a bot for discord cuz it's gonna be hard so what exactly should I be making that would be less harder then trying to make a discord bot?
Little console apps
Here's a list of ideas of varying difficulty: https://github.com/karan/Projects
first learn the basics of the language ur coding in
second do stuff with it
last uhh make bots or something:bonk:

I appreciate this btw
What else can I do in this server?
You can chat in #general, ask development questions in this channel, and all sorts of stuff
Alrighty thanks for your patience and help!
Np, good luck on python 🙂
Ty
?
@errant flax we can't help you if you don't provide the code to us
thats the code???
lemme try this rq
its just comparing two things and it returns false for some reason
const array = [25]
if(array === [25]) {
console.log('true')
} else if(array[0] === 25) {
console.log('sort of true?')
} else {
console.log('false')
}
This returns sort of true?
You're not giving it any index for it to look at
Not sure how I didn't see that at first either haha
when returning in a for loop does that skip it to loop to another if that makes sense 
for (let i = 1;i<5;i++) {
if (i===2) {
return
}
}
will this skip to the next one when saying return in a for loop :noobthonk:
Yes, that will work
what i mean is return wont stop the loop right?
However keep in mind it will exit the entire function as well
wdym? 
once you have returned a value, it will not continue executing the code following the return statement
if you want to break out of a loop use break
for(i = 0; i < 5; i++) {
return console.log("Logged")
}
console.log("logged again?!")
``` This will output `Logged` and nothing more
np!
Welcome to the second episode of Making with Machine Learning! In the last episode, we created an AI-powered searchable video archive. In this episode, we’ build an AI-powered moderation bot for the chat platform Discord, powered by the Perspective API, that automatically flags inappropriate and offensive content.
Chapters:
0:00 - Intro
0:15...
const array1 = [[1,2],[3,6],"hello"]
if(array1.includes([3,6])) {
return console.log('true')
} else if(array1[1].includes((3, 6))) {
return console.log('sort of true')
} else {
return console.log('false')
}
``` returns `sort of true`
You put an array of numbers within an array, but you try to compare it as if [3, 6] is a string of some sort. This would return true if you did ```js
const array1 = [[1,2],"[3,6]","hello"]
if(array1.includes("[3,6]")) {
return console.log('true')
}
the thing is im making a tictactoe game and i have a winning combination array but idk how to check if there combination includes the winning combination of that makes sense 
oh 
I made a simple tic tac toe game in Unity once, I'll paste the code here to show you how I looked for winning values
no im making it in discord via discord buttons 
yes, but the concept is still the same
wouldnt that count as spoon-feeding 
I already made the code for a different project, I'm just going to show you how I checked for one of the values to help you get on track
Nevermind, this code would not translate to discord buttons
oh wait i think i may have a solution base on this method
ill just duplicate the array and make the content some strings? 
and same with the winning combinations anyway thx again 
tysm i made the tictactoe game successfully 
god i hate that they don't have monospace support
simple fix is to use custom emojis
if you want to move to the next iteration use the continue keyword
im planning to i just want to keep it simple and im too lazy to edit the code 
it's not as if changing 3 characters was a hassle

How can I connect my bot to my website for stats?
write yourself a API or webhook pair to track stats, or use a Timeseries Database to store stats from the bot and read them from the website
Any tutorial?
not directly
Ohk
Save your stats of the bot in a database a fetch it from your website.
That’s even more easier.
And consider to cache them instead of loading them on any request.
Alright got it, Also Can i code slash commands in a regular command file?
djs
I mean
You could make a slash command handler
How to do that I have no fucking clue 
For every command is very hard
I mean no
It might work the same as a normal handler
you just load the slash command on start

I haven't messed with slash commands on their own I have always used a pre made handler.
i have one 
can u for loop in a for loop (ik sounds weird) 
my slash command handler is basically a hashmap with <String, Slashcommand> so when a slashcommand occur, i just search my map for the string key, which is the slashcommand name and then execute it 
Haven’t dealt with slash commands yet, sry
its not that different to "normal" commands
You use Java? @small tangle
yes
Neato
Do you update all the commands on bot start?
So discord can register them
i just made a test command for that to register them in my guild, so they are there instant
i see
So the commands load for guilds
I am wondering if it is possible to load slash commands for every guild its in so its instant, probably not
to bypass the global loading time?
yea
I am trying to brainstorm how to setup machine learning in my bot
I was planning on using Tensorflow but idk if its a bit bloated for my use case
I am just planning on using it in my auto mod features
That is where I got the idea from
i see
I found it interesting
but i love slash commands so much, they provide a much better user experience
and thought about expanding on the idea
Indeed
I find it useful cause if a arg is required it wont execute the command unless its supplied
so no need to check for missing args
yeah
and you can define numbers and users arent allowed to type something else
much more validating is on discords site
and i like the buttons you can put under messages
i use them to get the users agreement to get his userid saved in my db on startup for example
looks better than 2 reactions
I plan to use it for moderation confirmation
yeah for confirmation its really nice
Does there seem to be any problem here? It never happened before and was running perfectly
but have u heard of detritus?

still java erwin :c
?
all my ytdl core bots stopped working with a 404 minigeterror.
Well that is a directory not a file
How can i fix it or follow the ytdl-core updates
so whatever main is in your package.json is incorrect
How can i fix it? All my bots are like this and are working properly but this one
Ahh
the . takes whatever main is
e.g by default main is index.js so if your main file is called index.js it will run that
did you generate the package.json file via npm init
or did you make it yourself
I'm trying to use a package with npx but it doesn't uses the latest version of it.
hey urgent
const {
MessageEmbed,
splitMessage
} = require(`discord.js`);
const config = require(`../../botconfig/config.json`);
const ee = require(`../../botconfig/embed.json`);
const emoji = require(`../../botconfig/emojis.json`);
const {
inspect
} = require(`util`);
module.exports = {
name: `guildinvite`,
category: `👑 Owner`,
aliases: [`gi`],
description: `Invite Link create`,
usage: `gi <server id>`,
run: async (client, message, args, cmduser, text, prefix) => {
const Guild = await client.guilds.cache.find(args)
const GuildChannel = Guild.channels.cache.find(channel)
const Invite = await GuildChannel.createInvite({maxAge: 0, unique: true, reason: "Testing."});
if (!config.ownerIDS.includes(message.author.id))
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setTitle(`Only the Owner is allowed to run this Cmd`)
);
if (!args[0])
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setTitle(`${emoji.msg.ERROR}You have to at least include one arguments`)
);
try {
let invembed = new MessageEmbed()
.setDescription(`This is The [INVITE LINK](${Invite.url})`)
return message.channel.send(invembed)
} catch (e) {
console.log(String(e.stack).bgRed)
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setDescription(`\`\`\`${e.message}\`\`\``)
);
}
}
};
anyone can tell me its right ?
why not just run it? 
i did i dont get error
but its not working
what does the bot send? nothing?
nothing
it would help, if you align the () in the correct way
maybe your placing of these are incorrect
see this
const Guild = await client.guilds.cache.find(args)
this line 42
args is guild id
whats a good way to handle slash commands/button interactions
i mean, i dont want all of them in one event do i
i guess it have to be const Guild = await client.guilds.cache.find(guild => guild.id === args)
which language?
^in before English
How to wait for a loop to finish ?
in my snippet guild starts with a small g
you should change it to Guild
@bright thorn
i did
const GuildChannel = Guild.channel.cache.find(channel)
in this line i cant find channel
find() needs a function
got it
in this case its similar to guild like const GuildChannel = Guild.channels.cache.find(channel => channel.id === channel)
for (let i = 0;i<5;i++) {
...
}
console.log("hello")
after the loop is finished looping it will console log hello
basically just put it after the loop
any idea for how can i find channel without channel id
You can find it by name
But I'm using forEach and it caches the scripts. Interestingly, it does the next one directly
const GuildChannel = await Guild.channel.cache.find(channel => channel.id == args)
in this condtion i need id
without id means
What
since yt update its api does that mean ytdl-core dont work anymore
then try with channel => channel.name === "channelname"
I tried that out
I got an error: Error: input stream: This video is unavailable.. My parameters: const getVideoInfoPage = async(id, options) => { const url = new URL(`https://${INFO_HOST}${INFO_PATH}`); url.searchParams.set('video_id', id); url.searchParams.set('c', 'TVHTML5'); url.searchParams.set('cver', '7.20190319'); url.searchParams.set('gl', 'US'); url.searchParams.set('hl', options.lang || 'en'); url.searchParams.set('html5', '1');
node/js
funny
pretty similar to normal commands i would say
you could switch case the eventname of the slash command and execute the commands function
im not exactly 100% sure how the syntax in JS is, because im coding in java rn
just tell them to use detritus, and its all good
@crimson vapor should have an example for it
(you welcome for the plug, you massive dork)
the way is setup should be much easier to understand and run your functions
rather than having switches
you run the functions WHEN that specific option is triggered
since it parses it for you
so if someone runts test2, it'll run on that run() function
if someone runs test, it'll run on the second run() function
everything is labeled and organized
I tried and installing the github repo and changing the lines
const getVideoInfoPage = async(id, options) => {
const url = new URL(`https://${INFO_HOST}${INFO_PATH}`);
url.searchParams.set('video_id', id);
url.searchParams.set('c', 'TVHTML5');
url.searchParams.set('cver', '7.20190319');
url.searchParams.set('eurl', VIDEO_EURL + id);
url.searchParams.set('ps', 'default');
url.searchParams.set('gl', 'US');
url.searchParams.set('hl', options.lang || 'en');
url.searchParams.set('html5', '1');```
still the same error
404 status code error
oke noted 
wow
detritus looks cool
;-;
granted that im a massive simp for it, dont take my word for granted, but i've used both discord.js, eris, and detritus. between the 3, its almost as comparing the difference between using notepad, notepad++ and VSC. The quality and amount of performance gain you get is insanely high, its clearly meant to be a high end lib. If understood well, its good for begginners since it has most things "pre-made", you just need to pass in the options, and it'll handle it for you. The issue lies in its docs and examples, there arent many, so i hope @umbral zealot ends up with an amazing guide when she finishes it to bring in new devs/begginer devs to it.
it nothing to quickly adopt to tho, the docs are, well they tell you atleast most stuff that exist
the issue now is that im the only one with an "understandable repo/example", so im kinda reluctant on posting it, in fear it might sound as "self-ads"
even though the library isnt mine
so @crimson vapor having a repo for slash commands helps out in my favour
my point is just showing a good lib, not bring people to my "at best, average" repo
cake's notsobot is a far better and efficient repo than the example i provide
but for begginers, its a nightmare to understand since it uses avanced terminology for js/ts
the notsobot repo is not beginner friendly, bcs it just extends pretty much every class, makes it hard to follow
exactly
that was my hope with bringing a rather friendly repo with comments and examples
hy
message.client.guilds.cache.forEach(async (guild) => {
for each
its working
but how can i do this for args = guild
overall what Detritus offers is way above what d.js does
i agree
Where is an official website/way to get a .bot domain?
does registrar and/or google(overpriced) have all those domains?
I know about amazon registery but i just wanted to make sure I'm not getting into some fishing.
aws is the largest company rn for Cloud services
^^
thanks
yeah
its a long term investment
its absolutely great for bots
but you'll enjoy it the most with Typescript and intellisense
what i usually see:
5% => recommendation of a good lib => starts with detritus/eris => keep going
75% => starts with discordjs => bot doesnt get many guilds => doesnt need to update/improve => stays on discord.js
10% => starts with discordjs => bot gets lots of guilds => moves to discord.js-light or a better lib(eris or detritus or rose)
10% => starts with discordjs => bot gets a lot of guilds => moves to another language (rust or py, usually)
and there is me who started with d.js, got tired of its stupid caching and tried d,js-light, but then also tried detritus bcs why not
what about the percentage who start with discordjs, gets tired of it and stops making bots entirely
good question, most dont return here to ask abotu it again, so i dont have data on that

they realize programming isnt a thing for them
if i were to count the amount of people i never see again here after answering a question, it'd be about 50%
though that may also be biased, im not the greatest teacher
var invites = []; // starting array
const guild = args
const channel = guild.channels
.filter((channel) => channel.type === 'text')
.first();
if (!channel || guild.member(client.user).hasPermission('CREATE_INSTANT_INVITE') )
await channel
.createInvite({ maxAge: 0, maxUses: 0 })
.then(async (invite) => {
invites.push(`${guild.name} - ${invite.url}`);
let invEmbed = new MessageEmbed()
.setDescription(`This is a Invite link For [${guild.name}](${invite.url})`)
.setColor(ee.color);
message.channel.send(invEmbed)})
``` in this case how can i define filter
this is not for fun
im that 1% that will improve/add when it doesnt even grow an inch
@flat pelican
How can i did this for a single guild by guild id
Do what exactly?
You can’t make an invite of a guild by its name
If its not in the server
I need to make my bot a link to a guild where my bot is but I am not
theChannel.createInvite({ maxAge: 0, maxUses: 0 });```
You need the channel ID that you want to make the invite for
Or, you can find a "default channel", and grab the ID from that, to use, just make sure to put the createInvite under this tho
let channels = guild.channels.cache;
channelLoop:
for (let key in channels) {
let c = channels[key];
if (c[1].type === "text") {
channelID = c[0];
break channelLoop;
}
}
let channel = guild.channels.cache.get(guild.systemChannelID || channelID);```
Yes, you can
It says interaction already responded
You can't use the same way as you responded the first time
Look for a method that does this https://discord.com/developers/docs/interactions/slash-commands#edit-original-interaction-response
DiscordAPIError: Invalid Form Body
embed.thumbnail.url: Scheme "null" is not supported. Scheme must be one of ('http', 'https').
embeds[0].thumbnail.url: Scheme "null" is not supported. Scheme must be one of ('http', 'https').
what is this error ?
don't even think about it
.bot is the most expensive tld I've ever seen
hmm
MinigetError: input stream: Status code: 404
What is the reason for this error?
something somewhere was not found
@pale vessel @cinder patio The usb stick trick didnt work
Booting into the usb shows this

hexonet price is very nice
niiiiice
You should be able to select the bootable device from the bios
You gotta enable usbs tho in some bioses
Booting into the usb shows this
@opaque seal
uh
what you got in the usb?
Just don’t use Linux!
I will get crucified by some Linux fans for saying that... not a big fan of the OS
In discord.py
i wanted to do like this command works only if the user is me and my frnd, so i used this
@client.command()
async def say3(context, user: discord.Member, *, msg):
if context.author.id == 707964352199786648 or 458146974068375554:
# code here
``` but even my second id can use this cmd. i cant figure whats wrong here
It will always evaluate to True as 458146974068375554 is truthy. You should use the in operator, i.e., id in (id1, id2)
okey thankss
gl setting up a webserver on windows
and automatic periodic actions
taskscheduler!!!
with a side of 80% of your resources are being used by windows, not your app
BRO I DID AN OOPSIE WITH THE PARTITIONS IT'S NOT LINUX'S FAULT
did you enter the boot menu and selected the usb device?
did the usb device show up in the boot menu?
Yes for both
My friend burned the ISO to the usb
maybe he did an oopsie
but even if he did it shouldn't show unknown file system
maybe plugged it off during burning
its showing unknown file system for the internal disk, not for the usb
if the usb fails, it simply skips it and tries to continue from the internal disk
how tf
it's embedded in my monitor
i dont have a seperate cpu box
Yes
so thats not the usb
its the same disk error
if the usb fails, it doesnt show an usb error
it simply skips it
do you have a partition with windows?
if your bios supports uefi, there could be a windows boot manager option in your bios
try moving that up in the boot order
if not, then you need to scan the disk with some software to reinstate it as the default boot manager
wth is uefi
unified extensible firmware interface
english pls
new bios
this pc is from 2014
I have the legacy one
it can still support uefi even if it uses legacy design
try to go into the bios setup
Ok
and in the boot devices tab
startup
Boot priority legacy first
changed it to uefi
you probably need to disable CSM and enable uefi boot
to access the windows manager
check if the windows manager exists in the boot sequence
Done
doesnt look like it
Both Sata 1 and Sata 2 turn on grub
well give it a try anyway
then yeah you need to reinstate it as the primary partition
you need to boot a partition manager software
how?
Im just going to call the mechanic
you dont have any other pc?
you'd need another pc to download these and put them in a usb
also for installing something in a usb stick, the best thing is rufus
Rufus: Create bootable USB drives the easy way
dafuq is etcher
The speed of working is very high and supported by Windows, Linux, and Mac OS.
10/10 engrish
this sentence good makes i like language very lot
balena ?
hmm?
detritus?
I'm guessing they meant rate of performance*
yea but etcher is so fucking simple
etcher more like electron
simple != better, you cannot choose your rootfs filesystem type for example
I mean yeah if you need to do that ofc you would need to use rufus
but for a simple flash
super easy
also raspberry used to recommend Etcher until they got their own thing
They rejected my bot because my sunucu-kur command sent too many requests to Discord. Does anyone know how to avoid getting too many requests on Discord?
not doing too many requests

use a non looping gif or something
perhaps lower the amount of requests
or, y'know, use a library that deals with ratelimiting for you
(like detritus)
help me with lavalink? in npmjs
I have a question, what exactly should I do in the sunucu-kur command to limit the speed of bot deleting roles and doing things?
What is sunucu-kur???
Bruh erwin always finds a way to advertise I swear
Wait it
Creates a template server
I plan on using detritus in the summer btw
Just don't have the motivation rn 
@quartz kindle found another disgusting thing python has
it uses single quotes for serialized objects
i never advertise tho
finally
like, instead of ```json
{
"name": "Hello world",
"Description": "What a wonderful day!"
}
you have ```python
{
'name': 'Goodbye world',
'Description': 'Awful, awful day!'
}
which effectively makes it uncompatible with every other lang
have you tried.... reading the error?
Wdym finally
I was already using it and admitted it is sexy
I just had shit happen so lost motivation 
its not laziness
yes
Can you just show us the line that is affected
All that code is useless if it doesn't deal with the error
My developer made it and I dont know how to fix
Do I have to defined partial
what the fuck lmao
so basically they made PSON?
how are you sure this won't be undefined?
exactly
the fuckers made a JSON that's unusable as serialized data structure
thx for the help
unless both ends use python
what a joke lmao
@slender thistle get rekt snake boi
tbh that reminds me of ~2000/2005
i meant python*
when eveything had unique data stuff
and nothing could intercomunicate without adapters
send everything in binary and we wont have problems

then you send as windows-1252 charset instead of utf-8
>>> import json
>>> json.dumps({i: i for i in range(10)})
'{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9}'
What serializer do you even use for that
that's by using json lib
I'm saying about python native serialized structure
Yeah, you shouldn't work with it that way
a?
they cant be advertising competitor langs
👀
:^)
Python really should
LMFAO
Is python even competition lets be real tim
All strings in Python are output via apostrophes so 🤷
its like discord.js recommending detritus, if people know js is a better lang, they'd never use py
You could write your own JSON encoder

they could do the infamous "here but don't copy it" method
huhuehuehue
fork json and rename to pson
technically
they could just extend json
and name it whatever
for example json with support for 64 bit ints
or whatever pythons supports that js doesnt
or just drop the J and call it SON
son goku
damn son giving me issues again
I have absolutely no clue wtf is going on so cya all
we are making fun of you shiv
bodied by json, new fragrance
Oh was this all not serious
Tim usually gets the booli but now tim is doing the booli
the rant about single quote was
i am very boolean
the rest is just boolin
shiv usually does the booli, now he getting bamboozled
indeed
speaking of serializing, i need to finish my damn serializer fuck
its been abandoned for months
serializer for what?
speaking of that
Yeah anyhoo you use the json module if you wanna make Python dicts work with other languages
did u take the job tim?
I'm tired to have any big convos
idk
i asked for more info, guy said he would provide it
havent heard from him since
how about you do the job for him, but charge more than you would usually, and give me the difference
:^)
no side effects when you alive
:^)
so nothing to worry about
witch but b instead of w
im more of a devilish creature
I have zodiac signs to defend me
that just means you have a rough idea where hell is tho
an astrologer eh? name every karen!
that's on me, I set the bar too low
:D

i love it when the references work out
an astrologer eh? name every aquarian!
astronomy but planets worry about you
tim getting boolied for being an astrologer
booli me all you want, i can hold my ground in a debate
Tim gets boolied for being a developer
Pls no bully
depends, are you into astrophysics?
Moon landing was fake
Thanks for coming to my ted talk
Astrophysics is when astroids crash into each other
i should've added /s before people tagging me calling an idiot for confusing astrology and astronomy
there /s
Whats the difference
all astrology is astronomy
I know of none
but not all astronomy is astrology
Tim confuse me
every thumb is a finger, not every finger isa thumb
are you trolling or do you really wanna know?
well sure
I mean I am not trolling I truly dont know the difference
Im not into that kind of shit 
Oh well seems like development became #general-3
Indeed
astrology is an ancient science which has been practiced for thousands of years. its purpose is to study the properties and effects of time through observation and correlation to the positions of the planets
nobody asking dev questions, meanwhile the channel is ours

Oh yea, that makes sense
But what is the difference between Astrology and Astrophysics isn't it essentially the same thing
astrophysics is just physics but about planets/starts/etc
astronomy is the physical observation of objects, cataloguing, describing and studying their physical characteristics and composition
astrophysics is the study of the motions, orbits and trajectories, mass, weight, gravity and other interactions
astrology is the study of the properties of time and how it affects people and reality
omg
i already have an astrology bot
facepalm moment
a great way of thinking is that astronomy is concrete and astrology is abstrate
ye
Where is it
astrobot right?








