#development
1 messages ยท Page 721 of 1
@quartz kindle How can I load all the entries?, I have them saved like keyv.set ("messagelevel" + message.author.id, nlevel);
Map supports .keys() .values() .entires() and .forEach()
from what i understood in their docs, keyv should support the same
you cant use bots in this channel
Hope you realize this is #development
@quartz kindle I didn't know how to do it, I'm really very new
Learn a programming language, get used to it, choose a Discord API wrapper for your language, use it
dont do the wrapper before the lan
okay
at Function.render (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/application.js:580:17)
at ServerResponse.render (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/response.js:1012:7)
at router.get (/Users/jazz/Projects/Insta-DP/routes/dp.js:19:7)
at Layer.handle [as handle_request] (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/router/layer.js:95:5)
at /Users/jazz/Projects/Insta-DP/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/Users/jazz/Projects/Insta-DP/node_modules/express/lib/router/index.js:335:12)
at next (/Users/jazz/Projects/Insta-DP/nod``` wtf causes that
I don't understand this reason should I change my bot prefix
.js
so when ever
Library?
I have explained what happens
Theyre here to ignore bots which is what im going to help them with
:/
Oh Idk about your issue jazz
I would say send the code and wait for someone who knows
Error: Failed to lookup view "/Dp" in views directory "./web" wtf ejs causes that
So I need to edit in my code
Yes, can you show me your message event?
you need if and else function
if user = bot {
blah blah
} else if {
}
You dont need all that
ik u can do return to
Plus spoon feeding is not really fun
^
can u spooon feed me
just let people suffer until they figure I out
im going in depression cuz of this problem
@earnest phoenix Can you show me your index.js file?
pls hide your token
Yep do that
I need your message event
you ill prob need hastebin
You should still have a message event
do you even know what your code is?
if user = bot would not even work 
A wrong example?
Why did you spoon feed...
if(message.author.bot) return;***
I did it
smh
if they have all the code and there so close to it, not really spoon feeding
๐ฅ ๐
it's literally going into the d.js documentation
Spoonfeeding will help the user get their answer, sure - but when they need to find another answer on their own they wonโt be able to.. giving a docs link or hinting is good enough imo
users have a bot property, which you can use in an if statement or boolean
What is it
Error: Failed to lookup view "/Dp" in views directory "./web"```
ejs is being fairly lovely today
the file is there for sure
You are searching for a directory that doesnโt exist apparently.
Iโve never seen that error before then, so not sure.
ahk :[
Depending on file structure you may need to access it another way
it worked before since i have setup routers it stopped workin
@fiery stream have you tried referencing their gist page?
wdym
const axios = require('axios');
const logger = require('../lib/modules/logger');
const router = express.Router();
router.get('/Username', (req, res) => {
const name = req.query.words;
axios.get(`https://www.instagram.com/${name}/?__a=1`)
.then((response) => {
const data = response.data.graphql.user;
logger.debug(data);
})
.catch((error) => {
logger.debug(error);
});
res.render('/Dp');
});
module.exports = router;
``` tahts what i have for router
๐ค
what is that wrong?
No I just don't see anything that could be causing your error
Everything appears to be set properly
๐๐๐ we all have our moments
u know what the error was
i had res.render('/dp') was supposed to be res.render('dp')
oh lol
The / caught my eye but it didn't register as a issue lol
My brain was like nah that's fine
lol thats what i was thinking the whole time
yee
@spare goblet
@spare goblet hey I have some queries
@fallow spire you can reference this discord.js example package which has the node version in it ๐ค๐ https://github.com/discordjs/discord.js/blob/master/package.json
@fallow spire google "package.json engines"
@earnest phoenix what's up?
@spare goblet see if I invite my bot through top.gg then their is no permission granted like this and if I invite the bot from bot invite like then it's shows me that
Admin permission is required for bot
How to make a link for going in specific class with scroll down.without any process or new tab
And also the bot is not creating his role like this in other server @spare goblet
@earnest phoenix go to your bot page
click EDIT
and update the invite link to have permissions integer 8
@earnest phoenix use an anchor link
Where I can't se that
@spare goblet and my bot is muted here
@quartz kindle what is it ?
@spare goblet How can i restart my Build?
@earnest phoenix
@earnest phoenix https://www.w3schools.com/html/html_links.asp
scroll down to HTML Links - Create a Bookmark
Ok @quartz kindle ill try it
Thanks
And y it's not showing server in my bot page
@spare goblet the bot is fix can u unmute the bot
@quartz kindle can u tell me this
to show your server you need to use the website api to send it
no
you need to use the top.gg api
-servercount
To have your bot's server count displayed on DBL, please read the documentation on server/shard posting. Click here to see the docs.. You may also find #312614469819826177 useful; however it is strongly discouraged as most of the examples are extremely outdated.
@earnest phoenix and can you send me the bot's client ID in my DMs please? Thanks
@spare goblet ohk
the frick is that now @spare goblet
in package.json > engines?
yes
I am just curious if I'm going in the right direction/way in making a timed mute or something related to that
1 save the mute to a database including the date and length
2 have an interval that runs every 5 seconds or so that runs .all on the database and goes through the mutes
3 if the mute is supposed to end, remove it from db and remove the muted role
Pretty much i want the best way, if that isnt already
not really the best way, but an okay way
that's not a good way to do it
That's a really large query which would use a lot of resources
so only 10 or what?
which is not allowed because there are breaking changes between major versions
Do you have any tips/overviews on a better way?
you should do ^10.x.x
which means the most updated version of version 10, if im not wrong
@split hazel the best way would be to use timeouts
There's many ways
- cache it and set interval, so you're not calling db queries each time.
- schedule it to occur after a specific period of time, aka using setTimeout() or a schedule function
How can I add the upvotes count in my bot status
use the api
would you set a timeout for each active mute?
So something like restarting the timeouts after a bot restart or something like that
after restarting the bot load all mutes from the DB and create a timeout for each mute
i like number 1, caching it didnt come into my mind
would setting a timeout for each scale well
No it wouldn't @late hill

Anything but grabbing your entire schema/table/db every five seconds lul
so i should just save the .all in a variable or something and do it like that
basically caching
Yeah
if you got too many timeouts then you could run every hour and create timeouts for every mute that ends in the next hour
Remember to add it to the cache every new mute and remove from cache when unmuted
yeah i'll probs make a class for that
if it's possible to change the mute duration then also remember to reset the timeout for that mute
Does anyone know a good non-hardware eating way to dynamically import files from a folder in ruby?
Yay i finaly host on heroku
But that is for limited time
Yea you got months Hours for run
Wait how much?
get offa heroku and onto a vps
tbh glitch is much better than heroku
yes a vps is best
@split hazel are you using glitch
not specifically
please say sike
i only use it for testing
@split hazel i go back to Glitch xd
Glitch is only partially good if you're using node.
when i wanna put my stuff into production i put it onto my vps
But you should try fork out enough for a vps. They're so much better.
@split hazel you know how to save env there
because i tested a time and i not getting how to save env on glitch
glitch auto saves as far as i know
Where we can add env on glitch
Some of them are super cheap. https://qoilo.com/hosting $3 for a gig of ram and a cpu vcore should be enough for pretty much all new discord bots tbh
at the top, Add file ".env"
Okok
cloudflare
cloudflare workers :LUL:
The one i linked is also super reliable
k
There is lots of reliable ones, Check pins for a list of them.
Yeah. I used DO/Vultr before switching tbh
I liked Vultr the most and I still use them for some things im too lazy to setup myself
try to avoid very cheap vps's though
I never used galaxygate before tho bc i heard they fricked a lot of customers over
most of them promise you good resourses but actually their crap
cough VPSDime cough Scaleway
Qoilo is my site
Its a shortlink
But yeah vpsdime will reel you in with that and they are v reliable but their tos is shady at best
And Ive had bad reliability issues with OVH and Scaleway
So i cant rlly recommend them anymore. General rule is its usually always too good to be true lol. But thats only for most cases, there are some diamonds in the rough out there
Creating a style sheet
i can dm you it
What else do you run on that dedicated server?
Who is the host
Ahk
im on galaxygate for about 6 months now, never had a problem
Could someone help me with sending a message to a channel when someone voted for My bot?
use the vote event and do Something like message.channel.send("New Vote")
Also there is Something called "Docs"
impressed, it took you 4 days to set up hosting on heroku dont go shaming people for not reading the docs 
๐
๐ฌ

lmao
Same beef

sick burn
This is probs like super dumb but like uh
cost vtoken = "RV_" + w1 + "_" + w2 + "_" + w3 + "_" + w4 + "_" + w5
why is that giving me an error?
the w things are all variables
wait
fuck
im so dumb
disregard
i cant read
Howdo I create a webhook for the vote update?
Heyo anyone know why I'm unable to reach github using my VPS?
it means that it installed everything
you can ignore most of the warnings
having a package.json file is generally a good idea
C:\Users\kitty
Seems like it might be a fairly good idea to create a separate project folder and work inside of there, though.
wdym
The command prompt starts out at C:\Users\kitty which is your user folder. You can change folders in the command prompt using cd foldername
Node bases your entire project around the folder that it is contained within.
honestly if you're gonna move folders delete node_modules
it's not worth waiting to move like 30000 files
Do you already have a folder established for your bot?
In VS code, you'll go to File > Open Folder... and select your folder.
To work with that folder from the command prompt, after you open the command prompt, type cd C:\Users\kitty\yourfolder, changing the command as necessary.
You may also be able to use the command prompt inside of VS Code, which should put you directly into that folder as well.
If memory serves me correctly, there should be a "Terminal" menu up at the top. If so, you can select "New Terminal" from there, and you can use your npm commands inside of the pane that opens.
It should give you a prompt that has your folder name in it.
You can run npm install discord.js from there.
To my recollection, it should do it by default.
VS Code should attempt to save your session, including the open folder and any open files.
You can browse the files that are in the folder from the sidebar. Files open in tabs up at the top.
console.log('Stop mention :(');
});
client.on('message', message => {
if (message.content === `${message.author.bot}`) {
message.reply('Mon prรฉfix est `!7`, pour voir la liste des commandes tapez la commande `!7Help`. ')
}
});
Why When I @ my bot nothing is happening ?
@lunar crystal pretty weird but try this ```js
if(message.content === '<@botID>') {
// code
}
you didnt save the file lol
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
const Discord = require("discord.js");
// further code
Inline Codeblocks:
`console.log('inline!');` becomes console.log('inline!');
idk what your talking about by saying code blocks
you installed discord.js in C:/Users/kitty
your command line is in the wrong folder
you need to move it to the same folder as your file
you can use the command cd to move folders, for example cd documents
you need the three backticks on both sides of the code
beginning and end
```like this```
Don't put ur token like that
everyone can change it
Ah ok p
console.log('Stop mention ');
});
client.on('message', message => {
if (message.content === '627224487913455635') {
message.reply('Mon prรฉfix est `!7`, pour voir la liste des commandes tapez la commande `!7Help`. ')
}
});```
no
I've tried everything but still the same ^^'
@earnest phoenix the problem is not your code, is your command line being in the wrong folder
Ah ok like '<@Id>'
yeah
yeah ๐ฎ
that will work if the user doesnt have a nickname
if they have a nickname, it will be <@!ID>
or you could check the message#mentions collection
like message.mentions.members.first() and check if that member ID is your Bot's ID
oki thx ๐
can you run node -v real quick
you need to restart your pc after installing node. also, during node installation make sure the "Add to PATH" option is enabled
^
Ok it's working thx guys ๐
it says right there
Error: Incorrect login details were provided.
where did you get the token from? which page
which page?
did you click the copy button in the token section?
is the public bot switched on?
well, try resetting the token and trying again
thats part of it, errors tell you how to make it work
I always start to worry when there are no errors
it means something has gone terribly wrong if there are not even errors shown
Nightmare fuel for developers is starting your app, but it doesn't do anything.
You read the error message, you go to the line mentioned in the error and you try to figure out what went wrong
if you're still getting invalid login, dm me your token and i'll test it for you
DO NOT post the token here in chat, only in dm IF you trust tim
you can always reset the token if it leaks, but people might have already abused it by then
your token works
can you send the code you are using to get/use the token?
ofc replace the token with whatever
how can i check all the servers my bot is in in node.js?
Client#guilds
docs are here if you are using d.js https://discord.js.org/#/docs/main/stable/
Using your own computer for 24/7 uptime isn't always a good idea
There are hundreds of VPSes, some of the better ones are listed in pins
you can use my arms for 24/7 cuddle uptime
im a renown cuddle expert studying the field of qt
const fs = require('fs')
const editJsonFile = require("edit-json-file");
const path = `./users/${message.author.id}.json`
try {
if (fs.existsSync(path)) {
let file = editJsonFile(`./users/${message.author.id}.json`);
file.set("discordid", message.author.id);
file.set("robloxid", d.Id);
file.save();
} else {
fs.createReadStream('./users/template.json').pipe(fs.createWriteStream(`./users/${message.author.id}.json`)).then (function(run) {
let file = editJsonFile(`./users/${message.author.id}.json`);
file.set("discordid", message.author.id);
file.set("robloxid", d.Id);
file.save();
})
}
} catch(err) {
console.error(err)
}```
good lord that formatting
Yeah, wait why didn't that copy formatting.
i never seen something indented that much
hear lemme
just
const fs = require('fs')
const editJsonFile = require("edit-json-file");
const path = `./users/${message.author.id}.json`
try {
if (fs.existsSync(path)) {
let file = editJsonFile(`./users/${message.author.id}.json`);
file.set("discordid", message.author.id);
file.set("robloxid", d.Id);
file.save();
} else {
fs.createReadStream('./users/template.json').pipe(fs.createWriteStream(`./users/${message.author.id}.json`)).then(function (run) {
let file = editJsonFile(`./users/${message.author.id}.json`);
file.set("discordid", message.author.id);
file.set("robloxid", d.Id);
file.save();
})
}
} catch (err) {
console.error(err)
}```
wait one sec, lemme try uno last thing
alright so first of all
Yeah, ok uh I removed the .then thing
why the hell are you making a file for each user
is that a JSON database
dude
its not gonna be editted at all
this is like legit the only time lmao
your creating so much unnecessary work
you can use a proper database like what Dream said
and many others
SIGH
rethinkdb
i don't think you have the right to say "eww"
whatever floats your boat bud
lmao
you dont need to?
so i can make my api down the line easier
any proper database is better than JSON lmao
lol good luck
tim shush
u look like a potato
ok so uh
lemme thonk
which database is the easiest
to use
none
sqlite is pretty easy
it comes down to preference
dream i tried no database
what? lmao
how about study a bit about databases, their types/styles/differences?
yeah i see that
Alrighty boys, mongo it is
ok cool we're getting somewhere
lmao
because local databases are gay
very mature
i did this
client.on('ready', () => { console.log(Logged in as ${client.user.tag}!); console.log(Client.guilds); process.setMaxListeners(0) client.user.setActivity('.help') });
to show me the servers my bot is in but it says this in the cmd. what did i do wrong?
client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!);
console.log(Client.guilds);
process.setMaxListeners(0)
client.user.setActivity('.help')
}); ```
local databases are gay
you aren't importing Client
bold words for someone who thinks atlas is a good service
you just used a JSON database, why are you talking
you don't have to flood the channel with multiple line breaks when you talk dude
^
sIGh
trying to learn aws?
no
yes
well you should do some research based on a multitude of things
for example, java has basically a decade of support for sql databases while mongo works well with js
ok mongo it is
honestly id go with mongo for js since of its query syntax
alright we've already established this
most databases work everywhere, as long as someone made a driver for it
Client is the constructor, you defined your instance as client, use client
or just like
alright lemme go watch some por-pokemon
use mongo locally
afk
i guess this channel is his blog
glitch and heroku are free (and bad)
you should definitely buy a vps
^^
google and amazon are free for 12 months, but require a credit card to register
const uri = "mongodb+srv://RoVolution:<password>@rovolution-vhhqz.mongodb.net/test?retryWrites=true&w=majority";
const client = new MongoClient(uri, { useNewUrlParser: true });
client.connect(err => {
const collection = client.db("test").collection("devices");
// perform actions on the collection object
client.close();
});```
thats the connection code, lemme go find the docs lol
ok
๐คฆ
how about you send the issue
and your code
and we can help you through it
sigh.
stop spamming the same thing, we cant help you with that.
please stop being so dramatic, its getting a tad excessive at this point
lmfao spider
grey's anatomy screenwriters would've loved this
could not roll my eyes any farther with this man
๐
Hey guys, so trying to make a music bot with lavalink, I have 0 errors, the bot joins the voice channel, but it doesn't actually play the song (even though it states what it is playing)
But I have no errors to show, so idk if anybody has any suggestions here
Code?
Sigh. As in the ```js
code
if (!message.member || !message.member.voice.channel) return message.util.reply("you must connect to a voice channel!");
const [song] = await resolveSong(this.client, `ytsearch:${track}`);
if (!song) return message.util.reply("this track wasn't found!");
const player = await this.client.manager.join({
guild: message.guild.id,
channel: message.member.voice.channel.id,
host: this.client.manager.nodes.first().host
}, { selfdeaf: true });
if (!player) return message.util.reply("I could not join!");
this.client.logger.debug(song);
player.play(song.track);
player.once("error", error => this.client.logger.error(error));
player.once("end", async data => {
message.channel.send("This song has now ended!");
await this.client.manager.leave(message.guild.id);
});
return message.util.send(`Now playing: **${song.info.title}** by **${song.info.author}**!`);
It returns a track for sure
console.log('Jibillah');
});
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.find(ch => ch.name === 'logs-vitas');
if (!channel) return;
let user = message.author
const embed = new RichEmbed()
.setTitle(`**Bienvenue sur le serveur ${member} :tada:** `)
.setColor('#3e9e3b')
.addBlankField()
.addField(`${message.author.avatar}`)
});```
wassup
cause message isn't defined.
where do you expect to get message?
let user = member.user.username
in a log channel
you only have a member object
the guildMemberAdd event only provides you the member object
oki
yicks one sec
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.find(ch => ch.name === 'logs-vitas');
if (!channel) return;
const user = member.user
const embed = new RichEmbed()
.setTitle(`**Bienvenue sur le serveur ${user.username} :tada:** `)
.setColor('#3e9e3b')
.addBlankField()
.addField(`${user.avatar}`)
});
to get the user object use Member#user
should work
Ouh oki thank u very much ๐
here are all the events btw
which also shows which parameters they provide
and under the type you can click to see what methods or properties you can find under that param
oki thx
did it work?
So I made a mental health resources bot that can pull information as well as crisis intervention sources and I'm trying to get it on top.gg to offer it to everyone to get mental health resources to everyone bc I feel its that important but I dont have the bot in any top.gg servers. Can anyone help me with this part?
hi
hold on gonna answer this other guy
alright xD
@thin quartz you dont need to have it in any top.gg servers
anyways
show me ur code
let vEmbed = new Discord.RichEmbed()
.setColor(colours.gold)
.setAuthor("Vote for us!")
.addField("You can click [here](https://top.gg/bot/629657379633365002/vote) to vote!", "Thanks for your support!")
.setFooter(`y e s n o | Developed by yesno`, "https://images.discordapp.net/avatars/475607489107197952/33bf093103467309b40110cad555c496.png?
size=512");
message.channel.send({embed: vEmbed});
um?
nothing looks wrong
@humble pendant That's because it's the field title, it wouldn't embed the link.
ahh
I suggest switching them around, so:
For some reason i posted my stats once, and not it wont update again when i re-run my bot with the same code
@clever storm what's your code
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})```
lol
if you do something like this
const dbl = new DBL(dblapitoken, client)
it should automatically update
Is there a bot or a way to make a bot that gives a role to people who follow you on twitter or instagram. (not twitch)
Not 100% sure if this is dev related or not but in your package.json there is "main": "index.js" I am wanting to move my index out of the main directory into a sub folder would I do this by changing that line to "main": "./subFolder/index.js" or?
@loud salmon i mean, ITS COMPLICATED AF
How would i send a Message to the Person who invited my Bot?
๐ค invited it to their guild?
@fallow spire
I can guide you in the direction to sending a message to the guild owner when the bot joins but other then that ๐คท๐ปโโ๏ธ
did i see a json file database
where @earnest phoenix
somewhere above
@earnest phoenix if you are referring to me it's not a JSON database it's just the package.json? And I use SQL for db related stuff
not you
Okay
also sql bad mongo good 
Yeah I'm looking into switching actually
Everyone says mongo is better so ๐คท๐ปโโ๏ธ if you can't beat them you mine as well join them lol
its neat but its not like
life changing
if you deal with a lot of relational data
sql is your baby
Honestly I mainly use it for economy, level ect
Some per guild settings like bot name and pic but other then that
@earnest phoenix love u now
y
@spare goblet in console bot showing
Webhook running at http://0.0.0.0:5000/dblwebhook
@fallow spire why do you love me
what is the problem?
You are trying to get the length of something that doesn't exist @royal herald Example: prefix.length
@earnest phoenix use glitch ^^
No
Why
When you use glitch you car set webhookt at youprojet.glitch.me:port
No im not using glitch
Or open the port 5000 in your box and put yourip:port
Yes i know
@hoary elm how to fix this?
See my code upside
Webhook not responding when im testing
Yes
0.0.0.0 = local
Please open the port 5000
And put in your bot page: IP:PORT
Ip = your ip
So what should i use at 0.0.0.0
You can't use this
...
http://0.0.0.0:5000/dblwebhook im using this
You can't use this x2
'const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');
var prefix = ayarlar.prefix;
exports.run = (client, message, params) => {
if (!params[0]) {
const commandNames = Array.from(client.commands.keys());
const longest = commandNames.reduce((long, str) => Math.max(long, str.length), 0);
message.author.sendCode('asciidoc', = Komut Listesi =\n\n[Komut hakkฤฑnda bilgi iรงin ${ayarlar.prefix}yardฤฑm <komut adฤฑ>]\n\n${client.commands.map(c => ${ayarlar.prefix}${c.help.name}${' '.repeat(longest - c.help.name.length)} :: ${c.help.description}).join('\n')});
if (message.channel.type !== 'dm') {
const ozelmesajkontrol = new Discord.RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.setAuthor(message.author.username, message.author.avatarURL)
.setDescription('รzel mesajlarฤฑnฤฑ kontrol et. ๐ฎ');
message.channel.sendEmbed(ozelmesajkontrol) }
} else {
let command = params[0];
if (client.commands.has(command)) {
command = client.commands.get(command);
message.author.sendCode('asciidoc', = ${command.help.name} = \n${command.help.description}\nDoฤru kullanฤฑm: + prefix + ${command.help.usage});
}
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['h', 'halp', 'help', 'y'],
permLevel: 0
};
exports.help = {
name: 'yardฤฑm',
description: 'Tรผm komutlarฤฑ gรถsterir.',
usage: 'yardฤฑm [komut]'
};' Where is the error?
So what should i do
0.0.0.0 = 127.0.0.1 = localhost
Im using heroku
Use glitch OMG
I cant use glitch
You can...
And juste use the "make my projet private"
@earnest phoenix you say i should run my complete bot there or just webhook etc. ?
You can use glitch for thรฉ webhook
The *
Only webhook
Yes
const dbl = new DBL(process.env.dbl)
let votes
await dbl.getBot('398690824721924107').then(bot => { votes = bot.points }).catch(z=>{})
client.user.setActivity(votes)```
Does this is a code for upvote count in my bot status
.....
@earnest phoenix glitch is bad, and 0.0.0.0 is not localhost
@mossy vine wait
Idk im trying to do it from last 8-9 hours but nothing helped
When I used to use webhook locally he would tell me 0.0.0.0:3000 and I would do localhost:3000
0.0.0.0 is like localhost
@earnest phoenix wait
In the context of servers, 0.0.0.0 can mean "all IPv4 addresses on the local machine". If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host is configured to listen on 0.0.0.0, it will be reachable at both of those IP addresses.
also stop making it seem like that glitch is necessary for setting up a webhook
@earnest phoenix cuz u use mongo
yea mongo is op
Wait
Ok
our entire fancy infrastructure runs of mongo
uwu
Glitch is necessary if we don't want to open a port on our box @mossy vine
yes its pretty hot
@earnest phoenix opening a port isnt even that hard. on a vps you usually dont even have to do anything
I know
and its not necessary
there are so many other options
stop making it seem like its the only one
Like?
Im on glitch and still don't know how to create webhook can you guys give me some ref. or example.
the docs have examples
didnt you already get example code in #topgg-api
@earnest phoenix juste use the REMIX PROJECT button
ok i think its like frok
Yes
:)
And you can use the "Make this projet private"
You don't seem to be here to help the people. @mossy vine
So if you don't want to help, don't talk.
@earnest phoenix and need to login my d.bot there ?
No lol
Just config this in the config.json file
And
In your bot page
Webhook url: youwebhook.glitch.me:3000
And the password is the same in config.json
So you have to choose a password
But in glitch the only usable port is 3000
im asking about it
const bot = new Discord.Client();
@earnest phoenix
Hmm
For find the bot channel yes
This bot should be longin ?
Hmm
And send message too
You can remix the project and config him
^^
Hmm and after this what should i put on dbl page url section
Wait
Hmmm...
Yes
If you need anything, my dm are open.
Bye
ok thank you so much bro
Np
other than clearing caches, are there any decent ways to reduce overall memory and cpu usage on discord.js master w/ internal sharding?
How i can get commands like on just the category i want commands.map(command => command.name+':'+command.category)
commands.some?
is it possible to get the message when someone response the bot's in DM ?
Could someone please help me with sending a message to a channel when someone voted on my bot?
@glacial mango you just need to have an http server running that will listen for the dapi webhook
You can configure where dapi will send the web hook from your bot page
How do make a http server
Well it depends on the language you're using
There are a number of ways to create an http server
I use Javascript
hey there, does anyone happen to know how to list guilds name on a shard bot? I'm using discord.js
You could use the broadcastAsync function I think thats how its called iirc
broadcastEval which is available from the Discord.Client shard property
@shadow dust Could you help me making a script to do it? I don't really understand how to do it
@shadow dust thank you โบ๏ธ
@lunar crystal You can't erase because this is an field
.addField("title", "description or some text")
Hmmm... ok thx u ๐
You could use \u200B as description
which wouldn't show
That's probably what addBlankField() does
but then for both name and value
oki thx
What is the name of the permission ban member ?
and kick member ?
Because BAN_MEMBER & KICK_MEMBER are not working
@lunar crystal lol BAN_MEMBERS.
lol ^^
If that's not working then you got something wrong
The permissions are BAN_MEMBERS & KICK_MEMBERS
Oki thx ๐
Np
for future reference @lunar crystal
https://discordjs.guide/popular-topics/permissions.html#checking-member-permissions
ok
Uh hi. I need a bit of help with oauth. I've heard that it's possible to redirect the user to a URL after they invite my bot, but my link is not working. What's wrong with it? https://discordapp.com/api/oauth2/authorize?client_id=495496088510529556&permissions=27654&redirect_uri=https%3A%2F%2Fantiowo.xyz&scope=bot
the bot gets invited just fine, but nothing happens after that
I figured out the issue. One of these needs to be checked
Are u set callback?
yes, that fixed the issue
I cant ::/
why?
I dont know
How i can do that if its false dont return anything, at right now it returns empty string```js
data.push(commands.map(command => {
if (command.category === 'moderation') {
// finally command.name;
return command.name;
}
else {
}
}))
it's already doing that, but it'll return undefined instead.
Can you help me to make eval command ?
We aren't going to write code for you
try it out and see
Eval command? With that code?
Heu yes๐
Whaa
I think he's using js
If I could just send my home made code for my eval
oh okay
lol
@surreal wagon but be careful with the eval command. make sure it's locked to ONLY your user id. a lot can go wrong if you dont.
and doing rm -rf / --no-preserve-root, erasing your entire drive
...one good reason to use a vps
they also could technically download malware and run it
if(message.author.id !== 'your id') return;
^
yeah, you can make it send an amazing annoying message!
If the bot is not sending message, it's more frustrating
return message.channel.send("Go away.")
but all of this can be figured out in 3 seconds
I know
Oof
Lol
Lol
ok then lel
okeh
Im on mobile so y
Ok
Hi, i have this array :
["Balbuto (Normal)","Blindรฉpique (Normal)","Migalos (Normal)","Prismillon Jungle (Normal)","Oniglali (Normal)","Kapoera (Normal)","Cadoizo (Normal)","Ecrapince (Normal)","Boost","Boost","Chenipan (Normal)","Migalos (Normal)","Givrali (Normal)","Migalos (Normal)","Minotaupe (Normal)"]
How i can know how much this array have Migalos ? Here output is : 3
If you're asking how to count every entry of "Migalos", iterate through it with something like filter then count the length
Mmmh
@surreal wagon sorry if i'm late, but it didn't work because you made a typo in the first line
Who can give me a code :
like
$gen number
and the bot generate random number from notepad
Spoonfeed is not allowed in this server
You are expected to be willing to learn without getting shoved anything into your hands
random number from notepad 
yes
look up how to generate random numbers in the programming language you are using
or account like
$gen spotify
and the bot generate random spotify account from notepad
you.. want to generate accounts? thats not allowed at all
I know ๐คฆ it's example
also have fun getting that to work with random numbers
Can u help me pls ?
How do you expect a program to get a random number from notepad
I suppose if you have random numbers stored in that notepad you could let it read the file, split the numbers into an array and just randomly grab an index number to get the number
that's a bit overengineered for random nums innit
With discord bot maker
oK
@loud salmon Discord Bot maker is illegal?
ok
It's not my bot
Has anybody worked with PostgreSQL / TypeORM before? If so, do you know how to work with the type "bigint" because it returns as a string and I want it as an integer since I am comparing a timestamp.
cant you just convert it to an integer once you got the data?
no, cause apparently "bigint" is higher than the maximum size number in JavaScript
wait you want to store timestamps?
and the other types are too small for Date.now()
@rugged kelp yes i know, dont post images of that here
someone has experience or know how to get async code to work in repl it, or know another online ide, that supports async functions ?
jsยจ
use IIFEs
(async () => { /* some code here */})()
alternatively just write an async function and call it
how do i catch errors
as you would regardless
oh okay i already just wrote a standard async function
but from what i read online repl it doesn't support async code, normally
at least the code i give it (which code in vs code or what not) just returns (promise <pending>) in repl it
yeah, you dont await the promise
i assume thats inside of an async function?
can you show the full code
eh let me make it a bit more readable
gimme asec
console.log(error)
:200iq:
why log errors when you can just ignore them 
then you come here asking why your code doesnt work
if it makes you feel better, i do have console.log(error) just felt like writing // oof in the mwe
but is there a way to work around await, if it's not supported?
maybe just hardcode a timeout and hope you get response ?
no
if the library gives you a promise, you can only get the result by using await or .then()
you would have to use callbacks instead of promises
like the native http module
which lib?
One message removed from a suspended account.
One message removed from a suspended account.
Js
One message removed from a suspended account.
in d.js there'd be an arg disableEveryone for Client iirc, wouldn't there
^
One message removed from a suspended account.
@sage bobcat embed=embed1?
One message removed from a suspended account.
One message removed from a suspended account.
what do you mean "blank embed"
because I only ever use 1 embed/command
One message removed from a suspended account.
One message removed from a suspended account.
oh
Are u typing description?
so basically the description is missing. check your args
One message removed from a suspended account.
they are empty
console.log your args
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.
just .slice()
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
just dont put the id in the description?
why is the id even there in the first place?
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.
Oh.
-checkmybot @cedar brook
@cedar brook
Bots added to the site are ordered by a queue based on the time they submitted their bot. Website Moderators check bots according to the queue and cannot check your bot just because you requested it. In addition, queue length is confidential and we cannot tell you your position in queue, either.
As the FAQ: How long is Approval? states, your bot may take up to a week or more until it is checked. There is no set time how long bot approval will take; there is a queue and you're not the first nor are you the last.
Please be patient.
Oh, thank you. I am new in the discord bots family.
Yes.
@sage bobcat your description is args so that means the ID is also coming from args
One message removed from a suspended account.
how are you defining args? does the command you're using require you to type someone's id?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@cedar brook Trust me, discord bots are not family. Most people do this for competition and buisiness
;-;
or just for fun
I am making for fun
If else or a bunch of if statements?
What's the context to that question
I am using ruby and as of right now haven't found a good way for dynamically loading commands so until then I am just gonna use a statement base command loader.
(https://discordapp.com/channels/264445053596991498/272764566411149314/640306138407239692)
Fixed it, well there was nothing to fix, just a problem with git.
Anyone got like script to store stuff in database?
Or can anyone help me with it? discord.js
MYSQL?
that then
What program I can use to code bot?
any text editor, really
yes
visual studio
however, if you're talking about running and compiling the bot, you will need a runtime for the language you're working with
;-;



