#development

1 messages ยท Page 1346 of 1

quiet arch
tame kestrel
#

yes

vernal rivet
#

variable declaration doesn't dictate what the variable is being assigned to. only after the declaration

tame kestrel
#

prefix is no longer a string, but an array of strings, so you have to treat it differently

vernal rivet
#

^^^^^

quiet arch
#

oh

vernal rivet
#

also noticed it be easier to just have to be a string, and lowercase the message in the if statement.

#

shrug but i guess we are going down the array of string path

quiet arch
#

so with the array const this will not work anymore

if(!message.content.startsWith(prefix) || message.author.bot) return

`const args = message.content.slice(prefix.length).split(/ +/)`
`const command = args.shift().toLowerCase()`

if(command === 'ping'){
client.commands.get('ping',).execute(message, args)

tame kestrel
#

Are you following anidiots.guide?

vernal rivet
#

looks like it

quiet arch
#

nope

#

or maybe i do but i just dont know

vernal rivet
#

could also be discord.js guides

tardy moth
#

Gyus link to create the bot with phone

vernal rivet
#

yea that d.js guides

#

i just looked at the guide, it is the exact same

quiet arch
#

oh realy

vernal rivet
sudden geyser
#

even the comma

vernal rivet
#

not the comma

#

only the if check and under is the same.

tame kestrel
#

Okay, well. here's what you should try first.

First delete the !message.content.startsWith(prefix) || from the if statement at the top, and create another if statement below. This will serve as a test deciding if the message starts with the prefix or not.

Try applying what I showed you above with the || statement. Don't worry about arrays and all that if you don't understand how they work.

quiet arch
#

ok

trail orchid
#

hey I have a webhook server setup on a repl with a public domain. it successfully receives posts from top.gg but now I need help getting that post data into my python bot.

quiet arch
#

do i needa del this 2?

tame kestrel
#

no, that tests if the author is a bot

quiet arch
#

oh oki

trail orchid
#
class TopGG(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.manager = Manager()
        self.sticher = Stitcher()
        self.dbl_token = config('DBL_TOKEN')
        self.webhook_auth_token = config('ALICE_WEBHOOK_AUTH_TOKEN')
        self.dblpy = dbl.DBLClient(self.bot, self.dbl_token, webhook_path='https://alice-webhook-server.highelf.repl.co/dblwebhook', webhook_auth=self.webhook_auth_token, webhook_port=8000)
    
    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print(data)
quiet arch
#

how do u do that ^^^^

tame kestrel
#

Does your python bot run on the same webserver? If not, you'll need a way for the repl to contact the python script or database

#

@trail orchid

trail orchid
#

my python bot runs on a different webserver

#

it runs on heroku

vernal rivet
#

think of if statements like checks. thats the best way to describe what safe is asking for. || is an or operator, means you are saying if this or that is true, then then execute. this means bots can access your bot commands because the message has the prefix in it.

tardy moth
#

Hy guys how to create bot with phone plss

#

Link of application pls

trail orchid
#

Hy guys how to create bot with phone plss
research the twilio api

tardy moth
#

research the twilio api
@trail orchid what

tame kestrel
#

Okay, so you'll need a way for them to interact, you can have the webhook be hosted along with the heroku script, that way it's the same process and will be able to interact within the script, or you can have a database hosted somewhere and the webhook edits the database.

slender thistle
#

what why who when

trail orchid
#

so should I create a separate python script in my bot project that creates a flask server ruynning locally?

slender thistle
#

you

#

webhook_path isn't the damn URL

trail orchid
#

i know

#

it's just the path

slender thistle
#

it's the string after IP and port

tame kestrel
#

so should I create a separate python script in my bot project that creates a flask server ruynning locally?
@trail orchid you could, maybe try that and see if that's what would work best.

trail orchid
#

some guy yesterday told me I needed to create it on repl but I'm now thinking I can have topgg post directly to my heroku app

#

yeah, thanks guys!

quiet arch
#

client.once('ready', () => {
console.log('im online!!')
})

client.on('message', async message => {

if (message.author.bot) return

const command = args.shift().toLowerCase()

if(command === 'pepeping', 'Pepeping'){
    client.commands.get('ping',).execute(message, args)
}else if (command == 'pepepray', 'Pepepray'){
    client.commands.get('pray').execute(message, args)
}else if (command == 'pepeprayspam', 'Pepeprayspam'){
    client.commands.get('prayspam').execute(message, args)
}else if (command == 'hmm'){
    client.commands.get('hmm').execute(message, args)

so like this? (i still have to finish all tho)

tame kestrel
#

Well like, you can have it any way you want, but obviously everyone has a different tech stack to solve different problems and all that

slender thistle
#

Well if you were to host the webhook separately, you might as well scrap dblpy and use Flask/Sanic/Django/aiohttp.web

tardy moth
#

@quiet arch what is name of site ok application for create a bot discord pls

slender thistle
#

unless I missed the part where you said that already

tardy moth
#

Or*

trail orchid
#

wdym?

tame kestrel
#

client.once('ready', () => {
console.log('im online!!')
})

client.on('message', async message => {

if (message.author.bot) return

const command = args.shift().toLowerCase()

if(command === 'pepeping', 'Pepeping'){
    client.commands.get('ping',).execute(message, args)
}else if (command == 'pepepray', 'Pepepray'){
    client.commands.get('pray').execute(message, args)
}else if (command == 'pepeprayspam', 'Pepeprayspam'){
    client.commands.get('prayspam').execute(message, args)
}else if (command == 'hmm'){
    client.commands.get('hmm').execute(message, args)

so like this? (i still have to finish all tho)
@quiet arch you might want to check out javascript tutorials on how comparing strings works.

vernal rivet
#

^^^

trail orchid
#

rn my plan is to create a new python script that runs a flask server in conjunction with my bot

slender thistle
trail orchid
#

so when I host everything on heroku I have both my bot and flask server running

slender thistle
#

At least use Sanic's async server

trail orchid
#

why is it bad?

slender thistle
#

because Flask isn't async

tardy moth
#

@trail orchid what is name of site ok application for create a bot discord pls

trail orchid
#

is it really not async?

slender thistle
#

It's not

quiet arch
#

@quiet arch you might want to check out javascript tutorials on how comparing strings works.
@tame kestrel okay

#

u have one for me?

tame kestrel
slender thistle
#

Sanic is similar to Flask, you might want to give it a try

tame kestrel
trail orchid
#

yeah I like flask because it's extremely simple

slender thistle
#

It has an async server I used to attach to my bot

trail orchid
#

and this a very simple task

tame kestrel
#

mdn is my favorite guide

slender thistle
#

Yeah I'd suggest Sanic

#

They're quite similar

trail orchid
#

okay awesome

quiet arch
tardy moth
#

@tame kestrel thnx

#

How ?? 1 or 2 or 3 ??

quiet arch
#

thank u safe and panda for helping me

trail orchid
#

so just to get this clear, I create a sanic web server on the same domain my bot is hosted on and then post to that domain?

vernal rivet
#

np

#

||even though i didn't do too much||

quiet arch
#

hehe but still

slender thistle
#

Err, well

tame kestrel
#

You shouldn't program on a phone @tardy moth

if you want to try phone development maybe https://repl.it/ the website will help you

slender thistle
#

I thought you wanted to host your bot along with the webserver?

trail orchid
#

I don't quite understand, what's the point of the dbl library

slender thistle
#

To simplify using the top.gg API and hosting a webhook, as everything is handled internally and all you have to do is process the end data

trail orchid
#

but how does it simplify it if I have to host the webserver locally anyway

#

one thing that it does do

#

is autopost

#

my guild count

#

which is extremely helpful

#

but for receiving data, on the fly, it doesn't seem helpful

slender thistle
#

You don't have to handle authorization manually, or actually running the webhook yourself

#

Eh, yeah. It's optional

trail orchid
#

right?

#

cause I have to still host the web server myself for topgg to post data to

slender thistle
#

Yeah, you can either use dblpy or do it manually

#

in this case me yelling at you to use Sanic

trail orchid
#

the difference seems like a few lines of code lol

quiet arch
#

if(!message.content.startsWith('pepe', 'Pepe') || message.author.bot) return

will this work tho?

trail orchid
#

wait oh shit

#

I think I'm just starting to understand this

#

are you saying that dblpy creates a webserver for me when I initialize the client?

#

(on my local machine of course)

slender thistle
#

When you set the webhook_x arguments, yeah

trail orchid
#

OH SHIT

#

okay that makes so much more sense

slender thistle
#

Only webhook_port required in order to actually run it, the other two args have default values (webhook_auth being an empty string and webhook_path being /dblwebhook)

trail orchid
#

okay well for testing this

#

I am running the bot on my local machine

#

so how can I expose my machine to the topgg api

#

I know i can use ngrok

slender thistle
#

Port forwarding and making sure your firewall isn't blocking requests

hollow sedge
#

? shouldnt it still work on your local machine

trail orchid
#

but I'm not sure how that works here

slender thistle
#

Not familiar with ngrok k3llyhmm

#

Ah, I see

trail orchid
slender thistle
#

Huh, interesting

tame kestrel
#

cant u just start the ngrok and use the port it gives u for local host

trail orchid
#

yeah

quiet arch
#

oh const stands for constand that i didnt think of that ๐Ÿ˜”

trail orchid
#

that's what I'm thinking

tame kestrel
#

if it gives you 4040 use that in the py script, and then send the webhooks to the ngrok open port

tardy moth
#

Guys you don t have vedio for create bot

slender thistle
#

-faq 3

gilded plankBOT
slender thistle
#

No videos, only text guides

tame kestrel
#

Guys you don t have vedio for create bot
@tardy moth This channel is for technical questions with programming, if you need help please follow the link above or just google it

quiet arch
vernal rivet
#

String.toLowerCase()

trail orchid
#

ayyy

#

it worked!

#

thanks guys

vernal rivet
#

@quiet arch that if statement you sent, will not work, it will complain. String.startsWith() takes one parameter.

quiet arch
#

wait whut?

vernal rivet
pale vessel
#

it won't but it'll only check for pepe

quiet arch
#

no thats old

vernal rivet
#

ok

#

does it work now?

quiet arch
#

client.on('message', async message => {

const BotPrefix = "pepe"

if(!message.content.toLowerCase().startsWith(BotPrefix) || message.author.bot) return

const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase()

now i have this

#

and it works

vernal rivet
#

dont use an OR operator in that if statement

quiet arch
#

dont use an OR operator in that if statement
@vernal rivet why not?

pale vessel
#

it's for a return, why not

quiet arch
#

ye

vernal rivet
#

wait i am being dumb, your returning. and your condition is checking a NOT in there

eternal osprey
#

hey could anyone tell me why my !checking command is not working? ```js
if (message.content.startsWith === '!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("<@" + userId.id + ">" +  ` has 0 invites`);
    }

    else {

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

shrug idk whats wrong with it

quiet arch
#

how do u do that tho ???

#

like send with colours and shiii

pale vessel
#

string.startsWith() is a function

tame kestrel
#

use ```backticks like so``` @quiet arch

vernal rivet
#

what flaze said

quiet arch
#

oh thx

tame kestrel
#

if you want color formatting

```js <- put the name of the lang here
console.log()
```

vernal rivet
#

String.startsWith() is a function, that returns a boolean value. you don't need to use an equal operator there

eternal osprey
#

hmm

quiet arch
#

hmm

#

is that a python thing?

tame kestrel
#

no scroll up and see my other msg

eternal osprey
#

couldn't i just use message.content

#

instead of using startsWith?

quiet arch
#

ye so backtics ``` like this right?

vernal rivet
#

you could shrug but your making sure that the message is only the command and prefix.

eternal osprey
#

nvm got it ๐Ÿ˜‰

quiet arch
vernal rivet
#

what does your message event look like?

quiet arch
#

    const BotPrefix = "pepe"

    if(!message.content.toLowerCase().startsWith(BotPrefix) || message.author.bot) return

    const args = message.content.slice(BotPrefix.length).split(/ +/)
    const command = args.shift().toLowerCase()
    

    {

    if(command === 'ping'){
        client.commands.get('ping').execute(message, args)
    }else if (command == 'pray'){
        client.commands.get('pray').execute(message, args)
    }else if (command == 'prayspam'){
        client.commands.get('prayspam').execute(message, args)
    }else if (command == 'hmm'){
        client.commands.get('hmm').execute(message, args)
    }else if (message.content == 'pepedog'){
        const subreddits = ['memes', 'dankmeme']
        const random = subreddits[Math.floor(Math.random() * subreddits)]
        const img = await randomPuppy(random)
        console.log(img)
        const Meme = new Discord.MessageEmbed()
        .setImage(img)
        .setTitle(`From the luveley doggos`)
        .setURL(`https://reddit.com/r/${random}`)
        message.channel.send(Meme)
    }else if (message.content == 'pepememe', 'pepemeem' ){
        const subreddits = ["memes", "dankmeme", "me_irl", "meme", "woooosh"]
        const random = subreddits[Math.floor(Math.random() * subreddits.length)]
        const img = await randomPuppy(random)
        console.log(img)
        const Meme = new Discord.MessageEmbed()
        .setImage(img)
        .setTitle(`From r/${random}`)
        .setURL(`https://reddit.com/r/${random}`)
        message.channel.send(Meme)
    }```
eternal osprey
#

type js after the backslashes please

quiet arch
#

oh

#

wait

#

whut

vernal rivet
#

why are you encasing your commands in a lonely {}?

tame kestrel
quiet arch
#

oh

#

hmm

vernal rivet
#

you cant use , to do OR Operators.

quiet arch
#
client.on('message', async message => {

    const BotPrefix = "pepe"

    if(!message.content.toLowerCase().startsWith(BotPrefix) || message.author.bot) return

    const args = message.content.slice(BotPrefix.length).split(/ +/)
    const command = args.shift().toLowerCase()
    

    {

    if(command === 'ping'){
        client.commands.get('ping').execute(message, args)
    }else if (command == 'pray'){
        client.commands.get('pray').execute(message, args)
    }else if (command == 'prayspam'){
        client.commands.get('prayspam').execute(message, args)
    }else if (command == 'hmm'){
        client.commands.get('hmm').execute(message, args)
    }else if (message.content == 'pepedog'){
        const subreddits = ['memes', 'dankmeme']
        const random = subreddits[Math.floor(Math.random() * subreddits)]
        const img = await randomPuppy(random)
        console.log(img)
        const Meme = new Discord.MessageEmbed()
        .setImage(img)
        .setTitle(`From the luveley doggos`)
        .setURL(`https://reddit.com/r/${random}`)
        message.channel.send(Meme)
    }else if (message.content == 'pepememe', 'pepemeem' ){
        const subreddits = ["memes", "dankmeme", "me_irl", "meme", "woooosh"]
        const random = subreddits[Math.floor(Math.random() * subreddits.length)]
        const img = await randomPuppy(random)
        console.log(img)
        const Meme = new Discord.MessageEmbed()
        .setImage(img)
        .setTitle(`From r/${random}`)
        .setURL(`https://reddit.com/r/${random}`)
        message.channel.send(Meme)
    }



#

oh yey thx

#

you cant use , to do OR Operators.
@vernal rivet where?

tame kestrel
pale vessel
quiet arch
#

okay

vernal rivet
#

change

else if (message.content == 'pepememe', 'pepemeem')

to

else if(message.content == 'peepmeme' || message.content == 'pepemeem')
quiet arch
#

ok

pale vessel
#

nice

vernal rivet
#

OR operators checks if either condition is true. if so, then it return true. else it returns false. you can't use , to express a OR operator as it is not a OR Operator. only || is. and they have to be both conditions, that returns a boolean value. example:

//  false     true
if(1 == 2 || 2 == 2)
{
  console.log("2 equals 2");
}
#

do i love markdown sometimes

#

that beacuse it needs to be pepe pepememe

#

but that will never execute

quiet arch
#

flaze why nice

#

oh

tame kestrel
#

Listen Pepe, we won't give you the answer you're looking for, as programming on your own project is what you should be doing.

If what we've given you so far isn't clicking, I would try reading tutorials and learning more about how javascript works, and what tools they give you to solve problems.

vernal rivet
#

do interactive courses, those usually help people the most

pale vessel
#

reading online has always worked for me

vernal rivet
#

same

quiet arch
#

okay

tame kestrel
#

Everyone learns in different ways, so do some research on that, and try solving little javascript puzzles and then try approaching your problem again

quiet arch
tame kestrel
#

kore and I are happy to lead you in the right direction, but that guide and the anidiots.guide website will help you a lot.

vernal rivet
#

^^^^^^

#

||i mean you can call me panda, but that works||

tame kestrel
#

Oh sorry, Panda LOL

quartz kindle
#

Koreaboo

vernal rivet
#

you're fine, not many people call me kore, so it took me a second to realize who you were referring to

tame kestrel
#

I end up reading like the first few letters of anyone's username haha

vernal rivet
#

lol i do that some times

quiet arch
quartz kindle
#

It means if you do 5 === 4 in your code, you get false

#

Because 5 is not equal to 4

quiet arch
#

oh

#

oki

stoic girder
#

Am I allowed by the top.gg rules to beg for upvotes in user's DM after they finish their application process in DM?

quartz kindle
#

If the user initiated the application process with a command, yes, you can mention votes somewhere during the command or at the end of it

#

As long as youre not sending them a message without them doing anything, youre fine

stoic girder
#

Yep, that's it.

#

I had it send a message for discordbotlist.com before but removed it before my bot got reviewed here, wasn't sure is it a problem.

quartz kindle
#

Should be fine

quiet arch
#

thank u guys i read it and i was able to fix it

#

thx safe and panda

tame kestrel
#

@quiet arch congrats ๐ŸŽŠ

quiet arch
#

thx

stark abyss
#

Does anyone know how to blur an image from canvas or any other automation process?

quartz kindle
vocal sluice
#

i know some bots have it but how would you make like your bots pfp on its page round?

earnest phoenix
vocal sluice
#

yea\

opaque lake
#

Is a /seen command possible?
Where you do /seen @Person and it shows when they was last online.

earnest phoenix
#

no

#

@vocal sluice find the css class for the img on the top.gg page then overwrite it in your bot's description, set the border-radius to 50%

quartz kindle
#

technically it is possible, but it takes a lot of work

vocal sluice
#

like this part @earnest phoenix ?

earnest phoenix
#

yeah

#

you need to find a class above it though

#

then you can select the children

#

give me a sec

vocal sluice
#

oh

#

oh

#

so like <div class="bot-img"> that part?

earnest phoenix
#

yup

#
.bot-img > img 
{
//border radius blah blah
}
vocal sluice
#

do you know what 50% is for pixel?

earnest phoenix
#

just use 50%

#

css allows percentages

vocal sluice
#

oh ok

#

amazing thanks @earnest phoenix

rapid dune
#

I look at a LEVELING SYSTEM๐Ÿ˜…

#

Who can help me?

earnest phoenix
#

help you to look at a leveling system?

waxen tinsel
silver lintel
#
user.setNickname(args.slice(1).join(" "))
      .catch((err) => {
        return message.channel.send("I do not have permission to change this user's nickname");
      })
      .then(message.channel.send(`:white_check_mark: | Successfully changed **${user.user.tag}'s** nickname to **${args.slice(1).join(" ")}**`));
``` its sending both messages
faint prism
#

Out of context star posts are the best

earnest phoenix
#

@silver lintel using return in a callback won't return out of the function you're calling the method in

#

aka

silver lintel
#

:0

earnest phoenix
#

use await/async or .then().catch(), nevermind the second option will work too

silver lintel
#

thanks

subtle kiln
#

Hello! I have a simple question (I guess) but I couldn't find anything on the internet or in the documentation. How do you convert a tag (Cl00e9ment#3679) to an ID (347315660679938060) or an user object using discord.js, thanks

earnest phoenix
#

you can't really do it reliably

#

your best bet is to rely on user cache

subtle kiln
#

Why it's not possible ? Discord API doesn't provide a mean to do this ?

earnest phoenix
#

it doesn't

stark abyss
#

ty tim

subtle kiln
#

Is there a reason for this ? Because Discord itself can definitely do it

earnest phoenix
#

there's no reason and no it can't

#

the official client works off the user cache too

#

if the user isn't in your cache you won't mention them or get their id

subtle kiln
#

When you add a friend you provide a tag and Discord can find the user

earnest phoenix
#

that's an API endpoint exclusive to users only

subtle kiln
#

It's not a big deal if it's not possible. I was just curious why

earnest phoenix
#

this works off the cache and it's the only way to do it

rapid dune
#

Who know write in BDscript?

subtle kiln
#

this works off the cache and it's the only way to do it
@earnest phoenix OK thanks. You said that Discord itself couldn't do it. As I said, when you add a friend, you provide a tag and Discord can find the user. Is there something that I missed ?

earnest phoenix
#

like i said that's an endpoint exclusive to users only

#

it's also an endpoint to add a friend not to look up users

#

so you're at the mercy of discord

subtle kiln
#

Ah ok. I was talking about Discord as the Client/Server. So the server can do it, there isn't a technical limitation. It's sad that we don't have access to it. Thanks for your explanations

earnest phoenix
#

ah alright

#

yeah unfortunately there's so many features that are locked to users only

#

at the same time if you look at it from a security perspective, it's the best

#

if it was available to bots it would get spammed, bots would keep on targeting users, just so much abuse overall

quartz kindle
#

@subtle kiln if the user in question shares guilds with your bot, and you know which guild they are in, you can

#

otherwise its like cry said

subtle kiln
#

@subtle kiln if the user in question shares guilds with your bot, and you know which guild they are in, you can
@quartz kindle OK so if I search the user in a particular guild it would works 100%?

quartz kindle
#

there is an endpoint/gateway call to search for a guild member by a query string, that returns all members whose usernames match the string

#

its not an exact username#tag search, but you can search by username

#

and then filter the results

subtle kiln
#

Nice, thanks a lot. I will do that

storm basin
#

Can anyone help me figure out why my cooldown error is not sending whenever the message is on cooldown and someone tries to activate it?

#

@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.send("Command on Cooldown")

#

That's just what I have so far

#

This is exactly what I see other people have, but it doesn't send a message in Discord whenever the command goes on Cooldown

hollow sedge
#

@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.send("Command on Cooldown")
@storm basin looks good to me, you must be doing something else wrong

storm basin
#

@commands.cooldown(1, 5, commands.BucketType.user)

#

I just tacked that on to one of my working commands

hollow sedge
#

that also looks good

storm basin
#

I wonder what else it can be

hollow sedge
#

only thing i can think of is that you arent importing commands?

storm basin
#

The command works

hollow sedge
#

i mean from discord.ext import commands

storm basin
#

Yeah I have that

#

The command and cooldown works

#

It just doesn't send a message whenver I try to use the command when it's on cooldown

hollow sedge
#

can you send your entire script

#

not here but in pastebin

#

@storm basin

faint prism
#

or hastebin

#

python is like greek to me
@zinc sierra it's basically pseudocode though lol

storm basin
#

@hollow sedge I sent it in a DM

#

Ignore the weird ass commands I have

#

@hollow sedge

#

Wait

#

I think I'm stupid

hollow sedge
#

k give me a few mins

#

oh

storm basin
#

Let me try something

#

OH MY GOD

#

I'VE BEEN TRYING TO FIX THIS FOR LIKE 2 HOURS

#

DAMMIT

hollow sedge
#

lol

#

what did u do

storm basin
#

I completely forgot I already had on_command_error somewhere else in the file

hollow sedge
#

๐Ÿคฆ

storm basin
#

When you asked me to copy it over I looked it over and noticed it

hollow sedge
#

so i fixed your problem :)?

storm basin
#

Thanks for your help

hollow sedge
#

lol

storm basin
#

Yeah

solemn latch
#

stealing my name i see

outer topaz
#

Don't do that

tired nimbus
#

What happens if you need windows-build-tools but dont use windows

trim saddle
#

or hastebin
@faint prism personally i'd wait for pastebin pro to open back up

sudden geyser
#

why would you need it

trim saddle
#

since hastebin doesn't have private/permanent hastes

sudden geyser
#

There was another site I knew which had its own API for pastes and had permanent pastes but I forgot the name sadly

trim saddle
#

there's a sus version of pastebin that has pro open

#

but it's ran on an ip so thats a nope

faint prism
#

since hastebin doesn't have private/permanent hastes
@trim saddle Then use a proper repo. I'd say the point of those platforms is quickly sharing large amounts of text. For permanence, just use a repo

charred geyser
#

can anyone give me any tips on making some sort of handler that allows my bots commands to be disabled and enabled

pale vessel
#

use a database

charred geyser
#

im using a mongodb rn and atm im using a really messy way of doing it

#

yea i know im just tryna tidy up

#

right now i just have a schema with a boolean for every command the bot has but it doesn't seem like a good way of doing it

hollow sedge
#

discord py?

charred geyser
#

js

hollow sedge
#

๐Ÿคท

charred geyser
#

๐Ÿ˜ฆ

#

ill figure it out :))

hollow sedge
#

just use discord py ๐Ÿ™‚

#

jk use whatever u want

charred geyser
#

yeah ive looked at that

#

but

#

kinda a large rewrite

#

maybe its worth it Shrug

hollow sedge
#

well if you want to remove a command then maybe you should do that

vernal rivet
#

whats up?

#

your wanting to make a command handler?

charred geyser
#

well i have one but i want to make it a lot better

vernal rivet
#

flaze, no, thats an over kill

#

are you using Collection?

charred geyser
#

yeah

pale vessel
#

flaze, no, thats an over kill
@vernal rivet how else are you going to make it persistent

vernal rivet
#

ok good, don't use a db for commands. but anyways its actually pretty simple. what structure are your commands

charred geyser
#

one sec

pale vessel
#

they need a database to keep track of disabled commands

vernal rivet
#

Collection is much better for holding commands. using a db for them is kind of a overkill. unless your talking about something else then yes use a db. dogekek

#

not really

pale vessel
#

not for commands

#

why the fuck would you keep commands in a db lmao

hollow sedge
#

wait

#

do you mean disable per user or bot-wide

charred geyser
#
module.exports = {
  name: "name",
  category: "category",
  description: "description",
  run: async (client, message, args) => {
    //command
  }
};
#

lik this

#

do you mean disable per user or bot-wide
@hollow sedge i mean per server ig

hollow sedge
#

yeah you have to use a db for that

charred geyser
#

yea

vernal rivet
#

oh ok, so your doing module structure.

charred geyser
#

i mean

#

i am open to change

#

thats just what i have rn

vernal rivet
#

oh your trying to do it for each server. i mean db would be the best, but you don't really need a good db tbh. a local sqlite file will work

charred geyser
#

i have a mongo db

pale vessel
#

now you're telling a db would be best xd

vernal rivet
hollow sedge
#

@pale vessel thats cause he didnt make it clear where he wanted to disable it

charred geyser
vernal rivet
#

i didn't realized what he wanted i was guessing to disable commands everyone

charred geyser
#

yeah sorry i should have been clearer

vernal rivet
#

you're fine. yea i mean you could use mongodb, idk how fast it is. the reason why i say a local sqlite would work is that it would be faster to use and get data from, rather than a remote db. as you are probably going to have it get data from the db constantly in the message event, so it is better to go with an option that will not take too much time. but it really is up to you.

charred geyser
#

yeah i guess that makes sense

#

and in terms of handers how would it work?

vernal rivet
#

depends on how you want to implement it, and how it will work. but the solution would probably have a if check in the message event, that checks if the guild has that command disabled or not, if so, then return. that is probably the best way to do it.

charred geyser
#

yeah

#

alright thanks

vernal rivet
#

np

charred geyser
#

ill see what i can figure

vernal rivet
#

yert

#

enmap would be a good idea to use, or quick.db. both work as a local db. me personally like enmap more than quick.db, but i know that quick.db is easier to understand than enmap.

hasty mulch
#

How often can the topic be changed before Discord kicks in with the rate limits?

vernal rivet
#

tbh i never actually thought about that lipd. the answer could be on google if you have checked yet.

earnest phoenix
#

How to start run.bat file on Glitch.com
Using package.json

old cliff
#

You can use keyv

#

It works with many dbs

vernal rivet
#

i don't think you can do that happy. from what my knowledge is, that glitch is a pain to deal with. you could probably use process.cwd to execute it, but you would need to call on a js file to do that.

#

wait not cwd

#

hold on, let me read something

old cliff
#

Glitch doesn't allow bot hosting now

#

You can use heroku

earnest phoenix
old cliff
#

But that resets sqlite dbs everything so you can't use enmap with that

#

Heroku is also 100% free

earnest phoenix
#

Dyno hours sort

old cliff
#

Yep

earnest phoenix
#

Glitch doesn't allow bot hosting now
@old cliff allow still

#

But 5m

old cliff
earnest phoenix
#

I try

old cliff
#

I also know free hosts but posting server links is not allowed

pale vessel
#

thank you for reading the rules xd

#

most people don't do that

icy jolt
#

Hey what uh coding app do you guys recommend?

pale vessel
#

vsc, sublime text

vernal rivet
#

pc application, vscode

icy jolt
#

They will work for Discord Bots?

pale vessel
#

yes

#

any editor would do

icy jolt
#

Oki

#

Thanks

pale vessel
#

i use npp even

icy jolt
#

Vscode is downloading

vernal rivet
#

O,o why npp

pale vessel
#

just works for me

vernal rivet
#

npp tbh is gross ngl

pale vessel
#

some people don't like hearing that

sudden geyser
#

The code editor/IDE you use may also depend on what you're doing. For example, Python has PyCharm, but for the most part, having a code editor like Visual Studio Code is satisfactory.

vernal rivet
#

i mean you use what you want, but like why ;-; npp is just gross to look at in my opinion

pale vessel
#

idk, solarized doesn't look that bad

vernal rivet
#

vscode is just the go-to-go text editor most people use

pale vessel
#

plus it's portable

vernal rivet
#

very

pale vessel
#

i'm not convincing anybody at least, you can use whatever you want to code, as long as it works

icy jolt
#

Hey could I have a mentor? (I guess you would call it) this is my first time doing this me and my brother are having a competition who can 1.make it first and 2. make it best. He already has one and has started but I havent started and dont have a mentor?

pale vessel
#

don't use windows notepad though

vernal rivet
#

i mean i recommend vscode for newer people. i don't think npp or atom is good one for newer people to use

icy jolt
#

Noted

#

I am downloading vscode

pale vessel
#

yeah, i didn't suggest npp to them since it's not good for most people

vernal rivet
#

i know you didn't

pale vessel
#

all right

icy jolt
#

Hey Korean... Since clearly you use/have used vscode. Could you maybe help me make the bot? this is my first time doing this me and my brother are having a competition who can 1.make it first and 2. make it best. He already has one and has started but I havent started and dont have a mentor?

earnest phoenix
pale vessel
#

you can't use duration.format() without a plugin

vernal rivet
#

if you want to use py, then idk if there is guides for d.py

pale vessel
icy jolt
#

I downloaded vscode

vernal rivet
#

are you wanting to use Javascript or Python?

icy jolt
#

Python I think?

pale vessel
#

depends on what language you want to code in, make sure you learn the basics first or setting up a bot will be hell

icy jolt
#

Well

#

um

pale vessel
#

do you know python basics?

icy jolt
#

I downloaded it on an old computer just never got to it

pale vessel
icy jolt
#

So 1st step I am guessing. Go back and learn a coding language

pale vessel
#

yes

vernal rivet
#

||i sure hell don't know python. i programmed in it before, and absolutely hated it, so i am just much help when it comes to py||

pale vessel
#

take your time

#

don't code a bot without knowing the programming language since it'll make it worse

vernal rivet
#

^^^^^^

icy jolt
#

Okay yeah my brothers helper is just telling him what to type n stuff

vernal rivet
#

knowledge is like 80% of what programming is tbh

icy jolt
#

Thanks I will read this tomorrow that way I can actually pay attention

pale vessel
#

80% knowledge 20% errors

vernal rivet
#

yert.

icy jolt
#

@pale vessel The thing you sent I dont see where to learn a coding "language"

#

Do I just press next?

vernal rivet
#

yert

icy jolt
#

Does Discord take all Coding Languages?

solemn latch
#

its an api, so yes?

icy jolt
#

Oh okay

tame kestrel
#

Does Discord take all Coding Languages?
@icy jolt Just to clarify, since discord provides us with websockets, we can use code to talk to discord. It doesn't really matter the language, some languages have an easier time with websockets, while others need some help.

icy jolt
#

Okay, Thank you!

solemn latch
#

you could technically make a bot with a batch script Thonk

icy jolt
#

Would the code language affect how the bot works?

solemn latch
#

only up to the point of the capabilities of the language. any "proper" language should have no real limitations of what you can do

waxen tinsel
#

^

hollow sedge
#

it will be easier to use a language with an updated api wrapper though

solemn latch
#

^ joking btw

hollow sedge
#

Seems like a fun way to start programming tho

earnest phoenix
pale vessel
#

is there an error?

earnest phoenix
#

yea

pale vessel
#

what is it

earnest phoenix
pale vessel
#

so require("moment-duration-format")(moment);

earnest phoenix
#

I'm a try again 1 min

#

nothing has changed ;/

pale vessel
#

can you show me the code

earnest phoenix
pale vessel
earnest phoenix
#

Yes unfortunately

#

@pale vessel Ok, I found the problem, fixed it, thanks for the help

pale vessel
#

ah, nice

earnest phoenix
#

๐Ÿ™‚

pale vessel
#

yes

icy jolt
#

Sup brother

#

Didnt think I would find you here

#

Bro why expose me like that

pale vessel
tame kestrel
#

@earnest phoenix Why the mass pinging

#

Please be patient, it's not everyone's responsibility to help you.

#

What do you need help with

#

Looks fine to me

#

What's the problem

#

What are you trying to say yes to

fluid pivot
#

I just boosted the server

tame kestrel
#

npm init -y creates a file called package.json in the folder your PS is at.

So from there, you can install npm packages, and create a few files to get started

#

Since you're in this server, I assume you would like to create a discord bot, let me pull up some guides to help you out

#

That statement, the PS C:/Files > Thing is where your shell is located

#

It's like files on your system, so like right now, you're located in your downloads folder, inside a folder called New Folder

#

You can also look up tutorials on how to use cmd or powershell online.

#

Please read through the links I gave you and see if you can try making a bot yourself, come here when you need help

hollow sedge
#

anyone know what lang i should use for coloring

deft kestrel
#

Can someone figure out how to use pipes or a similar type of communication between two child processes in NodeJS

fluid basin
#

just use the built-in process IPC using child_process#fork

tame kestrel
#

Has anyone used the discord.js in the browser

pale vessel
#

tim has

#

he test stuff using it iirc

blissful coral
#

@quartz kindle

#

get in here

#

What language

tame kestrel
#

@earnest phoenix I usually don't tell people to use a different guide or anything, but seriously consider using the https://anidiots.guide/ tutorial, they walk you through node.js and all that from the ground up

blissful coral
#

And lib

#

yeah lmao

#

this is really bad guidew

tame kestrel
#

The guide you have pulled up looks like an article with as much words as possible in order to get google traffic

pale vessel
#

i skimmed through it and it didnt make since

blissful coral
pale vessel
#

well what do you expect

blissful coral
#

also good one

tame kestrel
blissful coral
#

Read those

#

Word for word

#

Then come back with questions once you have

tame kestrel
#

You should restart, if you don't know what you're doing then you won't get far treading in unknown territory.

delicate shore
#

I want it to forcefully remove

#

How can I

tame kestrel
#

read the error, it seems like the /var/lib/apache2 wasn't empty or something

delicate shore
#

Yes

tame kestrel
#

check whats inside that folder, if it's something you don't want, rm it

delicate shore
#

I want it to forcefully remove
@delicate shore

#

check whats inside that folder, if it's something you don't want, rm it
@tame kestrel I don't want anything

#

In dat

tame kestrel
#

rm -r /var/lib/apache2

delicate shore
#

kk

tame kestrel
#

check if it exists, maybe it just cleaned itself up?

delicate shore
#

lemme check

#

Yea it did

#

But in terminal it shows they exist

old cliff
#

Use sudo rm

#

If you have trouble next time

tame kestrel
#

Just keep reading the discord.js guide!

#

๐Ÿ™‚

vernal rivet
#

?

#

Why are you trying to do that in ps? If you want to make your program through command line, then use either nano, vim, or vi

#

I mean are you new to programming?

sonic lodge
#

you need a text editor to write code

vernal rivet
#

False

sonic lodge
#

wdym 'false'

vernal rivet
#

Ok then I recommend you look into using an application called visual studio code. Vscode as what most people call it, is a lightweight text editor. It's what most of us use when we are programming. It's much better for newer people to use this than nano or vim

#

You don't exactly need a text editor to make a program pool. Anything that allows you to edit a file and put text in can be used to program. It's not efficient but it works

#

Ok ok ok. One thing at a time, let me grab laptop so I can keep up

sonic lodge
#

while you do that please educate me and tell me why you said 'false' lol

vernal rivet
#

I already explain why

glacial trench
#

lol

sonic lodge
#

when

vernal rivet
#

Technically anything can be used to program something. As long it can edit the the text in a file it can be used to program. Its not efficient but it works

sonic lodge
#

yee so if it can edit a text file it's a text editor

#

๐Ÿ˜Ž

vernal rivet
#

including notepad PandaSouless

#

but you can do it through a console. touch command is a thing, and you can use nano and vim. i prefer vim over nano any day of the week except sundays, cause thats my me day

#

anyways

#

ok first question

#

yessir

#

oofers

#

but yes that is the one

#

bruh where is the fucking backlit button on my laptop. i know it exist, but where is it

#

i don't click it

#

np

#

found it

#

fuck it was fn + space bar dogekek

#

uhhhhhhhhhh sure, we can go with that

sonic lodge
#

are you here to program or talk about magic ๐Ÿ˜

vernal rivet
#

great question

sonic lodge
vernal rivet
#

ok ok ok, back on topic. so you had another question for me

#

ok, so i will explain stuff, but it be very beneficial if you where to read about some of the stuff talk about here, and about the language. but let me know if i am going full on programming talk, as i sometimes forget who i am talking to might not understand what i am saying

#

you don't nomnomnom so the thing is that you make the program. You don't throw code at it and expect it to work. thats kind of like throwing your game disc at your console, and expect it to play the game.

#

you have to write instructions for it. very detail instructions

#

oofers

#

because the bot is being ran locally. actually your making the bot. your program is the bot. the bot in discord is a shell. but in programming your bot is the program

#

ehhhhh not really. i mean in a way yes, but not really. you are putting code in it, but your actually just calling on the bot's token, and telling it what to do.

#

you're fine

pale vessel
#

did you read the guide

vernal rivet
#

i mean most people put it in a .env file.

#

mhm, thats because its not a command that ps knows.

#

flaze thats a good question

earnest phoenix
#

Why was i mentioned

vernal rivet
#

ok, so powershell is not what you will use to write the program. ps was only to make the package.json file, and to install the packages that you need. thats all it does, minus running your program

#

vscode is what you will be using to write your program

earnest phoenix
#

Sigh message was removed

vernal rivet
#

yes

#

but you will be seeing it, or at least command prompt, but thats when you are ready to run the bot, or test it.

#

tbh it is. at least for me it is

faint prism
#

Hmm could probably make a bot in Powershell tbh

vernal rivet
#

you're fine, there is no reason to apologize about that. we all start somewhere. heck, when i started, i took the hard way out. ||i started on cpp, the language that most people would say is bruted to learn as your first langauge||

#

you can

#

but you would need to use nano, or vime

#

vim*

faint prism
#

no?

vernal rivet
#

i mean you could use the touch command

faint prism
#

I mean you could make a ps1 script

vernal rivet
#

happy_boy oh right thats a thing

faint prism
#

lmao

vernal rivet
#

fucking ps being like this

faint prism
#

I'm not talking about editing the bot via a powershell terminal. I'm talking in the scripting language

vernal rivet
#

FLSweat fucking ps and it shit. why can it be like command prompt

faint prism
#

wdym

#

powershell is just superior to windows batch in every way

vernal rivet
#

god i hate the look that it starts with, can't stand it.

#

i mean fair

faint prism
#

They made it to succeed it really

vernal rivet
#

anyways you make a file called index.js and then read the guides

faint prism
vernal rivet
#

WAIT ACTUALLY

#

THE FUCK

#

oh wait

#

thats justj a webhook stuff

#

i thought it was to make a bot with LMAO

faint prism
#

I mean, looks like nobody has done it yet

#

But it's just api calls

#

so, you could do it, and make a library for it

vernal rivet
#

true

#

what it said shrug sounds about right.

#

Command-Line Interface = CLI

#

editor is vscode

#

CLI would be your powershell

#

what guide are you looking at?

#

ok, what does your index.js file look like?

#

hover your cursor over the section in red it should say something

#

what does it say?

#

oh? is your file extension ts or js?

#

is line 4 the client.login()?

#

yea no keep it js

#

oh is it in the problems section?

#

can you ss only that section?

#

i just want that line

#

do you not have a snippt tool?

faint prism
#

oof lol

vernal rivet
#

oh ok

#

strings

#

your good

faint prism
vernal rivet
#

so your problem is a syntax error.

faint prism
#
  1. Not specifying that text as a string
  2. Wtf is that
  3. No token
vernal rivet
#

they should be encased in "", or `` or ''

#

the token is removed because it was hard coded in. not in a .env file

#

also dogekek

#

yea your good

#

actually thats a shitty answer, don't read that

lofty musk
#

Hi

vernal rivet
#

hello

shy steeple
#

@lofty musk it takes 4-5 business days for your bot to be reviewed

faint prism
#

@earnest phoenix It's obvious you don't know Javascript. Which is kinda tough to make a Discord bot *in Javascript without knowing that

vernal rivet
#

i mean thats quicker than my life

faint prism
#

no

#

same issue as last

lofty musk
#

i created my bot on Sep, 17th 2020 and i want to know when my bot can get reviewed by discord, to get bot verified tick?

shy steeple
#

i created my bot on Sep, 17th 2020 and i want to know when my bot can get reviewed by discord, to get bot verified tick?
@lofty musk apply for verification

lofty musk
#

@lofty musk it takes 4-5 business days for your bot to be reviewed
@shy steeple IDC i already know THAT

#

YEs

vernal rivet
#

i mean there is some progress

lofty musk
#

but i'm asking

shy steeple
#

What

lofty musk
#

how long

#

do i have to wait

shy steeple
#

For what

lofty musk
#

cause i can't apply yet

faint prism
#

It takes 5 weeks

vernal rivet
#

it took my bot like 2 monthes i believe

faint prism
#

@faint prism whats the issue
@earnest phoenix You don't know Javascript's syntax. That's the issue

#

grammar

lofty musk
#

my bot is in 103 guilds but i can't verify it yet because it says application isn't ready yet (not old enough)

faint prism
#

At least make an effort to learn the language before doing a Discord bot

#

I recommend w3schools

vernal rivet
#
console.log("something); // Incorrect
console.log("something"); // correct
faint prism
vernal rivet
#

even discord markdown doesn't like that dogekek

faint prism
vernal rivet
#

PandaSouless thats more than the days i seen sun light, which is close to 0

#
event.on("something"), () => 
{
  console.log("wrong");
}

event.on("something", () =>
{
  console.log("right");
});
faint prism
#

have you looked at discord.js' example

#
#

lol

#

People take classes for learning programming languages

#

Wont hurt to read the documentation at least

vernal rivet
#

is it ok if i am using allman brace style in js milk_think i think its fine right auger?

faint prism
#

Also fine

#

is it ok if i am using allman brace style in js :milk_think: i think its fine right auger?
@vernal rivet a bit against convention but fine lol

vernal rivet
#

LOL

faint prism
#

no. It takes like 6 weeks to get approved and added here

vernal rivet
#

cause it is

faint prism
#

That's when you read the error log

#

If there isn't an error, you're missing code or have a logic error

vernal rivet
#

or you didn't run the bot

pearl trail
#

uh

#

why u type node mybot.js there

#

client.login("your_bot_token")

#

then open terminal in vsc, new terminal, and type node mybot.js there

#

oh

#

oh yes, cencored

vernal rivet
#

or you can do ctrl + shift + c to open command prompt

#

your require statement needs discord.js to be a string

pearl trail
#

use caps

#

const Discord = require('discord.js')

vernal rivet
#

both work

#

usually you would use " for strings, and ' for chars, but in javascript it doesn't matter, as they are for either one.

pearl trail
#

owh, both..

#

yes

#

you forgot 'discord.js'

#

u just type (discord.js)

vernal rivet
#

they are new to programming

pearl trail
#

yes..

#

change the const client = new discord.client(); to const client = new Discord.client();, because you use const Discord = require('discord.js')

#

save the project...

#

your code is right

compact briar
#

^

pearl trail
#

but in error log, it said
const discord = require(discord.js) without ' ' between discord.js

#

nonono

vernal rivet
#

if you see the white dot at the top it means it is unsaved

pearl trail
#

yes, add it

#

and, don't forget to save it before running the bot by ctrl+s

compact briar
#

i would recommend watching some YouTube vids. there are some good ones out there that will teach you how to get started.

vernal rivet
#

Discord.Client

pearl trail
#

caps, yes...

vernal rivet
#

case sensitive

pearl trail
#

caps is important ;-;

#

Client

#

const client = new Discord.Client();

#

no no

#

without ' '

compact briar
#

you also need to fix lines 9&10

you dont have either of those defined.
if you want it to be what the message contains, it needs to be a string.

#

you have to save it

#

before you run it.

#

every time you change something. you have to save it.

#

you need to go watch videos on how to create the bot. they will help you a lot on everything you need to do to get started.

#
client.on("message", async message => {
``` if you want it Asynchronous , if not delete the async
pearl trail
#
const command = args.shift().toLowerCase();
if(command === "ping") {
 const m = await message.channel.send("Ping?"); m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms`); } 
});```
test
#

yes, like that

compact briar
#

no

#

the second message is not a string

pearl trail
#

have you save the project? why the error is still in new Discord.Client();

compact briar
#
client.on("message", async message => {
``` if you want it Asynchronous , if not delete the async

it needs to be 100% like that

#

also after you save. rerun it. the error is showing uncapitalized letters, which doesn't match your code

pearl trail
#

change all 8th line to client.on("message", async message => {

compact briar
#

youre missing a )

#

read the error message

vernal rivet
#

line 12
})

pearl trail
#

so, it like

   if (message.content.startsWith("hi")) {
   message.channel.send("hewo");
   }
});```
#

no,

compact briar
#

yes if it is not defined anywhere else

pearl trail
#

can you send full code here?

#

ah, i'm not using my laptop rn,, so i can't test...

compact briar
#

dude honestly go watch some videos. its been an hour in this channel of just trying to get the basics up and running. it will help you alot

pearl trail
#

no error?

compact briar
#

thats good

#

yes

pearl trail
#

yes

compact briar
#

yes

pearl trail
#

yes

#

your bot aren't using prefix...

#

just type hi, and your bot will reply..

compact briar
#

i mean this in the nicest way. this isnt a page for us to write you bot for you. ik its challenging for some but it shows you are very new to this.

#

there are endless sources that can help you online. youtube is a great start if youve never done anything like this before. they will get into detail on how to get started with everything, after that you can decide what you want your bot to do.

#

also be careful to never show your bots token in here, since you have it in your main file rn

pearl trail
#

everyone who have your bot token, can use your bot...

compact briar
#

and they wont be using it for a good cause..

leaden rover
#

I can't seem to get my help command to work all of a sudden... I can't post code here, since its over 2k characters...

pearl trail
#

hastebin

leaden rover
#

Do I use Help_command=None or bot.remove_command(help)

#

Good idea

#

But hastebin won't let me save :/

pearl trail
slender thistle
#

I'd use bot.remove_command

boreal iron
#

U forgot to close ur if statement with another }

#

The }) closes ur async message function

#

np

earnest phoenix
#

is there a code already put out there for having a command that could restart a bot (coded in python)

compact briar
#

its message.content
not
message.context

clever dust
#

const table = sequelize.define('add', {
    string:{
        type: Sequelize.STRING
    }
})


table.findAll().then(e => {

console.log(e[0].dataValues)

    for(let i = 0; a < e.length; i++){
   console.log(`element ${i} : ${e[i].dataValues}`)
   }

   })

why do i get element 1 : [object Object] on the for loop, but i get actual data values from console.log(e[0].dataValues)

boreal iron
#

imma not working with templates, but I'm not sure u cant log a string and object in the same template, but this should work:

const table = sequelize.define('add',
{
    string:
    {
        type: Sequelize.STRING
    }
});


table.findAll().then(e =>
{
    console.log(e[0].dataValues);

    for(let i = 0; i < e.length; i++)
    {
        console.log(`element ${i} :`);
        console.log(e[i].dataValues);
    }
});
#

and btw for(let i = 0; a < e.length; a++) should be for(let a = 0; a < e.length; a++) or for(let i = 0; i < e.length; i++)

clever dust
#

yeah, i got a typo

boreal iron
#

whatever u like more more, lel

clever dust
#

i edited it

#

yep, it works, thanks

sweet ruin
#

Hello! I am trying to figure out how to call upon these models and update them individually in mongo.db (js)
Now This is the whole model:


const newTeamScores = new mongoose.Schema({

    teamDawn: {Number, default: 0},
    
    teamDusk: {Number, default: 0},
    
})

module.exports = new mongoose.model('teamScores', newTeamScores)

And This is how I am trying to save them


newTeamScores.teamDawn = args[1]
await newTeamScores.teamDawn.save()

Could Anyone Help Me? (This is a Index.js Only File BTW)
Please Ping Me :3

honest perch
#

Slow database?

#

Bad connection?

sweet ruin
#

yeah

honest perch
#

it works fine on my beta bot in 2 servers, but on my main bot in 600 guilds its slow. im using atlas btw
@low orbit can you share the code you are using to fetch the prefix

#

What would happen if you didn't use await

#

Apart from that I'm not really sure, my db with thousands of documents fetches fine in seconds

pale vessel
#

mongoose supports promises

solid snow
#

i feel like this is a really silly question but can i get the guild id with something else other than message.guild.id?

pale vessel
#

like what

#

everything that has something to do with guild like member and presence have the guild property

solid snow
#

Well I was trying to get the guild id in the ready event which obviously doesnt have any messages

pale vessel
#

channel and roles too

#

what guild id lol

solid snow
#

maybe thats not even possible idk

pale vessel
#

there's no context

solid snow
#

OHHH

#

yeah

#

oops

boreal iron
#

The ready event contains all guilds in a guilds array

pale vessel
#

not everyone makes their own wrapper

#

they're probably using discord.js which doesn't provide anything in the ready event

boreal iron
#

the djs ready event is not the gateway ready event

pale vessel
#

exactly

earnest phoenix
#

ok

#

error

#

SyntaxError: invalid syntax

sweet ruin
slender thistle
#

Is that where the syntax error is occurring @earnest phoenix

#

Send the code around it

tame kestrel
#

If I have an auth code that expires, what HTTP response code will I get back if I try to fetch from the api?

rose warren
earnest phoenix
#

@slender thistle dm

boreal iron
#

@tame kestrel Depends on the API ur speaking about. I would return code 401 based on ur example.

tame kestrel
#

@tame kestrel Depends on the API ur speaking about. I would return code 401 based on ur example.
@boreal iron I forgot to mention it's discord's api. I guess since it'll be a dead code, It'll be unauthorized like you said

boreal iron
#

I guess they respect the "industrial standards" which would be 401 in this case, since it's unauthorized

tame kestrel
#

Makes sense

stone meteor
#

I dont know why but my <style> tag doesn't work in detailed description

slender thistle
#

@earnest phoenix I don't know what the fuck is wrong with your code

earnest phoenix
#

lol

slender thistle
#

but the one you sent me doesn't have invalid syntax

stone meteor
#

@slender thistle do you know why I can't use the style tag in long description ?

boreal iron
#

did u close the tag?

slender thistle
#

show how you're entering the rules

stone meteor
#

did u close the tag?
Yep

#
  <style>
   body {
    border: 1px solid black;
    }
    h1 {
    color: blue;
    }
   </style>```
mossy basin
#

Sa

stone meteor
#

using this for text but does not work @slender thistle (do i have to use inline styles) ?

delicate shore
#

I am gonna send 4 screenshots here be ready

#

It gives an error

#

Here

#

Where as sub domains work

earnest phoenix
boreal iron
#

Clear your cache on ur mobile device, works well for me

delicate shore
#

Oh it works

#

Thanks

earnest phoenix
delicate shore
#

I should probably delete link it might count as self promotion

earnest phoenix
#

nice website

delicate shore
#

Thnx

earnest phoenix
#

no

#

its fine

delicate shore
#

I deleted it.

#

But I'll leave the question

jaunty flume
#

Does anyone know a way of filtering YouTube videos with the Data API for NSFW content if I already have the ID (so I can't use safe search)?

stone meteor
#

Why does the style tag doesn't work in my long description sed

drowsy kite
#

???

delicate shore
#

It gives invalid protocol error

#

I can't take ss because of a reason

slender thistle
#

@stone meteor Use Developer Tools in your browser, see what styling overwrites yours

wicked pivot
#
                     ^

TypeError: Cannot set property 'casino' of undefined```
stone meteor
#

@slender thistle nothing overwrites it but still it won't work ( inline styling is working )

wicked pivot
#

I may be doing it wrong but I would like to separate the commands in different folder how to do?

willow mirage
#

@delicate shore thx for your IP

#

:))

#

code913 imma quit that project

earnest phoenix
#

Does discord.js have support for OAuth?

delicate shore
#

@delicate shore thx for your IP
@willow mirage
Bruh
It's GitHub ip n

#

It's Public always

earnest phoenix
#

Does discord.js have support for OAuth?
or do i need to use discord-oauth package?

honest perch
#

@earnest phoenix nice site

#

i suggest using this as its for passport

earnest phoenix
#

wut

#

y pong

honest perch
#

oh nvm its pggamers

#

sorry for the ping

earnest phoenix
#

i mean my non exisnt website is nice

tulip ledge
#

@wicked pivot if u make ur loadcommands a function u can use fs to check if the file in ur commands folder is a directory, then u just run the function again but on that directory

wicked pivot
#

I succeeded thank you anyway, now I try to do a clean help with this

full flower
#

What syntax is used to send a custom emoticon? I tried <:name:id> with no luck. It just displays as :name: ๐Ÿค”

earnest phoenix
#

What syntax is used to send a custom emoticon? I tried <:name:id> with no luck. It just displays as :name: thonkconga
@full flower you have to put a: before the name so <a:name:id> iirc

full flower
#

@earnest phoenix hmmm, weird, it still displays as :name: ๐Ÿ˜ฎ

earnest phoenix
#

does the bot have permission to use external emotes in the server?

full flower
#

ooh that could be it! permissions! let's see

#

ah, @earnest phoenix I thought that was it. Though, the bot has administrator permissions... It still isn't working

viscid gale
#

oh... about that hard problem, it wasnt solved owo.. the code i had worked better cuz at least it was accurate :{

#

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..
.Q....

to the chess dudes out here, any advice?
thanks in advanced

#

oh they r dudes who could help huh

#

i didn't ping u guys btw

earnest phoenix
#

should i make a tic tac toe game or a game like coinmaster by quantumcat?

viscid gale
#

or a number guessing game

#

depends on the context, what game would be suited

earnest phoenix
#

idk

#

whatever you want

viscid gale
#

hmm since that question is gonna remain unanswered for a while(meaning i prob gotta learn the answer for myself as that is one of the hardest challenges on codewars), i'll ask something that can be answered

#

is it possible to have an embed that acts like an iframe?

#

like embed to an ngrok host that you have connection with so you could have a live hosting?

#

just how an iframe would load another page, not just info from another page, can embeds load a page itself?

vale garden
#

hi plz help

#
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2020-10-25T11_41_10_029Z-debug.log
exit status 1
#

im getting this error for some reason in my new bot

#

while installing better-sqlite3

earnest phoenix
#

I just got ghost pinged in here

viscid gale
#

yea

#

for my question above

#

and i didn't do the ghost pinging, someone did

earnest phoenix
#

When you run a puppeteer instance, do script tags on pages get run?

viscid gale
#

what r u trying to do

#

there is page.evaluate, where script gets run sorta like in browser eval function

#

bruhhhhhhhh

#

@earnest phoenix pinged u guys

#

;] can't delete my msg

#

LMFAO

#

the cap is real

#

srsly r they ppl that can help with my problems tho?

earnest phoenix
#

there is page.evaluate, where script gets run sorta like in browser eval function
@viscid gale no i mean like if there are script tags on the page does it block them from being executed (security protection) or does it run them automatically or do i have to manually tell it to block/run them?

viscid gale
#

the entire page is run

#

script tags, html, all of it

earnest phoenix
#

@viscid gale no i mean like if there are script tags on the page does it block them from being executed (security protection) or does it run them automatically or do i have to manually tell it to block/run them?
@earnest phoenix if the script tag gets sent by the server, they get executed. if they get created USING javascript, they dont run

#

ok

#

time to take revenge on glitch for wrecking my stuff by having it run massive scripts

viscid gale
#

how on earth do u not know how servers work??

earnest phoenix
#

||just kidding||

halcyon torrent
#

I have got pinged here; what happened ?

viscid gale
#

also scroll up i said who pinged u

vale garden
#

help anyone?

viscid gale
#

@vale garden paste the debug log in here

young cradle
#

Nice ghost ping.