#development
1 messages Β· Page 1664 of 1
Remove this
ones balance and ones beg
im trying to deploy python to heroku, but whatever libraries i dump into Aptfile dont seem to be working
Change Oy verilmedi to Bu komutu kullanabilmek iΓ§in b...
libespeak-dev for example
Yes, I got that. But I'm having a hard time understanding what you need help with
I can't help you unless you tell me what's wrong
I have everything there's no errors but it doesn't work
nothing happens when I do +beg
or
+balance
and I have client = commands.Bot(command_prefix = "+")
Well, once again, why are there two identical open_account(user) methods?
because one shows it when they do balance and the other one shows it when they beg
@pale vessel do you know how to remove this?
Do you know the basics of Python?
ye
Can you come to my server and try?
I've tried like 4 times to do this
but it does the same thing
But you would only need one open_account method
They are the exact same, so there's no reason to make two of them
what do I delete
One of the open_account methods
I deleted 1
Remove the formatter?
not sure what
I kinda need the formatter
Not sure if this is the right channel for this but
Iβm looking to expand my JS out a bit more so i want to learn more about the language itself
I am wondering if anyone has any good tutorials that go in depth in what they teach and tryβs to make it fun?
I did that and ran it it still doesn't work
@pale vessel Can you come to my server and try, I need a person who did not vote for the boat?
Sorry, I can't. Do you have an alt?
the problem is that I voted from all my sub accounts
oh
π
You will come to the server where I and my bot are already
@pale vessel thnks π
helpy mey
I couldn't understand what's wrong here?
sorry π

