#development

1 messages · Page 1345 of 1

trail orchid
#

but there isn't a permanent solution?

#

because this is an extremely low maintenance webhook server. I'm only receiving updates from one endpoint and that too not very often.

fiery sierra
#

are you running the bot locally?

trail orchid
#

no it's hosted on heroku

#

that's why I was thinking of using ngrok

#

not sure if that's a good idea though

earnest phoenix
#

no it's hosted on heroku
@trail orchid please switch

trail orchid
#

problem is I don't have any money to be spending on hosting

#

and heroku is extremely reputable and popular

#

their only downside is they limit usage, but that's not an issue for me since I never exceed their dynos

fiery sierra
#

i'm not sure the purpose of ngrok? why not just run an express.js web service on the same heroku app?

earnest phoenix
#

heroku is against bots

fiery sierra
#

though i'm not really totally familiar with either ngrok or heroku

trail orchid
#

because I'm trying to do everything in python

earnest phoenix
#

repl.it is the only good host i can find that is suitable for bots

trail orchid
#

ngrok runs a local server on your computer and essentially makes that server public to the world

earnest phoenix
#

heroku and glitch and shit beaned my projects

#

you can use heroku if you want but you'll regret it later

#

is there a code for python

#

where i can restart a bot

#

using commands

trail orchid
#

I mean isn't it easy to switch over

#

I have been using heroku for around 2 years without an issue thus far

earnest phoenix
#

please check the pins at least

trail orchid
#

I read through them

fiery sierra
#

if you can keep the ngrok tunnel active the whole time without the host address changing ever then i guess it could work

trail orchid
#

everytime the address changes couldn't I make an api call to dbl to tell them it's changed?

#

or is there no way to set the address through the api

earnest phoenix
#

I just realized I haven't even brushed my teeth instead I'm sitting here teaching someone why heroku sucks

trail orchid
#

I'm sorry man but you still haven't given me a valid reason why heroku sucks

#

the 4 reasons mentioned in the pin don't apply to me

#

heroku supports all python libraries, it rarely has downtime, I don't have any concerns with them stealing code, and the specs they provide for free are good enough to host my bot on a month to month basis

fiery sierra
#

i don't think there's a way to change your webhook URL via API tbh

trail orchid
#

@fiery sierra sorry about that, so do you know if I can make calls to change the webhook server address?

#

oh damn okay

fiery sierra
#

that's done in the page where you edit your bot, so unless you can dig into that request and emulate it (assuming that isn't against top.gg ToS) idk how you'd go about it

trail orchid
#

yeah I understand

#

so is there really no free webhook server hosting?

#

maybe I'll take you up on that aws plan then

earnest phoenix
#

why not just host a sub-process <python library name> server in your bot code and have that listen for stuff

trail orchid
#

?

#

can you explain more?

earnest phoenix
#

yes

#

the give you two free subdomains

#

a remotely accessable REPL (read evaluate process loop stuff) to access and a bash shell which only people with access to the repl can use

#

when i say REPL in caps it means the actual read evaluate process loop stuff

trail orchid
#

got it

earnest phoenix
#

but repl is a testing environment so don't expect it to be that fucking awesome

#

the free plan is good enough for my stuff tho I'm looking to buy hacker plan soon

trail orchid
#

okay so once I get a free repl domain

#

how can I set it up to receive webhooks

earnest phoenix
#

they have a lot of tutorials on their repl talk sitr

#

for hosting bots

#

not sure if they have for top.gg

#

but i might be able to explain

#

the two subdomains are <repl name without dots>.<user name withour dots>.repl.co and <repl name without dots>--<user name withour dots>.repl.co

#

Start a Flask server on your python app and have it listen for requests to the environment variable PORT

#

Now on your bot/server page add any of the subdomains

hollow sedge
#

I'm sorry but how is repl better than heroku?

earnest phoenix
#

Do your top.gg API stuff like normal

hollow sedge
#

the free plan is good enough for my stuff tho I'm looking to buy hacker plan soon
@earnest phoenix btw you can get the hacker plan for free with GitHub student

trail orchid
#

okay thank you sm for that information

hollow sedge
#

I have it rn

trail orchid
#

I'll try it out rn

earnest phoenix
#

My school is not on GitHub CS_AlphabetF

trail orchid
#

yeah I also have GitHub student

earnest phoenix
#

You can get private repls with hacker

hollow sedge
#

My school is not on GitHub :CS_AlphabetF:
@earnest phoenix neither is mine, you can still get it

earnest phoenix
#

Nobody can see your code

hollow sedge
#

You just need to send a pic of your ID

earnest phoenix
#

i don't need GitHub student rn

hollow sedge
#

It's free, you might as well get it

#

Also you just said you were planning on buying hacker

earnest phoenix
#

buying

hollow sedge
#

Yes, and I'm saying you don't have to do that

#

By all means, go ahead and pay for it then

earnest phoenix
#

ok

slender thistle
#

I'm sorry but how is repl better than heroku?
@hollow sedge it's not specifically better since it's more of a testing environment (as code said), but it has capable of a lot more in terms of supported languages

#

Not sure about specs though

hollow sedge
#

Yeah I was thinking more in terms of specs

#

I love repl as a testing environment though

slender thistle
#

It is awesome GWowoHehe

earnest phoenix
#

i only use repl as an IDE and a free host

hollow sedge
#

I see

slender thistle
#

I have my VPS for that which is paid by an admin in our team catshrug

hollow sedge
#

I wouldn't really use it as an IDE but u do u

slender thistle
#

I keep repl for testing

earnest phoenix
#

I wouldn't really use it as an IDE but u do u
@hollow sedge it is meant to be an IDE...

hollow sedge
#

nvm

#

Forget I said that

#

Purge it from your memory

low swan
#

is there any way to get a massage id from a specific channel ? at discord py

hollow sedge
#

What I meant was I'd rather use VS Code but that's long term development anyway

#

is there any way to get a massage id from a specific channel ? at discord py
@low swan ctx.message.id

low swan
#

nah didnt work

hollow sedge
#

Can you share your code

low swan
#

yes a moment please

#

i want to take the message id from diferent channel to log it in a diferent channel

#

😛

hollow sedge
#

Remove ctx

#

It'll work

#

So message.id

low swan
#

i tryed it

#

it didnt

hollow sedge
#

On what?

low swan
#

xD

hollow sedge
#

For the latest message?

low swan
#

yes

hollow sedge
#

K

low swan
#

i should use fetch ?

hollow sedge
#

use await channel.history(limit=1).flatten()

#

This will get the last message of the channel

#

As a list tho so you'll probably need to add [0]

#

Also this probably isn't the best way

#

Nvm

#

Do message = await channel.fetch_message( channel.last_message_id)

#

Either one will probably work

#

Not sure about the last one

low swan
#

ill try

#

ty mate 🙂

hollow sedge
#

np

low swan
#

noone worked 😛

#

if i explain what i want to do its will be easy for help ?

slender thistle
#

Okay

#

Two advices all wrong

#

@low swan Do you want to fetch a message with a specific ID in a specific channel?

low swan
#

basically the idea is that users sends a photo and i want to delete the photo and reupload it as embed

slender thistle
#

Err

low swan
#

like this

#

but i want to delete the user message

slender thistle
#

Well here's the thing

low swan
#

and keep the photo watchable

#

😛

fluid basin
#

I really want to ask this, why would even want that in the first place

low swan
#

i khnow its hard

slender thistle
#

