#development
1 messages · Page 794 of 1
@summer torrent how
@earnest phoenix have you tried not copypasting code
Where do you store the prefix?
connect to your vps
"Desktop"

@summer torrent it’s still messing up and showing code
connect to vps's console
wait 1-2 min for change
Ok
@summer torrent So how do i fix?
connect to vps's console
I’ll try now
how do i convert this into a string?:
let action = await db.fetch(actions_${user.id})
@solemn quartz do you know how to connect to your vps?
@solemn quartz do you know how to connect to your vps?
@summer torrent nnope
how do i convert this into a string?:
let action = await db.fetch(actions_${user.id})
@earnest phoenix
let action = await db.fetch(actions_${user.id}).toString()
Basics btw you should know
now it comes
@solemn quartz where do you host your bot
@summer torrent Visual Studio Code
show files in "Super Bot" folder
1 = images - 4 = mute-unmute
node index.js
@summer torrent
its showing a new error now
yeh go it , im stuck on 1 last thing
@summer torrent
Action of 1 from the Bots,Action of 2 from the Bots
how to seperate them into a new line in HTML
@summer torrent
EJS
@solemn quartz just type node index.js to console
i tried actions.toString().split(",").join("\n")
@solemn quartz show the error you're getting
@summer torrent whats wrong with my coding now
ok
No
which one
ok
Action of 1 from the Bots,Action of 2 from the Bots
how to seperate them into a new line in HTML
i tried actions.toString().split(",").join("\n")
You don't need toString
.join("<br>")
tried
It's already a string
but it does this
</br>
@amber fractal still wont work
same error?
yes
it doesnt matter
Action of 1 from the Bots<br>Action of 2 from the Bots
<br> works in all different variations
I dont think it matters
@earnest phoenix you need to insert the text as html, not as text
@earnest phoenix yes that's what it does
ah you're using ejs
yes
@copper cradle its not an error
@solemn quartz show what you get when u run node index.js
use <%-
@earnest phoenix
<%= is escaped html
ugh i need help
There are no problems
anyone wanna help me? anyone
Just
This is privacy