Come again?
Replace this with } });
Wow
ok thx
HOW TO MAKE CURREMCY SYSTEM FOR THE BOT
curremcy
You could start by setting up a way to store data, e.g a database
^
then add some features to add money to the users in the database
you could use sql
if it's larger scale
but if it's like a local bot you could probably just use a json file
We're not here to write code for you, start by yourself and ask here if you have any questions along the way
ok
there is likely a couple of great examples on github. Try googling youll easily find a script you can adapt.
thanks
help me pls
how to align text in center in markdown?
You can't, markdown doesn't have styling capabilities. HTML does though.
How could I get free ssl certificate for my website?
I wonder if I can do something like game tips/guide using markdown on github repo and integrate it with my discord bot
Like using webhook or request it via axios etc
Cloudflare or Let's Encrypt
When you have one property in a function, is there a way I can pass out more than 1 argument?
what do you mean
function functionName(oof) {
console.log(oof);
};
functionName(1, 3);
Is that possible?
use ...oof as parameter
It makes the property receive in array, I believe?
.. or to be able to pass out an array as the argument?
Yeah, or spread an array ([1, 2, ...[3, 4, 5]])
you can also use the arguments variable
I know, to return to the arguments.
Hey does anyone know how to list all server roles in discord.js? I'm trying to make a server info command and when i try
message.guild.roles i see "[object Object]" in the message.
You should list the role names
I just want a list idc how its laid out
right now you are trying to send a Collection of roles
well a rolemanager
right
Ty
<RoleManager>.cache.map(role => role.name) will give you an array with all role names
uh ok ill try that
don't just copy paste
function sum(x, y, z) {
return x + y + z;
}
const numbers = [1, 2, 3];
console.log(sum(...numbers));
// expected output: 6
I see here I created a function that receives 3 operators and returns by adding them.
I created an array called numbers which are numbers, and I assigned 3 values inside the array.
Did I use those values to assign them to the placeholders in the functions?
you should try it
me?
no, Hamood
No.
oh ok
google when i try that the <> messes up my code and make a bunch of random stuff a string & also unexpected token '<'
In the web, I didn't understad why they added the spread operator before assigning the values of the array to the placeholders in the function
and w/out it says RoleManager is not defined
That's because what I gave you is pseudo code - you're supposed to replace <RoleManager> with an actual RoleManager object
guild.roles
yeah
Because javascript doesn't know whether you want to pass the array as one argument, or the argument values themselves are in the array
so you add ... to specify that the arguments of the function are inside an iterator
Hm.
const oof = [1, 2, 3];
console.log(...oof)
I have removed the ... and it logged the array and added the ... and it logged the values of the array.
Basically ... can have many uses?
No, that's the same use
You can give as much params as you want for console.log
When you add the ... before the placeholder in the function, it makes it receive an array, though?
it iterates the array and pass them as arguments
it's equivalent to console.log(1, 2, 3)
Ok, let me write the final code just to asses my understanding.
for functions, it also makes things easierjs function sum(...nums) { return nums.reduce((acc, cur) => acc + cur, 0); } sum(1, 2, 3, 2) // 8
/* First Test */
function sum(x, y, z) {
return x + y + z;
}
const numbers = [1, 2, 3];
console.log(sum(...numbers)); // I think this will pass the values of the array to the placeholders or the parameters in the function.
// Outputs 6.
/* First Test */
function lol(...x) {
return x;
}
console.log(lol(1, 2, 3, 4, 5)); // I think this will pass the values to the placeholder which is an array.
// Outputs 1, 2, 3, 4, 5
/* Second Test */
const oof = [1, 2, 3];
console.log(...oof) // Logs, 1, 2, 3 ... "1" is a string.
this outputs an array, no?
Yes, woops.
I edited.
Just to understand, when you add the spread operator before a parameter, it makes it receive an array but when you add the spread operator before an array, it makes it not an array?
the parameter needs to be an iterable (for ... before params when calling functions)
In function args, ...params just gets all the parameters and puts them in an array
you use ...args in functions so that you can access them in an array, since you wouldn't know how much params the user gave
Indeed.
it's useful for handlers
While the spread operator in this:
/* Second Test */
const oof = [1, 2, 3];
console.log(...oof) // Logs, 1, 2, 3 ... "1" is a string.
just removes the values from the array and return them, right?
it provides every element of that array as a single argument for console.log, hence why you see 1 2 3 in your console
Also 1 shouldn't be a string
Oh, got that.
π
basically opposites in arrays.
tldr it turns arrays items into function params
Alright! π
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 293, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 247, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
what does this mean
nvm
I added My Bot to the site..,
I need to do now, help ??
how many hours are estimated
Is it possible to make a hyperlink with a reaction so when you click on a reaction it directie opens up the link
Just told you, 2+ weeks
no
when did you add it
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases
;-;
I will use a code with 2 words. What should I do?
example
name: "lol", and "lul",
but how will I do?
whut
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases
this error is comping ;-;
I want to use a code with 2 words
Hey everyone I'm Jess
And I'm very new to this
I was wondering if anyone could help me make my own bot?
I want to make a particular bot though
One that's private and for me to use
Is there anyway I can do this?
If so can you tell me what I'll need to do it
And Whats steps I would have to do?
Thanks
Well yes. Others could see him, but only you could use it
First of all, do you know what a bot actually is? Like, what makes a discord bot work
Your first step should probably be to get familiar with a programming language
heey
You'd be better off asking in #topgg-api
made my first smort contrakt using hardhat and tested it on a local blockchain
I feel p o w e r f u l
do while loops wait for it to finish to run a new loop?
or it just runs a new loop every milisecond?
it will finish the loop and run a new one, as long as the statement is true
unless you do some asynchronous stuff, no. All loops should finish before re-iterating
it's a blocking action
wdym by asynchronus stuff
If you don't know what it is, you don't need to worry, essentially
you can still do async work and have it block
tldr it will block further execution until the condition in the while loop is false
you mean by promises?
If you're curious you can look up asynchronous programming
@pale vessel
But yeah, what cry said ^^
how can I make a loop run even if it is not finished
depends on what language you're using
javascript?
I want to use a code with 2 words

It's very hard to know what you mean by "with 2 words"
||
||
put the stuff inside your loop block into a Promise and resolve the promise at the end. then put a continue statement
while (moderators === weebs) {
new Promise((resolve) => {
dbl.spam("WEEEEEEEEEEEEEEBS");
// dont forget this
resolve();
});
continue;
}
For example, when I type y, write s as an answer, but write s when u type at the same time