You'd have to cache the image manually

#

And I mean the image data itself

#

Not as far as I know

#

They have failed to work multiple times for me after deletion

low swan
#

i try to make it thouth to download an image it self

#

and reupload it to a secret channel

fluid basin
#

no, they will be immediately removed and up to cloudflare cache to decide when to expire the link (if you accessed it before it was deleted)

slender thistle
#

Logs channel?

low swan
#

and them i tryed to get the image url from the secret channel

#

but nah

#

i failed it

slender thistle
#

Why not use a database and store the image URL there?

low swan
#

it will work ?

fluid basin
#

uh why even use a database lol

low swan
#

because the image will be deleted

fluid basin
#
  1. get the link of the image attachment
  2. download the attachment to memory
  3. send the attachment to discord as an embed
slender thistle
#

and them i tryed to get the image url from the secret channel

#

Actually, true, could just fetch message instead

low swan
#

yes but i dont khnow da way

#

my brain right now is worse than a potato :p

slender thistle
#

Makes sense

low swan
#

i dont thint that will work because you delete the image

slender thistle
#

If you cache the image data, no

fluid basin
#

huh

slender thistle
#

Can't you cache for this?

fluid basin
#

just download and reupload the image smh

low swan
#

i made it like that

#

i download the icon local i delete the user message and i upload the image in a channel that users dont have perms

fluid basin
#

you need to reupload as attachment, NOT the link

#

yeah ok?

#

so whats not working

low swan
#

i used that way

#

i want to log the image to another channel

fluid basin
#

then send it to the correct channel

low swan
fluid basin
#

not the same channel

low swan
#

here is the full code

fluid basin
#

python is just await/async

low swan
#

i want the image url in embed and i want to retrieve the url from the sensed image in the secret channel

#

also my english are bad

copper cradle
#

dude use F strings

#

they look cleaner than regular .format

slender thistle
#

this

copper cradle
#

I'd rather have
f"Sum: 5 + 5 = {5 + 5}"
than
"Sum: 5 + 5 = {}".format(5 + 5)

slender thistle
#

It depends tbh

#
s = f"{string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)]}{string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)]}{string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)]}"```
copper cradle
#

lmao

low swan
#

that goes for me waitWhat

copper cradle
#

yes

low swan
#

😄

#

you khnow i am about 1 week in discord py

copper cradle
#

F strings are python syntax

#

nothing to do with d.py

earnest elm
#

Hey, can anyone help me change my vote and invite button colors on top.gg? I honestly don't know css
here's what i currently have:

<style>
  .titleandvote{
  color:#2B0548;
  }
</style>
copper cradle
#

background-color

#

the color attr only targets text inside html elems

earnest elm
#

nvm i figured it out

earnest phoenix
#

kotlin & Java Dev Needed

#

if any one can help pls DM

restive furnace
#

what ever dont ask to ask

#

ask here

earnest phoenix
#

@restive furnace link is wrong the 2 should be to

#

@earnest elm wait did you just steal the code of popular bots and combine them into one?!

earnest elm
#

nope

#

its all mine

earnest phoenix
#

Galaxy combines MEE6, Dankmemer, Dyno, and more

earnest elm
#

wait i didnt do that description

#

it was this

#

wat

#

hm

#

steal

#

thats a bold word

#

i have been working on this bot for about a year

earnest phoenix
#

Can you have CSS borders with rounded corners?

pale vessel
#

of course

earnest phoenix
#

there's nothing on MDN about rounded corners

pale vessel
#

it's just border-radius

earnest phoenix
sly marten
#

hey does anyone have good command ideas?

earnest phoenix
#

@slender thistle -ideas

slender thistle
#

-ideas @sly marten

gilded plankBOT
#

@sly marten

Find something that you would like in a bot, and has also not been done before. Try and come up with a list of things you are interested in, and think up ways you could make the task easier with a discord bot. Eg. I like fishing -> I'm in a fishing discord group -> I'll make a bot that has fishing data and gives fishing advice. or I like a certain cartoon/anime/tv show. -> Why not make a bot that reminds me when new episodes are released and their watch dates? Once you have a fair amount of concepts down, try and look for those bots on bot listing sites like this one. If you cant find a bot that does what you laid out before as a bot concept, then feel free to write it! Who knows? Maybe a lot of people would like what you create...

sly marten
#

ty

earnest phoenix
#

alright it's time to make a fishing bot ty luca for the -ideas

toxic pilot
#

How can I make a bot like epic rpg

earnest phoenix
#

How can I make a bot like epic rpg
@toxic pilot you code it

toxic pilot
#

How?

earnest phoenix
#

we can help with making the bot but the battling and RPG stuff you figure it out

abstract coyote
#

How could I make the presence like refresh to make the server count change, since whenever the bot joins a new server, the counter does not change. It is propably pretty simple I am just wondering how to make it :)

client.once('ready', () => {
    client.user.setPresence({ activity: { name: `${client.guilds.cache.size} Servers`, type: 'WATCHING'}, status: 'idle'});
});```
boreal iron
#

That should be an understandable explanation

abstract coyote
#

thanks I will check it out :)

boreal iron
#

Make sure to save a var1 with guilds.length and var2 = 0
On every GUILD_CREATED event var1++
GUILD_DELETED var1- -

Create a timer and compare var1 with var2.
If they are different first set var2 = var1;
and update the current presence info, watching var2 server

#

If(var1 == var2 || var1 == 0) return;

#

That’s it

#

Start the timer in the ready event

abstract coyote
#

hmm

#

allright

#

thanks :]

earnest phoenix
#

what is the difference between int++ and ++int and int-- and --int

eternal osprey
#

hey guys

#

could somebody help me with my error:

#
 console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng)
                        let start = raid.raid_start.splice(4);
                        let end = raid.raid_end.splice(4);
                        let spawn = raid.raid_spawn.splice(4)
                        const embed1 = new Discord.MessageEmbed()
                .setColor('#0099ff')
                .setTitle('Pokehub Raid Notifier')
                .setDescription("Pokemon name: " + name + "\n" + "Raid Level: " + raid.level + "\n" + "Raid Start time: " + start + "\n" + "Raid End Time: " + end + "\n" + "Raid Spawn Time: " + spawn)
                .addField(raid.gym_name, raid.lat + raid.lng)
                .setThumbnail('https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQ2hDLbaXZ41SB4HUikZSG1ZK4wIf9OvgT9hw&usqp=CAU')
                .setTimestamp()
                .setFooter('Command created for Pokehub!');
            ``` raid.raid-start.splice is not a function
boreal iron
#

Let’s explain it differently @earnest phoenix

a = 5; b = ++a; // b = 6, a = 6```
#

Using pre- or post decrements on one var is basically the same even if I never seen somebody using pre decrement in this case

restive furnace
#

@boreal iron decrement = -value, increment = +value

boreal iron
#

Not referring to the example

#

To lazy to write increment/decrement every time

gentle lynx
#

Why does "Loading..." stay?

toxic pilot
#

How can I make rpg bot?

gentle lynx
#

I dont know how

zealous sable
#

You need to code your own bot

#

You will need knowledge of a coding language of your choice for making bots, python and JavaScript for example

gentle lynx
#

Also use MySQL or just any database

#

Excluding json

zealous sable
#

I’ve had good luck with mongodb but yes you can choose your own

toxic pilot
#

Can u give me some example code?

zealous sable
#

No.

gentle lynx
#

See the docs

toxic pilot
#

Where