Do u have <client>.login()
@copper cradle ?
i have
bot.login(token)
with token const
my man not showing your code when you need help is like the doctor asking what your problem is and saying "privacy smh"
Yeah
Makes no sense and it's stupid
Why whould I steal your code?
Why would I do such a stupid thing, your code doesn't even work
what happens if you do "node -v"
ThE tErMinAl DoEsN't
it's the code then 😬
Bruh
Your code isn't working
there's something stopping it from being i terpreted
You're just a troll
@solemn quartz I hate to break this to you but, in programming people use each other's code all the time
i bet there's nothing inside index.js
no one really codes things entirely from scratch anymore
not for like 30 years or so lol
how do i make it so status is how many members the bot is watching?
It isn't that hard
client.user.setActivity('${client.users.size}) users, { type: 'WATCHING' }); this doesnt work
It is 87 lines and the max letters is 2000
At the very end
i dont think i can send it
where
And you're using the wrong `
@solemn quartz pastebin/hastebin/anyotherbin
client.user.setActivity(`${client.users.size} users`, { type: 'WATCHING' }); this does
^ wrong placement of backticks
whats the correct then?
@copper cradle is there a way to put what the prefix is?
while including the members?
Yes
how if u dont mind me asking
pastebin bad
the same way
^
instead of client.users.size you put your prefix
wym?
or just add it
but i want both
LEARN the basics of js first
im trying
`${value1} ${value2} ${value3} some text here ${value4} more text here`
client.user.setActivity(${client.users.size} users, { type: 'WATCHING' });
where do i but the second status
i just showed you how
what dont you understand?
do i do this
client.user.setActivity(${client.users.size} users, ${prefix}help{ type: 'WATCHING' });
no
how should it look like then
setActivity takes 2 paramenters
meaning, it should be setActivity(VALUE1, VALUE2)
notice the comma
...
so the entire text that you want to show
can u send me whole command
should go into VALUE1
no
you have two values
one value is this : `${client.users.size} users`
the other value is this: { type: 'WATCHING' }
you have to edit the first value, to include everything you want to show


I would like to build a Youtube bot for my discord server; most of the bots on the site have way more features than what I am looking to do. I just want the bot to post webhook to a youtube video, (not a live video), and keep a log of the videos that the bot has linked to so users can review all the posts after the fact. (Streaming would be nice, but that is a feature I'd rather leave for later.) Is there a github space or something that has a simple youtube script I could use for my bot?
you can use a db to store all the videos
and you can also use the youtube api v3
if you manage to store full quality livestreams in under .5mb per video
then gg to you
otherwise I'd have it use the YouTube api
setActivity(${client.users.size} users, ${prefix})`
l e a r n
^
I not understand give full command
Unlike @solemn quartz
I learned ML by reading like 20 different docs on the math, eventually figured it out.
@earnest phoenix i told you, TWO VALUES, the SECOND value is { type: "WATCHING" }
change only the FIRST value. VALUES are separated by a COMMA
yeah the logging part is probably pretty easy, I just need a script to add the youtube hook to the bot. I'm not trying to store entire videos, just the links to them. Not talking any live videos.
you would just check if <youtube url>/<channel>/live I think
and check for a video using web scraping
if true, send the URL
That's how I'd do it
setActivity(${client.users.size} users, ${prefix})` like this @Tim#2373
no
oh my god
@quartz kindle fr just let them figure it out, its not worth it.
someone send a docs link
he should let his own brain do the work
if he can't understand what tim says
^

im just gonna send 2 links
Literally read that whole thing.
read both
then we can talk
helping is not giving you the entire solution its just to make you understand a certain concept and then be able to do it yourself and learn out of it

so you won't be stuck with the same problem over and over
^
setActivity(${client.users.size} users, ${prefix})`
Reason one why when I search for stackoverflow fixes: I use the broken one and make it work.
oh my god
kms
Did you read the links
pls
^
oh my fucking god
no
I’m new and dumb
you just gotta know how to ctrl+f a webpage smfh
It’s the beginning of my bot
I even gave him everything he needed
@earnest phoenix learn. The. Language. Before. Developing. Bots.
That's why I said, literally read the entire thing.
^
and it even includes an example
All of the js site.
^^
Just read through the tutorial, THEN attempt the bot.
We are helping
Learn js then we can talk
You need to know what you're looking for.
come back with knowledge
I just simply need the code and I’ll never ask anything again
That's not how coding works.
this is why copy pasting code is a bad idea
If you want that, pay someone to do it for you.
you need to learn, we arent going to spoonfeed you the easiest code possible, you can google this..
I don’t have any commands yet
I just need to set status and I’ll work on commands
Discord js is SO easy
The tutorial will build you the entire bot, with code provided
ctrl+f and type in SetActivity
and explain how it all works
god
@earnest phoenix why would you rather code you don't even know what it will do
or use code where you know what it does and you know how to edit it
oh god
now even money is involved
¯_(ツ)_/¯
I just need the simple
for the easiest thing on earth
It's better than attempting it by just copy pasting things.
we are NOT gonna give you any code
learn it
seriously
LEARN IT
whats so hard to understand under the term "LEARN"
isnt it?
But
I need it to show how many users it’s watching and the prefix
oh my god.
develop the rest of the damn bot
Do you have a knife for me @west spoke
agreed
Just do the following:
Wow thanks for helping
yw
I just wish someone could help
his brain was not able to comprehend anything

it feels like he is deafen
guess some people really are hopeless
please come back after you learned what helping means @earnest phoenix
@earnest phoenix Help is not giving people code
help is to make you understand
not to give you the solution
because thats up to you
its so you dont make the same mistake
I already said it earlier
this is what helping is
Ok I’m sorry
but you still dont listen to me
Making a Discord Bot is not recommended as your first project
start with something simple like learning variables and strings and template literals
java is kind of the hardest programming language
like console.log("Text") or something
start with something simple
discord.js is not for beginners
it requires you to know js
Switch to eris, it's easier /s
and this is why you need to start with very simple stuff
However to use Eris you need to know how to use Eris
because js is a language which builds on each other
also eris has docs
and I looked into eris and it kinda looks better than discord.js
no need to flame beginners that much lol
because of the fact that eris has inital support for commands you don't even need to build a command handler like with discord.js
and it also seems easier to use
depends on your definition of "better"
i like discord.js because i can hack the shit out of it and make it stupidly efficient (havent tried hacking eris tho)
my definition of better is when it is simple to understand and simpe to use
and also flexebility
K.I.S.S. (Keep It Simple Stupid!)
there should be a low-level discord api library for js
something that just handles the token exchange and keeps the websocket connections
and gives you the raw packets and the rest api methods
NTUI
i did it!
true
im happy this is over
@muted vortex how is java the hardest xD
Anything can be hard
yea but i wanna hear their logic as to why java is harder than..say... c
^
yes
c is a PITA
peter that is not an opinion that is FACT
^
It is still an opinion
no. c is more complex.
you are stating the c is harder than java which is an opinion
no.
either way.
my original point
was
yea but i wanna hear their logic as to why java is harder than..say... c
@earnest phoenix
Ewww
huh
it disappeared just when I wanted to answer
yeah I found the answer in faq, sorry 
I'm using PostgreSQL in ElephantSQL and I'm getting this very large text error, the word being only 4 in length.
Does anyone have any idea why this happens?
I just duplicated the table and now this is working 
That's odd
From my limited sql knowledge, I assume dan was right, but the original table was only set up to take a single character for example
I ran into that issue yesterday
@earnest phoenix for one thing java and javaSCRIPT are not the exact same thing. I know a bit of JavaScript. Java is more complex than C++. Maybe by now there is something more complicated than Java, it's been quite some time since the days I was studying programming in college.
To be fair my bot was my first javascript project
But I know python so that's basically the same right xd
No
@muted vortex you cant say js and java are not the exact same thing. they're nothing alike, besides the name
but ye, its more complex than c++ in what it can do, but syntax wise, doesnt c++ win in complexity?
how do i parse sessiondata using express into an HTML file?
@earnest phoenix do you realize you just contradicted yourself?
No?
You said non the exact same thing, implying they were very similar
I was saying they are different
how do u reset the leaderboard
anyone know?
But the way you said it kinda seemed to imply you were saying they were similar but not the exact same..
@earnest phoenix wym?
!leaderboard
w/e the leaderboard is
how do u reset all of it
like the invites
@earnest phoenix this is not a support server, I think you are looking for this https://discord.gg/998Fcr8
ty
How can I make a seperate bot that detects my bot, and if it detects if it's offline, it would notify me saying something like "DogBot has crashed. Check console logs."
To put in less words,
how to make a bot that detects if my bot is online or offline, and when it's off it would dm me?
which lib
js
discord.js?
Mhm.
Js Best lib
There's presence under client#fetchUser if you want to look into that.
you can use "presenceUpdate" event for detect presence updates
To*
once you use the event you can also include code in there to detect if that presence update was done from your bot (make sure they are sharing at least one server)
Yeah, I'm gonna have a testing server that would have both bots in.
So it would be something with user.presence.status @summer torrent ?
yes.
yes
also in the future try not to use periods like that but more of this: user#presence#status
like in the server or in the coding?
in the server ^-^
Yeah
I use "heroku git: clone - a project name" but all. json comes redefined and I want me to install it with the files inside already
Using "heroku git: clone -a Project name" installs all files from the hosted bot, only for all .json files is reset
is it when the clone is done or over a period of time?
When I finish cloning, I open the .json file and it is reset as it is uploaded, and the bot stores data all the time in .json
example of how it looks:
}```
I think the issue is because of the heroku git clone, try making a test json with a test value and clone that.
what would be the command to clone just one file then?
The program you're using is heroku git right?
yes
Let me look into that one, give me a few minutes.
Okay
If I'm looking correctly at this you should read this page and it should explain it better than I could phrase it:
https://devcenter.heroku.com/articles/git#tracking-your-app-in-git
(You'll want to read through Tracking your app in git to Deploying code.)
Okay
But then it talks about how to start the bot, I want to install a bot file.
I don't think it does talk about how to start the bot...
Anyone able to help me with this?
0|main | File "/root/AIDungeon_bot/bot/story/story_manager.py", line 254, in generate_result
0|main | block = await loop.run_in_executor(pool, self.generator.generate, full_action)
0|main | *** print_exception:
0|main | concurrent.futures.process._RemoteTraceback:
0|main | """
0|main | Traceback (most recent call last):
0|main | File "/usr/lib/python3.7/multiprocessing/queues.py", line 236, in _feed
0|main | obj = _ForkingPickler.dumps(obj)
0|main | File "/usr/lib/python3.7/multiprocessing/reduction.py", line 51, in dumps
0|main | cls(buf, protocol).dump(obj)
0|main | TypeError: can't pickle _thread.RLock objects
0|main | """
0|main |
0|main | The above exception was the direct cause of the following exception:
0|main |
0|main | Traceback (most recent call last):
0|main | File "/root/AIDungeon_bot/bot/story/story_manager.py", line 254, in generate_result
0|main | block = await loop.run_in_executor(pool, self.generator.generate, full_action)
0|main | File "/usr/lib/python3.7/multiprocessing/queues.py", line 236, in _feed
0|main | obj = _ForkingPickler.dumps(obj)
0|main | TypeError: can't pickle _thread.RLock objects
``` I was having some thread blocking issues and told that running the function with `loop.run_in_executor` would help but that just brought up this error that I don't understand at all and google didn't help.
how do you make it so that it holds data? Like a database?
example of this:
(person in server1) verify (gets verified and such)
(same person goes to server2) (and gets automatically verified, having it reconized from last/first time they verified.
I've seen it before, so how would you?
When they join (or whatever) check to see if they're already verified. If they arent, have them verify then add them to the database and when they join next time it will test to see if they're already verified
but you would have to manually add them to a database
do you know any documents that like, explains?
Well you'll have to add them once and that'd be when they verify
idk exactly what you're trying to do
so idk what type of document to link
Is everything fine now?
then they join a diff server with the same bot
so then when they join
they get auto verified
@violet nimbus might want to change your webhookAuth
@amber fractalwdym?
I do have one question
you use client.on and you pass bot into the dbl constructor
so is it client or bot
who use mongoDB Cluster?
because im still getting the error. and my cluster is paused. idk why
@amber fractal bcuz i have 2 variables lol
seems inefficient but if it works
just a question
Yep
You need to use process.env.PORT as the port
you have to then use the same server
I don't use that
glitch doesnt let you use other ports
Yeah
Im doing a site for my bot
It uses passport-discord
And dont work
;-;
I think that package might be out of date. im not sure
const prefix = "cd";
const args = message.content
.slice(prefix.length)
.trim()
.split(/ +/g);
It reacts on the length. With what do i need to replace to let it work?
Could i use if(message.content.startsWith(prefix)) {
//scripts
}
?
Do it the other way?
wdym
if(!message.content.startsWith(prefix)) return;
Although both ways are fine.
ok
Yeah
TypeError: Cannot read property 'client' of undefined2:40 AM
at new MessageEmbed (/rbd/pnpm-volume/6ebe09a3-2c8f-4dda-bf12-aea0160c35f9/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/structures/MessageEmbed.js:13:60)2:40 AM
Jump Toat Object.execute (/app/commands/help.js:9:21)2:40 AM
Jump Toat Client.client.on (/app/server.js:44:36)2:40 AM
at emitOne (events.js:116:13)2:40 AM
at Client.emit (events.js:211:7)2:40 AM
at MessageCreateHandler.handle (/rbd/pnpm-volume/6ebe09a3-2c8f-4dda-bf12-aea0160c35f9/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)2:40 AM
at WebSocketPacketManager.handle (/rbd/pnpm-volume/6ebe09a3-2c8f-4dda-bf12-aea0160c35f9/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)2:40 AM
at WebSocketConnection.onPacket (/rbd/pnpm-volume/6ebe09a3-2c8f-4dda-bf12-aea0160c35f9/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)2:40 AM
at WebSocketConnection.onMessage (/rbd/pnpm-volume/6ebe09a3-2c8f-4dda-bf12-aea0160c35f9/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)2:40 AM
at WebSocket.onMessage (/rbd/pnpm-volume/6ebe09a3-2c8f-4dda-bf12-aea0160c35f9/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/event-target.js:120:16)
I keep getting this error can anyone help me.
Exactly as the errors says, you are reading the client property on some undefined value
<undefined>.client somewhere in your code, cant really help any more without some code
tell me when u go there
the whole bot i think might be breaking ita an old project my friend wants me to fix for him
i cant figure out the problem though
wdym
message.client is not a thing
what do i do
Read the correct property, im not spoonfeeding all i can say is that you cant read the client value property of a message object because that value does not exist unless you explicitly create it
that sounds complicate
@dusky marsh I fixed that but it still shows an error
It says cannot read array of undefined.
you arent passing the client instance in your command handler
you are passing message and args, not message and client as implied by your help command
so in help.js youre reading the array property of args not client
do i remove args?
pass whatever object you need to access the data from, its all down to your data flow but in this one instance yes
why u in my env file?
i just noticed it existed i was going to tell you to go delete the link message but i see you did already
and regen token
it still says cant read property of array undefined or whatever
switch the order in server.js
your parameters are switched
yeah like that
nah it was right the first way
does glitch automatically refresh code?
you dont have client anwhere on line 10
no i reload it in watch.json
wdym client on line 10
i have it defined at the top
yeah but the console is saying you have <something>.client on line 10
which is why i asked if glitch refreshes the code
cause if ya look <something>.client is nowhere on line 10 in the help file
I got it working
it needed to be RichEmbed lol
I have a few morw errors on the bot
oh right i guess they only changed it to MessageEmbed in v12 huh
there is something wrong with play command
i think you need voiceChannel
yeah just looks like you need to update some of the properties
what version of djs did he originally write that on
cause its been voiceChannel for a while
idk
Im just gonna tell him to let me make one from scratch lol
thanks for the help tho man
ye np sorry for the rabbit hole chase on the one problem, that was not a very descriptive error
your good
and gl with the rewrite i know it can be painful lol
thx lol
and make sure to regen token, not that i think they will do anything with it, but the mods definitely log deleted messages lol
almost every class has a client property
Could someone help me with my bassboost command? it sounds terrible, heres the code js function bassboost(msg, guild) { const node = msg.client.player.nodes.first() node.send({ op: "equalizer", guildId: guild.id, bands: Array(6).fill(0).map((n, i) => ({ band: i, gain: 1 })) }) }
Gain 0.5
Is possible to host Discord bot with containers, using 1 container per shard?
@copper cradle still sounds distorted as hell, I tried 0.1 doesn't sound any different, 0.2 sounds distorted, are all 6 of those bands bass? or is it like the only first 3
Not sure
at WebSocketConnection.client.ws.connection.once.event (/rbd/pnpm-volume/52fd4985-92c5-465a-a9c0-068e8cb10637/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/ClientManager.js:48:41)
at Object.onceWrapper (events.js:277:13)
at WebSocketConnection.emit (events.js:189:13)
at WebSocketConnection.onClose (/rbd/pnpm-volume/52fd4985-92c5-465a-a9c0-068e8cb10637/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:390:10)
at WebSocket.onClose (/rbd/pnpm-volume/52fd4985-92c5-465a-a9c0-068e8cb10637/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/event-target.js:124:16)
at WebSocket.emit (events.js:189:13)
at WebSocket.emitClose (/rbd/pnpm-volume/52fd4985-92c5-465a-a9c0-068e8cb10637/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/websocket.js:191:10)
at TLSSocket.socketOnClose (/rbd/pnpm-volume/52fd4985-92c5-465a-a9c0-068e8cb10637/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/websocket.js:850:15)
at TLSSocket.emit (events.js:194:15)
at _handle.close (net.js:597:12)
(node:782) 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(). (rejection id: 2)
(node:782) [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.```
i am trying to make if someone mention the bot and type help sand help message
your token is invalid
ok
@grizzled raven Message.Client is a thing
let [needdelete] = await (connection.execute)(SELECT cid FROM characters WHERE ownerid = ? AND cid IN (SELECT cid FROM wish WHERE id = ?), [author , author ]);
let total = needdelete.length;
let array= [];
for (var i=0; i<total; i++){
array[i] = parseInt(needdelete[i].cid);
}
await (connection.execute)(DELETE FROM wish WHERE id = ? AND cid IN (?), [author, array]);
I am running this code but it does not delete it. It does not give error.
What am I writing wrong?
nodejs
array is completely correct. but delete command not working
what db/library are you using? does it accept arrays as a prepared parameter?
you're essentially passing [author,[cid1,cid2,cid3]], im not sure how the library will serialize that into a parameter. you could try joining it into a string so it becomes [author,"cid1,cid2,cid3"]
also not sure if the library even accepts multiple values in a single parameter
@earnest phoenix thats what i said
you could try making a test like this AND cid in (${array.join(",")}) if the other attempts dont work, just to make sure the query itself is working
I will try. thx 🙂
Anyone have any good bassboost presets for lavalink (the equalizer)
@quartz kindle thx work this
How to add my bot back here
My bot was kicked, idk why
Is it possible to add him back?
find your bot in #mod-logs for the reason (using the search bar, insert the ID), fix it, contact a mod
Thanks
Anyone know a route I could go down to display the cpu load of the system my bot is running on?
what language
javascript (node js) running on ubuntu
Looked at cgroups but according to them my cpu usage is something like 6 billion so I assume some math has to be performed to get that as a percentage
you want the usage of the entire machine or just the node process?
Entire machine ideally
you could use grep and top
How would I go about using them?
The closest I've got is this
https://unix.stackexchange.com/questions/450748/calculating-cpu-usage-of-a-cgroup-over-a-period-of-time
But that doesn't answer your problem of just the process
var os = require('os');
var loads = os.loadavg();
Found this on stack overflow for process specific usage
os.loadavg() should work for system cpu usage as long as its not windows
for process specific usage (node.js's own process), the only built-in way in nodejs is to use process.cpuUsage(), which is a bit complicated to use
@quartz kindle
remember I was asking u about json databases some days ago?
well
glitch doesnt like updating json files using bot bot itself
so I will recommend restart after changing project
require("child_process").exec("refresh");
tried that
glitch doesn't like anything
What units are these in? js { user: 70093000, system: 9234000 }
process.cpuUsage()
... whose values are microsecond values (millionth of a second). These values measure time spent in user and system code respectively, and may end up being greater than actual elapsed time if multiple CPU cores are performing work for this process.
two questions:
1: Assuming you have a server that hosts your bot, and one that hosts your website. how often would you ping your bot from your website backend to update things like online status, user count, guilds, etc??
2: Do you include bots in the amount of users your bot tells people it has? ie. do you filter out the bots from the real users before displaying user count?
- depends, there are many ways to do this
- yes i include bots, but depends on what you want
I already do ping, just wondering how often i should 😄
they are both on same host atm so its sub 20ms latency
but it may move to a diff host for the website in future
for 1, the most efficient way would be for your bot to have an endpoint that your website can get data from on page load, and then have a cache for it that lasts however time you want
does
😛
i have docker containers, one for bot, one for site, one for nginx, mongod bd, etc. etc.
they share a network
and atm, my website app pings the bot every minute to get datas
so for example:
user loads page
page checks cache
if cache more recent than 60 seconds, load from cache
else make a request to bot and update cache
yea i could probasbly do it that way
iw as thinking more of constant pings for online status
you dont need to ping it every minute if nobody is using your website, thats basically the only difference from what you're already doing
no yea i get that 😄
in any case youre already good to go
yea thats probly best route
since latency isnt an issue anyway
like, at most i'd be adding 20-25ms onto the loading of a webpage for 1 user
thats negligible imo
ty Tim ❤️
Just a quick question. Is it safe 2 share the package-lock.json file in the bot?
i wouldnt. the package lock file stores machine specific data referencing the install paths/
its also regenerated upon npm install / yarn commands
so just include the package json itself
and when someone runs command to install node modules, it will create either package lock file, or yarn lock file, depending on package manager used
no cause i just wanted 2 upload commands and 1 or 2 other files on github for people 2 see
i wasnt going 2 host that 1
ok
thats what i mean, its specific to your machine, they would regenerate their own on installz
i just wanted people on a discord server im in 2 see the code for the commands
ya
well thanks for the help!
are you uploading to github via git command?
im not 2 advanced in github but im using github desktop 2 upload it
I always have issues uploading from the website and i like using the desktop program
ahh ok. you can include a .gitignore file in the project directory to specify files to ignore when uploading the git
ik, i just created a seperate folder like BotsnameherePublicVersion and i just copied the commands folder from the bot that has everything 2 the Publicversion so i dont need 2 deal with all the other files
1 last question. Should i also have the package.json file public or no. cause its just saying what dependencies r installed and links 2 githubs website
yes, the package.json is required to build the project node modules foldeer
it tells node what modules the app needs to run 🙂
you can remove github link if you want
or change or w.e
ok. well thats it. Am I allowed 2 share my github project on here or no?
no clue 😄
lol
unless there is a reason to share it, better not
it would count as self-advertising, which is not allowed
good job
!help
Hello, I'm making a poll bot and need to know if it is allowed to send a user a dm with all the responses?
@vestal star discord bot maker
what
wait what? so I could send the responses to all users, but not to just the poll maker?
i typed it diffrently to how i typed that message lmao
Ok, so I could DM the poll make after the time when they make the poll (poll time is specified)
yh
and they don't have to send a command to get the poll responses?
no
Okay
Wait, so they don't have to send a command to get the responses and can't just get them after the poll ends? Or is this not allowed? Sorry about how I worded my question, just want to be sure
You can set the bot
so the user starts a poll
then at end of the poll DM the user the results automatically
thats fine
ok good
is it possible to have a link in a message automatically be sent by the client if clicked on it? or if not automatically sent, typed into their prompt? i am using python
your first question:
- not rlly sure what you mean by that, but sounds like a protocol link which is annoying todo
Your second question:
- wait_for() is basically the input() of discord
can you wait_for click and get the details of what they clicked?
no
doesnt work like that
urls have nothing todo with discord
and would be an entirely different system
"""Examples"""
# Waiting for a user reply:
@client.event
async def on_message(message):
if message.content.startswith('$greet'):
channel = message.channel
await channel.send('Say hello!')
def check(m):
return m.content == 'hello' and m.channel == channel
msg = await client.wait_for('message', check=check)
await channel.send('Hello {.author}!'.format(msg))
# Waiting for a thumbs up reaction from the message author:
@client.event
async def on_message(message):
if message.content.startswith('$thumb'):
channel = message.channel
await channel.send('Send me that 👍 reaction, mate')
def check(reaction, user):
return user == message.author and str(reaction.emoji) == '👍'
try:
reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('👎')
else:
await channel.send('👍')
i basically want to present the client with options and if they click/select/type an option, i want it to send another message based on the selection - is the only way for me to allow them to type in the selection themselves?
could use reactions
wha
i use reactions for giving the user 'clickable' options
i see, i have 10 options though and the reactions would be a bit confusing i think
In discord.js you could use a message collector, but I don't know about discord.py
ignore that^
thanks, i think for now the wait_for will have to do
hey how to make the bot was 24/7 online
hey what are you using to host it
python,dbm
no i mean
that's not a host
eeee
because I don't know how to give it 24/7 online
either leave your computer on 24/7, or get a server
but bot how to give 24 out of 7 online
i told you
the bot only works if the bot program is on
if you close the bot program, the bot will not work
so you need a computer that runs the bot program 24/7
but bot how to give 24 out of 7
most people use a server/vps, which is like a computer you rent per month to run programs in it
¯_(ツ)_/¯
Free hosts are trash tho
a monthly vps in money value is equivalent to 2 cheeseburgers in McD per month
^
I'm only 13 years old
hi only 13 years old
If it's a small bot, honestly I could host it
den ask parents
But it'd only really be temporary
and if they don't always allow you to spend money
then you are screwed if you can't pay 2 Cheeseburgers a month
honestly you dont want to trust some whitename with an mc pfp with your token 
xX_UltimageGaYmer_Xx
🙄 Stop.
'm from Poland
It was an offer. I'm a whitename cuz Ansura is awaiting review.
if it comes to hosting glitch is the best way to go as it gives you a powerful hosting
You can only delete 100 discord messages at a time... how many can u fetch? Is there a limit or can I get the entire chat and maybe break discord?
Lmao

You can only delete 100 discord messages at a time... how many can u fetch? Is there a limit or can I get the entire chat and maybe break discord?
@visual sandal in discordjs: 100
Probs discord.py too. Seems like a discord limit
Oh
How long will bot applications take?
2 weeks, but I think they have a lot of request rn
How’d u get the bot to run the command lol that
@visual sandal eval command?
Yee
It's an eval command
Oh, so it got longer? I submitted a bot less than a year ago and it got accepted in a few days.
eval("your code")
Eval commands are a BIG security risk, if someone gets access to your account, your bot is screwed.
Uh.. idc I still want it lol
I wasn't trying to stop you, but I would not recommend it if you are hosting your bot on your own computer
Ok good 👍
which language are you using?
Js
then the command is literally eval(text)
Lmao ok thx.. haven’t tried it before
let command = "10 + 10"
eval(command) // 20```
make sure to only allow yourself to use it
never let other people use an eval command
so eval is built in?
you dont want to start language wars lmao
lmao
HTML is the best ||dont kill me, yet||
there is always pros, cons, and especially "better tool for the job"
HTML is the best Programming language
i use notepad to write my code 
html?
im already laughing
is html a programmminh language?
no
In my world.. yes
its a markup language
its considered a "declarative programming language" by some
i use notepad to write my code :MEMEME:
@earnest phoenix vscode is best
as opposed to an imperative language, which are most of them out there
like css is also a declarative language
no sublime @summer torrent
Yaas
triggered

GL
it’s 2 billion lines for the entirety of google
@visual sandal you want me to pull the latest code or keep it a few versions behind?
Either way is fine
Ok lol
did you think i was gonna wait?
No
read the error
not according to your error
yea, im just resarting it bc i've spent long enough anyways
like uploading 4k files
double check your folder structure
ok
you dont need to upload the node_modules folder
just upload your files and upload package.json
then in the terminal, run npm install
and it will reinstall everything and regenerate the node_modules folder
okay
holder?
Like,
Just a database.
Something that holds data and gets auto put in when someone does a command.
auto put into the database*
you have to code the auto part yourself
is there any documents?
but generally, sqlite is good for small-medium bots
depends also if you prefer an sql database or a no-sql database
The difference?
an sql database works like tables, with rows and columns, and uses the SQL language, which once you learn you can use on multiple databases
a no-sql database are other types that use either key-value or document storage, and are more similar to javascript objects. mongodb is a good example
generally yes, sql tends to work better for most things that bots do
ah okay thanks
also, between all the different SQL databases, SQLite is the only one that is embedded, which means it doesnt require a separate database server running on your machine
yup
ok thanks m8











