#development
1 messages · Page 552 of 1
wtf is horizontal caching
caching across machines
that would make it practical for me to retrieve in case I want to build an API
retrieve what?
Any cached data
why horizontal tho
hm? Am I suppose to put it on a single machine
why not
what if I want to do multiple machines for cost effectiveness
i dont care about cost effectiveness

sharing cache is just effort
you rich people
you could just fetch from each instance the needed data
Then that'd be back to the rabbitmq/nats route
unless youre telling me youre moving around thousand of dollars per month in servercosts, optimizing server costs is not worth the time thinking baout it
i be flossinn
nothing wrong with rmq/nats
I only have like $100 to work with
can you like, give me that lol
you can easily handle 100-150k guilds with that
I can get more juice if I buy another machine
Yeah, buy your own server
im handling 130k guilds with like 20 bucks per month
one of the bots i develop runs 300k guilds with 160/month
“one of the”
and we use just a bit above half the resources
using JDA
yes i develop multiple bots
-bots @inner jewel noembed
Natan#1337's
bots:
@pallid bramble @molten wren 
oh ok
i love manta robot
oh ok
speaking of proof of concepts i sent you one fishy
-bots @drowsy lily noembed
Napster#0001's
bots:
@stuck osprey
@rotund bloom 
wrong place ok
smh no fredboat
Oh aki is og
So, say I resolve to the hazelcast method, what's an ideal way to invalidate cache, if the ws goes unavailable, and a channel is removed
Do I just purge all the cache associated with that shard when ws comes back online
I think that was like one of the first bots i ever used properly
the ideal is to not go distributed unless you absolutely have to
i just purge all cache for the shard when session is oofed
if it's resumable no need to purge
also ^ what napster said
it's way easier to keep just your lib's cache and when needed fetch info from it and send where it's needed
Where does Fredboat store its cache
Is a fredboat dev here?
¯_(ツ)_/¯
on mantaro we use only JDA's cache
tf is mantaro
and that's enough for a lot of growth
distributed is
- more expensive
- requires skill and knowledge and time to set up
- makes simple code complicated
- is less supported by libraries
- has less users and therefore less docs and questions asked/answers answered about
- costs you a constant amout of time to maintain and evolve that could be invested in features
for the benefits of
- scaling a shitbot that will most likely never need it
sounds like a linux os
A music bot
with 100 usd you can literally throw 100 shards in a single process and get away with it
a multipurpose bot*
- requires skill and knowledge and time to set up
- makes simple code complicated
... - has less users and therefore less docs and questions asked/answers answered about
- costs you a constant amout of time to maintain and evolve that could be invested in features
being committed and having motivation can solve those
Well, I have most of my structure planned out, except for the cache layer
And I like the idea to keep ws layer separate, so I can apply restarts w/o restarting the ws
Depends if the programmer really cares what he or she is doing
being committed and having motivation can solve those
youre still a single person and the day has only 24 hours
everyone i know who did a distributed cache just gave up
it's not worth the effort
and now besides the bot you have to maintain all the extra stuff
Better if I deal with it now then when I need to in college
i think fredboat was running on like a single server with a millions guilds or more
- lavalink nodes but those dont count
wonder how dyno does it 
runs on 3 dedis afaik
keeping the cache in a single process is already a pain, share it between multiple and you got a never ending headache
why
the cache even if kept in a single process is unreliable
making it distributed is therefore not exactly a huge issue from that point of view
it is unreliable because any decision you do based on it's content can be wrong because discord might not have sent you an event or is just about to send it