zealous sable
#

You need to code it yourself, read the docs of the language you are using etc

#

Dude you need to look into it yourself, if we spoon feed you everything you won’t get anywhere with a bot. If it’s your first time coding I wouldn’t recommend starting with a bot.

gentle lynx
#

^^ dont start with an rpg bot as well

#

Start something simple

#

With

zealous sable
#

Even if it’s a dumb bot that shouts at you when you say fortnite etc

#

Just something to get used to the language

hazy sparrow
#

How to find a message by its ID in d.js?

#

Even if it’s a dumb bot that shouts at you when you say fortnite etc
Ahahahahahahaha

solid snow
#

Even if it’s a dumb bot that shouts at you when you say fortnite etc
thats a great idea actually

zealous sable
#

I’ll get on it

solid snow
#

great addition to my annoying bot

#

make it even more annoying lmao

earnest phoenix
#

Hi

#

Need help

#

How i create a purge messages command?

#

In Discord.js

cinder sandal
#

woah you sent 4 msges at the same time

earnest phoenix
#

yes

#

fast typer

#

help

#

pls help

zealous sable
#

Stop

earnest phoenix
#

ok

#

now can u tell me?

solid snow
#

you can use bulkDelete

earnest phoenix
#

like

solid snow
#

should be in the docs

earnest phoenix
#

link of docs

#

discord.js?

#

right

#

ohk

#

found it

solid snow
zealous sable
#

Well you will need to ensure the bot has perms to manage messages, you can add a check for it too if you wish, you might also want to check if the user running the command has a certain permission most likely manage messages, then you will need to have an argument that allows a user to type for example -purge (amount to purge). Then you use bulk delete to delete the amount of messages using the arguments the user put in

earnest phoenix
#

ok

solid snow
#

yeah and the permissions of course

earnest phoenix
#

set that up

#

already

solid snow
#

dont want everyone to delete messages

zealous sable
#

Yeh haha

solid snow
#

i mean i forgot that at first oops

zealous sable
#

Or maybe troll bot!

earnest phoenix
#

ok

#

thanks

#

working

zealous sable
#

🙂

solid snow
#

nice

#

I really need a new pfp for my bot

#

ugh

earnest phoenix
#
    const fetched = await message.channel.messages.fetch({ limit: deleteCount });
                    ^^^^^

SyntaxError: await is only valid in async function
    at wrapSafe (internal/modules/cjs/loader.js:931:16)
    at Module._compile (internal/modules/cjs/loader.js:979:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47```
#

Pls help

viscid gale
#

async needed

#

lemme explain

earnest phoenix
#
    if (!message.member.roles.cache.some(r => ["Amun-Ra 🌞", "Osiris 🔨", "Horus 🛠"].includes(r.name)))
      return message.reply("Sorry, you don't have permissions to use this! Please Make Sure you have either a role named **Moderator, Administrator or Owner**.");

    const deleteCount = parseInt(args[0], 10);

    if (!deleteCount || deleteCount < 1 || deleteCount > 100)
      return message.reply("Please provide a number between 1 and 100 for the number of messages to be deleted.");

    const fetched = await message.channel.messages.fetch({ limit: deleteCount });
    message.channel.bulkDelete(fetched)
      .catch(error => message.reply(`Couldn't delete messages because of: **${error}**`));
    message.channel.send("**Purged**")
  }```
#

my code

#

@viscid gale ohk

viscid gale
#

right.. u see how u didnt have async..

#

i cant remember the other word

earnest phoenix
#

where i mention async?

viscid gale
#

but basically (async=()=>{ASYNC-CODE-HERE})()

earnest phoenix
#

ok

#

thanks

viscid gale
#

by seeing how it is

earnest phoenix
#

ok

viscid gale
#

put everything in the ifstatement with the async block

#

like if(commandWhatever){ (async=()=>{stuff})() }

earnest phoenix
#

ok

#

same error

solid snow
#

Put it into the event maybe

tired panther
#
message.mentions.channel.first()
``` why foes not this work?
#

or are they something similar

solid snow
#

@earnest phoenix so like client.on('message', async message => {})

tired panther
#

any idea?

solid snow
#

If I remember correctly

earnest phoenix
#

@tired panther there should be an s after channel

#

so channels

tired panther
#

yes

#
const target = message.mentions.channels.first() || message.channel;
 if(target.members.size >= 36 ){
#

It can not get the size from channel mention @earnest phoenix

solid snow
#

wait doesnt members.size only work for voice channels or am i stupid

tired panther
#

it works for channel xD

sly marten
#

Hey does anyone know how to make a bot be online automatically without having to do it manually?

solid snow
#

You have to host it

#

I use heroku

sly marten
#

Host it?

solid snow
#

yes

#

hold on ill send youa tutorial

sly marten
#

Ty

solid snow
#

And does anyone here know why my firebase query returns undefined but when i run it for a second time it works?

#

Thats a bit annoying

tulip ledge
#

I'm not sure cause I don't know firebase but maybe something isn't cached?

#

Or it took too long to execute so the log goes first, then it gets cached and when u do it again it returns that

solid snow
#

could be yeah

#

i tried to delay it a bit so it has time to get it but still doesnt work

#

its only when you do it for the first time or after something changed

#

if something changes you have to run it again to get the actual result

tired gate
#

client.commands.get('vote').execute(message, args); gives me the error (node:9492) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'execute' of undefined

#

it worked before i npm i express'd

lost stone
#

hi

earnest phoenix
#

client.commands.get('vote').execute(message, args); gives me the error (node:9492) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'execute' of undefined
@tired gate just vote exist in client.commands?

tired gate
#

yep

#

via js module.exports = { name: 'vote', description: "sends the link to vote for the bot!", execute(message, args) {

ionic dawn
#

@lost stone what are doing, calling an API?

#

That error might be that the json is empty or you arent calling/using it right

ebon kelp
#

yep
@tired gate The error says it does not exists in the collection

eternal osprey
#

hey guys

#

i am trying to get the amount of invites someone has by using this code:

#
 if (message.content === '!check') {

        var userId = message.mentions.members.first();

        var userInvites = message.guild.fetchInvites().then(invites => invites.find(invite => invite.inviter.id === userId));

        var useAmount = userInvites.uses;

        if (useAmount === undefined) {

            message.channel.send("<@" + message.author.id + ">" +  ` has 0 invites`);
        }

        else {

            message.channel.send("<@" + message.author.id + ">" + ` has ${useAmount} invites`);
        }
    }```
#

the !selfcheck works

#

why doesn't this function work?

#

it straight up does nothing.

weak crag
#
    if(message.content.startsWith("c!invite")) {
        let invite = new Discord.RichEmbed()
            .setColor("RANDOM")
            .setAuthor(message.author.username, message.author.displayAvatarURL)
            .setThumbnail(message.author.avatarURL)
            .setTitle("Click Me")
            .setURL(`https://discordapp.com/oauth2/authorize?client_id=${client.user.id}&scope=bot&permissions=8`);///link bot
            message.channel.sendEmbed(invite);
    }
});
 client.login("");////// 
});

can someone help me why this gives me a error

eternal osprey
#

@weak crag what's te error

weak crag
#

it doesnt work

ebon kelp
eternal osprey
#

send the error

weak crag
#

its not a error it doesnt work

#

@eternal osprey

eternal osprey
#

don't ping me please.

weak crag
#

soz

ebon kelp
#

Well you have to run it ofc peepoLaugh

weak crag
#

