#development
1 messages ยท Page 1761 of 1
make your characters variable a const since it doesn't need to ever change
Okay.
the place where the three dots are at?
I have yet to ever use a loop.
or?
Correct.
you place whatever you had there in your old snippet
oh also
here's docs for for
mystr += characters['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-='];
???

no ๐คฆ
that's why i linked you the docs
Oh dear xD
Give me a few weeks
stealthy.exe has shutdown
@vivid fulcrum Yup, the docs were very useful......
I-
that's because you skipped all of the useful text and went straight to the colorful code blocks
I read almost everything 
in another words
whatever you have inside for is going to keep executing until the condition of the for loop becomes false
Ohhhh, okay.
Now that makes more sense.
xD, alright, welp, imma go try a few things.
well, I said you has to use an inner div
but anyway
use the previous method
but fine tune it by using f12
then you put stretch in the wrong place
do the same way you did here
but fine-tune with f12
how so?
use margin
the fact that one box is higher
use justify-content
i am lol
i figured it out with min-height and max-height
is logging command usage of a bot against discords terms of service?
It's not, but having it public is a gray area.
How about only allowing a bot support team to view the log channels?
Will I not have to specify that my bot logs commands to members?
That's still "Private"
Alright aha, thank you
Hey @umbral zealot on that topic
Im allowed to log command errors?
And guild logs right?
For me to see
Uhh yeah of course
I am gonna eventually log literally everything
For the server staff to see
Like for example, messages per day
Etc etc
Nothing too private
But that's fine?
I don't see why not
Ok cool
Error logs are common
I mean like yeah
That's visible to me
But like imma have in depth logging
That is like LITERALLY EVERYTHING
like for example when a user sends a message etc
Not for me
But for the guild staff
Like would that be fine?
basically a discord analytics thing, but better
And with a poggers ui
"user sends a message"???
Why does it have to be such a dumb ass example
If you mean a counter though... That's perfectly fine
Feels like you want a blanket statement, that's impossible to provide.
don't log sent messages' content
yeah
it will be like just that a message was sent in CHANNEL
not like who sent it
or what it contains
also don't log channel name
is there any real reason you want to log "LITERALLY EVERYTHING"?
the point of logging is to have a purpose, logging for the purpose of logging makes no sense.
also remember every log you add will add more processing time to your bot
uhh
ig so, but like its all async?
idk how do explain it
like for example
if a channel is created
the bot sends it in the log channel
but logs it after?
so it doesnt like slow that down?
so for example, if woo (the server admin) wanted to see how many messages in #general were sent this week, compared to last weeks
@lyric mountain @solemn latch
well yeah
id log the channel name though?
or the id
and just request the name when the person is looking at it
thats the idea?
what "logging" did u think i was thinking of?
oh
wait im confused
so for example
if i have a "log" of the messages this week
numbers are numbers
itll store:
guild ID
channel ID {
how many messages this week
}
they are anon
Discord already has a search feature that allows you to see how many messages were sent, and the content of all those messages in specific channels during specific dates. Logging this type of information seems kind of redundant
you cant visualize it
like for example
if you wanted to see
if u wanted to compare: members joined: to members left
you cant graph it easily
if u wanted to compare: members joined to members who joined and sent a message
etc
maybe just use a time series database?
ill look into that
i gtg rn
but just logging numbers is fine right
channel names, not so much?
Anyone know if it's against Youtube TOS to make a youtube to mp3 or mp4 converter?
you can just associate the data with channel ids, so its properly anonymous. You can then get the name from discord with that id when you need to display/graph data.
very very likely against their tos.
thought so
Couldn't be illegal though could it? I feel like ytdl-core would've been shot down very quickly if that were the case.
Hey, soooo, I am obv back again with yet AGAIN, another Question.
welcome.composite(avatar, 40, 55).write('Welcome2.png')
So I have that coded., how would I make it so it goes into the .setImage() portion of a embed?
ytdl-core has had a ton of issues hasn't it?
there was the whole github thing recently with it.
its also pretty common for software to be made and not be illegal, but illegal to use.
realistically, no its not illegal until you break a specific law, such as unlicensed redistribution or something.
.setImage(welcome.composite(avatar, 40, 55).write('Welcome2.png'))
?
Wouldn't this technically be a problem with bots like rhythm, seeing as they play music with what I'm assuming is ytdl
it might be more work, theres a weird quirk with discord image embeds, but cant remember what it is.
@solemn latch
it very well could be a problem for rhythm at some point, and any bot using it, however you tube doesn't seem to take any action.
ah yeah you have to attach the image, then use setimage. https://discordjs.guide/popular-topics/embeds.html#using-the-embed-constructor
Thanks for the docs link xD
Can you elaborate on "attach the image"?
ohhh
.attachFiles()
Gotcha.
Wait, this is constructing a image.
It is not in assets.
Makes sense, google probably just can't be bothered to pursue a civil case against discord bot developers
https://discord.js.org/#/docs/main/stable/class/MessageEmbed?scrollTo=attachFiles
pretty sure you can use a buffer(FileOptions)
so i can store all the guild data together
and have the guild id separate
and then preform some sort of algorithm with the guild id to find the data?
I would probably store all of it by channel id, then get the relevant channels.
if you wanted all the channels of a guild, you would have that mapped in another database, or just use the discord api.
ok so for example
if i have a guild database
can i or not have like just one document with like guild id, guild name, etc etc
?
realistically, you wouldnt keep all data from a time series data in a single document.
ok but im asking more like is it allowed?
like is it bad safety practice?
i get that its bad code practice
but im trying to understand the safety side of things
safety wise, you are storing more data than you strictly need, which is always bad.
gotcha
im making an api to fix all that
but like for example the analytical time data
that i cant request
bc like its from the past
like for example if i need the guild name from the id, ill use the api
but if i need to get the data from a month ago
thats one of the very few times it would be okay, with guild owner consent.
Analytical data is fine. Discord doesn't really care if you count messages, even messages from a user
ill delete the data every month btw
However, logging content is a completely different beast
So. Logging numbers : no problem. Logging text: super bad idea.
yes
ok cool
ID isn't user data
You're not allowed to log things people typed or people uploaded or people sent without their constent, and when you have it, it has to be secured, encrypted, deleted on demand, etc etc.
ok
But stats? Discord don't care at all. It's not personal, it's not identifiable, that's fine.
that's your data so.... yeah it's fine
ok poggers
Mee6 and its points and levels is annoying but absolutely not a problem
tysm woo and evie
also just wondering
if i have an api which is really just like domain.com/internalapi/RANDOMNUMBERS(token)/request whatever
is that fine
ik its not like in the data bla bla bla
but does it matter?
is not erwin still here
putting tokens in the url is bad practice, as urls are logged in several places, such as server logs.
i believe the url is encrypted during https requests, but it will still be logged unencrypted places.
putting tokens in the url is bad practice
Tell that to Discord Webhooks
its like localhost:blablabla/request thingy
yeah ive tried
didnt work as i wanted
i know
@umbral zealot ipc didnt work as i wanted for many reasons
i had to switch frameworks to use ipc
if bot or webserver restarted it broke