wdym cwiccks
it waits for it to finish then start a new one?
normal loops do that yes
but what i did here was create a Promise (so it wont block code execution) and put a continue so the while loop continues running even if the old stuff hasnt finished yet
@carmine summit i dont get what you're tryna say
I mean things like axios is a promise
if you make a request,
it will return a promise
so you need to await it
to return data
?
promise basically means "run this code alongside other stuff instead of waiting for this to finish before doing anything else"
why cant await be in a code without async?
while async can be in a code without await
what does async do exactly?
...why do you need to await synchronous code
you cant
on the bright side, djs v13 isn't out yet so no need for v14 node
if I wanted to get info on some api
also repl.it is now replit.com
need help
didnt notice that xD
no api is asynchronous because http isnt synchronous
what the heck are you trying to say
I mean I needed to await the axios for it to return data. and I cant put an await without async. what does async do exactly?
In what language?
We can't help you unless you tell us what language you are programming in dude
i dont know program
.-.
Then you can't change the status
Don't give out your token
pls set his custom status
why
Because anyone can hack your bot if they have it
no
We won't write code for you
why
Learn how to program before trying to make a bot
yes, learn code
i host it on botghost.com
You just said you don't know how to program
yes
i host it on botghost.com
This isn't a channel to ask for code
This is for help with code you're trying to write yourself
None, you're in the wrong discord if you want people to write code for you
Again, no
then i can save it discord.js
No one is going to write code for you, end of story
@dry cosmos ill write code for you if you paypal me 5$
No one is going to write it for you, and no one is going to give you their finished code
Async/await is a wrapper / syntax sugar around then , that's all there is to it
no money give me it free
@dry cosmos stop begging for other people to write your code
no beg
exactly, no begging
15
- doesnt know code
- is in VSC
You should know better
π
Then you should understand that begging for code won't help
I mean, is there any difference of
async () => {
console.log("A")
console.log("B")
console.log("C")
}
to
() => {
console.log("A")
console.log("B")
console.log("C")
}
I'm younger than you, yet know more than you :P
;D
The only difference is that the function is going to return a promise
This isn't a place to bash people for their knowledge, so please don't
antiSpam = {}
function antiChatSpam()
if isTimer(antiSpam[source]) then
cancelEvent()
outputChatBox("#0000be[MUTE] #ffffff" ..getPlayerName(source).." #ff6600Have Been Muted! ( 60 seconds )", getRootElement(), 255, 255, 0,true)
setPlayerMuted(source, true)
setTimer ( autoUnmute, 60000, 1, source)
else
antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source)
end
end
addEventHandler("onPlayerChat", root, antiChatSpam)
function autoUnmute ( player )
if ( isElement ( player ) and isPlayerMuted ( player ) ) then
setPlayerMuted ( player, false )
outputChatBox ("#0000be[MUTE] #ffffff" ..getPlayerName ( player ).." #ff6600Has Been Unmuted !",getRootElement(), 255, 255, 0,true )
end
end
Literally,
async () => {
}```
is the same as:
```js
() => {
return new Promise((resolve) => {
resolve();
}
}
oh, ok I get it now. Thank you.
help
so both of those is going to say A, B, C
yeah
can u tell me how create this box/bar
```js
This is a code block for javascript
```
Like this
how create this bar
die(false);
can you give me a scenario that will return B, C, A
That would never happen
It'll never happen because the console.log function doesn't return a promise - it's synchronous. Nothing is going to happen if you await it
hi```
is there a way that when someone boost it will send a message there? i know there is i just dont know how
tysm
it will get messy?
yeah
Hi @everyone
Please stop with the unnecessary spam
please?
() => {
message.channel.send("a");
message.channel.send("b");
message.channel.send("c");
}
There's no guarantee which one will be sent first because you don't await them
What do you mean by "boost it"?
I get it.
my bad, i was not specific enough, i meant by server boosting
And what do you want to happen with that?
when someone does it will send a message
So, promises are just like: Run this code even if that code is not done
discord already has a feature for that
async () => {
await message.channel.send("a");
await message.channel.send("b");
await message.channel.send("c");
}
If you mean this, then no, the messages will be sent in order and the rest of the code will be executed AFTER all the messages have been sent
in the channel that then boost happened @dusky sundial
Isn't that a thing that happens by default?
correct me if im wrong
no, i mean that the bot will send a message there
for example:
Does anyone know how the warn system is in node.js language?
database
wdum?
you need to use database
@dusky sundial
Whats database?
What language are you using?
me?
Yes
there is a lot, i use quick.db
what if I placed something synchronus inside a promise?
node.js
i mean in coding
I don't know js, can't help you
ik
if (command === "!warn") { message.reply?
you need to cache the warned users id and save it in a database
Hi
You can use the on message event to check if the message type is equal to message.type.USER_PREMIUM_GUILD_SUBSCRIPTION
@tardy hornet https://discord.js.org/#/docs/main/master/class/GuildMember?scrollTo=premiumSinceTimestamp
hi
I told you to stop spamming here
how?
hi
??????????
antiSpam = {}
function antiChatSpam()
if isTimer(antiSpam[source]) then
cancelEvent()
outputChatBox("#0000be[MUTE] #ffffff" ..getPlayerName(source).." #ff6600Have Been Muted! ( 60 seconds )", getRootElement(), 255, 255, 0,true)
setPlayerMuted(source, true)
setTimer ( autoUnmute, 60000, 1, source)
else
antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source)
end
end
addEventHandler("onPlayerChat", root, antiChatSpam)
function autoUnmute ( player )
if ( isElement ( player ) and isPlayerMuted ( player ) ) then
setPlayerMuted ( player, false )
outputChatBox ("#0000be[MUTE] #ffffff" ..getPlayerName ( player ).." #ff6600Has Been Unmuted !",getRootElement(), 255, 255, 0,true )
end
end
@dry cosmos please stop
what?
Auto Moderation in programming language maybe someone?
ty
tysm
ill go check it out
@dusky sundial he is spamming again
@ripe prairie
@dry cosmos keeps spamming long messages without context
hhhh where
@ripe prairie
@dusky sundial keeps spamming long messages without context
;D
Bruh

yes
np
then say that instead of repeatedly posting random code please
Oh my
Please
have you tried googling first if you want spoonfeed
Not Yet
Star*
would recommend that then
can you not type in code blocks <_<
Pog
i learn it today
from here
it is nice and i like it so much
Bihandu Bro
@latent heron
BB
me go clz
online
;D
Huh?
bruh
what is the advantage of a shard
no advantage
Discord requires you to shard your bot when you reach 2500 guilds though
ok
β
how the heck do you get an api key for etherscan
they dont have any info on actually getting an api key in their docs
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
how to fix this?
you accidentally pressed the spam button
yeah
I understand
but
idk what's the problem
why this happened
because the bot worked fine for some months
You're send to many requests in a given time
You can fix it by not sending any requests for a while and waiting to be unblocked
yikes
that the bot just pastes all the id's of the servers
π€¦ββοΈ
yikes
json dbs are very terrible
so the bot is taking random id's of servers for no reason which are not even there
and giving errors
I DON'T WANT A DATABASE.
I DON'T NEED IT
it's just a server's id's dumper
what
nothing.....
so you just dump server ids into a json file for fun?
I just dump them there to be able to make the prefix change command
that's everything I need the json file for
Well thats probably one of the worst things to use JSON for but sure
what does you bot do exactly?

I just want to undertand
Hi
We could tell you where you're likely being ratelimited from if we actually new what it did but sure
it just randomly generates them
hola
show yer code
str
python
And you're using Discord.py i assume?
yes
Wtf are you doing so much of that's causing you to get temp banned
that's what I am trying to figure out
the only place where I use requests is when I want it to go to the website where you are given random images of animals
so it just goes there, goes to it's json file
and sends it to discord as an Image
I don't use requests somewhere else
just show you code 
500 lines
yes and?
I only care about the code not the text you send
what error are you getting
i can send you the log?
send it on https://hastebin.com
unicode problem
ik
that's why we upload to hastebin
for channel in guild.text_channels:
if channel.permissions_for(guild.me).send_messages:
await channel.send("??????! ??????? ??? ???????? ???? ?? ??????.\n?????????? ????????? ? ???, ??? ???? **Dowuud** ????????? ???? ??????????????, ????? ? ?? ????? ????????? ????????? ??????!")
break
yikes number 1
and?
lmao are they spamming every single channel with the same message
not
mm pretty much
i can clearly see why they got rate limited
still a bad idea
sad
you know that you can just dm the owner
it should send to only one since it has a break
when the bot is added to that server
oh hi tim
ea games
that's the reason I send it to one of the available channels
await ctx.send('? ??????? ????? ?? **1** ?? **1000**. \n???????? ????????.')
for i in range(0, 91283789127389):
msg = await bot.wait_for('message', check=lambda message: message.author == ctx.author and message.channel == ctx.channel)
try:
msgg = int(msg.content)
if int(msgg) > num:
await ctx.send(f'????? ?????? **{msgg}**')
if int(msgg) < num:
await ctx.send(f"????? ?????? **{msgg}**")
if int(msgg) == num:
await ctx.send(f"?????????! \n?????: **{num}**")
break
except:
await ctx.send('? ???????? ???? ???, ??? ?? ???? ?????!')
break```
yikes number 2
this?
@bot.command(aliases=['?????'])
@commands.has_permissions(manage_channels = True)
async def channel(ctx, name):
await ctx.guild.create_text_channel(name)
await ctx.send(f'????????? ????? **{name}** ??? ??????? ??????!')```
would probably check how many time's someone is using this^
just send the error: smth part
channel ratelimits are incredibly high both in creation, deletion and renaming
wait
Python = π’
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd C:\Users\<user>\Desktop\GrellBot\node_modules\better-sqlite3
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.1.2 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@7.1.2 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<user>\AppData\Roaming\npm-cache\_logs\2021-03-22T11_24_12_667Z-debug.log
npm WARN grellbot@1.0.0 No description
npm WARN grellbot@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.1.2 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@7.1.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<user>\AppData\Roaming\npm-cache\_logs\2021-03-22T11_24_12_907Z-debug.log
?
so?
Well, someone can just spam that command for a while in some servers and get your bot banned
so just delete that? or any better ideas for that code?

i think you should ask @umbral zealot for that one
i had the same kind of error with sqlite
after 5 months still cant fix
C:\Users\<user>\Desktop\GrellBot\node_modules\better-sqlite3\build\deps\locate_sqlite3.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that th
e file exists on disk.
wait i didnt see ths
my b
C++ error with visual studio?
did you install windows build tools?
Does the username contain any special characters, accented letters, spaces, etc?
thats the required packages for enmap
i didnt get any errors while installing this btw
did you wait until it said "all ready"?
yea
cough
no it's just GrellBot
wait what username
This is why Python is just nice sometimes
We get SQlite installed by default
/users/username
try moving the bot folder out of there
Move the project into a path that has no special characters at all
Like c:/dev/bots/GrellBot/
should i worry? (db is json)
million wants to see your location
10k folders is nothing
you're using jason.db right
but why

i didnt know how to use sqlite... or any other db
same
C:\GrellBot\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --release ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\GrellBot\node_modules\better-sqlite3\build\deps\locate_sqlite3.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
i used to use a txt db
nope
sqlitr is super easy tho
so you spent extra work making a json db
yes
(i work with two on the same bot)
any youtube tutorials? or only docs?
docs are more than enough
thanks both of you
Could you upload the full npm log (path at the end of the whole error) somewhere like paste.gg?
keyv sounds like kiwi ngl
line 14
lol
error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C++???
c++ is needed for sqlite
dont ask me why
lmao
alright how do i fix that then
when in doubt ask tim
@quartz kindle how do i fix this issue
you should have that setup if you installed BuildTools correctly
Build Tools should give you the needed compilers for both C and C++ along with their relevant linkers
i tried re-installing windows build tools and i get an error saying visual studio build tools couldnt be installed
maybe thats the issue?
uhh it just says this
Could not install Visual Studio Build Tools.
Please find more details in the log files, which can be found at
C:\Users\<user>\.windows-build-tools
open that file
Hey Tim I had a question about that function u made
for some reason there was no new log file created?
however im running the vs build tools executable and seeing if that makes a difference
maybe a more detailed error
sounds like you may have permission issues
static addMaterialsToInv(items, string) {
console.log(items)
for(let item of items) {
let key = item.itemid;
let value = item.amount;
if(!string.includes(key + ":")) {
string += `${string ? "," : ""}${key}:${value}`
} else {
let startIndex = string.indexOf(key + ":");
let endIndex = string.indexOf(",", startIndex);
if(endIndex === -1) { endIndex = string.length; }
let piece = string.slice(startIndex, endIndex);
let existingValue = Number(piece.split(":")[1]);
string = string.replace(piece, `${key}:${existingValue + value}`);
}
}
return string;
}
It adds the objects to the string right but what I've noticed is if I have in the string "22:5" (so itemid 22) and then if I ant to add something with id "2" it adds to the item with id "22"
try uninstalling everything rated to visual studio from the control panel
and delete the folders from Program Files
yeah
ok now try again to run the pre-requisite command, make sure you're in an admin prompt when you do so
wait, you mean everything?
no you dont need to uninstall the redistributables
just those 3
nor studio code
alright
yes
then i just run the command npm install -g --production windows-build-tools?
@tulip ledge needs to change some stuff then, indexOf("," + key + ":")
Tim can u vc?
but will need to changes the includes too
yo'ure missing part of the command
the full command in the docs
Cus i'm still working for hours on this Vps to get npm to work but no matter what, i cant
and add special handling for first item
npm i -g --add-python-to-path --vs2015 --production windows-build-tools
im on tbe phone rn, cant do it
ah, thats ok then, thanks anyway
alright ill do this one
You're trying to install enmap, it's important to run the exact command enmap tells you to install π
Won't this make it so the first one in the string can't be changed? As it doesn't start with a ,
i actually copied the command from the evie-code youtube video :)
Videos cannot be edited or updated. Docs can.
At least nobody does update a video.
Try ./example.db instead
same
Do you use actually use visual studio enterprise?
then make sure your file isn't opened by any other application that might read it, like a database client or something
Then uninstall it, save yourself a few gigabytes
it's not
o
tΓΌrk vaemΔ± qq
@tulip ledge yes thats why i said it needs special handling for the first item
Is a .db file actually a sql database file? Wouldnβt it be .sqlite?
oh i cant even uninstall it
function addMaterialsToInv(items, string) {
console.log(items)
for(let item of items) {
let key = item.itemid;
let value = item.amount;
if(!string.includes(key + ":")) {
string += `${string ? "," : ""}${key}:${value}`
} else {
let startIndex = string.indexOf("," + key + ":");
let endIndex = string.indexOf(",", startIndex);
if(endIndex === -1) { endIndex = string.length; }
let piece = string.slice(startIndex, endIndex);
let existingValue = Number(piece.split(":")[1]);
string = string.replace(piece, `${key}:${existingValue + value}`);
}
}
return string;
}
console.log(addMaterialsToInv([{itemid: '1', amount: 2}, {itemid: '2', amount: 3}], "1:1,22:5"))
returns: 2:NaN1:NaN1:1,22:5
No, the file extension is pretty irrelevant actually.
yeesh, sounds like there was some corrupted install there, that's... uhm.. 
@tulip ledge it needs special handling for the first item, and also needs changes to the includes
Just thinking about it may isnβt a real database file the lib can open
bad?
rip
does it even matter if i uninstall it
Well maybe not specifically, especially if it's actually deleted
what do I change the includes to?
alright
im on tbe phone now, cant do it
still returns 2:NaN1:NaN,1:1,22:5
and add +1 to startIndex
2:NaN,1:3,22:5 I got this now
wheres tbe comma at the beginning?
string = "," + string;
did you add the comma to includes? whats ghe full code now
function addMaterialsToInv(items, string) {
string = "," + string;
console.log(string)
for(let item of items) {
let key = item.itemid;
let value = item.amount;
if(!string.includes(",", key + ":")) {
string += `${string ? "," : ""}${key}:${value}`
} else {
let startIndex = string.indexOf("," + key + ":") + 1;
let endIndex = string.indexOf(",", startIndex);
if(endIndex === -1) { endIndex = string.length; }
let piece = string.slice(startIndex, endIndex);
let existingValue = Number(piece.split(":")[1]);
string = string.replace(piece, `${key}:${existingValue + value}`);
}
}
return string;
}
console.log(addMaterialsToInv([{itemid: '1', amount: 2}, {itemid: '2', amount: 3}], "1:1,22:5"))
alright @quartz kindle @umbral zealot i uninstalled it all, do i run npm i -g --add-python-to-path --vs2015 --production windows-build-tools in admin powershell now?
yep! Exactly
and can I then just return string.substring(1)?
yes
alright it's working now ty π
um
im not sure what happened but i feel like the installation just froze
its normal
can i see the error?
anyone know a way to limit VSC to open huge txt files? i mean huge
its been asking me to reopen it with 4gb but im afraid that still might not be enough.
is there a way to show only first 100k lines or something?

welp
it opened

Notepad++ is really good in opening large files
Apparently you can start it from the terminal with a parameter to limit the memory
u will use a ton of bytes whatever u do since you have to load the file thru ur memory
code --disable-extensions --max-memory=12288mb
I wonder if that wonβt cause an error reaching the memory limit than opening it up
i got more ram to feed it, the issue is that its absurdly long
so its trying to fit all in memory
i wonder how sm like vim would handle it
Ah, I see
sheesh
but terminals have a maximum output
Sublime? 
I can send you a 200GB database file if you wanna test 
@umbral zealot alright i did it all and now it installed correctly :)) thank you for your help
no error lol
oh, ok
Seems fine π₯

-botinfo @finite heath
(node:72128) UnhandledPromiseRejectionWarning: Response: Internal Server Error this error keeps pooping up
I'd probably pick the one you're most comfortable with
If you're looking for simplicity, use Python. If you want the faster one, go for js
@umbral zealot can you help me with something regarding enmap?
Of course, ask away!
how would i go about creating a config file?
bot.settings = new Enmap({
name: "settings",
fetchAll: false,
autoFetch: true,
cloneLevel: 'deep',
autoEnsure: {
prefix: "g.",
welcomeChannel: "welcome",
welcomeMessage: "Grelle Sutcliff greets {{user}}, welcome to the server!"
}
});
``` this is the code for it but i dont know how to create it & make it specific for every guild id
hi
There's no "config file". That creates a ./data folder which contains a database file.
ohh wait i didnt even see the data folder that was created
is it automatically per-server?
@umbral zealot
It's not "automatic", it depends how you write the rest
if you're doing bot.settings.set(message.guild.id, something), that's per guild. if you were to do bot.settings.set(message.author.id, something) that would be per user. If you were to do bot.settings.set("global", blah) then that's a static entry. It's all in the code.
ohh
alright thanks
so for example, if i wanted to make a currency system i would use message.author.id and if i wanted to make per-server prefix i'd do message.guild.id?
Exactly! π
(node:72128) UnhandledPromiseRejectionWarning: Response: Internal Server Error i keep getting this error
Lol
π»ππ
no
yo
#general to chat in english, #general-int for non-english, please keep this channel for development questions.
nothing you can do about it unfortunately
damn
like the error says, an error happened internally at the server so you, as the client, really can't do anything except wait it out and hope it fixes itself as time passes lol
Damn thanks
Ok so i have this command called $anime that gives you a random anime js { "id": 140, "names": { "en": "BLEND-S", "jp": "γγ¬γ³γγ»S", "ep": "12" }, "from": { "link": "https://anilist.co/anime/97994/BLENDS/", "type": "Anime", "time": "24 mins" }, "url": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx97994-5k4ISEsvDl5x.png" } i added this into a .json file i have around 140 different of these so i wanted to make it that it can do $anime {anime name} so it will show that particular anime but i forgot how it was called and how i can do that
this is a really dumb question because its so obvious but idk man i cant figure it out, how do you send a command by pinging the bot? im confused on what the expression is for the bot mention
if(message.content === `${?????????}`) {
message.channel.send(prefix);
}
wha??
For example you can check the property message mentions.
Guessing you work with djs
Yes
then the if statement would be
if(mentionMember == `${bot}`) {
}
``` right?
@boreal iron
err nope
did you forgot about var mentionMember = message.mentions.members.first(); already? a few seconds after we talked about it?
check if the message content is <@your bots id> OR <@!your bots id>
no??
Ok so i have this command called $anime that gives you a random anime js { "id": 140, "names": { "en": "BLEND-S", "jp": "γγ¬γ³γγ»S", "ep": "12" }, "from": { "link": "https://anilist.co/anime/97994/BLENDS/", "type": "Anime", "time": "24 mins" }, "url": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx97994-5k4ISEsvDl5x.png" } i added this into a .json file i have around 140 different of these so i wanted to make it that it can do $anime {anime name} so it will show that particular anime but i forgot how it was called and how i can do that.
oh alright
thanks
aye, that works as well
and it's much more efficient and fool proof
don't overcomplicate when you dont need to ig
I prefer things to be more complicated than that 
but something I don't know...
<@! and <@
what's what?
wait wait
the one with the exclamation mark used to indicate a member with a nickname
that behavior is now removed and it's considered legacy, it appears at random times depending on which client platform the user is using
ah alright
good to know
wait ill just send an image instead
i want the prefix to be typed like this but if i do it like this i just get an error, how do i fix it
don't overcomplicate when you dont need to ig
just to say ... lol
just ask your question here
im more impressed that the IDE/editor didnt catch that
eh which database is the best for storing currencies
i just need to store how much money does one have.
what is the best database for that
Then sqlite is fine - you can use quick.db or enmap for it if you want it easy
oh then nevermind. yes, sqlite is fine.
where do i put the \`
You escape the ` around your prefix, the ` which are inside other `
bro literally just copy what i sent inside of the codeblock and paste it in your template string wherever you want to use backticks
could someone teach me enmap or some ez database thing
could someone teach me how to use voice connections and opus decoding/encoding and streaming?


Open up TeamSpeak, click on Connections > Connect to server > enter it's address and boom there u go
im gonna hit you with a chair
lmao
BUT you will have an active optus voice connection
node native addons are a nightmare
well im stuck at the first step
3 different environments π³ββοΈ
just go with the djs route and create your own bindings
not even gonna lie, i have no clue whats infront of my eyes rn
im not using djs
thats why i need opus

node-opus deprecated
...
do you understand what a binding is
absolutely not
it binds a native library (in your case, opus) to your language incapable of interfacing binaries natively
does anyone knows way to fix installation of quick.db? :v
djs went ahead and created their own opus bindings, https://www.npmjs.com/package/@discordjs/opus
and how does that translate to what's going on?
i just suggested to create your own bindings instead of using someone else's, probably garbage and abandoned, library
i meaaan....
it does seem to be maintained at least
not sure about the garbage bit tho
you can also just use djs opus bindings if you want
how?
bro take a guess how
this is exactly me trying to install both opus and djs opus
my only intuition would be : install it
but the whole error came from actually attemping to install it
so, yeah, bit confused lul
do you meet these conditions
can you shove the full stacktrace in a bin
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.0/opus-v0.5.0-node-v88-napi-v3-win32-x64-unknown-unknown.tar.gz
Use an older node version
it should attempt to build manually if it doesn't find a prebuild
let me sniff through the logs a bit more
i think so yeah
god these stacktraces suck ass
im trying to dig thru them too