i did

eternal osprey
#

also

#

what the fuck why is your color RANDOM

#

have you defined it with math.random?

weak crag
#

yes

eternal osprey
#

debug it

#

an send a ss of your console.

#

also try logging it

#

console.log(invite)

#

also you are using message.content.Startswith wrong.

#

look at the docs @weak crag

coarse dragon
#

@weak crag i think u need to use message.author.displayAvatarURL() and not message.author.displayAvatarURL only

eternal osprey
#

@coarse dragon it would give an error in the sonsole

weak crag
#

i tried it and it didnt work i tried everything can u guys send me a code and i put in idk if mine is wrong or something

eternal osprey
#

console

#

@weak crag no we are not going to spoonfeed.

#

i already gave you the answer.

#

you are using message.content.StartsWith wrong

#

use message.content instead

weak crag
#

ok a sec

#

i use glitch is that a problem ? @eternal osprey its like vs but its a website

eternal osprey
#

idk never used glitch

#

try it on vs

#

i think that they use different debuggers (i have no clue tbh

#

so it might be

#

could somebody help me with my problem?

#
if (message.content === '!check') {

        var userId = message.mentions.members.first();

        var userInvites = message.guild.fetchInvites().then(invites => invites.find(invite => invite.inviter.id === userId));

        var useAmount = userInvites.uses;

        if (useAmount === undefined) {

            message.channel.send("<@" + message.author.id + ">" +  ` has 0 invites`);
        }

        else {

            message.channel.send("<@" + message.author.id + ">" + ` has ${useAmount} invites`);
        }
    }``` it is not displaying anything.
#

tried logging it etc.

fluid basin
#
  1. Member is not user
  2. You are not getting the id of user
pale vessel
#

userId could be a GuildMember? and you need to add .id to get the id. add a check to make sure it exists first or make it the author as a fallback. don't compare the inviter id with a member object

on the bottom, you used message.author.id instead of userId.id

ebon kelp
#

message.content === '!check' results false when you type: "!check [tag]", cuz message.content gives: "!check @ebon kelp"

Try: message.content.startsWith("!check")

pale vessel
fluid basin
#

flaze stop spooning angeryBOYE

pale vessel
#

N OMEGALUL

#

@ebon kelp omit == '!check'

#

startsWith() returns a bool

ebon kelp
#

oh woops

#

Yeah I just straight up copied his

#

forgot to delete that part

eternal osprey
#

yeah i tried making it but it wouldn't work.

#

but !check <@id> would automatically convert

#

to a valid user.

solemn leaf
#

why would you

#

do <@{id}>

earnest phoenix
#

does google analytics eat your resources

eternal osprey
#

@solemn leaf only way i know to do this

pale vessel
#

`${member} has ${useAmount}...`

solemn leaf
#

member.tag

#

member.user

pale vessel
#

wot

#

i'm assuming he wants the mention

earnest phoenix
#

why do textarea tags have max-height set to their height by default

solemn leaf
#

why would we know

earnest phoenix
#

why would we know
@solemn leaf because you guys are cool

pale vessel
#

you're cool

earnest phoenix
solemn leaf
#

no

#

no hes not

#

bcs he ping

earnest phoenix
tired gate
#

could express be interfering with the error im having?

#

client.commands.get('vote').execute(message, args); gives me the error (node:9492) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'execute' of undefined

#

since i changed nothing, stopped working after installing express

earnest phoenix
#

it can't be

pale vessel
#

there is no command vote

tired gate
#

there is xD

#

i changed absolutely nothing to the code and it worked fine before

#
module.exports = {
    name: 'vote',
    description: "sends the link to vote for the bot!",
    execute(message, args) {```
pale vessel
#

¯_(ツ)_/¯

#

read the error

earnest phoenix
#

should i add a preview command to my webhook generator?

vale garden
#

hi

#

im new to better sqlite

#

and

#
case 'start':
      let table = sql.prepare("SELECT count(*) FROM sqlite_master WHERE type='table' AND name = 'info';").get();
      if (!table['count(*)'])
      {
      sql.prepare("CREATE TABLE info (id TEXT PRIMARY KEY, username TEXT, bal INTEGER)").run();
      sql.prepare("CREATE UNIQUE INDEX idx_info_id ON info (id);").run();
      sql.pragma("synchronous = 1");
      sql.pragma("journal_mode = wal");

       bot.getInfo = sql.prepare("SELECT * FROM info WHERE username = ?");
       bot.setInfo = sql.prepare("INSERT OR REPLACE INTO info (id, username, bal) VALUES (@id, @username, @bal);");

       infoL = { id: message.author.id, username: message.author.username, bal: 0 }
      }
      else {
        message.reply("test")
      }

       
      break;
#

here

solemn leaf
#

And we dont care

vale garden
#

but i do

#

and i need help

#

so would be great if you help out

solemn leaf
#

We wouldn't care if your new

vale garden
#

just saying cuz then you will say this is quite ez bro

#

anyways

solemn leaf
#

Apperently not

vale garden
#

it sends test cuz it says the table already exists

#

not you im just saying in general

solemn leaf
#

Bcs you cant do it

vale garden
#

bruh just help pls

#

lmao

pale vessel
#

with what

solemn leaf
#

is it a db

vale garden
#

ye

pale vessel
#

you didn't really specify the problem

solemn leaf
#

then use a real db

pale vessel
#

it is a real db lmao

vale garden
#

wdymm

#

yea it is lol

#

ok so it sends test cuz it says the table exists

#

even tho i didnt create it.. i think

#

cuz only the start cmd creates it

#

so im confused here

#

thats my problem

pale vessel
#

hm, nosql user here so i can't really help

#

you should ask tim, he uses sqlite

vale garden
#

oof ok

pale vessel
#

it's sqlite right?

#

or is it just mysql

vale garden
#

sqlite

pale vessel
#

ah

#

yeah ping tim or something

vale garden
#

@quartz kindle

#

oof hes offline

solemn leaf
#

I could help you with a quick-db

split hazel
#

does visual studio code have proper ejs support?

#

it's kinda messy

lost stone
#

Failed to login: Error [TOKEN_INVALID]: An invalid token was provided.

vale garden
#

um

solemn leaf
#

@split hazel addons

vale garden
#

check your token dude

#

@lost stone

lost stone
#

my bot is working in another project but in this it says Failed to login: Error [TOKEN_INVALID]: An invalid token was provided.

split hazel
solemn leaf
#

lol

split hazel
#

much better

solemn leaf
#

hold up

#

why you have a url for images

earnest phoenix
#

does visual studio code have proper ejs support?
@split hazel it has support for egirls too iirc

solemn leaf
#

. bruh

lost stone
#

i have a question , there is 2 config js and json, and in both i have to put the token how can i say to connect config.json token?

solemn leaf
#

wait

earnest phoenix
#

i have a question , there is 2 config js and json, and in both i have to put the token how can i say to connect config.js token?
@lost stone can you explain your question better?

solemn leaf
#

You have a js config file?

earnest phoenix
#

i can't understand anything

lost stone
#

yes and json

solemn leaf
#

config.js laughcry

earnest phoenix
solemn leaf
#

COde we understand all he is the one not understanding

lost stone
#

and i want to say in config.js to connect with config.json

#

token

solemn leaf
#

say in?

#

say in

#

bruh

#

what

earnest phoenix
#

COde we understand all he is the one not understanding

say in?
say in
bruh
what
@solemn leaf bruh

lost stone
#

this is in js

#

u see the token

earnest phoenix
#

wow you just leaked your bot token

solemn leaf
#

Why

#

oml

#

LOLLOLOLOLOLOLOLO

earnest phoenix
#

BRO

lost stone
#

this one json

solemn leaf
#

LOL

pale vessel
#

thonk

earnest phoenix
#

WHY ARE YOU SENDING YOUR BOT TOKEN

solemn leaf
#

You just gave enough for someone to crack the token

#

LUAGG

lost stone
#

this is not all the token

#

whtttt

earnest phoenix
#

are you fucking telling me you split it up into multiple strings

lost stone
#

nvm bye no one understandin mee

split hazel
#

you should reset your tokens "uncrackable" or not

earnest phoenix
#

two mods are typing I'm scared

slender thistle
#

they're saying they only sent non-essential parts of the token

solemn leaf
#

IM 89% a mod

slender thistle
#

You wish

solemn leaf
#

the 89% is teh name

#

the rest is nothing

delicate shore
#

-bots noembed

gilded plankBOT
#

PGamerX#7851's bots:
@outer marsh @steady ridge

delicate shore
#

oh wait

#

wrong channel

#

shit

solemn leaf
#

get out

stable eagle
#

I added a multiple prefixes feature to my bot, but when I add a prefix that has more than 1 character, my bot doesnt respond to it. Heres what I used in my main bot.

       if(!prefixPara) {
           const standardPrefix = new prefixData({
               _id: message.guild.id,
               prefix: ["<"]      
           })
           standardPrefix.save()
       } else {
const prefixes = prefixPara.prefix;
for(const prefix of prefixes) {

// my code
}```

Idk whats wrong
solemn leaf
#

idk

#

seems like

#

its a shit way to do it

#

and in theory you only need 2 lines of code

earnest phoenix
delicate shore
#
 if(command === "3d" || command === "flanger" || command === "gate" || command === "haas" || command === "karaoke" || command === "reverse"){
  let premiumorno = db.get(`PREMIUM_${msg.author.id}`)
  let serverpre = db.get(`SERVERWOW_${msg.guild.id}`)
  if(premiumorno !== "yes" || serverpre !== "yes") return msg.reply(`Woah there this is a premium command! which means you need to become a patreon to use it :) **But You can still try out - ${PREFIX}bassboost,${PREFIX}echo,${PREFIX}nightcore,${PREFIX}vaporwave without being a patreon** If you are a patreon then kindly run ${PREFIX}givepremium command`)
#

Server is added as a premium guild as you can see then why does it says not allowed

earnest phoenix
#

||

#

use &&

#

|| OR
&& AND

delicate shore
#

That's what I am using

#

||

earnest phoenix
#

&&

delicate shore
#

@earnest phoenix The && and || Operators in JavaScript. If applied to boolean values, the && operator only returns true when both of its operands are true (and false in all other cases), while the || operator only returns false when both of its operands are false (and true in all other cases).May 25, 2016

#

I don't want both to be true

#

I want it to see if any one of those are true

earnest phoenix
#

app.post('/dblwebhook', async (req, res) => {
console.log("test")
})

sonic lodge
#

is premiumorno whether the user has premium

earnest phoenix
#

How to get user?

#

also

delicate shore
#

is premiumorno whether the user has premium
@sonic lodge yes

earnest phoenix
#

why the fuck do you use yes

#

instaed of boolean

sonic lodge
#

so if your user does have premium, but the server he's using the command in does not, your error will trigger

lyric hedge
#

@lost stone bro do not send here your token,i did it once and then my bot sent everywhere some random nudes lmao

delicate shore
#

Wait we cannot use 1?

#

so if your user does have premium, but the server he's using the command in does not, your error will trigger
@sonic lodge why?

#

I am using ||

#

isn't it if one of them is true

sonic lodge
#

if(premiumorno !== "yes" || serverpre !== "yes")
if (user doesn't have premium OR server doesn't have premium)

delicate shore
#

it will work

#

ye

#

if one is false code would work

earnest phoenix
#

yeah

sonic lodge
#

let's say user has premium, but server does not. we get
if (false or true)
so the error triggers

earnest phoenix
#

but why the fuck

#

don't you use boolean

#

instead of fucking yes and no

sonic lodge
#

lol that too

delicate shore
#

example?

#

But no

#

you are getting it wrong

earnest phoenix
#

command === "3d" || command === "flanger" || command === "gate" || command === "haas" || command === "karaoke" || command === "reverse"

delicate shore
#

db.set(`SERVERWOW_${msg.guild.id}`,`yes`)

#

I do this

earnest phoenix
#

[].includes also work

#

db.set(`SERVERWOW_${msg.guild.id}`,true)

delicate shore
#

ok

earnest phoenix
#

that also work

delicate shore
#

db.set(`SERVERWOW_${msg.guild.id}`,`yes`)
@delicate shore
And I get vakue of SERVERWOW_${msg.guild.id}

#

and check if it returns yes

#

@earnest phoenix I do it like this in other cmd but they don't work

earnest phoenix
#

SERVERWOW KEK

#

WOWO

delicate shore
#

what happend

earnest phoenix
#

why do i have this emote

lyric hedge
#

does someone know ,where can i find all multiple guilds,like message.guild.channels.cache.size?

delicate shore
#

@earnest phoenix I do it like this in other cmd but they don't work
@delicate shore
I meant in other they work

#

but not in dis

earnest phoenix
#

stop pingin me

delicate shore
#

Sorry

lyric hedge
#

does someone know any website,where i can find all multiple guilds like message.guild.channels.cache.size?

earnest phoenix
#

why should a website tell you that

lyric hedge
#

because i do not know them

#

where i can find them?

earnest phoenix
#

a website does not have access to your bot

toxic jolt
#

hello guys

earnest phoenix
#

hello guys
@toxic jolt bye wave

lyric hedge
#

it does not matter,if it has or does not have,i want only know multiple guilds

earnest phoenix
#

your question makes no sense to me

toxic jolt
#
const request = require('request');
 
const options = {
  url: `https://cortexai.xyz/AI/Chatbot/Cortex`,
  headers: {
    'key': '3)w74xo+Dew/)s0bTFxaASF24gdd&24$2>3',
    'soru': 'anan nasıl' // "ı" is special character.
  } 
};