flask doesnt have a discord ipc
I mean sure, ok.
quart does
bruh localhost
google did this
and it didnt work
unless you forward it
:p
tot he web
just comment it out
no problem I guess
Currently attempting to write scuffed HTML and js to keep the height and width values in an input box in a 16:9 ratio... html <label for="widthRes">Width</label> <input type="number" id="widthRes" min="1" oninput="calcSize(); AspectRatioWidth(true)" placeholder="Insert number here"><br><br> <label for="heightRes">Height</label> <input type="number" id="heightRes" min="1" oninput="calcSize(); AspectRatioWidth(false)" placeholder="Insert number here"><br><br> for some reason my second function AspectRatioWidth() does not seem to get called. Is there any reason for this?
function AspectRatio(toggleHeight) {
const getCheckboxState = document.getElementById("scalarValue");
document.getElementById("test").innerHTML = "Works";
if(getCheckboxState.checked == true) {
const width = parseInt(document.getElementById("widthRes").value);
const height = parseInt(document.getElementById("heightRes").value);
if(toggleHeight) {
document.getElementById("widthRes").value = height*(16/9);
} else {
document.getElementById("heightRes").value = width*(9/16);
}
}
}
``` method for reference ^
I fixed it by just calling AspectRatioWidth() in my calcSize function instead. Not a great solution, but hey, it works.
Why are you multiplying width by 9/16?
Apparently I've a syntax error in my sql query but I have no clue where it is 
worked fine on my local db also running the same version iirc
alter table discord_user_premium add column applied_api_id varchar(191) default discord_api_id after discord_api_id;
what is an efficient way to delete more than 100 messages in one go?
Loop? or what?
coz I don't want to get ratelimited
I hate SQL errors, it says there's an error but doesn't say where, fucking hell
it just says "check your manual" or some shit like that
hey guyz, in css, how can I clip a inline span to its parent div. Just like a background-clip: text is for text. But I want to do the inlined span instead.
kind of old but you should use document.addEventListener if possible. You could also wrap the two functions in an anon function to ensure they both run: ```html
<input type="number" id="widthRes" min="1" oninput="(function() { calcSize(); AspectRatioWidth(true); })();" placeholder="Insert number here"><br><br>
just to prevent an xy problem, what exactly are you trying to do with this?
I want to make 20 vertical bars (spans), gradient to right in red-yellow-green.
as a background?
some thing like this, but separated with some spacing
if it wont have anything in front of it maybe try a flexbox parent div with 20 children each colored with the gradient pattern
for the spacing you can just add a margin to the children
nvm, I achieved the effect with repeating-linear-gradient property ๐
backgroundImage:
repeating-linear-gradient(to right, transparent 0, transparent 6px, white 6px, white 10px),
repeating-linear-gradient(to right, red 0%, yellow 50%, green 100%);
Regarding VPS's, what are the recommended locations to bring your bot ping super low?
I'm using digitalocean so anything specifically relating to that would be great. In general as well is useful 
I've heard San Francisco area is good but I could be wrong.
help?
Python Vs Javascript which is better for bot dev in long time???
new york
doesnt matter theyre both bad :^)
How much time?
time for what
if youre waiting for approval it takes 1-3 weeks
1 week 5 days passed
Sed
Some one know an application or a website to create a cool bot website?
vscode
a simple application ๐
Did it got full or not started
Any reason why? Why would it be better than San Francisco?
last i heard the api gateway is there
i have a vps in new york, gets me 25 ws ping
but try it from san fransisco and see how much you get
why would you go for SF? discord doesn't host their servers in their headquarters lol
Hmm so for the verification there is a question asking about data collection
Do server member ids count as data being collected?
yes, just explain that you collect them for x y z reasons
for example for storing user configuration
ye
yes
in 100 characters
i have IP open to all
How do i change new Date()'s UTC timezone according to the server's region?
Like if server's region is US East nd time is May 5, 2029 16:39 in utc nd bot will convert it to timezone of US East which is GMT-5:00 ig
its not recommended tho
Help someone please? ๐
you can call toLocaleDateString on a date object, and then pass in the locale
can I DM cause I dont see any option to fix that error
Thanks akio
np
How do i change repository?
That is a great question that I don't know and can't find the answer to, so you should probably ask on their discord
https://repl.it/discord
is it now?
we do that in guidebot because our config also has code to check for perm levels
Currently, I'm rewriting my bot in TypeScript, and I'm currently contemplating how I want to build it. I could just use tsc, but I'm considering using a tsickle + closure setup with either webpack or bazel, as that's what I use for compiling frontend web applications. Not sure if it makes sense or if it's good practice, so figured I'd ask here
(node:7680) UnhandledPromiseRejectionWarning: TypeError: body used already for: https://discord.com/api/v8/users/SOMEID
what does this mean?
Yeah but the point Erwin is making is that it's usually .JSON not .JS
either .json or .env, but yeah
i'd personally go against using .js/.ts for tokens
mainly cuz we are all dumb and we'll likely forget to .gitnore it or end up commiting the changes and accidently leaking it

