#development
1 messages · Page 769 of 1
Idk, why it should be unmuted?
Did you fix that?
That's not okay to do lol.
That's still not okay.
That's still not OK lol
The issue has been resolved tho
You just proved you were acting like a child.
Don't act like child = no problems
Rule 1 lol
So?
Report it then.
Doesn't mean do it back
Two wrongs don't make a right.
Yeah well one wrong doesn't make a right either. At least two wrongs will make me feel better.

No one claimed that? Stop acting like a child and just fess up to a mod or something.
i did
Then leave it at that.
@sinful lotus I fixed my bot it doesn't respond without a prefix anymore. (645824637338386433)
done
thank you
My comments on above discussion is
why do you test on production at the first place
have a proper test enviroment
even you did stop it, it still flooded #commands and I wont really let that left unoticed
so I muted it, so you the developer of the bot would make sure it wont happen again
what if it does
var sonicIcon = client.emojis.find(e => e.id == "667304852422131722").toString()
very simple code execpt
that it tells me it cannot read toString of null
except you are still using var
use let or const, var is outdated (on js, cause ur code seems to be js)
and why you need to make it to string
js automatically makes it string if you add it to string
k
Well.. not really since client.emojis.find will return an emoji object.
It's called a method.
So the class itself has a method to conver tit to the emoji id if it's implicit/explicit.
My bad. Erm.
I'm replying to js automatically makes it string if you add it to string
Yeah
"var is outdated" not really, It's just a resource hog and doesn't really care too much for scoping.
client.emojis.find(e => e.id == "667304852422131722") returns an object.
but why is it null
the id isn't invalid
and the emoji with that id exists
and the bot is in that server
Var isn't outdated. Of course If you use Node.js I don't see the use to be honest. If you don't wanna use polyfills you can still use var for old browsers support.
Unless they updated it. I haven't tried in a while.
What i mean't is.
const/let used not to work on IE11 by example.
It probably still don't.
@marble juniper You are using Discord.js right?
yeah
So according to their docs:
All collections used in Discord.js are mapped using their `id` property, and if you want to find by id you should use the `get` method. See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.
What happen if.
var emoji = client.emojis.first();
and try to console log it.
I mean the actual emoji object.
Ok so It definitly can't find the id erm..
I will go look their docs I haven't used Discord.js in a while I use C#
Did you try to find it by name?
Oh wait.
What is client? Ain't that the whole Discord client.
Shouldn't you check who is sending where on what guild?
Through the message object.
Discord.js works funny.
Everything gets cached into the client so you just grab it from there.
Maybe the ID is incorrect?
Said It is correct. So I don't know.
Yeah but was it double checked? probably not.
@marble juniper Try to console.log(client.emojis)
Possibility that they copied the message id and not the emoji id
True.
Log the whole emojis array.
And check the id through there.
Because It gonna be an array of emojis object.
it seems like I copied the message id yep
Lmao.
@marble juniper linkus what will u dom
🤦♂️
That's like me earlier with my bot.. trying to understand why I kept getting error 403 from Discord.. saying I didn't have enough permissions. I double checked and I was in a channel where my bot couldn't reply in.
10/10.
User errors, Best errors.
It is was unclear though "Missing permissions".
There is more than just one permission.
Should add checks for stuff like that.
That's what I did at the same time earlier.
where can I change my prefix?
I meant on this server my bot has been given common prefix role so it can not be used in #commands #265156322012561408
Hi, who can help me plz ??
soo iam trying to make the progress bar floow the xp and that not realy working
const bar = Math.round(curxp / next); // curxp = the current xp the player has || next = 500/1000 <= 1000 is the next
.addBeveledRect(200, 120, bar, 25, 0)
i think that thing with the math but i have no idia how to fix it because iam sucks with math
do anyone know?
calculate the percentage of progress then create a bar with the width percentage (which is the percentage of progress) of the max width of the bar
p=xp/totalxp
w=max width * p
Don't skip my problem 😦
I don't know quickDB
^
:/
wdym by splice
to all you developers out there, i have only one thing to say.
01010111 00100000 01110111 01011001 00100000 01100111 01111111 00100000 00110011 01110001 01101110
Ah yes
W wY g 3qn
you can't make a meme using hex values
Me, and intellectual:
#000000
#000000 #000000
#000000 #FFFFFF #000000
translate for me almighty doge ruler
What's a good way to pad my text over in an embed?
Would love to have the folder icons all aligned vertically.
with pm2 is it possible to do pm2 logs [app], only return x amount of lines then completely quit. i know i can do it with certain amount of lines but how can i make it so once it's done it exits because ik it'll just keep going on logs
what lib, Panku
D.js
Ooh that looks good.
Thanks for the save August 
I would still love to learn how to pad an embed though
imagine bothering with that
put the things that would not change in length in front, ex like the folder emoji
order it like that so it would look a lot better
Does glitch.com uses Cloudflare?
idk
I get Error with the sever Cloudflare and the error code 401
Hello, when my friends are attempting to add my bot to their server they get a "Forbidden" error, is this because the bot is still awaiting approval? Thanks
No.
thanks for the wealth of information
@frosty citrus the top.gg page for your bot will not work if your bot hasnt been approved
You can give the invite link of the bot to your friends if they want your bot
Hi , if personn can help me
I have my array ["AB", "BC", "JA"] and i want delete BC with .splice and indexOf
@glad charm with your folder thing, can you use a unicode character to switch to right-to-left reading mode and back?
i think there is such a thing
then your first character is across to the right
_ _ free space for y'all
parks in it
plz
Lewd
@lofty hamlet just get the array and then "array".fucnction()
@restive furnace ?
In the screenshot with your code
database.set(database) was probably not what you meant to do
var indexdon = db.get(`dresseur_${message.author.id}.Sac`).indexOf("Pingoléon (Normal)"); let newarray = db.get(`dresseur_${message.author.id}.Sac`).splice(indexdon, 1) db.set(`dresseur_${message.author.id}.Sac`, newarray); console.log(db.get(`dresseur_${message.author.id}.Sac`))
In my array .Sac i have 10 items and when i remove "Pingoleon" the array is just `["Pingoleon"] he rest just the indexOf
It's full bug
Splice returns whatever you removed/replaced so yes that makes sense
No quick db is just bug, with array with not quick db he does work
But with quick db does not work
No but with not quick db he does work
Javascript will execute everything you put on the right side of the = before assigning it to variable you picked
which means that your newarray variable is equal to whatever the splice method returns
Which as said before
Splice returns whatever you removed/replaced so yes that makes sense
It's strange i say but with array with not wuick db it work, so with quick db how i can remove an item from array ?
It worked with the array because the array is actually edited
Your db isn't until you've used set()
And you messed that part up
non-async sleep in async code bad
Uh, so with this i can make splice for remove just one item of array ?
Yes

I've told you the issue with the current code
You just have to change it so that doesn't happen
But i have not understand :/

You're setting the value
To what splice removed
That's the issue
And I explained why, up above
Do you understand that newarray is going to be the result of splice
Google stranslate is fucked

...
I can't because i have already not understand
I can't translate this in my language
Or i have just not understand what is the problem
Why he does work for array and does not work with quick db
bruh
let originalArray = ["a", "b", "c"];
let newArray = originalArray.splice(1, 1);
console.log(newArray) // ["b"] >>>> the result of splice
console.log(originalArray) // ["a", "c"] >>>> the updated array```
That's what you did with a regular array
Yeah
newArray is still not what you intend it to be
<And it work
but it edits the original so it doesn't matter
As explained, that doesn't work with your db
because the splice will just edit your in-memory value
you have to use set() to update the db
and when you do
use the updated array
instead of what splice returned