request(options, (err, res, body) => {
  let parsedJson = JSON.parse(body)
  console.log(parsedJson)
})``` i have a this error
#

i how to fix special character errors

solemn leaf
#

thanks fro your key

#

time to abuse posts and gets

lyric hedge
#

Code913,on Discord Js i found only basic guilds where you need only 3 parts = message.guild.id,but i did not find there guilds of more parts,like message.guild.channels.cache.size,where i can find these multiple guilds?

earnest phoenix
#

discordjs guide does not tell you everything
some stuff you need to figure out on your own

tardy hornet
#

bro am i blind?

#
        '1',
        '2',
        '3',
        '4',
        '5',
        '6',
        '7',
        '8',
        '9',
        '10',
        '11',
        '12',
        '13',
        '14',
        '15',
        '16',
        '17',
        '18',
        '19',
        '20',
        '21',
        '22',
        '23',
        '24',
        '25',
        '26',
        '27',
        '28',
        '29',
        '30',
        '31',
        '32',
        '33',
        '34',
        '35',
        '36',
        '37',
        '38',
        '39',
        '40',
        '41',
        '42',
        '43',
        '44',
        '45',
        '46',
        '47',
        '48',
        '49',
        '50',
        '51',
        '52',
        '53',
        '54',
        '55',
        '56',
        '57',
        '58',
        '59',
        '60',
        '61',
        '62',
        '63',
        '64',
        '65',
        '66',
        '67',
        '68',
        '69',
        '70',
        '71',
        '72',
        '73',
        '74',
        '75',
        '76',
        '77',
        '78',
        '79',
        '80',
        '81',
        '82',
        '83',
        '84',
        '85',
        '86',
        '87',
        '88',
        '89',
        '90',
        '91',
        '92',
        '93',
        '94',
        '95',
        '96',
        '97',
        '98',
        '99',
        '100',
#

there is 1 missing

#

i looked 22 times

#

cant find it

pale vessel
#

wtf are you doing

tardy hornet
#

im going crazy

#

I NEED TO FIND THE MISSING NUMBER

pale vessel
#

there's no missing number

tardy hornet
#

i typed it in line

#

215

pale vessel
#

theres 100

tardy hornet
#

and it ended in 314

toxic jolt
#

there is 1 missing
@tardy hornet

        '96',
        '97',
        '98',
        '99',
        '100' // delete this ","```