what
the .env package and the .env file
why use it
just use the actual system env
or node env
or whatever
you could simply do MYENV=123 node file.js
or if you're using pm2, you can put everything in a pm2 ecosystem file
i only use stuff like that as argsv
for a token, its fine, but isnt it consuming to have to add another line on your command to run node everytime?
usually you have something that runs node for you
like pm2 or a startup script to run it in the background
so you just add it there
but at the end of the day it'd be the same, you either have to edit the script, or edit the .env
ye but i mean
the entire env functionality already exists
the .env package is not needed
its just another useless dep
guess u have a point
I think it's biggest use case is having it .gitignored and throwing tokens and keys or whatever that you don't want public into it as opposed to having to edit package.json or pm2 config or whatever is being used to start the process
And for example, I have a .env with an array of YouTube authorization headers, that'd be quite ugly to have a 400 character long line in a startup command
Yeah, same case, you'd be having to be careful to not comnit tokens, but I suppose you could just use a config.js and import it and gitignore it
ah I see what you mean now
I was thinking of smthn else
yeah that makes sense
problem is a lot of people don't use that system, so I think that's where dotenv is applicable
you could also do ENV_VAR=value pm2 start app.js
and pm2 will remember it through restarts
Oh yes now I need a batch file to start my bot, or editing my actual environment variables to change my prefix. Brilliant! 
Prefix should be in like a config file
Depends.
Only stuff that should be in a .emv realistically is sensitive configuration, that being tokens or whatever
It's always a case by case basis
We use .env files for development, or because places like repl.it require it.
repl.it doesnt even use env files anymore
besides, at that point whats the difference between an .env file to anything else like .config .ini .json etc?
i like using env the way it was made to be used
if i want anything stored in a file i'll just use a json file or something and gitignore that instead, no need for another dependency to read a file
message.guild.roles.create({ data: { name: 'Verified', permissions: ['VIEW_CHANNELS', 'READ_MESSAGES'] } });
message.guild.roles.create({ data: { name: 'Non-verified', permissions: [0] } });``` is this a valid way of giving one of the roles reading and viewing permissions and the other none
it has lot diffrent to json but not that much to ini and config
ok so i have a delete button
and i want the entire div to disappear
when u click it
but idk how
yes, but i need to get the big div element
like it doesnt have an id
and if it did, it wont work well
besides the data format i mean
if the button is inside the div you can use .parentNode
lemem try
hey anyone know how to fix : bot crash when join in a stage channel?
discord js version?
my thought exactly
12.3.1
Update.
try updating discord js
indeed
v11 crashes on stage channels
I keep telling people "hey yeah you had a full year to update, so that's on you"
^^
if it works, don't fix it. unless its deprecated
now doesnt crash
"If it ain't broke don't fix it" works for physical machines, not for programming code on external systems ๐
but leave istant the channel (nothing in console)
it works
but deletes everything
like so 1 .parentNode leaves the bot
box
but removes content
then 2 of them
deletes all the boxes
@earnest phoenix
updated?
there are some documentations about stage channels?
pog ty
They're literally just like voice channels, mostly
stage channels are not supported in v12 technically
you need to use the master branch
yes but my bot say that I must be in vc channel (if i am in stage channel)
is a music bot
code?
js
discord.js v12 treats stage channels as "unknown" so it doesnt register them in the cache
but groovy can play song in stage channels
groovy isn't using discord.js is it
oh okay
if you want support for stage channels you have to use the master version
which is v13 thats in development and not officially released yet
so I can't make that the bot play in s.c. if I use discord.js v12
Has anyone ever used this? https://github.com/aio-libs/async-timeout
in html, y do buttons have, default type of submit. Like y the f??
const filter = (m) => m.author.id === newMember.id
newMember.dmChannel.awaitMessages(filter)
.then((collected) => console.log(collected.first().content))```
why is this giving me: cannot read awaitmessages of undefined?
newMember is the property i have passed in the guildmemberadd function
because they were made to be used with forms
then what should we use in general?
would it be good, for screen readers? Can they detect it
if div is used as a button
๐
newMember.user.dmChannel
The button role should be used for clickable elements that trigger a response when activated by the user. Adding role="button" will make an element appearย as a button control to a screen reader. This role can be used in combination with theย aria-pressedย attribute to create toggle buttons.The button role should be used for clickable elements that...
check if the string is number like this
if(!isNaN(+args))
yo everyone
i got a problem with my leveling system
so first lemme show the code then lemme show the bug
and this is the bug
i don't understand what causes the bug and i request your help
what's the bug?? Does it always show level 3?
no it just loops the level 3 for one user
it also loops level 6 for me
and other dude with some other level
const user = message.mentions.users.first
if(!user) return message.channel.send("Please mention a user to give money")
const money = args[1]
if(!money) return message.channel.send("Lamo you are not giving anything to that user!")
if(!isNan(money)) return message.channel.send("Money should be in numbers")
When I type only
--give them it sends me money error not user error
if you're not using an editor like notepad then your editor should scream at you already
first convert args[1] to number
const money = +args[1]
why do !isNaN() if isNaN() is is Not a Number so !isNaN() is is not Not a Number
= is a Number
Is anyone able to answer this 
idk typescript so no im not able to
if the string is a number then !isNaN() returns true
yes
you can use ts-node with nodemon, then u no need to build everytime u make changes
Yeah that's an option, it's more or less entertaining options for production building
For building in dev I'd be using something simple
Or deno with --watch flag
There is a deno port of discord.js on deno.land
I don't use djs
discord-rose
import the module in deno with import stuff from "https://esm.sh/discord-rose" if it's on npm
berry brainwashed me
yep
and deno is 30% smaller than nodejs because it doesn't have npm as it imports stuff from url
internal/fs/utils.js:269
throw err;
^
Error: ENOENT: no such file or directory, open '/home/runner/novabot30/index.js'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at Object.<anonymous> (/run_dir/interp.js:195:19)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/home/runner/novabot30/index.js'
}
I'm tryign to host on replit from heroku
and I dont know what is going on
how... are you hosting a project on replit from heroku
nope, I'm moving my project from heroku to replit
I've uploaded the file from my computer to replit
well the error is saying you don`t have a file called index.js here
ok i did it
Is the cache like a Discord Collection so you can use client.channels.cache.find(x=>x.name==="test")
what happen if I host the same bot on 2 clients?
it`ll probably answer twice to commands
But it is really better replit than heroku? I ask because I wanted to do a test. I'm using the same commands with same code but from different bots and the heroku one answer faster
Neither is better unless you pay for them.
So why do you want to move away, then?
idk, I've Heard that Heroku Is Better
whoever you heard that from doesn't sound very smart, no offence
Both free services are going to be crap
There are no good free hosting services. Period.
It costs money in the real world for good stuff
^^^
obv
You could be like me though
i recommended digitalocean myself, itโs safe & secure and you only pay for what you need
with my Intel Pentium lol
you only need good wifi
only
โonlyโ
with a bot running either in JS or Python? yeah