so making a cache distributed and a little more eventually consistent than it already is shouldnt have a huge impact on your code which should be assuming that the cache is somewhat unreliable in the first place
gonna ask around more I guess
why bother ppl with it instead of building a prototype and seeing for yourself whether you like that way of building a discord bot or not
Well I'm in the middle of building a prototype
But I'm not sure how I would approach that specific part
Natan showed a sc of you mentioning it, so I thought you had some experience, figure I might ask
I'll ask around other devs
on github, how do you keep the token private?
by not adding it to github
you dont upload it in the first place
^
add your config file to gitignore
Or better yet dont bundle the config file with your bot files 
hey im wanting to create a level system that saves the info to mongodb can anyone help me please
i already have a basic level system but it saves it to a json file
how do I completely reset everything to do with node and Visual Studio Code
@mental solstice node js
u have Mongodb installed and running already? I recently just started messing with it.. but it's pretty easy
yes i have it installed and running
Yep i know
I did try it and i followed every step right
I can't find the key though
Glitch is easy. You can find it and follow the tutorial in here: https://anidiots.guide/other-guides/hosting-on-glitch
For heroku: https://anidiots.guide/other-guides/heroku
Um. Still didn't get that
If you still can't get it, maybe read it again.
I know, you used Scanning reading method
Shit, you're somewhat right
is it gonna more lag, Fishy?
well, if it's doing more, what you think 
does anyone know how i can FULLY reset Visual Studio Code, delete all the windows-build-tools and node.js
@sturdy delta reinstall windows
put ur computer in water
use the mrclean magic eraser
delete system32 on cmd prompt
don’t preserve your root folder
buy a new pc
throw your pc in the ocean
Any one here can help me pls
sure
Error: Could not locate the bindings file. Tried:
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/build/Debug/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/build/Release/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/out/Debug/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/Debug/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/out/Release/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/Release/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/build/default/node-opus.node
→ /rbd/pnpm-volume/a101ff8b-4edd-4948-9858-57b6130fa91f/node_modules/.registry.npmjs.org/node-opus/0.3.1/node_modules/node-opus/compiled/8.14.0/linux/x64/node-opus.node```
excuse me what the fuck
Are you on glitch?
did you update node or did node update itself or did the OS update itself?
if so, you need to rebuild the package
thanks
hey i want to add who each user was invited by to my welcome message my code is written in js any help would be greatly appreciated
Which lib
discord js
i already have the welcome message set up i just want to know how to add who each user was invited by too it
Djs is shite with that sort of things
Ut if you really want it, fetch invites and check which one changed is the best way
// welcome member message module
bot.on('guildMemberAdd', member => {
let channel = member.guild.channels.find('name', 'welcome');
let memberavatar = member.user.avatarURL
if (!channel) return;
let embed = new Discord.RichEmbed()
.setColor('RANDOM')
.setThumbnail(memberavatar)
.addField(':bust_in_silhouette: | name : ', `${member}`)
.addField(':microphone2: | Welcome!', `Welcome to the server, ${member}`)
.addField(':id: | User :', "**[" + `${member.id}` + "]**")
.addField(':family_mwgb: | Your are the newest member', `${member.guild.memberCount}`)
.addField("Name", `<@` + `${member.id}` + `>`, true)
.addField('Server', `${member.guild.name}`, true )
.setFooter(`**${member.guild.name}**`)
.setTimestamp()
channel.sendEmbed(embed);
});
bot.on('guildMemberAdd', member => {
console.log(`${member}`, "has joined" + `${member.guild.name}`)
});
Spaghetti code is all i can say
it works though 😄
why two event listeners lul
@dapper bear yo how did you do that text format, i used to do it i forgot xD
@dapper bear you missed a ' in the code
one leaves a message in the console log i check it alot to make sure no problems
Hello guys, I need some help with Bootstrap 4. Can someone help me or is this off-topic ?
https://alekeagle.tk/screenshots/RPVNfyDRuM.png @smoky mica
@fervent oyster where abouts? my text editor didnt flag any errors?
Does it show the color?
console.log('triangles')
Just tried it
hang on broomez, im opening mine
idk then, but thats the way you do it
@smoky mica yes its set as random
thanks
someone can help me ?
@fervent oyster okay thanks
I don't really use bootstrap 4 or wtv so um yeah 🙄
well, if you don't use bootstrap that much, you'll not be able to help me..
I mean, my demand is veeery specific
@dapper bear your syntax is all good, markdown syntax highlighting needs some work done on it
my mistake
ahh okay its my first time coding a bot so im still learning myself 😃
@late nova ok, you want to make a webhook for votes, what language do you use
javascript, i am being helped in #topgg-api
ahh ok
if you want to come in more than welcome
how would i add who invited the user to the welcome message?
you could try to get the invite used and then get the invite creator
there is no reliable way of getting who invited who
im currently building an asp.net core website which is basically an invite tracker. it has its own invites, basically it creates a new invite, makes the user login with oauth2 with the guilds.join scope, if they accept the invite, add them to the guild. that way you can track who invited who, uses, etc., it might be an overkill but as of right now having your own middleware for it is the only reliable way
i just want a basic invite tracker 😅
To track who creates invites?
no to say who invited a user when they join
@dapper bear you can't see that directly, you'll need to track the count of each invite and see which one increased when they join
So you'll need to store it in a db
I think he wants to have the user input it manually
Like a referral system in games
Am I allowed to set the display property of the donate button to none on my bots page?
If someone is very good at html, css, js please write to me privately have few questions
@earnest phoenix or just write the questions here? 
how does a switchTo work? with HTML & JS
do you think I would not have done that? I'm asking for a van here
Iirc (really not sure) it sends a request to the browser to change the window
Someone uses roblox-js ?
Because when i get online the bot, ut fails to log in. (It has everything that it should and the pass and username are correct)
Oof
If u don't see a package for the thing you want, then you will have to make it, if you cant do that, then your better off making it do something else
noblox.js?
For anything
What do I do if my bot's console keeps saying "msg.edit is not a function"
What is msg defined as?
message
bot.user.lastMessageID
and on my bot console (it lets me type in it and run commands via console as needed / wanted)
but if I do "msg.edit(test edit/some message) .then(msg => console.log(Successfully Edited Message, ${msg}) .catch(console.error);" it wont let me successfully run
anyone know if webhooks can use emotes?
@stray wasp they can use all emotes in the server include animated emotes, but they cant use emotes from other servers
alright thanks
Guys what is a shard
@crude portal big bots are split into multiple shards, each shard has its own connection to the Discord API. depending on your lib and the sharding type it may make one process per shard
Ohh ok cheers
each shard can only be on 2500 servers so u need to set it up before you reach that
yw
yw
So if I use discord.js I don't need to require the api and I don't need .postStats right
?
Yeah if you pass the client in
K great thanks
@crude portal Sharding is the method by which a bot's code is "split" into multiple instances of itself. When a bot is sharded, each shard handles only a certain percentage of all the guilds the bot is on.
Don't use this method too early.
You can use this when your bot has 2k / 2,5k servers.
Using shards can decreases your bot performance.
I havent had any issues
Thank you!
Especially, music.
Sharded bots often gain very marginal performance increase and might even use more memory due to using more node processes.
Yeah I certainly don't need to worry about any time soon
Glad you know it <3
if you have an unified cache sharding has pretty much no overhead
besides synchronization for the cache

try{
message.guild.members.array().forEach(member => {
member.send('string')})
}catch(err){
console.log(err)
}
Anyone have any clue as to why evaling this could have possibly escaped just the message server, and dm'd in every server that the bot is in?
bro what, no, i did an eval command, it was supposed to dm people in the server i did the eval in, instead it dm'd in every server she is in
Yeah, it should have only DM'd the one sever yet it DM'd all the bots users.
Same no dm
I have a question
Ask it
I didnt get a dm either
Same here
you are sending stuff to the res twice
u have res.send('some stuff') and res.sendFile(idk what)
u can't use res.send twice cause it is a website
@blazing star the issue is he/she put res.sendFile on the bottom
what does it do
the username exists smh
I know it does
I am testing to see if it works
try a different username then

by the username input box
what
RRight beside this
oh
i see what u mean
yea
well
what I did was I didn’t use a form. I used a button that when pressed it made a post request to the specific route, and it handled errors and such
there is probably some other way but that’s the way I do it
Ok
gl tho
How could I make an alert box
I tried
alert
and window.alert
but none of those want to work
Oh ok
@bright condor
var callback = function(stackframes) {
var stringifiedStack = stackframes.map(function(sf) {
return sf.toString();
}).join('\n');
console.log(stringifiedStack);
};
var errback = function(err) { console.log(err.message); };
require('stacktrace-js').fromError(err).then(callback).catch(errback);```
I use this for getting to the exact line of error
works like magic
you could put this in the catch(err)
have a good one
thnks
how to list all the names of the roles in a server
JS?
if sojs message.guild.roles.map(r => `${r.name}`).join(", "); // Change ', ' if you want to add anything else at the end of each role name.
.join("\n");
like this
yeah that
oh thanks.
no problem!
is it something like member.guild.user.roles to display 0/1/2 members|
sorry if this sounds dumb XD
Can someone help me?
I am getting this error: SyntaxError: Unexpected end of JSON input
This is my code: ```
module.exports.run = async (client, msg, args) => {
let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf8"));
prefixes[msg.guild.id] = {
prefix: args[0]
};
fs.writeFile("./prefixes.json", JSON.stringify(prefixes), (err) => {
if (err) console.log(err)
});
}```
I have a problem.
I type lofi play neotic
Then, join the voice channel. And play the radio normally.
5 or 10 seconds, it leave itself
And, i tried 3 - 5 times.
dont use json as a db 
const Discord = require("discord.js")
const ytdl = require('ytdl-core')
exports.run = async (lofi, message, args) => {
/* Unknown Message */
if (message.channel.type == "dm") return message.channel.send("unknown error: launched in dm.")
if (!message.member.voiceChannel) return message.channel.send("unknown error: join the voice channel.")
if (!args[0]) return message.channel.send("unknown error: choose the streamer. `instead of 'lofi help play'`")
const permissions = message.member.voiceChannel.permissionsFor(lofi.user);
if (!permissions.has('CONNECT')) return message.channel.send("unknown permissions: connect.")
if (!permissions.has('SPEAK')) return message.channel.send("unknown permissions: speak.")
if (args[0] == "neotic") {
await message.member.voiceChannel.leave()
await message.member.voiceChannel.join()
.then(connection => {
const embed = new Discord.RichEmbed()
.setDescription(`played: [this lofi](https://www.youtube.com/watch?v=fxn8p26WTR4) \npeople: [neotic] \nrequest: [${message.author}]`)
.setImage(`https://i.ytimg.com/vi/fxn8p26WTR4/maxresdefault.jpg?width=1280&height=720`)
.setColor("RANDOM")
message.channel.send(embed);
const stream = ytdl('https://www.youtube.com/watch?v=fxn8p26WTR4', { quality: "highestaudio" });
const dispatcher = connection.playStream(stream);
dispatcher.on('end', () => message.member.voiceChannel.leave());
dispatcher.on('error', e => message.channel.send(`${e}`));;
dispatcher.setVolume(1);
dispatcher.setBitrate(96)
})
.catch(console.log);
}
if (args[0] == "chillhop") {
await message.member.voiceChannel.leave()
await message.member.voiceChannel.join()
.then(connection => { ...```
@knotty steeple just using it for prefixes
@lethal sun Use quick.db and it's simple.
quick.db sucks
🤔
fuck that
idc if its only prefixes
@lethal sun Oh that error, put { } in your json, like prefixes.json
use a database
No. Put that { } on your prefixes.json or something
samurai do you recommend mongoose?
Yo. My bot has been running for the past 3 months but it randomly shut down. Now my token is invalid and generating a new one doesn't work either. Any ideason why this is happening?
i dont like mongodb
@earnest phoenix Any error? Check your console log.
mongodb isn't good
quick.db, sqlite.
Just invalid token @dull idol
or... enmap.
@earnest phoenix try to make a new bot and put that token
Yep that works
quick.db is just a wrapper
@earnest phoenix Try to regen your Client secret and your token too.
I don't get how generating new token doesn't work tho
enmap isnt a database
yeah
Will try
Or, you put your token in the wrong way
Thnx
Welcome!
@knotty steeple then? use sqlite.
its "token": "token"
Oh
sqlite is probably the best solution for small bots
Just delete and make new one
Tim's right
whats the best db xD
im gonna switch my bot to sqlite and use redis on my api
when you delete mysql, does it become nosql?
wat
lmao wot
there is no best db, it all depends on your needs and design
sqlite is the best light weight sql rdbms
it doesnt keep a server running, doesnt eat ram
and its pretty fast
depends your vps
if your bot gets big though, you'll need a database server that accepts multiple connections
if my bot gets big, i will shard them
mysql and postgre are the most used full scale rdbms servers
nah, jk. i need shard + new vps
Yep refreshed the client secret too, no success. it's still invalid 😦
mongodb is a document-based database, it has a completely different structure
client secret isnt needed if you are making a bot
Hmm
My other bots work fine. My bot just shut down yesterday
Is it possible that Discord just locks bots or something?
@earnest phoenix as your bot not abusing the API.
@lethal sun copy the contents of your json file and paste them in an online json linter
Any way to get it unlocked though @dull idol
@earnest phoenix Is your bot abusing the API?
Really doubt it but it's worth a shot
Ok, here.
Try to make another bot. Create it one.
And, grab the token on your new bot.
Then, you paste in your config.json or process.env (idk)
Try it.
If the new bot is online, maybe your one bot is locked.
@earnest phoenix
yep that worked lol. it started fine
@earnest phoenix in the new bot?
yeah
didn't work.
this is my json right now:
{
"493347937649295371": {
"prefix": "!"
}
}```
did it say your json is valid?
so i'm just low key fucked right now
i dont need like that.
it said it's valid, yeah @quartz kindle
you know what isnt working
try changing "utf8" to "utf-8"
you're messed up :^)
:^)
yeah p sure my bot is locked
still same error @quartz kindle
do console.log(fs.readFileSync("./prefixes.json", "utf-8"))
doesn't log anything @quartz kindle
F.
.-.
then your json file is empty or in the wrong folder
Is there a support chat for discord? i want to contact them about my locked bot
I really need it unlocked though
contact their support
@smoky mica language?
discord.js
ty <3
^
ReferenceError: RichEmbed is not defined
at Client.client.on.msg (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\bot.js:78:
23)
at Client.emit (events.js:188:13)
at MessageCreateHandler.handle (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\nod
e_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34
)
at WebSocketPacketManager.handle (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\n
ode_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:10
3:65)
at WebSocketConnection.onPacket (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\no
de_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\n
ode_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\node_module
s\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:188:13)
at Receiver._receiver.onmessage (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\no
de_modules\ws\lib\websocket.js:137:47)
at Receiver.dataMessage (C:\Users\NOEL-TPC\Desktop\TestDiscordBot\node_modul
es\ws\lib\receiver.js:409:14)```
why?
var embed = new RichEmbed()
.setTitle('New Update!')
.setThumbnail("")
.setImage("https://i.imgur.com/ukLE8HE.jpg")
.setDescription('Update')
.addField("New LoginScreen Design", "a better look", true)
.setFooter('all new Updates')
.setURL("https://i.imgur.com/ukLE8HE.jpg") // onli graphics
.setColor(0x27ae60)
.setTimestamp()
msg.channel.send(embed);
ping.sendconsole();
msg.delete();
break;```
const { RichEmbed } = require('discord.js');
^
const yes = require("./../")
./ = Finds the directory you are in and then ../ goes back one
so if I want to access a file that isn't in a folder that I am currently in, I do "../prefixes.json"?
const yes = require("./../prefix.json")
Send me a screenshot of your files
So I can get a layout of where the prefixes.json file is
main
|-> index.js
|-> prefixes.json
|-> commands -> command.js```
main is the folder where index.js and prefixes.json files are
and the commands folder is in the main folder and contains the commands for the bot
so I need to go from the command file back to the main folder and define the prefixes.json file
'../prefixes.json'
nope @coral trellis and nope @fierce thorn
So you are in /commands/command correct?
my command is called prefix so the command file is called prefix.js
command/prefix.js
when i start to ran the command @royal zodiac
lofi play neotic
play then leave
without any reasons and errors
/ skip
this is what I am trying to do
JSON.parse(fs.readFileSync('./../../prefix.json', "utf-8"))```
@coral trellis
You can just require json files
let prx = JSON.parse(fs.readFileSync('./../../prefix.json', "utf-8")) @late hill
that's what I want to do ^
Try just let prx = require('../../prefix')
but I want to parse it with fs
won't that cause the require cache to mess it?
^
> fs.writeFileSync("data.json", JSON.stringify({a: 1}))
undefined
> require("./data.json")
{ a: 1 }
> fs.writeFileSync("data.json", JSON.stringify({a: 2}))
undefined
> require("./data.json")
{ a: 1 }```
> delete require.cache[require.resolve("./data.json")]
true
> require("./data.json")
{ a: 2 }```
I want to parse it, change the content of the json file and then write it
although using json as data storage is a bad idea
I only use json for configs so just requiring it works fine
Configs that can't be edited*
Unless changing the actual file
Mongo !!!
quick.db is just an sqlite wrapper
It's just for people who are legit too lazy to learn sqlite
And sqlite is easy
@lethal sun why not mongo
mongo is good
but like it isn't even hard to set up
xd
How do you create folders on GitHub???
use git and push a file in the folder
I want to split the fields/lines like that
I tried the code below but it doesn't work, what am i doing wrong?
.addField("Owner", message.guild.owner, true)
.addField("Region", message.guild.region, true)
What is your result
Just adds a new field
Under it?
yeah
Perhaps it didn't fit on screen?
Nope

It should for some AT LEAST
If you only have 2 fields and set them both to inline they should be next to eachother
I actually like 5 - 7 fields where i put true for all
And they are all displaying under eachother?
Yep
Show the result 
If there's alot of text used in the field
It also won't be able to put another one next to it
hm
Yeah i know that
I'd guess the "Created on" is too big
Remove that one for a sec
And see what happens
👋
👋
This doesn't work, can any1 tell me why css jsfile.forEach((f, i) =>{ let props = require(`./commands/${f}`); console.log(`${f} loaded!`); bot.commands.set(props.help.name, props); });
What's the error
bot.commands.set(props.help.name, props); on name
bot.commands.set(props.help.name, props);
^
TypeError: Cannot read property 'name' of undefined
It's working now
okay yeah thats a phishing link or some shit
and you just post it in a public channel
👏👏
@loud salmon we got a dumdum in here. I guess you'd wanna remove the github link?
@rocky dagger 👏 dont 👏 leak 👏 your 👏 token 👏
wait so since he got the dm with the known shady link from his bot ~20 minutes before he posted this repo, does that mean that the guy doing this is in this channel? or was it possibly a github token scraper?
that scrapper is someone looking for bot tokens on github and abusing those tokens
Then i am not a scrapper
Madmadz be honest you copied all the code from TSC right? XD

Let me give you a tip, stop copying I mean you can copy some stuff here and there but try to learn stuff mainly
Its my first bot ok?
i recommend you learn the language and create the bot yourself
Everyone has their first bot lol
also most tutorials are horrible
I started coding on 25 december
and get outdated pretty quickly
Agreed
I learnt so much from the time I started coding cause I tried experimenting and tried to make the smallest things as good as they can be
any one know?
parse error: Invalid numeric literal at line 1, column 7
you have an invalid numeric literal at line 1, column 7
at line 1, column 7
it'll tell you
Send the surrounding text
glitch
nevermind
Well did you use a number as a key in a json file?
this is in package.json
I’ve been searching all morning and can not find an answer: Can you begin using API features with a server after it’s established and it has users?
because you didn't do the prefix check properly
how can i do that
learn js
i know js
maybe check if the content (hint hint) starts with the prefix
KK
Might be a dumb question, gonna ask nonetheless, how do I get a custom page on the DBL site, just use HTML in the field it gives you?
Ping me when answer ^
Mm, how does one go about getting cert?
I haven't really touched the site yet, sorry if these are stupid questions.
you fill up a form on the website
Ah, alright, thank you, gonna take a look at that.
Thank you, appreciate it 👍🏼
i am a bot developer
Hey, so my RRS feed isn't working. Heres my code:
function rssFetch(channel, url, displayName) {
(async () => {
let feed = await parser.parseURL(url);
console.log("Fetching from " + feed.title);
let updatefile = JSON.parse(fs.readFileSync("./updates.json", "utf8"))
feed.items.forEach(item => {
let update = new Discord.RichEmbed()
.setColor("#2d87d3")
.setAuthor(item.title + " | " + displayName)
.setDescription(item.content)
.setTimestamp()
.setFooter("Posted by " + item.dc)
if(!updatefile[item.link]){
updatefile[item.link] = {
read: "true"
};
channel.send(update)
fs.writeFile("./updates.json", JSON.stringify(updatefile), (err) => {
if(err) {
console.log(err);
}
})
} else {
return;
}
});
})();
}``` I get no errors in console
and heres the rrs request function code thing
bot.on("ready", async () => {
console.log(`${bot.user.username} is now online!`)
bot.user.setActivity(`to the forums!`, {type: `LISTENING`});
rssFetch(bot.channels.get('533506639756656650'), "http://minefracture.com/forums/global-updates/index.rss", "Global")
rssFetch(bot.channels.get('533506639756656650'), "http://minefracture.com/forums/discord-updates/index.rss", "Discord")
rssFetch(bot.channels.get('533506639756656650'), "http://minefracture.com/forums/hub-updates/index.rss", "Hub")
rssFetch(bot.channels.get('533506639756656650'), "http://minefracture.com/forums/forum-updates/index.rss", "Forums")
});```
I've tried removing the async as well as simplifying the code
I've also rmoved the embed, and use console.log
[ this is discord.js btw]
o, could this be an issue
This is not an error with my code! It may be with discord, still, i do need help.
Why isn't discord developer or any of my bots logging in?

possibly
You answered your own question
What happen?
Discord did a discord
I cant connect dev
Apparently, the Discord API is currently offline. While some bots are still online, they may have not been restarted.
Ok
*My new question is, how do I get my bot online, if the api is offline 
discord is taking a shit, you need to wait until it fixes
Time to binge Tasty and Food Network......
is that why bots can't connect at the moment?
Apparently
ri[
any services like uptime robot? 
rip*
its so laggy jesus h christ
API is still offline :/
yes, but at least they found the problem
rip most of the bots that are effected
i still could not find a way to get a specific shard's ping
can someone help maybe 
which language?
discord.js with commando
might want to wait to do that if your bot is online, once its taken offline its offline till discord fixes the problem
^
my bots seem to work normally
Mine's still broken.
its works when its online, but if you take it offline it doesn't connect to discord, because the api response time is too high for the bot to connect, it has to be around 100 -200ms for a bot to connect with no problems, right now its around 216 which is still high, but at 12:10 it was 700ms
o-o
it doesn't have to be low for bots to connect
the issue is that it's throwing errors
lol
well now its fine
help pls thx
(node:79149) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 192.185.20.112:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:79149) 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: 914)
@raven bronze it's an issue with the site you are trying to make a request to
oh
well it's my site
@bright spear i use xenforo, how can i make it work?
oh
i think i broke my website....
UHHHHMMMMMM
UHHHHHHHHMMSMSMMSMSS
@bright spear is it possible to break a website?
Stop spamming
How many fields can an embed have?
25
Seems kind of a lot tbh, IDK why you are disappointed of this number
Not to mention you can really make it more by adding a pages system. Hitting 25 is a bit excessive imo
Is there any to play a radio without ytdl?
like using FFMPEG?
node.js: 10.15.0 - discord.js: 11.4.2
@red hollow is it working on with node?
Hey I'm thinking to post guilds count on dbl so I add it in main file or in ready event
Is there any docs
nvm
got it
Set an interval to request the stats from the API then use something like jquery to update the text
Some fatal error probs occurred on start up
guys, how to solve this shit.
play the radio > join the vc > leave
node: 10.x
discord.js: 11.4.2
ytdl-core: 0.29.0
what have u done?
is it because the length of the video cant handle the bot to play or somewhat?
If it's leaving right after, no. If its leaving mid stream then thats one of the many possibilities. If there's an error, there's something you need to fix.
@earnest phoenix no error.
Is it leaving as soon as it joins the vc or mid way?
If you're using ytdl to stream a youtube video it's probably due to a restriction from youtube itself.
yeah. in my opinion is like that too.
Thus, it just can't stream it. That or ytdl needs an update.
my ytdl-core is latest.
No I mean the package itself. YouTube updates its stuff all the time, so it breaks every now and then. If its not streaming other videos then thats why. But my musicbot seems to be fine, so its just a restriction.
@earnest phoenix yeah, but..
Guys, how can my bot get unmuted? I added if(message.author.bot) return; already
Tell a mod @waxen blaze
ok
hai i need help
since yesterday's discord API problems, my bot refuses the commands
its running, no error
In need of some helpers who script js I am a beginner
same
Why .svg doesn't work, when I'm using .setImage() in RichEmbed?
.svg is banned on discord i think cause someone can make svg which will crash all clients xd
mhm, thx
has anyone experienced certain guilds stop sending events for no reason?
for example, my bot stopped responding in a specific guild, but worked normally in dms and in other guilds
its not sharded
and restarting it fixes the problem
Wtf?
and the logs show that there is nothing coming from that guild... it simply stops sending message events
The discord outage maybe?
Welcome to Discord's home for real-time and historical data on system performance.
probably
it has happened other times before
usually after being online for a long time (~10+ days)
I’m trying to make my bot log who votes for my bot in a certain channel. This is used so I can reward those people 😉. Someone from an alternate server said this would work but didn’t explain it a lot:
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' }); .
anyone help?
That's to attach it to an existing server
Personally it didn't work for me
ok im here xiggy
@dull idol
.atag:after {
display: none:
}```
👍
wrong channel sir
too many requests sent?
The only things I can think of are:
- You doing some weird stuff
- Someone spamming commands
- Your bot reconnecting to Discord after the last outage
@dull idol yep, lavalink supports
@earnest phoenix you'll need a database, and decide what you want to reward them with
hmm
@quartz kindle i mean like
floating
you declare keyframes independently
example
@keyframes animationname {
//what the animation does
}
css selectors {
animation: animationname duration repeattimes otheroptions
}```
@quartz kindle Working. but how i can remove this annoying border.
you probably have a border somewhere
border:none
inspect it and its parents until you find it
@sick cloud not working
okay
...
How do i require the package.json in to the botconfig.js file? https://github.com/Madmadz16/FirstBot
what do you mean
you dont need to do anything with package.json
its just a control file for npm
I am using this line in my botconfig.jscss "author": "Madmadz16",
just write it in your botconfig, no need to require package
uh
afaik you can import it as a regular json file
const packageFile = require('./package.json')
idk, but its way easier to just not use package.json
you dont need it
just let it be there, no need to require it
Hi All!!!
@rocky dagger can you send your file tree or whatever its called
huh, i guess you cant use pakckage then
as i said, you dont need it
just remove it
lol
from your code, not from your folders
http://prntscr.com/m6muyn anybody know how to fix this error ?? when i am busy installing pm2 on vps ?
Looks like you're using let somewhere where you can't use let
(node:4614) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
the details are correct
That means your token is incorrect
that error doesn't happen unless it's not correct
ill regen but i definitely did it right
probably didnt copy the entire thing.
help When i did node . iit didn't load
And press enter
He doesn't seem to be doing that lol
it eroded 🤦
What error did you get?
SyntaxError: Unexpected identifier
then its most likely an error with your code
lemme restart my terminal
No but if I go over my code again
Okay, so when I put node . its supposed to bring up "Testing" to make sure the console responds
Okay and?
If you got unexpected identifier, the error is iin your code
nothing
You didnt hit enter
You're writing this in index.js right?
mhm
Try node index.js instead
Did you save the file?
of course
Take a screenshot of the whole screen
Get me a screenshot of index.js
(just changed to pacage.jsn
And you have definitely not saved index.js smh
ctrl s
ctrl s
forgot to save project,jsn
..?
Don't code when you're stoned 👏
ye
Looks like it should be
Guys, could you help me ?
I'm trying to create an interative help system that when someone reacts with a specifc emoji (located at a list of specifics emojis), my bot send another message with something.
I'm doing something wrong that i don't know what is this.
You're checking the message itself. Check its reactions instead
(node:6392) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event (C:\Users\adamv\OneDrive\Documents\HelpfulBot\node_modules\discord.js\src\client\ClientManager.js:48:41)
at Object.onceWrapper (events.js:276:13)
at WebSocketConnection.emit (events.js:188:13)
at WebSocketConnection.onClose (C:\Users\adamv\OneDrive\Documents\HelpfulBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10)
at WebSocket.onClose (C:\Users\adamv\OneDrive\Documents\HelpfulBot\node_modules\ws\lib\event-target.js:124:16)
at WebSocket.emit (events.js:188:13)
at _receiver.cleanup (C:\Users\adamv\OneDrive\Documents\HelpfulBot\node_modules\ws\lib\websocket.js:220:12)
at Receiver.cleanup (C:\Users\adamv\OneDrive\Documents\HelpfulBot\node_modules\ws\lib\receiver.js:535:15)
at WebSocket.finalize (C:\Users\adamv\OneDrive\Documents\HelpfulBot\node_modules\ws\lib\websocket.js:206:20)
at TLSSocket.emit (events.js:193:15)
(node:6392) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6392) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i got this error
i hate my life
Check your token
I just did I
It's your token
Copy it precisely
yea i even made it visible to make sure sd
from the d.py docs
@client.event
async def on_message(message):
if message.content.startswith('$thumb'):
channel = message.channel
await channel.send('Send me that 👍 reaction, mate')
def check(reaction, user):
return user == message.author and str(reaction.emoji) == '👍'
try:
reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('👎')
else:
await channel.send('👍')```
reaction in list -> str(reaction.emoji) in list






