#development
1 messages ยท Page 1518 of 1
if you wrap the anchor tag around the div, the entire div should redirect you to the href
mhm
- [object Promise]
- [object Promise]
- [object Promise]
- [object Promise]
uh wait I think it might not be working as i want it to be
oops
removing the anchor from the text fucked it up doe
css
cursor: pointer
o
why
idk im basically writing code drunk at this point
why not require all prefixes on startup?
dont you dare bad mouth drunk code

thats my motto, drink and code
do pointer cursor work with divs?
yes to what?
not to you
41 event listeners on 'message' also work, doesnt make it less shit
fuck yea
to save on database calls simply require all on startup and map them on redis
yea that might work
but i'll do that later
once this shit works
heY at least i amn't working on prod
ah yes
๐๏ธ
"i'll do that later"
precisely
what
or something to that affect?
why would you want that
anchor tags
i know what an a tag is bro
so im making like this button
and i need an href
<div class="col-xl-2 card1" style="float: left;">
<div style="padding: 10px; border-radius: 6px; display: flex; justify-content: center;" class="bg-dark">
<a style="color: #e0e0e0;" href="#">
<i class="fas fa-heart" style="color: #FF6B6B;"></i>
Support Us
</a>
</div>
</div>```
but, i want the entire box to have an href
flexbox is life
pong
piing
pong
use the onclick event
have you ever looked in jquery it makes stuff like this easy or something
what are you even doing
jquery isn't needed for this 
jquery isn't needed for a lot of things
its just a redirect
i use jquery for everything ๐
i use it for some things
https://matt-the-scottish-twat.cc/u/fwfNIinGUY this is my favourite thing i've done with jquery
this has no backend
where yould the onclick event be?
and returns a project by id
thats awesome
document.getElementById('id').onClick(function(){}) or somethin idk
im already using an a tag
huh
like im already using it in the div
why do you need another one
for an href
i need an href of the entire div
and if i do use js
i need cursor to be pointer
on div hover
i can share code ๐
just wrap it with an atag?
im ALREADY USING AN A TAG
wrap it
<div style="padding: 10px; border-radius: 6px; display: flex; justify-content: center;" class="bg-dark">
<a style="color: #e0e0e0;" href="#">
<i class="fas fa-heart" style="color: #FF6B6B;"></i>
Support Us
</a>
</div>
</div>```
wrap it?
why do you need js for this
back to callback hell i go
sad promise noises
yea that might be easier
how can i get these cards to like go to the next row?
so like,
--
--
instead of -- -- --
flex-direction: column;
```?
Im glad i code usind bdscript and not java or .js
thats not code but sure....
like to basically be in the next thing
are those cards in a flexbox?
now yes
what is bdscript?
flexbox and flex is different?
you can make any element display as flex
apparently it's this https://botdesignerdiscord.com/
Free, simple and powerful bot creator for Discord.
Create your awesome bot anywhere, hosting included.
mhm
play around with it
some bot creation tool
with inspect element
flexbox for alignment is heaven
its fucking heaven ikr
just UGHHHHHHHHHHHH you type a few characters and shIT IS ALIGNED
how the fuck did i live without this shit
Mobile script
https://css-tricks.com/snippets/css/a-guide-to-flexbox/ this article is going to help you
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.
ty
Oh be
T
I'm trying to use a command handler to make my command and one of my commands uses message.author.username but my console says TypeError: Cannot read property 'username' of null My modules are like these:
module.exports = {
name: 'name',
execute (message, args){
//code here
}
}```
https://matt-the-scottish-twat.cc/u/UEuITHidHU poggers lmao
localhost ram db go BRRRRRRRR
this happens lmfao
make width bigger
for the cards
i think?
use the inspect tool to check which one is limiting the width
making the cards and the container width's bigger doesnt help
wait
i got it
ty
๐
noice
ty guys :)))
np
is there a way to make the texts / icons all start at the same spot?
just margin lefts?
What's the vanity url ?
pretty sure you can use text-align
its a custom url path that boosted servers can use for invites
o
if I have a JSON file like this, and a line that does this
data.games[index].deck = data.deck
will that make a shallow copy or a deep copy
can someone please give me a discord.js.org guild.channels.create file?
i can't find it
That's just a reference, so neither
if i have an item that is position: absolute the scroll bar gets wonky
any fixes?
got it
Any idea for what's the best command handler?
anyone know how to host a bot 24/7 for free without it ever having to sleep?
you either get 500 Hours/Month or forced Restarts once a day. if you got a Credit card AWS and Google Offer 1 Free Year, the card is only needed for registration
there is no best, just go with what works for you
sadly I don't have a credit card :.(
borrow your parents'
no one will give you Hardware entirely free
spectacular idea
right?
yeah, let me actually try that rn
btw Ig google only offers 3 months now
wait if its only free for one year or three months, how much do I pay after that?
as long as you don't enable billing on google, you're not paying.
hmm ok
so the console output is that strings[i] does indeed exist and it is exactly what i want, but here is what I am receiving from my bot:
any reason why this might be happening?
(please ping with response)
where did you make the variable?
can you send an ss of that?
you should make your code async and then use await to make sure it runs step by step so you know for sure that the value has been defined before sending it
ok so is that code part of a function?
nope
or part of a thing that says on.client or something
ok add async to (message) so it looks like async (message)
okay
ok, now before adding anything else, in case that did it, try running it again
ok, so for lines where you're assigning a value to strings add await to them
Error: Cannot find module '/root/Among Us Bot/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node'
okay
so like if you're doing string[i] += 'whatever' just change it to string[i] += await 'whatever'
ok
did you moved the node_modules folder from a Windows PC on a Linux VPS?
ok so try running again after doing that
did you push the value to strings first?
after pushing a value to the array then you can add to it using [i]
so the first time you do it do strings.push("Your Cards:\n")
still nope
what
Error: Cannot find module '/root/Among Us Bot/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node'
did you copied the node_modules folder from a windows PC on a linux machine?
delete the entire folder and build them again
so something interesting happened
when i started it as "test"
so it appears that strings[0] is test and the rest of the stuff is just getting appended yet not printed?
idk
okay
that appears to be invalid syntax
both await for() and for await() dont work
maybe add await before the brackets?
also doesnt work
I have no idea then, sorry
for (await) iirc
says this is invalid
for await
okay good news, you had the right idea, it turns out i need to await the message.channel.send
else if (command == "start")
{
index = findGame(id);
if (findHost(id) == -1) {message.channel.send("You aren't the host of a lobby."); return;}
//if (data.games[index].numPlayers < 3) {message.channel.send("You need at least 3 players to begin."); return;}
let x = shuffle(data.deck);
let strings = [];
for (i = 0 ; i < x.length; i++)
{
data.games[index].deck.push(x[i]);
}
for (i = 0; i < data.games[index].numPlayers; i++)
{
strings.push("Your Cards:\n");
data.games[index].scores.push(0);
data.games[index].hands.push([data.games[index].deck[0],data.games[index].deck[1],data.games[index].deck[2],data.games[index].deck[3],data.games[index].deck[4]]);
data.games[index].deck.splice(0, 5);
for (j = 0; j < 5; j++)
{
strings[i] += await `${j+1}. ${data.games[index].hands[i][j]}\n`;
}
}
for(i = 0; i < 5; i++)
{
await message.guild.members.fetch(data.games[index].playerIDs[i]).then(val => val.send(strings[i] + "\n\nThe game will begin shortly."));
console.log(i + ": " + strings[i] + "\n");
}
}
well unfortunately it appears there is another issue, the hands array in the json file is not updating
this is a yikes
I'm not entirely sure why, it was working a while ago
this time putting await in front of the data.games[index].hands.push([big spaghet mess]) line did not solve the issue
putting console.log immediately after shows that the array is what it should be
hello gilicten coded bot bot. I got the startup file elsewhere does not work. Can you help me?
what's the difference between
Discord.MessageEmbed() and Discord.RichEmbed() ?
MessageEmbed replaced RichEmebed in djs v12 - any code you've written for RichEmbed will work fine for MessageEmbed, however there are a few minor changes you'll need to check the docs for
oh thanks
I saw a code on GitHub and it said RichEmbed which I never heard of so I got confused
Hello!
How can i "load" a command?
so you want to split commands into individual files and then load them when the bot starts?
which language ?
For JS, this is a good example
https://github.com/Netail/DiscordBotTemplate
template bots bad
:(
they invite users to just copy/paste the entire code without knowing what it does
it's EASY start but BAD start
if i make a new bot i usually use one of my Existing bots as Template,
That's also an option
nvm i figured it out, it didnt automatically load with rest cause it was outdated lol
If they never made bots before ye
they should learn how to
There are tons of tutorial out there
COPYING is definitely not MAKING
I know I know, but it's an easy for people who know what they're doing
they probably dont use then some random github template
no they copy from repl.it
people who made already a few bots and have made themself an optimized template?
You can't say if a GitHub code works or not
But repl codes, they're already working
Yeah I have my own bot library
Ye, but why should anyone look there for templates?
actually some guys who can't verify on Heroku use it for hosting
yea those bots are already running. So they're more reliable
you can also use VSC to code together
yea
Live share extension ye
BTW are we forgetting GitHub ?
Wat
why? i use it more for version control, and when working together it makes merging code easy
Yea Git is mostly for saving your a** from the edit you made
but it's also used for coding together
you can use liveshare yea or create iirc some sort of ssh connection so you can work on the vsc project whenever without worrying about live share
you can use ssh to edit files directly on your VPS
yea, cause I use ssh to help work on a bot with someone
why would you put effort in that while there is an easy to use extension?
ssh is easy to setup?
Liveshare
Like if you're coding top secret code right now lol
its less bcs of informations more about intercepting the connection
liveshare is bad if you wanna code the bot when the other user isnt available
i think you can force dimensions in px
give avatarURL() with an option
like .avatarURL({size: 1024})
i think that'll work
Ye
If you want custon dimensions, you'll have to use a dependency
no I just want a better quality in avatar Command. I don't need custom dimensions
Mhm
Quality is as good as the quality someone uploads it as (probably lower because of compression) You can't rely on getting hd pictures
yea just depends on the quality of the original photo
Just deal with it 
Hi
hey guys
(node:10824) UnhandledPromiseRejectionWarning: TypeError: spawns.includes is not a function
currentMon = {};
currentMon.id = Math.floor(Math.random() * Math.floor(dex.length)) + 1;
currentMon.name = dex[foundst];
currentMon.level = Math.floor(Math.random() * Math.floor(100)) + 1;
currentMon.catchChance = (pConfig.catchDifficulty/currentMon.level);
currentMon.spawnId = Math.floor(Math.random() * Math.floor(9999999-999999)) + 999999;
while (spawns.includes(currentMon.spawnId)){
currentMon.spawnId = Math.floor(Math.random() * Math.floor(9999999-999999)) + 999999;
}
spawns.push(currentMon.spawnId);
updatePoke();
if (Math.random() < pConfig.shinyChance){```
how do you define spawns
Hi pgamerx
this is actually decent
you could get lower if you find a Host that is in the same datacenter where discord is
i mean i got it down to
then i installed the packages tim recommended to install with discord.js light and now its slow
Dice check palace
s l o w
let msg = await client.guilds.cache.get("777458791796703262").channels.cache.get("777458792958787590").send({ embed: report,}).catch((error)=> {message.channel.send("Error happend! ,Pls try again later or join our support server")});
``` why is msg undefined?
you're defining msg and trying to reference it in itself
or it cant get the guild/channel
they exist
then maybe they're not cached
caching is on
also client.channels.cache is a thing
just because caching is on doesnt mean everything is cached
https://alebot.is-inside.me/XRg8yFRt.png i wanna make it faster
get a closer location to discords api / Gateway Servers
the only way to improve api ping is to move closer to the gateway
get a vps located in new york
message latency is pretty much the lowest you can get already
move to new york and selfhost 
only if you have really good fiber xd
but im in fraaanceeee 
Change host 
no ๐
I need help
for (i = 0; i < predictions.length; i++) {
console.log(optionsboi)
console.log(probboi)
if (predictions[i].probability > probboi) {
if (optionsboi.includes(predictions[i].className)) {
msg.delete()
}
}
}
This is my code
Bot doesn't delete the message
This is predictions
[
{ className: 'Neutral', probability: 0.9956157207489014 },
{ className: 'Drawing', probability: 0.004245242103934288 },
{ className: 'Hentai', probability: 0.0001161084437626414 },
{ className: 'Porn', probability: 0.000020942647097399458 },
{ className: 'Sexy', probability: 7.311034551094053e-7 }
]
This is optionsboi
["Sexy"]
This is probboi
0.7
Why doesn't Bot delete the message
Sexy 
what's probBoi
this
Does it have perms?
Log everything console.log(predictions[i].probability > probboi, optionsboi.includes(predictions[i].className))
it does not delete because it doesnt pass the ifs
by the way you should use && instead of chaining it like that
but why , that's what I don't get
only Neutral passes the first if, and only Sexy can pass the second if
But isn't
7. > 0.7
ohh
maybe round the numbers to 4-6 digits after 0
yes you
no u
owo
no u
const member = message.mentions.members.first()
member.setChannel(null)```
why doesn't this work?
you tell me
yes sup cry, stargirl, flazepe and tim
bored rn in online class
i just browsed the docs, there is no setChannel method on a member
theres edit
you're probably looking for that
im looking for this
yeah you can do that with edit
again, that's VoiceState#setChannel()
How to round off numbers in js
Math.floor(n), Math.ceil(n), Math.round(n), parseInt(n), n.toFixed()...
all of those can be used for rounding
i used toFixed for that
but keep in mind that toFixed converts the number to a string
Alright thanks tim
if (command === 'queue' && subcommand === 'join') {
if (queueMessageId === 0) {
message.channel.send('A queue does not currently exist trainer '+ "<@" + message.author.id + ">");
} else {
message.channel.messages.fetch(queueMessageId).then(queueMessage => {
if (addUserToQueue(message.member.displayName, message.member.id, test)) {
assembleQueueMessage();
const userQueueDuration = timeInQueue(message.member.id);
queueMessageText += ' ' + message.content.slice(Config.prefix.length).replace(/^queue *join/, '').trim()
timesss = userQueueDuration;
setInterval(async () => {
if (Config.useEmbeds) {
timesss = userQueueDuration;
if (typeof userQueueDuration === 'string' || userQueueDuration instanceof String) {
let z = userQueueDuration;
queueMessage.edit(embedQueue.setDescription(queueMessageText + z));
} else {
queueMessage.edit(queueMessageText + z);
} }}, 10000);
} else {
message.channel.send(`${message.author} already entered the list queue!`);
}
})
.catch(console.error);
}
}```
is it maybe because i have to use the command queue join?
use commands.Bot instead.
how?
are you new to python
rtfd
But @quartz kindle if it's 0.49373736 it returns 0
Isn't there any way that I can round it off to 0.5
Like any method
from discord.ext import commands
bot = commands.Bot(command_prefix = "$")```
this is my code
and i didnt gave the command
hol up
from discord.ext import commands
bot = commands.Bot(command_prefix = "$")
@bot.event
async def on_ready():
print('Online!')
swear = [ ]
@bot.commmand()
async def banword(ctx , *, word = None):
swear.append(word)
@bot.event
async def on_message(message):
if message.content.startswith == word:
await message.delete()
bot.run(token)```
^^
thats all
what's the error
well, im proud to announce my bot hit 250 guilds uwu and almost 1k players now
You want the in operator and str.lower()
word isn't even defined kekw
Thank you guys so much for helping when i had issues ๐
aah lemme see
fixed
but i am still getting the same error
lmao its done
worked โค๏ธ
thanks
@slender thistle i got another error lmfao
i want to make it like if the message content is in the list. It will automatically delete.
async def on_message(message):
if message.content.startswith == (str(word)):
await message.delete()```
word isn't even defined kekw
you're changing nothing that shiv has mentioned doe
hello
bol
i cant understand it tbh
i would like to know how to make commands
I am like doing a lot of things at the same time
r u indian
So you lied about you're not new to python? 
no
ooh ok
I mean i am not new to python
i cant just understand it lmfao
You're not showing that though
do you have any experience with programming/coding? @tame meteor
no
creating a bot requires knowing how to code
i will eventually learn about it
Yo
Ah alr
Thanks Tim
I didn't put 1 in the ()
but i do a little bit about QBASIC
how old are you? 
I have no clue how is a function equal to str, but okay.
15๐
fuck man
what did you use for the Image classification?
Function.toString() :)
@earnest phoenix can i dm you??
regarding what
python and making process of commands of bot
if you're at least familiar with python, sure. Otherwise no
i am little bit familiar with python
setInterval(() => {
dbl.postStats(client.guilds.cache.size, client.shards.ids, client.shards.total);
}, 1800000);
});``` thats true?
automatic image object recognition isn't good enough to be a line between what is nsfw and isn't if you're showing users images classified automatically.
who knows how use mongodb?
many people
someone here with an idea why this call wont increase the value in the db?js member.update({ memberID: uid }, { $inc: { warnings: 1 } }); member is a valid MongoDB document
uid also exist in the database.
make sure your variables are correct
Mongo playground: a simple sandbox to test and share MongoDB queries online
How do I make a bot?
First choose a language you wanna code in
Most of users stat with python or JavaScript
I started with JavaScript
JavaScript is faster but python is easier as it has no syntax issues
Why
they're both pretty much equivalent in speed
wdym by no syntax issues
if anything, py would be faster because out of the box threading
Python and JavaScript both have their own use cases with performance being dependent on the work load type
I read an article and it suggests that js is faster
Don't trust everything you read online
Python is much preferable for Math related work loads which makes it popular for AIML
Good luck doing that in Js 
note how it's all prefaced with "web programming"
A server sided environment is usually best done in JS
I c
Python 3 Node js - Which programs are fastest?
Needless to say a server could do anything and it's possible a web server implements the use of multiple languages where another language acts as a worker
It depends on your use case. If you are not going to get into AIML, the answer is usually no. If you want to learn it just to know it, there's nothing stopping you.
from a lot of people i know that uses/used both (and some other langs), the usually consensus i hear is that py is only good for arduinos n shit
@slender thistle prove them wrong
Alr thanks
For Arduinos you'd very possibly use Arduino IDE
Python is more for data science/machine learning
if(oldState.channelID != newState.channelID){
if(oldState.channel.parentID === '798413426086510673' || oldState.channel.parentID === '736472475625324568'){
let host = await db.get(`host_${oldState.channelID}`);
if(newState.id == host){
oldState.channel.delete()
await db.delete(`host_${oldState.channelID}`);
}
else return;
}
else return;
}```
it says cannot read property 'parentID' of null
what should i do?
wait, but it'd still be run in py no? IDE in the end tells me its prob just an editor, not a lang
It is a language
oh thats interesting
Arduino language is similar to C
Realistically you can run any programming language on an arduino
well at least py isnt bloated with shitty 2 line packages that are downloaded by 300k users like is-odd 

take a guess
voiceState.channel is nullable, the channel wont exist if the voice state is not connected
its literally 1 line
if i want a fruit, and i don't want it to be an apple, what would i do so i don't eat an apple?
(num % 2) === -1
user connected/disconnected from voice channel, thats why
check if it isn't an apple?
yes, the same way here you need to check for null
if it's null
you cannot use it
the user wasn't in a voice channel
he really wasn't
it's for when someone joins a vc
oh damn tf it's oldState
im blind
oldState is the users voiceState before the update
yes i got it
now i got this code
if(oldState.channelID != newState.channelID){
if(newState.channel.parentID === '798413426086510673' || newState.channel.parentID === '736472475625324568'){
let host = await db.get(`host_${oldState.channelID}`);
if(newState.id == host){
oldState.channel.delete()
await db.delete(`host_${oldState.channelID}`);
}
else return;
}
else return;
}```
it still shows the same error
you're still using oldState in your code
and not checking if the channel is not null before using it
oh wait that's for disconnecting
if the user leaves the voice channel, then newState will not have a channel either
so that's why it's null
wait i got an idea
if(oldState.channelID != newState.channelID){
if(oldState.channelID){
if(oldState.channel.parentID === '798413426086510673' || oldState.channel.parentID === '736472475625324568'){
let host = await db.get(`host_${oldState.channelID}`);
if(newState.id == host){
oldState.channel.delete()
await db.delete(`host_${oldState.channelID}`);
}
else return;
}
else return;
}
}```
here
probably should work
fresh join: old state channel null, new state channel defined
channel switch: both channels are defined
channel disconnect: old state channel defined, new state channel null
Is there a way to make a mongodb document delete itself after a given time?
Thanks
@clever chasm this is the part that matters
i have no clue what happened but my bot said screw it il work again
so i think its ok
Trying to install 1.5 on py 3.9?
already person with ganyu pfp, love it
Anyone know the authentication end point for https://discordapp.com/api/v6/guilds/guildId
Is authentication even required to get guild info by id?
not members, channels, etc. Just guild info
you have to authorize the request with an oauth2 bearer token
i already got her builds up btw if you want it
So would the token need to be for example... a token of the owner of the guild for instance?
what the fuck
what server you playing?
Because even with an oauth2 token and bearer I cant get this information
america, but its her build sheet, its nothing related to having her or not
well if you do, shameless plug, i got her chaarcter build in meh bot
i need to schedule another scrape unit
it's Bearer <token>
Idk just really not sure. The token is valid, and has guilds in scope
you can't use a bearer token for that endpoint
o
a bot token
shouldn't it be possible with a bearer token too
no
And I assume the bot must be present in the server?
correct
however you're probably looking for this endpoint
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
No. Im not.
I want to get guild data by ID only. Not for specific user.
This is for a website.
V6 is deprecated
But if a bot is required then so be it.
use V8
also the API will only send the first 100 Guilds, if you want all use Websocket
how to get the list of guilds with which my bot has the "send_messages" permission?
get all guilds and then check the bitfield for the send_messages permission
get the bot guilds list and filter it out
(filter them out of the manager)
that is for the endpoint i sent, not for the one they want to use
ok
I might just skip the way I was thinking about doing it then.
With a bot using a wrapper I can get all of this data significantly easier than with a REST call. And setup services to constantly update the guild data in my database.
Cool beans. Thisll work great actually.
(node:31272) UnhandledPromiseRejectionWarning: TypeError: r.me.permissions is not a function
bot.guilds.cache
.map(r => {
if(r.me.permissions('SEND_MESSAGES')) console.log(r.name)
})```
.has(), read the docs https://discord.js.org/#/docs/main/stable/class/Permissions
@wicked pivot
oh yes i'm stupid sorry
I just have a question - if I'm waiting for my bot to get approved, can I make an invite command? If so, where do I get the link?
A small calculator that generates Discord OAuth invite links
thank you
what's a REST API
@earnest phoenix HTTP(S) API
REpresentational State Transfer
so its basically an api where stuff goes over the air through http
api which using rest architectural style
top.gg is turning into a monopoly
We need to break it up.
always has been
Does that mean I have to choose between dsl and the bot list
Oh no its like choosing mom or dad all over again
How would I define a user? I am making a bug report message event. I want to be able to send 2 of the developers for the bot dm's with the bug reports when made...
you get or fetch a user
they might not be in the same guild as the bot either so I can't do message.guild.members
they have to be in a guild with the bot to dm afaik
^ yes but not the same as the message originates from
Since its developers I assume they are in atleast one server with the bot.
also shouldn't client.members work?
I would use client.users personally since you are just using it for a dm.
I also would use fetch
Not get
hey
"spawnChannel": "798261704071970837",how do i select a random channel from the json file?
Agreed. Member indicates theyโre apart of a guild.
if you have an array, pick a random number using Math.floor(Math.random()*myArray.length), and access that indes
index
but that spawnChannel is defined in the json file
in the config file
not sure what you're trying to do, there's only 1 value so any random generation would pick that value
yea what relay said
object.spawnChannel[Math.floor(Math.random()*object.spawnChannel.length)] will give you a random item in the array
just replace "object" with the name of your object
aha yeah
and i would have to assign it a variable to call it.
thanks
is there a way to prevent one ctx.clip() from hiding another? im using canvas with discord.js
when i do this it deletes the progress bar
why do you want to clip again?
hey what name is the object?
in my case it would be spawnChannel1 right as that is the object in the json file containing the channels.
to prevent the progress rectangle from glitching over the main one
idk what you mean by that, but the clip method uses the last path you created
and always applies to the entire canvas
it does this
"spawnChannel1": ["798261704071970837", "795941685690368021", "761256089131548692"],```hey how do i randomize the channel?
i want to select 1 channel, with a randomizer
where is the glitch?
hmmm is it possible to see how many people are following an announcements channel ?
discord.com/developers>insigths
ah, ty
are you still running the Jsondb? like i suggested you will have a better time if you switch to a proper DB, even tho the bot is only for one server
yessirr
that looks like you're doing something wrong when drawing, not something you'd want to fix with clip
still at the json dbs 
yes if that's the name of the object. But you need to import that json to a js file first using const myJsonFile = require('path/to/file')
aha okay
if you got an array you can use the randomizer code someone else sended in earlyer
my solution was to add a clip over it to prevent that from showing
i have an idea now
i already did that but it wasn't working,
let me try it again
@eternal osprey try starting the path to the file with './'
const file = require("./pokemon_config.json") this is what i did before
yeah i know how to import files etc.
oke
let spawnChannel = object.spawnChannel1[Math.floor(Math.random()*object.spawnChannel1.length)]```but why is there spawnChannel1 right there?
you can access the array with file.spawnChannel1
yeah i get it
this will always return [0]
halp
That means dbl.webhook is undefined, what's dbl defined as
dbl i defined as...
you need to have the port and auth defined in the initialization of it.
otherwise the webhook is never enabled
also, that library is deprecated
const dbl = new DBL('No taking my token', client);```
how do i fix that?
Instead of using dblapi.js, use @top-gg/sdk
oki
webhook is only available if you actually setup a webhook
how do i setup a webhook
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
see how here the port and auth are set.
new DBL('No taking my token', { webhookPort: YOURWEBHOOKPORTHERE, webhookAuth: "bla" }, client);
http://<Your IP>:<Your port>/dblwehook for example
Your IP?
Just put your IP 
where do i get my local IP address?
if you are hosting on a VPS, the ip you use to connect to that vps
if you are hosting at home, google "whats my ip" it will tell you.
make sure to disable any vpns first
i went to cmd prompt, which one is it
You won't find your router IP in cmd
okay
for instance
I WANT HELP WITH MY MUSIC BOT NOW NOBODY HELPS ME :cry:
or just google "what is my IP"
You'd be better off explaining your problem
Yes
also whattfismyip is a thing
i will send the code here
oki
problem = disconnect command sends message leaving but not leaving voice
Tells you WTF your IP address is
case 'stop':
var server = servers[message.guild.id];
if(message.guild.voice.connection){
for(var i = server.queue.length -1; i >=0; i--){
server.queue.splice(i, 1);
}
if(server.dispatcher) server.dispatcher.end();
message.channel.send("Leaving...")
console.log('Leaved Succes')
}
if(message.guild.connection) message.guild.voice.connection.disconnect();
break;
any available port, its the same between your code and the url
At least use a Map
wheres the port
๐บ๏ธ
in the initialization line we talked about before.
...
Just use any port that isn't already being used by another service
where is your bot hosted?
It's those companies that host for you
so its not a full vps
I really need to make one of these bot hosting platforms, these guys make bank.
for zero effort
lol
in a full vps, you can use any port from 1024 to 64k, as long as there is no other process using that port
you can try doing that as well and see if it works
s/help
@glad violet You're ending the dispatcher but not leaving the voice channel
https://discord.js.org/#/docs/main/stable/class/VoiceChannel?scrollTo=leave
rent a cheap Root Server and then just run something like petrodactyl and give each customer a Docker Container. (its not even a joke met someone here who used such a hoster)
if it doesnt work, your host might be limiting what ports are available for you, in which case you need to ask them
can you give me a port?
6969
like tell me one to use
Testing it sends a payload to the webhook to log something to see if it works, set it up first
uhh i used the ip of my bot host
wait i used my local ip
using ipchicken
yeah
you need to use the ip the host of your bot gave you
or should have given you
I'll ask them
ok thx
let me test
mariadb.InterfaceError: MySQL server has gone
anyone know how to fix this?
maria dumped you and left
@dusky sundial WITH THAT COMMAND IT CRASHED MY BOT NOW BRUH
..
Any error messages?
no it just closes cmd
case 'stop':
var server = servers[message.guild.id];
if(message.guild.voice.connection){
for(var i = server.queue.length -1; i >=0; i--){
server.queue.splice(i, 1);
}
if(server.dispatcher) server.dispatcher.end();
message.channel.send("Leaving...")
console.log('Leaved Succes')
}
if(message.guild.connection) message.guild.voice.connection.disconnect();
voiceChannel.leave();
break;
can u fix it @dusky sundial
ping me if fixed
Hiii
or someone fix it and ping me
Well I'm not gonna write the command for ya, pretty sure @earnest phoenix gave you a solution above as well
AND DO NOT TALK ABOUT server.dispatcher
i used a variable
Ohh ok
@dusky sundial if u fix my code send it in my dms ok?
Not a js dev, so I won't fix much
lots are, but most of us wont fix your code for you.
we can help you understand how to fix it.
Uhh when i voted for my bot the console doesn't say i voted
i think voiceChannel Is voice.channel now
i make large circles around Music bots
Music bots can be a good practice project, but I wouldn't bet on them ever becoming popular
And they're not too much of a practice if you don't understand what you're doing
also get expensive if they do grow at all
^^
Yay! Discord has an incredibly fast turnaround time. My bot verification was approved in under 24 hours.
they finally caught up i guess
@dusky sundial
crashes with this log
ReferenceError: voice is not defined
at Client.<anonymous> (C:\Users\katte\Desktop\Music Bot\index.js:94:18)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\katte\Desktop\Music Bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\katte\Desktop\Music Bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\katte\Desktop\Music Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (C:\Users\katte\Desktop\Music Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (C:\Users\katte\Desktop\Music Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (C:\Users\katte\Desktop\Music Bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\katte\Desktop\Music Bot\node_modules\ws\lib\websocket.js:800:20)
so then message.guild doesn't have anything called voice is what I take from that
yeah my friend got approved in an hour
Yeah, it was incredibly fast.
ok its better
now bot leaves the channel but node shows an error
(node:7580) UnhandledPromiseRejectionWarning: #<ErrorEvent>
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7580) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7580) [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.
should i type .catch console.log()
You can try
no need i just restarted the bot and no more errors ๐
lol
also how to make my bot searchs with youtube-search-api and no with no link or video id
Is there any way for shards of a bot to share variables? like modify and read from the same int/string/array
using discord.js
if i remember the conversation well enough yesterday, yes, but its pretty complex.
pretty sure youd be implementing it mostly by hand.
Idk if it'd work but maybe use a redis database to store the variable values.
Is it possible to preload something using the css src:url() property? (Like <link rel="preload"..., but for CSS)
@sinful elk https://discord.gg/dbl
why would you send an invite link to a server INSIDE THAT SERVER
what's the ~max amount of guilds before you need to shard?
2500
also is it mainly due to having to cache too many guilds or just the sheer amt of messages being processed
it's because that's too much data to send over a single connection