both are very well optimized languages
decent
or well, if you have good standing code, you should only need wifi to begin with

284 mbps is more than decent, that's very good
anything above 20 mbps honestly is good enough lmao
that sounds more like a standard you've set for yourself lol
if not, reallyyyyy shit
the lowest i get is 70 mbps but highest i've gotten was 350 mbps

lol what
๐ค
cool
i'll choose what plan works best for me
judging people for wifi speed anything over even 10 mbps is dumb
some people just genuinely canโt get that
which is why it's considered rude
highly populated areas/rural areas/etc, canโt control what they canโt
not judging people if you would read
Italy ๐ช
i am judging the speed
alright so you're also indirectly judging the plans people choose with their ISPs
I am indirectly judging the guy
you don't need to explicitly call it out in order to be judgemental of it
i am indirectly judging his family
i am indirectly judging his grand parents
I am indirectly judging his country
i am indirectly judging earth
so i am indirectly judging everyone
4head
your argument makes no sense
no u
you started saying i am indirectly judging
then i just said who or what i am indirectly judging
so now you can say i am rude to everyone on earth
no you're honestly just a smartass trying to play it off cool and that's also annoying as hell

alright, i think this conversation is just going to go in circles & isnโt relevant to development anymore, letโs move off of this 
nice
what is
client.channels.cache.find(x=>x.name==="channelname")
in discord-rose
worker ??????
If you enable cache, kinda yes but different syntax due to funny
yeah i will disable some props
already saw it but did not find out where it get saves as worker.channels.cache or without.I will have to try it ig
worker.channels.find(e => e.name === 'name') or something
where are you getting that cache from
^
it's not discord.js
work with disabled props too?
Id have to test that
Experiment 
I mean I use everything enabled but without intents
I want to just use discord-rose bc custom caching
Also million I have a PR berry is waiting for your approval on
Yeah it's nice
ik ik
Command handler is also bussin
my internet went out yesterday
Rip
it was like 2 pm to like 12 or something
rip
let me test it
Nice thing is the library is quite small as opposed to the likes of eris and djs so if you need to figure out how something works you can just look at source
yeah okay,btw are there internal shards?
yes
Sharding config is mainly set through BotOptions
okay gd
It's just, "how many shards total do you want" and "how many shards should a cluster have"
bot.guilds.cache.get('846512453658738720').channels.create('๐ Chat ' + Channel, {
type: 'text'
}).then(async(chan) => {
await chan.setParent('846512454103859222')
await chan.overwritePermissions([
{
id: 846512453658738721,
deny: ['VIEW_CHANNEL']
},
{
id: 846512453658738720,
deny: ['VIEW_CHANNEL']
},
{
id: user.id,
allow: ['VIEW_CHANNEL']
}
])
})```
that's all permissions except the user
IDs are strings not integers.
use quotes around all IDs in your code.
const client = new discord.Client({ disableMentions: 'everyone' });
What is disableMentions
or use String()
It disables... mentions.
For clarity an id is this
`${bigInt}`
Is there is any other event then disableMentions
disableMentions: 'everyone'
thx
when typed, yes @south sinew
wrong.
๐คฏ
but most people don't care about it
Also wrong.
!
doesn't JS also do bit rounding or smth?
you forgot n
It is technically a big int when typing it
or BigInt(number)
it's greater than whatever the stupid for it is
yeah ok but discord.js treats them all as strings
2e52 I think
so trying to use bigint is completely pointless
I'm just saying when it's typed that's what it is
its the same thing
^
Ok but guys this isn't useful to a user that just wants to use discord.js
I agree
I suppose
It's great to flex that you know what a bigint is, but it's not useful to anyone in this context.
In like 4 contexts it is 
I'm not trying to flex information I'm just saying it to be helpful
It's not broken
its not wrong?
Sheesh
its just the way its output
It's 100% working correctly
there is no reason to output the "" for a string
Now do the same thing with 683630053686378498 which is the context in which we're in right now
Show the result of String(683630053686378498) and tell me again how my eval is broken.
not the typeof
the result
I know it's a string, you noob
Hey I wanna learn react with electronjs to make dekstop apps with JS but when I run my start command: "electron-react": "concurrently \"BROWSER=none npm start\" \"wait-on http://localhost:3000 && electron .\"" I gain this error:
just keep ids as strings and move on
why does it even matter
its not
thats how mine does it
I don't see what you are on about
Sorry, I'm getting agitated. I just can't stand people flexing ridiculous knowledge thinking they can one-up my 20 years of experience, when all I want to do is fix an issue for one user that doesn't understand any of this shit.
@earnest phoenix eval String(683630053686378498) please.
Go ahead. Humor me.
its not getting output as a number

Do you see how this number is not the same?
would you mind doing 'O' + "w" + 'O' and tell me if the quotes are output in the eval
It's not the ID that this person is trying to give to permission overrides, because it's no longer the same ID
it was just joining the two strings
if you're doing permission checks you should be checking the mutated ID, so the ID after the change
why are you checking the old one
it's literally the wrong string even as such
the whole point is you're trying to perform a logical operation to check if the comparison of both are equal and they're literally not
you're going to genuinely give people brain aneurysms RAKE lmao
The worst here is that the person that asked the question was answered and helped like 15 minutes ago and y'all are still flexing how you think you understand JS integers.
So pointless.
Anyone knows speak Arabic here
#general-int does
This channel is english only
I honestly don't see anyone really trying to flex, just a miscommunication trying to prove another person wrong
no
no
it is a flex
@earnest phoenix you cannot use integers
It would not
Literally would not
And I've proven this to you
you've proven it to yourself
It won't
@earnest phoenix integers don't have the precision that IDs use, you need to keep it as a string
and it clearly doesn't
are you blind or being stupid right now?
@ripe prairie
too slow
It's RIGHT HERE that it doesn't work, right in your face, my friend.
-b @inland yarrow racism
Banned Raiz#7046 (@inland yarrow)
ty
LOL
Our pleasure, Neko! ๐
ah i see what you mean
hello so whats a bufsize in python?
File "C:\Users\Cameron\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 778, in init
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer
Once again I have disabused someone of an erroneous notion. 
but what is the function for String() then? when it is still a number
It converts a number type into a string type
stinky pun
doesnt that error just pop up for a variable?

It's not "still a number". It's a string containing a number.
send full error/code
i dont even know where the error is it doesnt say
"12345" is not the same as 12345, @earnest phoenix
๐ค
i was testing this janky ass way of running a javascript file with my python code
and it didnt like it
LMAO

so how would you convert a number to a string then?
They are technically numbers, but js cannot process them as such.
using a number means you lose precision
snowflakes
don't confuse him please
thank you
what we learned from this conversation
IDs are strings
treat them as such
The problem here, isn't converting a number to a string. It's processing/reading numbers that are larger than JS's MAX_SAFE_INTEGER. That number is 9007199254740991 , anything bigger than that cannot be processed this way.
I actually used numbers for my first database
I'm confused why you would run JS along with Python
you wouldn't
correct That's why discord creation age are not correct .Since they use snowflakes
not exactly
djs utils does a lot of work to get it correct
I yoinked a function that seems to work when I needed it
How do you generate snowflakes in languages that don't support int64 is my question
I'm guessing you wouldn't be able to.
Do you literally take right-most character from last ID, increment it, then put it back
how do I fix this?
huh
yes?
if they dont support bigints or any other arbitrary precision arithmetic, then you can do it in multiple steps and converting each piece to string
What I have to do for hosting 24/7 on replit?
Use uptimerobot
hacker plan or uptime robo
Multiple steps = ?
See full guide here: https://anidiots.guide/hosting/repl
$tu
how I get the link?
can someone please explain how tofix my issue?
timestamp.toString() + instance.toString() + sequence.toString()
you will need a bit of padding tho
Run a webserver along with your bot
You will have a repl.co URL. That will be the URL to send your requests to
the code before the token?
Oh, I see
just read the whole thing
timestamp doesnt need padding since its the front of the sequence
It says at the bottom
what does it say at the bottom
but the instance and sequence bits need to be padded to 4 characters if they output a number smaller than 1000
set an env var with HOST=localhost
how?
linux windows?
windows
I need more info do you run it on a local machine or remote device with public ip?
local machine
did you set the port?
wdym set the port? I'm new to react and electron
I did it, but it doesnt turn green
win.loadURL('http://localhost:3000') this?
well look at the error message you probably did something incorrect
okay i see go to package.json
yup
scripts .start
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"electron-react": "concurrently \"SET BROWSER=none && npm start\" \"wait-on http://localhost:3000 && electron .\""
},
and change it too "set PORT=3000 && react-scripts start"
I want to align items like this with flexbox:
/--------\ /----------\
| [left] | [space] | [center] |
\--------/ \----------/
how do i do that?
same error
"permission denied" sounds like, y'know, a permission issue
as if you weren't, like, admin.
clearly this isn't running under that account then
i tried removing the flexbox and setting align items to center and putting the first element on position absolute
still doesnt work
how do I make it run under my account then?
why does it search a port in 0.0.0.0 and not in locahost
I'm not sure
try running this under an admin command prompt
see if it changes anything
The issue is that it's on my D drive and I don't know how to access my D drive through my cmd prompt
It's replit really 24/7?
the hacker plan is
the free plan, not so much
Literally just write D: in prompt
and uptimerobot doesnt guarantee 24/7
yeah that didn't work, I had to do cd /d D:
also with uptime robot?
but that doesn't fix it either
yeah
really? wat
same error
how much does the hacker plan costs?
5$ a month
a vps is the same price but better
try with SET HOST=localhost && react-scripts start
anyone?
any yt video for doing this?
got to task manager
yup
Evie or a guide?
this?
If you don't have any important process running at background terminate them all
did you kill all proccess?
all node processes yes
then use an another port maybe 3005
you are doing It with vpn?
doing what
VPN is not a VPS, those are 2 different things
6969 is better
remove set host=localhost
"electron-react": "concurrently \"SET BROWSER=none && npm start\" \"wait-on http://localhost:3005 && electron .\""
win.loadURL('http://localhost:3005')
Oh that's not gonna work, I tried using a different port before
my bad
Evie you have a Guidor for VPS?
help needed
I want to align items like this with flexbox:
/--------\ /----------\
| [left] | [space] | [center] |
\--------/ \----------/
how do i do that?
this for example?
you can do it for free if you get the "express" package and use Uptime-Robot
nope, because each service can be completely different.
did you try it with align-items: flex-start; align-items: flex-end;?
nope
time to try it and see
so I guess I'm not learning electron and react then
OS system of the VPS?
Ubuntu 19.04 or 20
anything you'd like
ubuntu is just popular
nothing to change in the code?
actually no changes are required
since the code is compatible with every os
I've found a guide for Digital Ocean. Anyone that knows It?
inb4 we're expected to index the entirety of google in our brains
Johnny Mnemonic gang.
Thatโs what we have Google for 
To know anything Google knows
makes sense?
That entirely depends on how you build your command handler
using @bot.command(name="", aliases=[])
So my question is quite long so should I wate for you all to finish?
woops
sent that twice
ok
So I am trying to make a command for my friend and I's rpg bot. Its meant to choose the elemen tyou will use on your journey but for some reason when I run it i get an error. Any idea what's going on?
Code:
@commands.command()
async def start(self, ctx):
embed = discord.Embed(
title = "Welcome to Discordia!",
description = "To get started please choose a element you wish to use below.\n`โWarning this can't be changed laterโ`",
colour = discord.Colour.blue()
)
embed.set_footer(text=self.bot.user, icon_url=self.bot.user.avatar_url)
embed.add_field(name='Elements', value="\n๐ฅ for Fire\n๐ for Water\n๐จ for Air", inline=True)
msg = await ctx.send(embed=embed)
reactionFire = await bot.wait_for_reaction('๐ฅ')
await msg.add_reaction("๐ฅ")
await msg.add_reaction("๐")
await msg.add_reaction("๐จ")
def check(self, reaction):
return user == ctx.author and str(reaction.emoji) == "๐ฅ"
#return user == msg.author and str(reaction.emoji) == "๐"
#return user == msg.author and str(reaction.emoji) == "๐จ"
try:
reaction, user = await self.bot.wait_for("reaction_add", timeout=10.0, check=check)
except asyncio.TimeoutError:
await ctx.send("Timed out.")
return
if str(msg.reaction.emoji) == "๐ฅ":
await ctx.send("You choose **Fire**!")
if str(msg.reaction.emoji) == "๐":
await ctx.send("You choose **Water**!")
if str(msg.reaction.emoji) == "๐จ":
await ctx.send("You choose **Air**!")```
Error:
``` File "/home/container/cogs/start.py", line 22, in start
reactionFire = await bot.wait_for_reaction('๐ฅ')
NameError: name 'bot' is not defined```
I had it on copy and paste
this is line 22: reactionFire = await bot.wait_for_reaction('๐ฅ')
yes. look 3 lines above. ```
embed.set_footer(text=self.bot.user, icon_url=self.bot.user.avatar_url)
self.bot ?
seems useful
from main import * hah
lemme try that
reactionFire = await self.bot.wait_for_reaction('๐ฅ')
AttributeError: 'AutoShardedBot' object has no attribute 'wait_for_reaction'```
WAIT_FOR
I don't even code in python. lol.
oh
?
BROOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
calm down i can't understand what you mean
no dude explain
rtfd = read the f*cking docs
oh I didn't even see that.
Use wait_for. wait_for_reaction is a legacy method
OH
And as you can tell, it doesn't exist
Yell at your friend
< Me
I thought of that xD




