#development
1 messages · Page 1010 of 1
@pure lion ??
Wdym they reset
@pure lion ??
@cobalt spruce *channels
i tryed@earnest phoenix
Wdym they reset
@pure lion they reset to git repo state
i tryed@earnest phoenix
@cobalt spruce well thats correct soo
@cobalt spruce is that a console log channel?
@solemn latch ok
@cobalt spruce is that a console log channel?
.
-dotpost @pure lion 
.
<client>.channels.cache.get(`7270844755231657289`)
@pure lion i used the general channel id to test
Anyone wana test my new bot
Me
Asked in literally every channel
@pure lion i used the general channel id to test
@cobalt spruce what general channel?

Message doesn't exist anymore
@quartz kindle ```js
let prefix; // define balnk variable with any name you want
let prefixes = await client.db.fetch(prefix_${message.guild.id});
if (prefixes == null) {
prefix = "d-"; // default prefix if no prefix set for this guild
} else {
prefix = prefixes;
}
if(message.content == "@void zenith")
{
message.channel.send(My prefix is \`+ prefix +`` for this guild!`)
};i still need help with this thingy how to make it work with my mongo db?
Because you changed it to channel
try .send
it worked
how can i do setprefix command with quick.db?
const Discord = require(`discord.js`)
const db = require("quick.db")
const default_prefix = (";")
module.exports.run = async(bot, msg, args) => {
if(!msg.member.hasPermission("ADMINISTRATOR")) {
return msg.channel.send("You are not allowed or do not have permission to change prefix")
}
if(!args[0]) {
return msg.channel.send("Please give the prefix that you want to set")
}
if(args[1]) {
return msg.channel.send("You can not set prefix a double argument")
}
if(args[0].length > 3) {
return msg.channel.send("You can not send prefix more than 3 characters")
}
if(args.join("") === default_prefix) {
db.delete(`prefix_${msg.guild.id}`)
return await msg.channel.send("Reseted Prefix :white_check_mark:")
}
db.set(`prefix_${msg.guild.id}`, args[0])
await msg.channel.send(`Seted Bot Prefix to ${args[0]}`)
}
@pure lion bro i just wanted to make a log channel tells when i make a channel
my brain is my ass now
@cobalt spruce ok that's easy lma9
Send the message to the channel you got
const Discord = require(`discord.js`) const db = require("quick.db") const default_prefix = (";") module.exports.run = async(bot, msg, args) => { if(!msg.member.hasPermission("ADMINISTRATOR")) { return msg.channel.send("You are not allowed or do not have permission to change prefix") } if(!args[0]) { return msg.channel.send("Please give the prefix that you want to set") } if(args[1]) { return msg.channel.send("You can not set prefix a double argument") } if(args[0].length > 3) { return msg.channel.send("You can not send prefix more than 3 characters") } if(args.join("") === default_prefix) { db.delete(`prefix_${msg.guild.id}`) return await msg.channel.send("Reseted Prefix :white_check_mark:") } db.set(`prefix_${msg.guild.id}`, args[0]) await msg.channel.send(`Seted Bot Prefix to ${args[0]}`) }
@vivid ravine thats my code
@vivid ravine why are you limiting the length
idk
Don't
Some people like to set the prefix to your bots tag
You could have a prefix like peepeepoopoo
true
i changed it
but when i do prefix !
its says set the prefix to ;
but when i do help
with the new prefix
its not working
@vivid ravine are you refining prefix everywhere it's called?
@pure lion sry my english is bad
Oh god
@pure lion const channel = message.guild.channels.find(channel => channel.name === "general") if (!channel) return;
will this work
try it
Didn't you already get a channel in your earlier example?
;-; basics
@earnest phoenix IDFC my first code
Bots are complex subjects, doing something on an event is about the simplest thing that happens in a bot.
A discord bot is a good third project maybe 4th
It would be better to start with things that build up skills imo
Somone please help me
Python
When I try to do
@client.command()
async def translate(ctx, lang="en", *, args):
#translate with the lang in a way I am not gonna show you```
It shows a MissingRequiredArgument Error even though I said `lang = "en"`
don't u need to give an output lang?
help!
(node:4) UnhandledPromiseRejectionWarning: TypeError: oldRole.hasPermission is not a function
#development message help
I needed to use : instead of =
@earnest phoenix I dont think roles have hasPermission
Thats for members
^ where to get the methods for roles
Still mot working 😭
@solemn latch oldRole.has() ?
Lol
I suggest looking at the docs
They will tell you what does and doesn't exist
Instead of just shouting random things that could potentially exist
how i add permisions?
HUGE
that's a very poor excuse
someone had the work to write all that info in a clear way
Its also generally speaking your main resource
Whenever your working with anything, docs are resource #1
#2 is google
Well, some people use Google to get the docs. So maybe Google is number one
forums are #0
Forums are generally last resort for me
lol
Solving something yourself is better long term.
No
Whatcha mean
It's not
it just shows message is not defined
Go and read them again
@earnest phoenix
const exampleEmbed = new Discord.MessageEmbed()
channel.send(exampleEmbed);
Spoonfeeding
@cobalt spruce we don't spoonfeed here
i see
What is spoonfeeding?
@earnest phoenix i can link you a Tutorial in how to get a per server config with mongoDB
lol
spoonfeeding means giving someone entire commands as code as example
Ooooh
spoonfeeding is helping someone by giving them everything without them doing any effort in doing it themselves
Oooh
how i get this? https://gyazo.com/0ba3c9fd2975b865765fa0efdffed5c8
why do I have a Cannot read property 'send' of undefined" ```
module.exports = {
name: "reset",
description: "turn the bot off (OWNER ONLY dont try :))",
execute(message) {
const Discord = require('discord.js');
const client = new Discord.Client();
const { description } = require("./fkick");
const channel = client.channels.cache.get('706152605574889584');
if (message.author.id === '362991657236561923') {
// inside a command, event listener, etc.
const exampleEmbed = new Discord.MessageEmbed()
.setColor('##ff0000')
.setAuthor('astral status', 'https://cdn.discordapp.com/attachments/675371978386833428/704717055877972038/4a425077ed2809403254ffec40454752.png')
.setDescription('astral have been disconnect by an admin !')
.setTimestamp()
.setFooter('astral beta build', 'https://cdn.discordapp.com/avatars/674611545279299598/d0fa76ad86b1966a4a4995b49009bf3d.webp?size=128');
channel.send(exampleEmbed);
setTimeout(() => {
process.exit();
},5)
}
}
}```
everything is good
no?
@slender thistle you there?
@regal raven I was there but also not, is the issue still up?
how can define client as this.client lol
u talk to who?
@lofty lagoon do the channel really exist?
yes
o h
I imported data and it worked. But every query returns none even though there's data in the imported table? What can be the iseue
anyone :d?
well since I'm not getting a response I assume the issue was fixed
@lofty lagoon you're creating a new discord client
@quartz kindle so how I dont create a new client cuz I cant remove the new
Make sure message is defined
how tho?
Can't say without your code
I’m having trouble keeping my bot active
Is it just crashing? Or are you using a service like glitch?
Promise { <pending> }Logged in as PROBOT#4452!
/home/runner/QuestionableGrouchyModularity/index.js:15 channel.send(embed); ^
ReferenceError: channel is not defined
at Client.<anonymous> (/home/runner/QuestionableGrouchyModu
larity/index.js:15:5)
at Client.emit (events.js:310:20)
at Client.EventEmitter.emit (domain.js:482:12)
at MessageCreateAction.handle (/home/runner/QuestionableGro
uchyModularity/node_modules/discord.js/src/client/actions/Messa
geCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/
QuestionableGrouchyModularity/node_modules/discord.js/src/clien
t/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/Questionable
GrouchyModularity/node_modules/discord.js/src/client/websocket/
WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/home/runner/QuestionableGrouch
yModularity/node_modules/discord.js/src/client/websocket/WebSoc
ketShard.js:436:22)
at WebSocketShard.onMessage (/home/runner/QuestionableGrouc
hyModularity/node_modules/discord.js/src/client/websocket/WebSo
cketShard.js:293:10)
at WebSocket.onMessage (/home/runner/QuestionableGrouchyMod
ularity/node_modules/ws/lib/event-target.js:125:16)
at WebSocket.emit (events.js:310:20)```
@solemn latch I’m using glitch
Channel is not defined
@lofty lagoon you have to use the same client you already have. you can get it from message
Your error is channel not defined, not message @earnest phoenix
glitch banned all ping services
^
Glitch can't be used for 24/7 bots
@lofty lagoon all discord.js structures have a link back to the client, including message, so for example message.client links back to your original client
Make sure channel is defined to the channel you are sending to @earnest phoenix
means?
Nice ads
nice try
oh hey
Yea joao is just spamming ads
@solemn latch am sending it in a text channel
I dont understand where I put the message.client
@earnest phoenix if you want to send a message to the origin of message, its as simple as message.channel.send
thats the problem
@lofty lagoon top of the command
it says message not defined
Promise { <pending> }
Logged in as PROBOT#4452!/home/runner/QuestionableGrouchyModularity/index.js:15 message.channel.send(embed);
^
ReferenceError: message is not defined
at Client.<anonymous> (/home/runner/QuestionableGrouchyModu
larity/index.js:15:5)
at Client.emit (events.js:310:20)
at Client.EventEmitter.emit (domain.js:482:12)
at MessageCreateAction.handle (/home/runner/QuestionableGro
uchyModularity/node_modules/discord.js/src/client/actions/Messa
geCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/
QuestionableGrouchyModularity/node_modules/discord.js/src/clien
t/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/Questionable
GrouchyModularity/node_modules/discord.js/src/client/websocket/
WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/home/runner/QuestionableGrouch
yModularity/node_modules/discord.js/src/client/websocket/WebSoc
ketShard.js:436:22)
at WebSocketShard.onMessage (/home/runner/QuestionableGrouc
hyModularity/node_modules/discord.js/src/client/websocket/WebSo
cketShard.js:293:10)
at WebSocket.onMessage (/home/runner/QuestionableGrouchyMod
ularity/node_modules/ws/lib/event-target.js:125:16)```
@solemn latch .setFooter("Ahx", https://imgur.com/LIH0Ugx)
do i add icon to footer like this??
Okay, then we need to see your code to have any chance of helping for that one
Same as any other thing in an embed
its vulgar asf lemme change it
Can somone help me get my bot to be online all the time
Embed.setFooter
@eager citrus glitch charges $10 a month to do that, or change platforms
@eager citrus don't use glitch
Your message is defined as msg
^
it worked
What platform can I use on mobile
Learn to debug your code kthx
@earnest phoenix is it for mobile
Most anything you do on a desktop, can be done on mobile these days
Heroku says its platform isn't intended for discord bots. Expect them to do the same as glitch and ban bots from their platform if you dont pay money @cobalt spruce
French ?
@lofty lagoon top of the command
@solemn latch I use a module.export
but for the const client = new Discord.client
Don't use that
I just remove this
heroku won't do a thing against bots, it's just so badly optimized for them that you'll be giving up on performance
also, unless you register a credit card, you'll have only 22 days of uptime

Then your bot gets randomly taken down
And you gotta fix it while you lose users and servers
@solemn latch yes i tested and it didnt get down
ReferenceError: client is not defined
name: "reset",
description: "turn the bot off (OWNER ONLY dont try :))",
execute(message) {
message.client
const Discord = require('discord.js');
const { description } = require("./fkick");
const channel = client.channels.cache.get('706152605574889584');
if (message.author.id === '362991657236561923') {
// inside a command, event listener, etc.
const exampleEmbed = new Discord.MessageEmbed()
.setColor('##ff0000')
.setAuthor('astral status', 'https://cdn.discordapp.com/attachments/675371978386833428/704717055877972038/4a425077ed2809403254ffec40454752.png')
.setDescription('astral have been disconnect by an admin !')
.setTimestamp()
.setFooter('astral beta build', 'https://cdn.discordapp.com/avatars/674611545279299598/d0fa76ad86b1966a4a4995b49009bf3d.webp?size=128');
channel.send(exampleEmbed);
setTimeout(() => {
process.exit();
},5)
}
}
}```
I put it
Suuuup
you need to set it as a const client
o h
Or replace all client with message client
Bots just a bad way to do it imo
Theres already something called bot in the library
User.bot
Also, bot makes it sound like its the entire bot, which is only true until you start sharding
Ok true
When your sharding, client is absolutely more accurate
never gonna shard<