Yes
- get the array from your db using it's key
- edit the array
- use the key again but this time, set it to the updated array
Did you do it
I can't do it
what did you try
var indexdon = db.get(`dresseur_${message.author.id}.Sac`).indexOf("Pingoléon (Normal)"); let newarray = db.get(`dresseur_${message.author.id}.Sac`).splice(indexdon, 1) db.set(`dresseur_${message.author.id}.Sac`, newarray);
so you didn't change anything

fuck it
let arr = db.get(key);
arr.splice(arr.indexOf(removal), 1);
db.set(key, arr);```
That's it

🥄!
Note how I'm not saving the return value of splice
Because it's not used for anything anyway
I don't know what happened
But somewhere in this
It's outputting from the anime endpoint
No errors
Thx u dude wesley
Nevermind
I found my problem
alright my problem is back
Nowhere in that code is there a neko-bot.net/anime/(num)
so why does it output iy
nevermind I'm dumb
it was from the init file
@late hill you know how i can know how many key exist for db.get(`gts_${message.author.id}`)
Because i do transform this in quick db : for (let item in GTS) { let text = `**${item}** - Personne : **${db.get(`gts_${message.author.id}.Personne`)[item]}** | Pokemon : **${db.get(`gts_${message.author.id}.Pokemon`)[item]}** | Prix : **${db.get(`gts_${message.author.id}.Prix`)[item]} P$**\n` items.push(text); }
The content is already transform but he rest in GTS
You want the amount of keys that an object has?
The amount of object who start by gts_
Oh ok :/
I dont understand why nobody use mysql or postgresql
@surreal wagon a lot of ppl use PostgreSQL
That
And maybe people who use them, actually know how to use them so they don't have to ask questions as frequently

@lofty hamlet Did you read the documentation for quickdb?
This might be what you are looking for:
https://quickdb.js.org/docs.html#all-method
I had to type quickdb get keys
This may be a dumb question, but how do I keep my site's navbar in view without it loading again? e.g. when you switch from home to advertise on https://top.gg, the navbar doesn't flicker or something -- it just stays there
its called all in one site
so everything is loaded and part of essentailly one page not several pages of html
How is a new page loaded? Does it load all at once and then just switch html files? I am confushion
you dont have seperate html files
its essentailly
one page
and stuff is hidden until a event triggers it's unhiding
what happened to ur profile pic cry
bout to go on a social media detox so i removed it to signal i wont be active for a while
@modest maple when you click a link there is still a server call to load the new data, but instead of refreshing the entire page it just overwrites the existing page.
Kinda like what you describe but still loading data when it is needed
i hope not, else all the bot info would also send to the client when you open the first page
what
Hi, how i can know if shard contain server id ?
bot's pages are seperate
top.gg is an all in one website, but it still sends data to the client when the client requests it
yes
that yes
you were referencing actual pages which incorrect
which is*
i have dbs today can't spell
if you open the developer tools with F12 then you see that there is still a lot of data send to the client every time you go to a new page on the top.gg site
For example if you go from Advertise to Add Bot the server will still send the page to the client when you click on that link
https://tayron.is-inside.me/IFvUDRTv.png has anyone a idea how it works?
yes
Are you sharding your bot
yeah
but what else?
i've js
xD
are you on d.js v11 or v12?
on v11 should be client.shard.count
are you sure? because client.shards doesnt exist in v11
Hi, how i can know if shard contain this server id : XXXX ?
and your error said cannot read property 'total' of undefined which implies client.shards is undefined
that doesnt mean it works lol
it just means it doesnt have a syntax error
wait until the 600000 interval passes, then you will see if it works or not
the bot posted the things and yea but okay i'll wait
yeah
then it already posted automatically
not from postStats
doing dbl = new DBL('Your top.gg token', client); already enables the automatic poster
well idk then, but you're literally doing dbl.postStats(client.guilds.size, undefined)
which is probably the same as sending guild size without shard count
wait 10 mins pls
Thanks y'all! Looking into react-router now :)
Hi, how i can know if shard contain this server id : XXXX ?
if(client.guilds.has(id))
@quartz kindle thx
And how this code does not work ??
let content = ""
try {
for (let i = 0; i < 10; i++) {
let user = bot.users.get(lvl[i].ID.split('_')[1])
content += `${i + 1}. __${db.get(`dresseur_${user.id}.NomDresseur`)}__ - **${lvl[i].data.Points}**\n`
}
} catch (err) {
console.log(err)
}
console.log(content)```
TypeError: db.startsWith is not a function
I think startWith is remove from my quick db version so how i can make leaderboard like this ?
sortBy: '.Points'
should that be .Points or Points?
@blissful scaffold hu ? This is for example : db.get('dresseur_${message.author.id}.Points')
I think it's because the startwith is remove
also @lofty hamlet if you read the documentation then you see that there is no startsWith method
https://quickdb.js.org/docs.html
It existed before
@blissful scaffold
So now how i can make leaderboard like this ?
Because startsWith exist after
I'm sur
Searsh in google
iam trying to make my progress bar moving with the xp value of the player can anyone help me?
js
do it off pct off of lvl up
scale like that
@earnest phoenix i try i didnt understand
i don't know how else i can simplify it for you
if you can't understand percentages, which is maths for 12 year olds, programming maybe isn't for you
i know what you saying but its not working
you did it wrong then
(currentXp/xpPerLevel)*barLength = length of the xp bar in pixels
then you draw that on top of the full bar length
they already got told that
sometimes you need to repeat it so it also enters the 2nd eye/ear
<db>.startsWith isn't a function
https://quickdb.js.org/docs.html#all-method
try db.all() and see if you can do anything useful with that array
quick.db has bad documentation
what are you even trying to do?
Is it possible with Discord.JS to make it read a file from a GitHub repo?
So for example I have a version command with an open source bot so they can download and host their own copy obviously the open source project is available via my GitHub repo... What I am trying to accomplish is if they are hosting their own version of my bot and run the version check command it will check my GitHub repo for a file (versions.json) or something like this and inside that file will be the bots version (1.0.0 ect) and the bot will compare this to it's Versions.json file if the versions don't match it will send a message telling them to check for updates.
sure
but rather than doing files
that can easily be edited and broken
just have a const in code
You can use node-fetch
you can then compare that const to some versioning file in your github repo
So like const version = require('PathToRepo)
no
i-
how would that even work
i was pointing at a const string in your code
so many issues xD
you have a const string that defines the version
Yeah
then you use node-fetch to make a request to the file hosted on github
and compare the version strings
Nodejs can't automatically fetch from github btw, don't even try it because it won't work
thank you for saying what was said a few messages above
@west raptor that's why we suggested node-fetch
Yeah sorry misunderstood you the first time
Oh well I'm fucking blind
😂😂 it happens
Thanks guys I will use your recommendation with node-fetch I was told I could also use the "HTTP" module
🤷🏻♂️
"http" module in node is very bare bones
Yeah I've heard that's why I asked for another opinion
i use the http module most of the times lol
but yeah, there are like 93746593 different http libraries out there
all of them based on the http module
Yeah the one I was told about is this one
The "built in" HTTP Module
But I haven't been able to find docs for or examples of it doing what I'm trying to do (if there even are any 🤷🏻♂️)
^ scroll down to https://nodejs.org/api/http.html#http_http_get_options_callback
Nodejs can't automatically fetch from github btw, don't even try it because it won't work
Really, there's no git client as an npm module? That's surprising.
you don't need to bloat your app with a package for everything
Thanks again 😁 sorry for the delay in response
Can someone please help me host a bot on my laptop?
Why host it on your computer when you could use Heroku or Glitch?
If you want top host a bot I would reccomend using a VPS or rpi4.
A bot isn't made to be hosted on your personal computer
@flat pelican you say that
you can
and self hosting is still better than glitch or heroku
You can - but this is just more than bad
imo
if you have spare hardware it's really not bad
Never said that you can't
I mean you can host it locally while you develop it (normal)
what lib?
cry, the price you pay for electricity for the pc will probb be more than buying a VPS.
well no
You can use an old computer for it, I mean it's bad to host a bot in a PC that you use everyday
for daily stuff
I love how this started a whole debate. Host it on a Rasperry pi.
ok
Raspberry if it's a simple bot for a few servers
@modest maple agreed.
xD
the investment into an rpi isn't worth it if you're only going to buy it for a discord bot
Could be using Linode, Digital Ocean, Azure.
Yes
azure lul
1,500$ Azure Server for a bot on 1 server 🧠
Contabo for best hosts
wasted my student credits for having a student account open
Cheap and high quality
I didn't even use my student credits
Their servers are expensive af
Contabo website ain't eye catchy.
A website doesn't need to be eye catchy for the service to be good
I use Contabo
I have a website hosted
But they provide the best quality hosts
my bot
Never said the service ain't good.
I'm saying that their website ain't eye catchy.
yes
contabo looks interesting
The price for what they offer is okay.
it's a lot cheaper than what I pay now
4.99$
a person asks how "how to do X" and the whole community starts a discussion whether X is good or bad
lmao
CPU: ten cores
Intel® Xeon® E5-2620v3, E5-2630v4 or 4114 processor
60 GB RAM (guaranteed)
1600 GB disk space (100% SSD)
100% SSD disk space
for 29,99 eur.
That's good.
I might consider switching with them.
No one by anychance
knows
how to find the position on a PDF
in terms of X and Y positions
for alignment
@modest maple Hmmm I know there is a lib Pdf.js for Javascript.
It renders PDF to HTML
You could then get positions. I guess.
i need le X n Y pos to edit stuff
which is a pain
when there is no easy way to get
its not a render i need xD
i have a reader and writer set up
i need like an arrow going x = this and y = this
soemone needs to make an app for that
😂
@earnest phoenix wether or not there's a package for git client is what I was surprised at, if there isn't one that's a bit of a missing module, regardless of if someone decides to bloat out their node_modules 😁
I think I have four deps, aegis, mysqlclient, libz and libpcre. If I was going to do git from within my bot id probably just run git commands via the shell.
there probably are multiple lol
hello ive posted here before about an issue about votes not getting recieved, seems votes just have a big delay sometimes
idrc that much just wanted to report the issue
@sage bluff it should be fixed since the last time (a day ago)
o cool
i only had a minor delay of about 5 mins just now
compared to yesterday
shouldnt be the same issue
How do i make an mbed message for my bot?
Depends on the language
js
const Discord = require('discord.js')
const embednamehere = new Discord.RichEmbed()
Then add title fields ect under that
That should help 😁
Or you can use an object js const PingEmbed = { title: "Pong!", // ... } <Channel>#send({ embed: PingEmbed });
or like
docs > any guide
embed object is also cool
msg.channel.send({embed: {
color: 0x696969,
description: "nice"
}})```
I honestly forgot about that method ^^
it is quicker
I like that... Its unique
Lol
I'm just so used to using RichEmbeds via the method I did an example of 🤷🏻♂️
I kinda forgot about the others lol
hey is it just me or is discord.js acting up
/root/node_modules/discord.js/src/structures/interfaces/Collector.js:211
yield queue.shift();
^^^^^
SyntaxError: Unexpected strict mode reserved word
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/root/node_modules/discord.js/src/structures/MessageCollector.js:3:19)
@humble pendant Are you using strict mode?
@humble pendant Also please post a snippet.
Oh wait.
It comes directly from Discord.js my bad.
lol
That's weird.
@humble pendant what version of d.js are you on
discordjs/discord.js repo has no current issues for it
Oh very true
Does anyone know of a bot that can track certain user's status messages?
Or know anyone that can make this
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
So basically in our discord we offer discounts and rewards for the advertisement link in their status, we would like it for tracking purposes to make sure they fulfill their end of the deal
@sage bobcat
@sudden geyser would i need to update it? i use v8.5.2 or smth like that
😳
lmao
So as my status has the discord link, we would like to add users to a tracking bot that would alert us if they changed their status message so we can determine if the discount/reward should be paid
One message removed from a suspended account.
One message removed from a suspended account.
Our discord offers services and we sell things
One message removed from a suspended account.
One message removed from a suspended account.
But the status message is just advertising
uhh
No not a scam at all
One message removed from a suspended account.
It's for the game Runescape, we sell gold and services
Time to tell god ash
indirect ads much
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Noooo
Nothing like that haha
We offer nothing of monetary value
Just discounts
@sage bobcat Runescape is an old mmo and gold selling sites have been around forever.
One message removed from a suspended account.
However are against the games rules
oof
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
So could creating a bot like this be possible? Or are you saying such as those bots, it is not possible?
AFAIK there are no libs that can currently see a users custom status.
It's just newer is why I assume.
One message removed from a suspended account.
Well friends, I appreciate the help so far
Good luck in your ventures.
I just wonder if there's anything else I can do
Probably find another way to go about advertising.
Advertising runescape services is no easy task
Been playing the game for 14 years, I can kinda guess that.
Doesn't help when your game is full of bots either lol.
I can 100% agree
We may be breaking tos by offering services, but we are not the botting type
One message removed from a suspended account.
Lmao runescape isn't worth it :))
AFAIK there are no libs that can currently see a users custom status.
like 70% libs in dapi started supporting custom status the day it was released
mainly because it is rp under the hood
I can't see it on d.js.
it's on master iirc
Right
Presence#activities should contain the custom status
I assumed activities would be Streaming/Playing... etc
Presence{status='online', activity=Activity{type=4, name='Custom Status', streamingUrl='null', richData=RichActivityBean{start=null, end=null, sessionId='null', applicationId=null, details='null', syncId='null', state='test status', emoji=EmojiResponse{name='blobnomchristmas', id=659077525464547338, animated=false}, instance=null, flags=null, partyId='null', currentPartySize=null, maxPartySize=null, largeImage='null', largeText='null', smallImage='null', smallText='null'} ActivityBean{name='Custom Status', type=4, url='null'}}}
This is the raw data that gets returned from the library that I use
It includes the custom status message and emoji
Think someone earlier said it just returns Custom Status I'll have to test it in a minute
heyo if anyone could help me with this error, it would be highly greatful!
(node:4795) UnhandledPromiseRejectionWarning: MongoTimeoutError: Server selection timed out after 30000 ms
at Timeout.setTimeout [as _onTimeout] (/root/node_modules/mongodb/lib/core/sdam/server_selection.js:309:9)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
(node:4795) 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: 1)
(node:4795) [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.
Looks like your mongo database did not respond within 30 seconds
I can't do much research but it seems to me it's incorrectly setup
Has this issue happened before?
no never
Hmm weird, I have limited knowledge of mongo but you might wanna verify mongo is actually running?
check it with sudo systemctl status mongod
it should say active (running) if it's running
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-01-17 02:55:28 UTC; 22min ago
Docs: https://docs.mongodb.org/manual
Main PID: 4732 (mongod)
CGroup: /system.slice/mongod.service
└─4732 /usr/bin/mongod --config /etc/mongod.conf
Jan 17 02:55:28 yesno1 systemd[1]: Started MongoDB Database Server.

Yeah idk then
/root/node_modules/mongodb/lib/core/sdam/server_selection.js:39
x if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) {
^^
SyntaxError: Unexpected token if
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/root/node_modules/mongodb/lib/core/sdam/topology.js:32:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
aw great now what
it could be it can't connect to the instance or you have your connection string wrong
x
/root/node_modules/mongodb/lib/core/sdam/server_selection.js:39
there is an x in front of your if?
@humble pendant what version of the library you're using
I never gotten that error on v3.4.1
that's the mongo server version
I'm talking about the NPM library version in your package.json
no they want mongodb version
oh well
"mongodb": "^3.4.1",
lol
only thing that can make sense that the library can't connect to your instance
hold on gimme a second
I think the ^ means 3.4.1 or higher
Maybe you got a newer version that breaks stuff?

Did you try turning it off and on again?
^ means NPM will update the version when installing dependencies
Did it work earlier? What did you change since the last time it worked?
well, why is x really just sitting there
I think yesno already removed the x
This is the current problem:
https://discordapp.com/channels/264445053596991498/272764566411149314/667564160422248468
What did you change before it broke?
nothing really
Ah
they all have that automatically?
Or do you have to pay
time to selfbotum for free nitro
Auto
selfbotums are no real botums and don't have that
It is also a bannable offence
Only real bots with the bot tag can use all the emotes from the servers they are in
do \:emotename: for the emote info
- warning: wont work on mobile
Is it possible to play a file from a link? I am using discord.js
Yes.
how?
You can add a file or url to an embed
im trying to play the file in a voiceconnection
you have node-fetch installed correct?
yes
ah, cant help with any details about that, but you can play files in a voice channel
playStream and playFile?
yeah
ok i will try it
except on master those doesnt exists, its just play on master
_
i'm probably being an idiot but er
import * as express from 'express';
import port from './variables.js'
const server = express();
server.listen(port, console.log('Listening on port', port));
^
TypeError: express is not a function```
typescript?
using import probably
hm
u sure you're using the flag
yarn add express
oh ok so apparently express is a commonjs module
si
oh
so i have to do import express from express
ye
* as => default export
yeah
Lennart#1406 
Lennart#1406

anyone got good resources on learning about pointers in c++
ive relied one resource so far but i feel like more would help since yknow
also most are paywalled
Learning how to make a binary tree with nodes is a good way to get familiar with C++ pointers.
Or making a linked list.
What is?
the general topic
It's a little weird starting off but it's not bad.
afaik it's the actual low level part of c++ given that a lot of it seems high level
i guess practice makes perfect 
Do you know what a Binary tree is?
sort of, but i haven't gone in depth yet
i can do the research on my own though don't worry
I'd say that'd be a good way to start and learn
yeah thanks
That's how I teach my students at least

we teach C++ here yay
np
How do I download an audio file from a link? I tried using node-fetch but discord.js outputs “this.inputMedia.pipe” is not a function.
I also tried js-file-downloader and it also doesn’t work
whats your code?
you should download it as buffer/binary and write to disk like that
you can also download it as a stream
but if you want to stream the file directly to discord, without writing to disk, thats another thing entirely
I want to stream the file directly to Discord without saving it
let tts2 = await googleTTS(`Congratulations, ${user.username}! Your ${stats.beys[stats.main].name} has levelled up!`, "en", 1);
let file2 = fetch(tts2);
console.log(tts2);
connection.playStream(file2);
``` this is my code
Ok I somehow fixed it by playing the link directly
Thanks anyway
em
So you basically want to fetch a google tts into a file and then stream it into a voice channel
amiright
like making it a file but not saving It anywhere on the disk
k
Ok so how do I make a voiceConnection listens to the “speaking” event until the connection is destroyed? I tried using .on(“speaking”) but it only fires it once.
it shouldnt be firing only once, it should fire everytime a user starts/stops speaking
but if the user starts talking and doesnt stop, then it will not fire until the user stops
@quartz kindle but it only fires once for me. I am doing it in a command handler, does that have anything to do with it?
hey peoople
i have a bot embed that list players
but how could i change the format of it so there is 3 names on one line, then moves to the next line and so on
add \n after 3 players?
how can i write that in js?
because my code
literally just lists the players as a whole
Is it a string?
split it to an array
and use the for loop to add a \n at the end of 3 players
\n works like "player1, player2, player3\nplayer4, player5"
join("\n")
won’t that make one player one line?
its okay, everyone wants it the way it looks rn
so i dont need to care about the thing i wanted
I use https://github.com/MarkisDev/discordoauth
Error:
Notice: Undefined index: id in /var/www/u0917781/data/www/help.avenger-bot/index.php on line 24
how to fix it?
I have already logged in to the site via Discord
const Discord = require("discord.js");
const fetch = require("node-fetch");
const googleTTS = require("google-tts-api");
async function listen(connection, db){
connection.on("speaking", async (user,speaking) => {
let stats = await db.collection("users").findOne({_id: user.id});
if(speaking === true && stats !== null){
console.log("ok");
let xpAdd = Math.floor(Math.random() * 7) + 8;
let xpAdd2 = Math.floor(Math.random() * 7) + 8;
let main = stats.beys[stats.main];
let nxtLvl = stats.level * 300;
let nxtLvl2 = main.level * 300;
stats.beys[stats.main].xp = stats.beys[stats.main].xp + xpAdd2;
db.collection("users").updateOne({_id: user.id}, {$set: {xp: stats.xp + xpAdd, beys: stats.beys}});
if (nxtLvl2 <= main.xp && main.level < 100) {
stats.beys[stats.main].level = main.level + 1;
db.collection("users").updateOne({_id: user.id}, {$set: {beys: stats.beys}});
let tts2 = await googleTTS(`Congratulations, ${user.username}! Your ${stats.beys[stats.main].name} has levelled up to Level ${main.level+1}!`, "en", 1);
let file2 = fetch(tts2);
connection.playStream(tts2);
}
if(nxtLvl <= stats.xp){
db.collection("users").updateOne({_id: user.id}, {$set: {level: stats.level + 1}});
let tts = await googleTTS(`Congratulations, ${user.username}! You've levelled up to Level ${stats.level + 1}!`, "en", 1);
let file = fetch(tts);
connection.playStream(tts);
}
}
});
}
module.exports.run = async (client, message, args, prefix, player, db) => {
let vc = message.member.voiceChannel;
let connection;
if(vc) connection = await vc.join(); else return message.reply("please join a voice channel first.");
listen(connection, db);
}
``` little help here? The bot only listens to the event once
any idea how to make a bot type server emojis
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Discord ids are based on the time when the id is created
17 and 18 iirc
They might have been shorter in the past
how is it based off of the time?
I think I have seen old accounts where the id is 17 long
XD
You can get the user creation date from the user id
how to create an interactive command ?

interactive what
bruh, google...
Isn't every command that makes the bot send a response interactive?
Yes
Is it possible to make a bot using C/C++? If yes, I can't seem to find a guide in the pins here. I have at least 3 years experience with java.
yes it is.
my bot is written in C++
use a library like aegis.cpp @neat vapor
there are a few gotchas to writing a bot in C++, its not the most user friendly of environments. but if you prefer C++ as a language i'd say its worth it
if youre interested in seeing some source: https://github.com/brainboxdotcc/sporks
Here's also another C++ lib https://github.com/yourWaifu/sleepy-discord
I want to try something new here and I will be using C++ in my next year in software dev and I just want a self project to get myself into C++.
@glad charm i'd avoid sleepy discord. it doesnt cache anything and its rate limiting is broken
i challenge anyone to write a fully functional discord bot in C
C lol
so it causes a whole load of needless REST calls and can get you in trouble
I might check out aegis, I assume they're done with the lib now
i originally wrote my bot using sleepy_discord, changed over to aegis
Right
@glad charm aegis is still under active development, theyre about to gut out the promises implementation and replace it with more stable callbacks
ive uncovered a few issues as i have the biggest bot using the lib atm, so im kind of the pioneer
I might try it out then. I remember a year ago the dude was still deving it.
I am aware my question will be asking for opinions but I will ask. What language should I write my first discord bot?
I'm mainly a C++ dude myself so it'll be fun
hmm. whatever language youre most comfortable in
JS / Python are gonna be the easiest ones.
ive rewritten my bot several times. first i tried perl. the library support was atrocious. that lasted a day. then i did php, the library support was again broken and dead... this wasnt using restcord.
I am comfortable with Java, learning a bit of Javascript and that's it.
then i went from there to sleepy_discord and there to aegis
there are some quite mature java libraries for discord
C and C++ are new to me and are something that I will need to know.
I'm a Java dev, so my bot is written in Java.
Most bots here are JS or Python.
But you should make it in the language you prefer
If you're new to C++ I don't recommend it.
yeah, im not new to C++ thats why i chose to make my bot in it. ive written ircds and all sorts.
You'll have to learn C++ and getting libs to work together, Cmake files probably and classes/pointers/ etc all on top of each other.
worse than that youll have to learn proper C++14/C++17, maybe some C++20
and not just the "C with objects" that college teaches you
lol
Yeah college really only teaches C with objects.
Yikes,thank you for the help. I will work on a bot using java then. Will ask if I am struggling with anything or have questions on the guides pinned here.
Is there any difference in using X coding language or can they still carry out the same function without any difference?
Example, Python being quicker than Java.
Most libs can do the same things, but some do it a different way
^
libs == library(s)?
yes
There are even big differences between the different Java libs
Is it something I will find out or should know before jumping in?
I use discord4j, it is based around reactive code and promises.
There are also a few jda devs here and I think that library doesn't use reactive stuff.
But I have not looked closely at other libs besides discord4j
I want my bot to have emote reactions and to display X information about a game.
Like assigning roles for example.
Pretty much every library can do that
Oh that's good.
php just sitting there with all reds
Php just being php
So you can't do anything with RestCord?
Thanks again for the help.
you probably can, it just says there's no websocket support
Keep in mind that that list is almost 2 years old
Is / a banned prefix for this server?