tardy hornet
#

ik but you still dont get it

#

i typed that in line 214

toxic jolt
#

thanks fro your key
@solemn leaf i changed key :3

#

lol

tardy hornet
#

and it ended in line 313

pale vessel
#

the trailing , doesn't matter in arrays

solemn leaf
#

Why you ping me

slender thistle
#

Because they replied to you

solemn leaf
#

Idc

#

I have 0 notifications

#

So if i get 1 and its pointless i get pissed

lyric hedge
#

0?

#

i have already 10 000

solemn leaf
#

Didnt ask about you being 12 and in 80 servera

earnest phoenix
#

I'm attempting rubber duck debugging

solemn leaf
#

Gl

earnest phoenix
#

||kthnxbai||

lost stone
sudden geyser
#

Which means you don't have permission to do something on Discord

#

Such as banning a member

solemn leaf
#

Intents reqired now?

lost stone
#

i am the ownership

earnest phoenix
#

Intents reqired now?
@solemn leaf for what?

prisma oriole
#

@lost stone does the bot have permissioms? no you

earnest phoenix
#

i am the ownership
@lost stone they're talking about server member role permissions

prisma oriole
#

mot*

#

not*

sudden geyser
#

Robot the API says otherwise. Are you able to reproduce what you did to get that error

lost stone
#

yes

earnest phoenix
#

mot*
not*
is it just me or people don't know that the edit button exists

lost stone
#

he have full perms

earnest phoenix
#

he have full perms
@lost stone even administrators have restrictions

#

they can't edit some stuff of people with roles above them

lost stone
#

accessableby: "Administrators"

earnest phoenix
#

can you send the code?

sudden geyser
#

You need to debug your error via reproducing. Just because you think it has permission to do something does not mean it really has permission to do something.

lost stone
#

module.exports = {
  config: {
    name: "setwelcomechannel",
    category: "moderation",
    aliases: ["enablewelcomechannel", "swc", "ewc", 'sw', 'ew'],
    description: "Sets A Channel Where The Bot Can Welcome Users!",
    usage: "[channel mention | channel ID | channel name]",
    accessableby: "Administrators"
  },
  run: async (bot, message, args) => {
    if (!message.member.hasPermission("ADMINISTRATOR"))
      return message.channel.send(
        "**You Do Not Have The Required Permissions! - [ADMINISTRATOR]**"
      );
    ```
#

the bottom of the code

tired gate
#

what's the problem

sudden geyser
#

missing permissions

lost stone
#

also there is ``` } catch (e) {
return message.channel.send("Error - Missing Permissions Or Channel Is Not A Text Channel!");
}
}
};

#

he have administrator perm

sudden geyser
#

Can you share the whole command via hastebin

lost stone
#

ok hastebin crashed

sudden geyser
lost stone
earnest phoenix
#

@lost stone are you checking if the member AND the bot has permission to do smth?

lost stone
#

yes i am ownership and he is full perms

#

his role is abovw me

earnest phoenix
limber oak
#

How do me get someone's vote and the results of the vote can be used for certain cmd that the bot requires?

sudden geyser
lost stone
#

what happened

sudden geyser
#

With the code you shared, it could only be coming from <Channel>.send(...) (includes when trying to send to a channel specified by the author). The stacktrace produced from the screenshot does not detail where it's coming from either. Are you sure the error is originating from the code you shared.

lost stone
#

yes when i try this command

#

it shows this err

earnest phoenix
lost stone
#

nice

earnest phoenix
#

why the fuck do the buttons just disappear

ionic dawn
earnest phoenix
#

@ionic dawn imagine laughing at me literally at the same time when i finally fixed it

ionic dawn
#

I wasnt laughin at you

#

I was laughing with you

earnest phoenix
coral trellis
#

@quick dune You don't have NPM installed, you can install it by installing nodejs as it comes pre-installed iirc

quick dune
#

I see

solemn leaf
#

Lmao

quick dune
#

I have node.js installed now

vocal sluice
#

then re do the npm i dblapi.js

quick dune
compact oriole
#

why are you in the nodejs repl?

vocal sluice
#

do it in a normal command prompt

quick dune
#

No clue lol

#

I did

vocal sluice
#

like go to your folder click the address thing at the top, type cmd hit enter then type it

queen crescent
vocal sluice
#

you need a domain?

quick dune
queen crescent
#

nah i have a domain, just wondering how to make like vanitys

#

so like with discord you can have /dbl

vocal sluice
#

you make a new html page?

queen crescent
#

yeah but making it automatic, like people can make their own vanitys

vocal sluice
#

oh idk sorry

#

@quick dune show the part of you installing dblapi.js

quick dune
#

ok

earnest phoenix
#

how do i remove an attribute from an element in D3?

queen crescent
#

@vocal sluice basically tryna assign a vanity url to an express site

earnest phoenix
#

yeah but making it automatic, like people can make their own vanitys
@queen crescent just generate a new HTML page to that route and the page just redirects people to the correct invites

quick dune
vocal sluice
quick dune
#

okay

normal sage
#

does anyone know a good api for trivia?

#

I’m trying to make a trivia command, and trying to make it pull random questions

stoic hull
#

Anyone have experience with React routing?

earnest phoenix
#

does anyone know a good api for trivia?
@normal sage I think @green kestrel has an API for trivia bot

#

help await is only valid in async function

normal sage
#

alright, I willl check it out!

earnest phoenix
#

help error: await is only valid in async function

#

what the fuck

stoic hull
#

Lol.

earnest phoenix
#

@earnest phoenix you're passing async as a parameter and NOT making the function async

#

put async after the =

#

i add the code js await is only valid in async function

stoic hull
#

Well im trying to get my dashboard up, made with react and hosted with apache, but when i AUTH with discord, it redirects to the server selector page and instantly redirects back to the landing page, anyone know how to fix this issue?

earnest phoenix
#
  
 var black = await Blacklisted(message.author.id);
  if(black) return message.channel.send("Personas en el ForceNo tienen permitido mis comandos.");
```*
#

@earnest phoenix re read my message

#

how do i put that?

#

literally just put the async keyword before the function declaration

#

exports.run = exports.run = async (client, message, args) => {?

#
tulip ledge
green kestrel
#

@normal sage I think @green kestrel has an API for trivia bot
@earnest phoenix I don't share access to triviabot API but there's an open one you can use which is at https://opentdb.com

blissful coral
#
message.guild.members.cache.get(results[0].user)
``` is returning undefined when in my database, results[0].user is my ID
#