bot too smol<
the class name itself is Client
^
But you can call it noopnoop
yup, but the internal class name doesnt change, and its also standarized as client everywhere
for example, you can do bot.guilds but cant do message.bot, you have to do message.client
Which is confusing
so yeah, its a matter of preference, but calling it client is the same as starting a new zelda game and naming your character "link", it even gives you bonus stuff for using the original name
wait, does it?
anyone know a proper way to build a jar file with maven
I've tried mvn install and when I run the jar file
it just does something not normal
Jar = java?
use ShadowJar
shadowjar creates a "fat jar" containing all ur dependences and code
which is executable
aka, a jar of dirt
java's package managing is a clusterfuck 
yikes
Jaja
kuuhaku that looks like a gradle-only plugin
meh
maven also has their own shade plugin iirc
just search "maven fat jar" and you'll get some options
imho gradle is easier to use on bigger projects
lol it's the exact oposit for me
it's just preference ig
i use dotnet which also has xml structure for project files
so i prefer maven because xml
also, do you have any clue on how to publish a library to mavencentral?
no clue i never had to
ah
fun
no main manifest
oh, even more fun
stack overflow has only answers that won't work
how to edit my bot's site? (not edit)
yes
@lyric mountain have you ever had that issue with shade
where it makes a jar but then says there's no main manifest
never used it, I use gradle for my projects
F
see if cry has experience with it
what is the eval to fetch an invite from a server d.js v12
I imported data and it worked. But every query returns none even though there's data in the imported table? What can be the iseue
i think its actually importing data as wrong data type
in which encoding should i export it
How do you get the website id to make the bot
website id?
Yes
i log my url for mongodb and it comes up with this auth: [Object],
so uuhh is my password not done correct?
How long does it take to be approved
?
Your own bot
Holy
2-3 weeks
Dam
what is the eval to fetch an invite from a server and have it dm me the invite d.js v12
Uh
Me?
like if im in the server
Look at the docs for the invite constructor
remember that getting invites to a server you're not invited to is a serious privacy breach
^^^ that too
@lyric mountain well i need to check if a server a bot farm
uhh no field thing?
@earnest phoenix it's finee
wdym
Ignore the warns
just record command usage in a log, it'll became crystal clear whether it's a bot farm or not
@silent berry i really dont think theres any way you can do that in a moral manor other than getting the owner tag and adding him as friend, then asking for permission. You can monitor the amount of commands coming from that server and blacklist your bot from there, but spying on a server that your bot is in is just absolutely immoral
its your bot, your service, you are allowed to blacklist servers from using it if you wish, if you have suspicion about people abusing your bot
@opal plank i would log things but my bot runs on high memory usage for some odd reason. a friend said its bc i have too many console.log's
but ok thank you all
const Discord = require(`discord.js`)
const db = require("quick.db")
const default_prefix = (";")
module.exports.run = async(bot, msg, args) => {
if(!msg.member.hasPermission("ADMINISTRATOR")) {
return msg.channel.send("You are not allowed or do not have permission to change prefix")
}
if(!args[0]) {
return msg.channel.send("Please give the prefix that you want to set")
}
if(args[1]) {
return msg.channel.send("You can not set prefix a double argument")
}
if(args[0].length > 3) {
return msg.channel.send("You can not send prefix more than 3 characters")
}
if(args.join("") === default_prefix) {
db.delete(`prefix_${msg.guild.id}`)
return await msg.channel.send("Reseted Prefix :white_check_mark:")
}
db.set(`prefix_${msg.guild.id}`, args[0])
await msg.channel.send(`Seted Bot Prefix to ${args[0]}`)
}
When i do prefix (the new prefix)
Then it send set the preifx to (the new prefix)
how are you definding args?
args is usually defined AFTER you got the prefix
So how can i fix it
show args
default_prefix = (";") can you actually do that
I believe it would run as just the string
Usually you'd want something along those lines, but if you are ALREADY PASSING args onto the command, it wont matter if you are using it by default
you need to check prefix before you set args
so it's possible? bruh
@vivid ravine
So can you show me how to fix it
im assuming what he's got going on is the args being set on the message event, then passing args onto the module, then trying to check prefix there(which wont work cuz he already has args defined)
@glad charm random bot dm (prob triggered msg above)
ok
i copy-pasted your message in testing-2 and didnt get a dm
ah it was already kicked
was about to say that
mods be fast
wait the mod-log says it was dms on every message lmao
ooof imagine the amount of complaints
i could delete my msg above, pinging a random mod, but then they'll have a ghostping, gonna leave it as is
i just noticed #memes-and-media going nuts about that bot lmao
uuEu
I want to store stuff like guild count, user count, number of recently run commands, and a handful of other things, over time(probably just because that data seems fun to look at)
Anyone got some ideas on that? I was looking at time series databases, and im not really sure what im looking for.
bla bla bla
Ehh, any actual database should be fine if you implement caching as well
honestly, figured that was the case.
TSDB I would think wouldn't be too beneficial until hundreds of thousands of rows, which storing data every 30 minutes, ill never hit that
The way I used to store stuff is on event, I'd cache anything needed for the bot to function properly (guild settings like custom prefixes), that and the rest is saved in the database but isn't stored in memory
little question what is the function for check if the user have perms cuz I try to use (member.hasPermision('KICK_MEMBERS') but it's say this is not a function
show full snippet
k wait
the script java module.exports = { name: "kick", execute( message, args) { const kick = message.mentions.members.first(); const member = message.author; if (member.hasPermision('KICK_MEMBERS')) { if (!args[0]) return message.reply("you need to tag a user to kick."); kick.kick(); message.channel.send (`I sucessfull kick ${member.tag}`) } }}
ah, yes, that works
TypeError: message.member.hasPermision is not a function
looks like you might have spelt hasPermission wrong
im removing 5 internet points from myself for not seeing that typo
TypeError: member.hasPermission is not a function
let log = bot.guilds.channel.find(c => c.name == "logs")
"find" is undefiened
i wanted to get all channels has name logs and send msg to it
find is something separate i think
dude i tried
fun fact: get uses find
nope
you have to update to v12 soon anyway
if i use v12
you should update since v11 will stop working soon
yeah
mhmm
intents
imagine not updating
there is a guide showing how to update from v11 to v12
theres like 5 main diffrences
https://discordjs.guide/additional-info/changes-in-v12.html @earnest phoenix
all inside guild or all in your cache?
wut
i dont understand
message.mentions.members.first().id
will this work in v12
?
?
Here's a global question that might come out true: Are you willing to find someone to make a software that will help you develop something? And what would you let that software do?
yeah @earnest phoenix
what?
ok
@surreal sage what you on about?
a program that helps me do dev work?
@surreal sage what you on about?
@opal plank suggestion for a app
i already have vsc, not much else i need
if there was a plugin for VSC that would take me to the docs page for specific text
bot.channels.cache.get("716995043323412562")
that would be amazing
this is v12 right ?
if there was a plugin for VSC that would take me to the docs page for specific text
@solemn latch no
exstensions
that aint a app lol
wait a npm package alr lol
@earnest phoenix that get that channel, indeed
i still dont know what dev is on about
nvm lol
gets the channel with that id
basically, yes @earnest phoenix
yes
though prob not what you looking for
so it will work
cuz you want name match
not id match
you could loop cache and get channel name for matching
richembed was replaced
const {RichEmbed} = require("discord.js");
Discord.MessageEmbed()
by messageembed
its on the changes page
🤔
you dont need to go through each error with us, its explained on the page you where given
https://discordjs.guide/additional-info/changes-in-v12.html keep this open
how can I turn a json response into something users can understand
wat
parse
gusy i need
help
how i can find all word RichEmbed in a folder and replace it
in vscode
ctrl + f
VSC?
no i want it to turn this https://paste.vurighosting.com/view/716c8199 into something like this
Botvrij.eu - detected: false - result: clean site
next one
next one
you cant do on folder i dont think though
parse it @obtuse jolt
the magnifying glass
i did but the ammount of data changed every time
so i cant just
display it perm
it changed
@obtuse jolt https://www.w3schools.com/js/js_json_parse.asp
check if property is there, then parse it if it is
parsing means pretty much means get things from other things in an organized way.
i dont see the issue
PARSE IT
THAT IS PARSED
description: `
obj.name
obj.birth
obj.city
`
])```
yes i could do that for all 79 of the things but sometimes is 60 sometimes its 80
it keeps changine
but idk what they are all called
bruh
what is .addField in v12
.addField
TypeError: fields.flat is not a function
Parsing Phase and post phase
in parsing you get all the properties of your JSON response and then organize them into an obj to be used on the post phase
on the post phase, you already have the obj arranged nicely to be sent, but its an object, so you parse it to be send
@obtuse jolt
is there not a way to go through each entry and do it
Does anyone know how to make there bot online 24/7
dude
buy a VPS @eager citrus
What’s that
smh
oh you want an object
What’s a vps
for(key in object)
^^
Virtual Private Server
Oh
@solemn latch
give the entire error
ok
can you show a little more
as properties
now show where you have the error. and please more than 1 line
How do i remotely access postgre sql
for example same error
with .addfield
or fields
smh
i hate v12
i want to go back with v11
smh
honestly, i dont think dev work is for you if you dont like breaking library changes
they are very common, and its your job to maintain them
🤔
any1 know how to get the shard ID of the client in v12?
This might help you mate @wet ferry
https://discordjs.guide/sharding/additional-information.html
thx
NP mate
how do i get system time in discord.js
nvm i got it
some is something in javascript
its not a feature of discordjs, so it wouldnt be in the docs
Shitposting in #memes-and-media please
Okay
could i slice more than 1 value out of a string?
Is there a possible module/package or api that i can use to check if an image includes a specific image?
@errant perch yea
how
You mean like how exactly, define what you said tho
args[2] you mean?
slice(2) ?
lit
args.slice(2)
yes
ok lit
Is there a possible module/package or api that i can use to check if an image includes a specific image?
Ideas?
Integrate TinEye’s reverse image search engine to automatically retrieve results from the TinEye index.
@earnest phoenix
Oh thanks i'll look into it
reverse image search is expensive
just like photo to text is expensive
might be able to get something cheaper with google, but it still wont be free
hey guys. do any of you know how to upload an image from my pc to a discord embed (discord.py) i know i can use a URL but that is the problem as i have the image on my pc
i generate it in code
you could make a webserver on your pc to host it.
or make the code you generate it on run on the same server as your bot
I mean it was in the documentations
Does anybody have experience with playing Spotify songs with ytdl-code (discord js)? Because I have literally no idea how to do that. I have implemented the web api from npm. But how do I play the link?
you're not allowed to
I mean you can get the name of the songs and then use YouTube to find and play
what is wrong with this?
message.guild.fetchInvites('702261250603745358').then(() => { helium.users.cache.get('550170362248429568').send(invite.code) })
i don't know you tell me
also technically its against YouTube TOS to download videos most likely
spotify does not allow restreaming to other platforms
How come that there are bots that are able to play songs from Spotify?
they don't
they take the song name and do a youtube lookup
yes
How can you take the song names out of a URL 😕
I mean with consent its okay
no lol, spotify does not allow restreaming of any kind
ye
If you want to search on yt use ytsl api
they already know that
tldr none of the bots actually play music from spotify, they scrape the spotify page to get the artist name and song and then do a youtube lookup instead
I know there is a library for Python which can get the songs names from URL and store it in a txt
ye
I might be able to use the spotify api to get the song name from the URL and then search on yt
If I have understood you correctly this might be the only way of doing it right?
Yeah I mean look at a Spotify link
it's very much possible
Just a bunch of numbers
i don't think you understand what scraping means
That may be true as well xD
scraping is making a request to the url and the parsing the html content to get what you need
Since sql only allows flat values i cant save array in it
Im thinking of storing something as a string for example
blabla blablabla bla b l a
This basically would be then .split(" ") into 6 items
So what my question is
Is there any limit of characters in a string in SQL or Nodejs
And is this Efficient?
hence "scraping"
Looool
That's next level shit
I gotta read me into that
Is that efficient tho? Cause it can crash everything by just changing their html on the website
just started better-sqlite3 a while ago
Since sql only allows flat values i cant save array in it
Im thinking of storing something as a string for example
blabla blablabla bla b l aThis basically would be then .split(" ") into 6 items
So what my question is
Is there any limit of characters in a string in SQL or NodejsAnd is this Efficient?
@small prairie
there's always a limit to everything, however that limit is huge. the limit is as much memory can be allocated to the string, and yeah, it's common practice to split
Is that efficient tho? Cause it can crash everything by just changing their html on the website
@hidden lynx
crash?
and i mean yeah, if you write good code for it scraping can take under 200ms
I mean im doing it for a private bot which has like lets say 170k members
Lets say if i wanna store all of their ID's
Will that hit limit?
why do you want to store all of the ids
I don't
Im just giving the worst case scenario
Sorry lol
if somehow everyone does something and it has to stored
i know i wont even get like 2k ID's to store
Just curious......
the limits are exponentially huge
The limits depend on the ram or something else?
on the ram, yeah
but considering a string can take just a few merely bytes of memory that's nothing
Well anyways thanks a lot for helping out bro! I would have wasted hours on finding a way of how to include Spotify
case'resume':
if (!msg.member.voice.channel) {
return msg.channel.send('You need to be in a voice channel to pause the music')
} else if (!serverQueue) {
return msg.channel.send('There is nothing playing in that channel')
} else if (serverQueue.playing == true) {
return msg.channel.send('The music isn\'t paused')
} else {
serverQueue.playing == true
serverQueue.connection.dispatcher.resume()
return msg.channel.send(`${msg.author.username} paused the music`)
}
break;
resume command not working
nvm fixed it my bad
Ok, so my bot keeps sending "Status Code 429"
code/line/lib
That's the problem I looked through my whole code and there was nothing with error 429
BOT
Today at 4:46 PM
@ZWrld#3499, Status code: 429```
429 is the too many requests status code
you're being ratelimited
from whatever you're trying to do
So what am I supposed to do?
dang it
figure out where is that status code coming from, what is logging it
Well it keeps saying that after I do the command ..play
node.js discord.js
are you listening to the rateLimit event?
client.on("rateLimit",console.log)
but that status code doesnt look related to discord
it might be coming from whatever audio library you're using and the audio sources you're using
Error: Status code: 429
at ClientRequest.<anonymous> (/rbd/pnpm-volume/3b5f9c99-2ab5-49f0-a1fc-f120a96885d4/node_modules/.registry.npmjs.org/miniget/2.0.1/node_modules/miniget/dist/index.js:150:31)
at Object.onceWrapper (events.js:284:20)
at ClientRequest.emit (events.js:196:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:23)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
at TLSSocket.socketOnData (_http_client.js:452:22)
at TLSSocket.emit (events.js:196:13)
at addChunk (_stream_readable.js:290:12)
at readableAddChunk (_stream_readable.js:271:11)
at TLSSocket.Readable.push (_stream_readable.js:226:10)
are you using miniget in your code?
Not that I know of
then one of your packages is using it
check all your packages that make http requests, such as api packages, etc
Ok,
Anyone need help?
simple-youtube-api
I have created a super simple DM fetcher for my Bot but it won't use added pictures. Can someone point me in the right direction?
.addField('DM Content', message.content)```
Doing it in an embed.
What :d?
I am fetching the DMs people send to my bot and forward them to me. But if someone adds an image, it does not get forwarded too
message.attachments.first() ? message.attachments.first().url : message.content
message content does not include attachments
don't spoonfeed code
that's also probably not what they want
don't spoonfeed code
@earnest phoenix then point me in the right direction maybe ? Just screaming like "don't help" doesn't help too
but message.attachments seems to be the thing I needed. thx
np 👌
Jsjsjsjjs
the fuck
the fuck
huh
Need help?
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token “ in JSON at position 3 while parsing near '{
npm ERR! JSON.parse “name”: “aSingleCell...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
I keep getting this when first trying to set up the npm install discord.io winston –save in CMD. Kinda lost now
Hmmmm
wrong quotes. you're using “ which is not valid in programming, you have to use "
It's time to learn from Tim 👀 uwu
" <--
What's the difference between ' and " in json?
single quotes dont work in json
Any use at all?
Ah
Epic
hey it worked
seems like it
which sadly is still on the top of google results and has not been taken down for some reason
someone should delete that lol
does it still work fine?
nope
discord.io is not maintained and afaik doesnt even work anymore
sooo
use either discord.js or eris
so same command just discord.js ?
discord.js has a beautiful guide, and huge community, eris is less user friendly and more for advanced usage
Discordjs is greate for noobs like me
yup, remove all that garbage
best option?
npm I discord.js
or is simply removing an app enough
Why do people use the i in npm
npm uninstall discord.io
you can simply delete your node_modules folder
npm discord.js works fine right
and remove the dependencies from your package.json
I've experimened with eris but it isn't as documented
npm i is a shortcut for npm install
npm discord.js doesnt do anything on its own
it needs either i or install
Great I typed it wrong
or whatever other command you want it to do
i does save a few keystrokes I guess instead of using install
i still use install myself lmao
Since I am here I ran into an issue, locally when I use erlpack everything is fine, I tried it on my host and it gave me a bunch of errors
Well Tim is noob
I will send screenshot
erlpack is a native c++ lib, it may require some build tools
is there any more info above that?
node-gyp rebuild
Well there is other stuff but I am not sure if it's safe to show that information
Since it gives away my server structure
I mean probably safe but I like to be careful
you can dm me the pic if you prefer lol
sent
is that running on docker or what
I am using a shared webhost
This is the SSH client
So I have restrictions, could be a permission issue
It's not a VPS but it's better than Glitch
I guess your main file?
Yes
I use main.js personally but that's a preference
So I have restrictions, could be a permission issue
Ye
It's a permission issue alright
test command?
Alright guess I will have to do without it then
@hushed jungle that might be a problem. it seems there is a single node.js installation being used for the entire machine and shared across all users. im not sure how to approach this, you could try asking the host owners/support
Yeah I was actually surprised that they even allow node.js on a shared environment
its a webhost right? webhosts usually dont give you root access nor give you node lol
It's a shared hosting
I can also do python applications
But haven't tested that yet
create a virtual machine and install the exact same linux version there, install erlpack there, then copy and upload the installed erlpack folder to your node_modules folder
lmao
Nice.
I could zip the node-modules on my PC and then upload it to my host
Would that do the same?
is your pc linux?
then it wont work
because erlpack is a native c++ language, its not javascript
what do I put for test command? haven't heard of that before
I kept it empty
when you install it, it is built and compiled for the machine where you installed it
you cannot port it to another machine, unless both machines are running the same environment
I will keep the option in mind if support can't help
windows builds are not compatible with linux builds, the same way windows software doesnt run on linux
git repository?
I think they will just refer me to their VPS package though
Your github/gitlab
If you have one
I don't
Then skip
usually a generic linux should be enough
try running lsb_release -a in your ssh
what about uname -mrs
dafuq
I try installing the package but is it unable to locate the package?
that linux version looks like cent-os / red hat
idk that kernel version is old af, whats your ubuntu's kernel version?
run the uname command on your ubuntu
It just says linux
@charred sundial linter is not needed, and its complicated to set up
gotcha
It's only terminal
then it wont work
I thought linux is linux 😦