I am in the guild

pale vessel
#

debug

#

is your bot verified

blissful coral
#

I figured it out

#

lmao

#

It was intents

#

Got denied for GUILD_MEMBER intents

sly marten
#
<!DOCTYPE html>
<html>
<body>

<body style="background-color:rgba(0, 255, 21, 0.096);"></body>

<h1 style="font-family:courier;">NKBot!</h1>
<p style="font-family:Century Gothic;">[BOT STILL IN EARLY DEVELOPMENT]</p>

<p style="font-family:Century Gothic;">[ADDING THIS BOT TO YOUR SERVER WILL ONLY RESULT TO SUPPORT TO THE CREATOR]</p>

<p style="font-family:Century Gothic;">[SOME COMMANDS ARE UNAVAILABLE]</p>

<p style="font-family:Century Gothic;">Want a multi-function bot in your server?</p>

<p style="font-family:Century Gothic;">Want a bot that will give you many types of random commands?</p>

<p style="font-family:Century Gothic;">Then add NKBot to your server! Not only do you get early development bot perks, but you also support the creator!</p>

<p style="font-family:Century Gothic;">Invite NKBot to your server and use nk;help for commands</p>

<a href="[link]>NKBot Support Server</a>

<a href="[link]">Invite NKBot</a>

</script>
</body>
</html>
#

someone a little help with this?

stoic hull
#

Why is there a closed <script> tag but its never opened?

#

And 2 bodys.

earnest phoenix
#

How do I call a file that is close to the index for a handler?

boreal iron
#

Use CSS and don’t assign the same style to each element.

earnest phoenix
#

code: 'MODULE_NOT_FOUND',
requireStack: [

#

!nobadge

#

!nobadge

#

.nobadge

stoic hull
#

@fluid basin what does the bot do?

fluid basin
#

hrm among us bot

#

300 emergency meeting

stoic hull
#

Does it actually connect to the game?

still merlin
#

I'm trying to install ffmpeg for my radio command

stoic hull
#

just "cd" per folder.

tulip ledge
still merlin
#

I'm in the right folder, sort of

#

My folder is called "Spiderbot command handler" and I'm in the folder that holds it

#

I think I fixed the issue, My sister must've moved the folder by accident :/

restive furnace
#

cd "The folder with spaces"

faint prism
#

or use backticks

restive furnace
#

my way easier

faint prism
#

cd Dont\ Use\ Spaces\ In\ Folder\ Names

sudden geyser
#

this-is-better
or_use_underscores

#

justdontdothis
thisIsAlsoWeird

restive furnace
#

or don't use spaces at all yes

#

PascalCase folders 4 ever

sudden geyser
#

those are hot

stoic hull
#

@fluid basin Does that actually connect to an among us game?

viscid gale
#

among us??

#

;]

olive rune
#

Does anyone know how to center an image horizontally to the right? for example:

blissful coral
#

flex box

fluid basin
#

@stoic hull yes it does, but its buggy rn

stoic hull
#

Thats cool, whats the package name? Might try to turn it into a discord bot.

restive furnace
#

I'm interested too lol

stoic hull
#

Whoops

#

I'm interested too lol
@restive furnace among-js

#

But for me it only joins with a private server.

restive furnace
#

kk

#

i don't think so kognise is willi123yao's github

stoic hull
restive furnace
#

ok but still i don't think that

tardy hornet
#

hey guys

#

my bot go verified

#

and i still dont have the tag

#

why?

restive furnace
#

and i still dont have the tag
@tardy hornet you don't get it anymore

tardy hornet
#

what?

#

why?

rustic nova
#

They removed it due to presumably applying with their bots just to get the badge

#

The Developers who had their Bot verified have the Early Developer Badge now

#

aka the verified Developer badge is no longer obtainable

olive rune
#

I tried flexboxes, they appear to align images to the far right now

still merlin
#

I'm getting a 'connection.play' is not a function error while making a radio command, can someone help please?

module.exports = {
    name: 'radio',
    description: 'radio',
    execute(client, message, args) {
        const broadcast = client.voice.createBroadcast();
        const dispatcher = broadcast.play('https://radio.dual.pw/stream.mp3');
        if (!message.guild) return;
        if (message.member.voice.channel) {
            const connection = message.member.voice.channel.join();
            connection.play(broadcast).then(
                message => { (message.channel.send('Playing the <https://dual.pw> radio!')); },
            );

            if (!message.member.voiceChannel) return message.channel.send('**error** You need to be in a voice channel to play the radio');
        }
    },
};```
#

I checked the docs and something similar to what im doing

const dispatcher = connection.play('/home/discord/audio.mp3');```
sudden geyser
#

connection is a promise as the .join() method returns one.

still merlin
#

Alright, thanks.

Is there a alternative I can use?

earnest phoenix
#

alternative
what? Thonk

#

"damn it i have to open my car door to enter it, is there an alternative?"

vale garden
#

hi

#

does anyone know how i can make my bot get the invite link of a server its in

rustic nova
#

Privacy breach sir

vale garden
#

hmm maybe

#

but i just wanna know

#

lol

rustic nova
#

Unless the Bot User is being informed that the bot creates a invite

#

But still a privacy breach

vale garden
#

well im in all the servers my bot is in

#

but it would be cool to try that so im asking

sudden geyser
#

Alright, thanks.

Is there a alternative I can use?
@still merlin your alternative is to fix the problem.

#

If your value is wrapped around a promise, you need to get the result of it. Either through async/await or .then

#

Read this guide for more information on using promises, as it's something you'll use throughout JS: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises

still merlin
#

thanks

#

Uh

#

@drowsy crag ads ^^ (sry for random ping)

drowsy crag
#

YEET

vale garden
#

lol

still merlin
#

I tried awaiting it, and my bot joined the voice channel but its logged a weird error

(what);ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}Module["noExitRuntime"]=true;run();

abort(TypeError: connection.play is not a function). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)```
earnest phoenix
#

Using package.json

restive furnace
#
  1. don't use glitch
#
  1. get a vps
viscid gale
#

ok this following question is logically difficult(for me at least)

now i tried a 1 kyu problem(don't ask me y xD) and i chose the chess challenge
https://www.codewars.com/kata/5985ea20695be6079e000003

below shows an example of what my code gives, then what was an expected outcome
the problem im facing is that although i can successfully place down queens that do not check each other, i cannot place ENOUGH safe queens in the board

Q.....
..Q...
....Q.
.Q....
...Q..
......
..Q...
Q.....
.....Q
...Q..
.Q....

to the chess dudes out here, any advice?

#

thanks in advanced

sonic lodge
#

you can put a queen in the bottom right position in your first example

viscid gale
#

sry typo

#

not typo

#

some weird thing that discord did

#

fixed

willow mirage
#
guild.leveling = {
            "enable": false, "rewards": {
                "enable": false, "roles": []
            }, "blacklist": [], "levelUp": {
                "channelId": "", "enable": false, "text": ""
            }
        }
leveling: {
        "enable": Boolean, "rewards": {
            "enable": Boolean, "roles": [{
                "level": Number, "roleId": Number
            }]
        }, "blacklist": [String], "levelUp": {
            "channelId": String, "enable": Boolean, "text": String
        }
    }
#

help me

#

it is not saving those "enable"

solid snow
#

hm is BAN_MEMBERS a valid permission, my bot keeps saying it doesnt have permissions but it has?

#

KICK_MEMBERS works

rugged cobalt
#

Am I able to apply for a spot in the top.gg website even if my bot isn't 100% ready yet?

#

also how will I know when they're trying to review it because I don't want my bot to be offline when that's happening otherwise it would be quite annoying

solid snow
#

i mean my but is also still WIP but most features work and its online 24/7

#

i usually keep it online, do stuff and test it with another bot and then i update which takes like 20 seconds

rugged cobalt
#

yeah the features I have on my bot work well but it's just I haven't yet added all my features

#

I actually have some really nice plans

solid snow
#

hm is BAN_MEMBERS a valid permission, my bot keeps saying it doesnt have permissions but it has?
figured that out btw typed banable instead of bannable

#

yeah the features I have on my bot work well but it's just I haven't yet added all my features
@rugged cobalt Well you can add them whil its on top.gg

#

i dont think thats a problem

rugged cobalt
#

yeah

#

I just applied but they're gonna take a while to see my application, right?

solid snow
#

exactly

rugged cobalt
#

so then I have some time to get an online database

solid snow
#

i have a lot of really nice features but seeing that they take multiple weeks anyway i just decided to make them a bit more fancy

#

mine was just intended to be on a friends server but they told me to put it on top.gg and make everything look fancy

#

im still planning to add more aswell

rugged cobalt
#

yeah same

#

mine is kinda based around currency but it's not really like any of the other currency bots

solid snow
#

yeah i thought about adding a few currency based minigames aswell

rugged cobalt
#

I just need to plan it out

solid snow
#

yeah

earnest phoenix
viscid gale
#

@viscid gale Well i created a function to solve that problem in JavaScript :OMEGALUL:
@earnest phoenix thank uuuu

#

i'll see how much it works

rugged cobalt
#

What do y'all use for hosting?

rustic nova
#

VPS from retracted host

rugged cobalt
#

what does that mean

rustic nova
#

Say no more

rugged cobalt
#

no I meant the retracted part

#

is that like the host isn't able to see your code?

rustic nova
#

Don't wanna advertise the host

#

the vps is private, the host is legally not allowed to inspect the files on it

solid snow
#

i use heroku

#

fine for now ig

signal lantern
#

Can anyone help me with status? I am trying to use the code below but for some reason I don't think the time intervals work and also sometimes when it shows one it'll show the next for like a split second and go back. I can't seem to crack it for the life of me?```function testbotstatus(client) {
setInterval(() => {
client.user.setActivity('$help | Test')
}, 1000);
setInterval(() => {
client.user.setActivity('$help | test 2')
}, 2000);
}

tame kestrel
#

@signal lantern 1000 2000 are in milliseconds, so every 1 and 2 seconds you're setting the status to be different

#

Discord doesn't like spamming of the api

signal lantern
#

is there a standard time? Because itll sit on the first for a little while before switching

tame kestrel
#

well in terms of minimum time, you can do like minutes at a time, I think people would like it if the status didn't change too fast.

You have to think of each setInterval as it's own timer, so like the top one is boinking every second, while the second one is boinking every 2 seconds

#

If you wanted to rotate between each status message, you might want to structure it a bit differently.

signal lantern
#

Yeah I was hoping to get it to rotate, thank you for the info I will try to rework how I am doing it

tame kestrel
signal lantern
#

oooo thanks, ill see what I can do! 🙂

quiet arch
#

how can i add 2 prefixes (bc on phone u automatically get a capital at the begining)

tame kestrel
#

Are you talking about your own bot that you're programming?

quiet arch
#

yes

tame kestrel
#

Well, currently, you should check for if the message begins with whatever prefix, maybe you can check if the prefix starts with the first prefix OR the second prefix

#

Or, in your case, since the formatting gets messed up, you can format it so that the prefix check for the same letter, regardless of capitals

quiet arch
#

Or, in your case, since the formatting gets messed up, you can format it so that the prefix check for the same letter, regardless of capitals
@tame kestrel how?

vagrant prawn
#

how can i add 2 prefixes (bc on phone u automatically get a capital at the begining)
@quiet arch you can test the message's lower case version with the prefix

hollow sedge
#

so like i did here but then with capital and non-capital
@quiet arch What language?

quiet arch
#

js

river thistle
#

anyone knows how to fetch more than 100 messages in a channel ?

vagrant prawn
#

Do you use something.startsWith(prefix)?

hollow sedge
#

anyone knows how to fetch more than 100 messages in a channel ?
@river thistle what language

river thistle
#

discord.js

#

sorry didnt mention it

tame kestrel
#

so like i did here but then with capital and non-capital
@quiet arch so something like this, you can use the || operator, also known as the OR operator

msg.content == 'pepe' || msg.content == 'uwu'

If either side is "true" then it outputs as true

quiet arch
#

bc if i do const prefix = pepe in my case i cant do const prefix = ('pepe', 'Pepe')

hollow sedge
river thistle
#

hehe thx

#

my bad I didnt look at so

tame kestrel
#

@quiet arch take a closer look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR to learn about the OR operator a bit more, you can use these to do compound boolean expressions, basically meaning you can check multiple things at a time, or check for multiple things

quiet arch
#

okay

#

thx

tame kestrel
#

Yes! Let me know if you have any questions or concerns, I want you to be able to learn it so that you can apply it to other things in the future

quiet arch
#

sure i will take my time to read it but one more question bout the prefix

tame kestrel
#

What's up

quiet arch
#

if ure in const can u do like more then one output or however u call it ex: const prefix = 'pepe', 'peepo'

earnest phoenix
tame kestrel
#

So, const is just another way of creating a variable. When you use const it usually means that you can not change the variable after.

In terms of lists, you can use arrays/tuples like this: const name = [ 'one', 'two' ]

They come with their own benefits like being able to sort and all that. I don't think you can use them how I think you want to use them though.

#

like you can't do msg.content === name

quiet arch
#

oh

#

will it work with that?

pale vessel
#

yes

vernal rivet
#

yes

quiet arch
#

now nothing works

tame kestrel
#

@quiet arch depends on how you implement it, try deleting the !msg.content.startsWith(prefix) and creating your own logic for filtering out message that start with either of your prefixes

vernal rivet
#

a variable can only be assign to one value

quiet arch
#

oh ok

vernal rivet
#

if you want to have your prefix to have multiply values, then you would need to make a string array

#

wait, i am just repeating what safe said dogekek oopies

quiet arch
#

but if i make like 2x const 1, will be prefix_1 and 2, prefix_2 and then in my code prefix1|| prefix2 + command

vernal rivet
#

not needed

pale vessel
#

an array would be more efficient

vernal rivet
#

arrays are more efficient

quiet arch
#

u have an article about array bc i dont know what it does

vernal rivet
quiet arch
#

so array is let

tame kestrel
#

Yes, an array is better, but I'm trying to have aka start from the ground up, and understand what really is going on when they check for multiple prefixes

vernal rivet
#

no

quiet arch
#

hmm

vernal rivet
#

let is just another variable declaration like const

quiet arch
#

oh

tame kestrel
#

let means it's mutable, or changeable after, const means you shouldn't change it later on

vernal rivet
#

^^^^^

quiet arch
#

oh

vernal rivet
#

array is []

quiet arch
#

oh

#

but u cant use array in const

vernal rivet
#

everything inside the braces are items in the array.

#

you can