#development

1 messages · Page 1072 of 1

earnest phoenix
#

my bot is 1 day 400 guilds

misty sigil
#

woah

solemn latch
#

Gz

olive rune
#

my bot is 5 days 2k guilds, big sad, it took a bit of time

opaque seal
#

I use this code to find the index of an array element:
genIndex = generators.indexOf(element => element.generator === newChannel.id)

This is the array element that it's supposed to find:
{"generator":"728903742539431948","category":"715868270133248010"}

But the index always results -1, is there something wrong with my code?

earnest phoenix
#

.

warm marsh
#

You're missing a return

#

iirc

solemn latch
#

Is that how index of works

opaque seal
#

?

warm marsh
#

Wait. Your code has an random {

opaque seal
#

No I removed it in the actual code not the issue

warm marsh
#

Use find instead?

#

<arr>.find(el => el == "")

solemn latch
#

Looks like your using indexof like you'd use a filter

warm marsh
#

Using .find should do what you want indexOf to do.

opaque seal
#

Solved, yeah I need to use find or findIndex, not indexOf, thanks guys

tight plinth
solemn latch
#

Pretty sure indexof works here, your just using it wrong

tight plinth
#

who wants it

opaque seal
#

yeah it doesn't take a function

warm marsh
#

Your custom method is a method that's built into Ruby called each_split.

#

The code for it is really simple.

solemn latch
#

Let the boy be proud

warm marsh
#

😐

tight plinth
#

try to do it in js lol

warm marsh
#

Will do.

tight plinth
#
String.prototype.sliceEvery = function sliceEvery(ChunkBy) {
        if (!ChunkBy || isNaN(ChunkBy)) {
            throw new TypeError("No string chunk char was provided or the provided amount is not a number");
        }
        let ChunkArray = this.match(new RegExp(`.{${parseInt(ChunkBy)}}`, "g")).map(z=>{
            return z;
        }
        );
        return ChunkArray;
      }```
solemn latch
#

Wouldn't you just slice in multiples

#

Of the input number

tight plinth
#

could be improved

warm marsh
#

the map could be shortend to z => z

#

but why is it needed?

tight plinth
#

better

#
/**
     * Slices a string every x
     * @param {Number} num - The number of time to slice the string
     * @returns {Array} an array
     */
    String.prototype.sliceEvery = function sliceEvery(num) {
        if (!num || isNaN(num)) {
            throw new TypeError("No number provided");
        }
       return this.match(new RegExp(`.{${parseInt(num)}}`, "g")).map(a => a);
      }```
warm marsh
#

Yeah but the map isn't needed.

#

It returns an array of the first entry.

tight plinth
#

is it?

warm marsh
#

Or should do.

amber fractal
#

mapping something to itself

silver spear
#

hey does anyone know CSS

amber fractal
#

doesnt make sense Thonk

tight plinth
#

thats just how js works

silver spear
#

because i need to learn it rly quick

amber fractal
tight plinth
#

git auto deplyo is very useful

warm marsh
silver spear
#

anyone know css

#

...

tight plinth
#

wait a sec

solemn latch
#

Define know css

silver spear
#

woo, i need to code my top.gg page

#

i want to put in a background

tight plinth
#

learn css urself

silver spear
#

and i need css for that right?

tight plinth
#

google is very useful

#

yes u need css

earnest phoenix
#

Why is Discord keep saying
Hang tight, we're still processing your submission.. This can take a few minutes.

tight plinth
#

and also inspect element

earnest phoenix
#

on the Verfication

#

nvm

fringe axle
solemn latch
#

Looks like its going to take a few minutes tiny

silver spear
#

does anyone just know a simple command for the background to put in HTML

tight plinth
#

man

silver spear
#

i only need that one command, dont rly need entire css

solemn latch
#

Lol

amber fractal
warm marsh
#

Have you tried Googling?

tight plinth
#

learn css yourself

#

yes

silver spear
#

body {
background-color: lightblue;
}

#

thats very simple

#

lmao

tight plinth
#

congrats u just learned how to use css

solemn latch
#

Pro

fringe axle
silver spear
#

lmao

tight plinth
#

@fringe axle unknown user, nothing u can do

#

and also

fringe axle
#

Means?

solemn latch
#

@fringe axle discord gives that when you fetch a user thats not known

tight plinth
#

youre tryung to put the owner as a client option

fringe axle
#

And how can I fix it?

tight plinth
#

and u cant

fringe axle
#

And how can I fix it?

solemn latch
#

Don't search for users that don't exier

tight plinth
#

remove it

solemn latch
#

Exist

tight plinth
#

smh

fringe axle
#

What I have to remove? ;__;

tight plinth
#

youre probably doing new Discord.Client({owner: ...})

#

just remove the owner part

fringe axle
#

If I type any command then this error comes

#

Okay

silver spear
#

oh no

#

it didnt work sad

#

very very sad

fringe axle
#

Problem:

#

Where the heck is it?

#

Which folder

#

;_;

solemn latch
#

We don't know your code

#

Lol

#

You wrote it, you should know

fringe axle
#

Yea

tight plinth
#

it didnt work sad
@silver spear it's backround, not background-color

silver spear
#

lol

tight plinth
#

@fringe axle dont tell me its not your code

silver spear
#

ok

fringe axle
#

@fringe axle dont tell me its not your code
@tight plinth It's not my code

#

xD

warm marsh
#

background-color is for the color but background will do the exact same.

tight plinth
#

fucking

silver spear
#

ok

tight plinth
#

in this case

silver spear
#

how do i edit

#

bot page

tight plinth
#

if you want to really do discord bots

fringe axle
#

It's mine but

#

With a tutorial

#

;_;

solemn latch
#

Go to your bots page.
Click edit @silver spear

tight plinth
#

dont use tutorials

warm marsh
#

Mine with a tutorial

silver spear
#

ok

fringe axle
#

D:

silver spear
#

i clicked edit

tight plinth
#

the only 'tutorial" you can use is the official discorD.js guide

silver spear
#

and it brought me to this page

#

i cant edit it...

tight plinth
#

others r shit

solemn latch
#

You need to be logged in

silver spear
#

i am woo

tight plinth
#

only you can see this page

silver spear
#

wait nvm

#

lol

#

h1 {
background-color: lightblue;
}

#

that seems to be the right

#

because thats HTML

tight plinth
#

plz

earnest phoenix
#

html

#

?

tight plinth
#

background-color --> background

silver spear
#

ok

#

cool

tight plinth
#

and thats css, not html

silver spear
#

oh...

#

oof

tight plinth
#

put it inside <style> </style>

misty sigil
#

Hello

hazy sparrow
#

hi

misty sigil
#

Are variables shared between try and catch?

fallow ivy
#

My bit

tight plinth
#

plz

#

no link for ur bot

fathom meteor
#

yes pls no

earnest phoenix
#

Your "bit"

solemn latch
#

Is it a 1 or a 0

hazy sparrow
#

lul

misty sigil
#

its a 2 @solemn latch

cobalt spruce
#

my bot is hosted 24/7

#

@solemn latch

#

thank u

solemn latch
#

Quantum computing @misty sigil ?

misty sigil
#

indeed

summer torrent
#

how can I prevent return to stop the loop

misty sigil
#

@wet dove we got ads above

wet dove
#

@fallow ivy don't send ads in this server

#

we don't allow it

restive pebble
#

@midnight blaze thx

midnight blaze
#

@restive pebble ?

restive pebble
#

for the idea

#

i am working

midnight blaze
#

if you manage to do that

#

GG

restive pebble
#

yes

#

lol

midnight blaze
#

yeah, I thought it wouldnt be too hard, I mean, all you have to do is save screenshots and transform them into a gif

#

just dont make too many fps so performance is good^^

restive pebble
#

ill make it configurable

shy turret
#

on a bot page, I know how to change the <body> color though, but how do you change it for the description

solemn latch
#

Inspect element, get the class.
Then in css
.classname {
Stuff here
}

tight plinth
#

#botdescription iirc

solemn latch
#

O

#

That too

shy turret
#

i couldnt

.content {
  background-color: black;
}
tight plinth
#

.content on itself is nothing

shy turret
#

.longdescription .content {

#

?

restive pebble
#

does discord automatically makes the link into an attachment?

tight plinth
#

yes

#

does discord automatically makes the link into an attachment?
@restive pebble wdym

restive pebble
#

like if i sent an link

#

which contains an image

midnight blaze
#

test it out

#

?

restive pebble
#

ok

versed igloo
#

Is there a way for a bot to have a daily counter like its been x days since ive been created

tight plinth
#

yes it is

restive pebble
#

true

#

thats why discord is gay

solemn latch
#

The id of the bot is a snowflake, snowflakes have timestamps for when things are created @versed igloo

Or if you have the user, there may be a created at timestamp depending on the lib

midnight blaze
#

@restive pebble if you manage to do that gif command, it would be amazing. I dont think anyone else ever done something like that 🤔

versed igloo
#

Well it was just an example i really just need something like its been x days since Nintendo realeased a new game

restive pebble
#

restarting

#

kek

#

hope it works

solemn latch
#

Days since is pretty simple.

#

What are you doing @restive pebble

restive pebble
#

rendering html

solemn latch
#

Yeah not hard

midnight blaze
#

I will test it, let me know when u are ready

#

woo, he is doing animations, not only rendering html

solemn latch
#

Can easily be applied to html

midnight blaze
#

ok, good for you xD

versed igloo
#

Ok so how do I set up a days since

solemn latch
#

Gif encoder 2, combined with pupetter or any html renderer

#

Get the timestamps for each, get the difference.
Convert into days

midnight blaze
#

yeah, I see, you are very experienced in this field. Your bot is cool

versed igloo
#

Oh ok

shy turret
#

do iframes work for bot descriptions or..

solemn latch
#

Yep

shy turret
#

is preview just broken

restive pebble
#

pangloss

midnight blaze
#

yes?

restive pebble
#

i made a type error

midnight blaze
#

xD ok, np, take your time with your bot man

restive pebble
#

lol

hazy sparrow
#

Who knows a free bot hosting thingy which is NOT heroku

solemn latch
#

Glitch.
But they are taking down bots

hazy sparrow
#

Wdym

misty sigil
solemn latch
#

Its against glitch tos

hazy sparrow
#

Ah

midnight blaze
#

glitch isnt free anymore, they even blocked pinging your server

solemn latch
#

🤷‍♂️

hazy sparrow
#

so what do I use ;-;

solemn latch
#

Google and aws have some free trials

midnight blaze
#

wait, what is against tos ?

solemn latch
#

Pinging services

midnight blaze
#

how so?

solemn latch
#

When they banned them

#

They made it againt tos

midnight blaze
#

how is pinging your own server against tos

solemn latch
#

🤔

#

What

tired nimbus
#

how would you find the person who reacted in awaitReactions

solemn latch
#

glitch isnt free anymore, they even blocked pinging your server

#

They made it against tos when they did that

#

Pinging to make your website 24 7 without paying for their 24 hour service is against tos

midnight blaze
#

you mean this

#

you simply can not do it anymore

#

that is what I said

solemn latch
#

Yes

#

And they made it agaisnt tos

midnight blaze
#

I thought u were talking about discord for a second, sry^^

#

but it being against tos is not new

#

what new is that they blocked, so you are not able to do it

solemn latch
#

Hmm I wonder what they updated their tos for then

#

Because it happened the same day

#

🤔

empty badge
versed igloo
#

ok another quick question I have the last direct day now how do I have the bot do the equation than send the result

digital ibex
#

wdym?

#

you want it to do maths equations?

versed igloo
#

im trying to make a days since bot

still merlin
#

Check the docs

digital ibex
#

u want it to do math equations?

#

what equation

still merlin
#

I'm making a bot command called search, The search command is done but you need to catch it with a command but im not sure how to do it, It sends a random embed every time or a you found no hostile mobs, How would I make a catch command [discord.js v12]

versed igloo
#

like 7/20/20 - 9/10/19 = days since

digital ibex
#

what

versed igloo
#

those are dates

digital ibex
#

yes?

versed igloo
#

so i need how many days in between dates

digital ibex
#

use moment

restive furnace
#

@solemn latch library of code = better & safer glitch if you rly want free hosting

solemn latch
#

🤔

#

what

#

what are we talking about

solemn latch
#

o

#

i heard someone talking about it

#

the other day

digital ibex
#

probably me :p

austere vessel
#

hello I was wondering if you have two bots and the two bots have the same code, for example, .play, is there a way to prioritize one bot to the other to execute that command?

solemn latch
#

you own both bots?

digital ibex
#

no

brittle horizon
#

How to make a python discord bot on Android?

#

1 question....

#

Why is my nickname White_Devil

solemn latch
#

android isnt really a place to host a bot.
its possible, people do it, but it wont be a great choice

brittle horizon
#

@solemn latch ok

sleek wagon
#

android isnt really a place to host a bot.
its possible, people do it, but it wont be a great choice
I just tried doing that about 2hrs before I joined. Trust its a real pain

reef carbon
#
@commands.Cog.listener()
    async def on_dbl_vote(data):
        channel = self.client.get_channel(734610683718664203)
        embed = discord.Embed(
            colour=discord.Colour.purple(),
            description=f"{data}"
            )
        await channel.send(embed=embed)
#

this doesn't work and doesn't show an error

tight plinth
#

are you sure the webhook is properly setup'd ?

reef carbon
#

i need a webhook?

#

oof

#

i'll do that

#
@commands.Cog.listener()
    async def on_dbl_vote(data):
        async with aiohttp.ClientSession() as session:
            webhook = Webhook.from_url('https://discordapp.com/api/webhooks/734809239486464040/DfqCd8VQbsUxUcRY-a3JfB9xMDT0B3IJQ_5jdzsrzb96xVbzEC5d3bVGAc0pFmNyKL02', adapter=AsyncWebhookAdapter(session))
            embed = discord.Embed(
                colour=discord.Colour.purple(),
                description=f"{data}"
                )
            await webhhook.send(embed=embed)
#

will this work?

#

i can only vote every 12 hours

#

so I need to get it right @tight plinth

fierce wolf
#

hi i already done the a?avatar feature but idk how to do the a?avatar <your id> .

hoary lily
#

Hi can someone help me with my code?

#

This is my code

jsfile.forEach((f, i) => {
    let pull = require(\`./commands/${f}\`);
    client.commands.set(pull.config.name, pull);
    pull.config.aliases.forEach(alias => {
         client.aliases.set(alias, pull.config.name)
    });
});
#

It throws an error

TypeError: pull.config.aliases.forEach is not a function
at /storage/emulated/0/project-genesis1/index.js:25:23
at Array.forEach (<anonymous>)
at /storage/emulated/0/project-genesis1/index.js:22:9
at FSReqCallback.oncomplete (fs.js:163:23)

thin turret
#

ATTATCH_FILES includes sending images through embeds correct?

sudden geyser
#

It doesn't.

paper phoenix
#

@hoary lily - One of your jsfile doesn't have a defined alias array.

#
const { config: { aliases } } = pull;

const hasAliases = aliases && Array.isArray( aliases );

if( hasAliases )
  aliases.forEach( ...

Or cleaner:

( pull.config.aliases || [ ] ).forEach( ...

Or, if Node 14.* use optional chaining.

earnest phoenix
#

anyone here know how to make temp mute , even if i restart bot it still works?

opaque seal
#

what are you currently using?

earnest phoenix
#

mongodb

opaque seal
#

setTimeout()?

earnest phoenix
#

yes

#

hi?

opaque seal
#

Idk tbh

#

I think that big bots used setTimeout correct me if I'm wrong

paper phoenix
#

Timeout doesn't address bot restart

opaque seal
#

Ik but their bots usually don't restart

paper phoenix
#

They likely do

opaque seal
#

idk then

#

I don't really see another easy way to do that

heavy flame
#

so i am hoping to start workin on a bot, but was wonderin if anyone could help me figure out if my idea would be even possible

earnest phoenix
#

can someone help me here

 let sortSelection = { Money: 1 };

let test = bot.db.collection("Profiles").find()
test.sort(sortSelection).toArray(function(err, result) {
    if (err) throw err;
   console.log(result);
})
``` i want to just show the money not the user id ect.
opaque seal
#

so i am hoping to start workin on a bot, but was wonderin if anyone could help me figure out if my idea would be even possible
@heavy flame what's that

blazing stag
#

.

paper phoenix
#

@earnest phoenix - I would look into "Cron". There are great Cron packages designed to execute tasks (such as removing a mute) on a schedule that accept Date objects.

When someone is muted, I'd generate the Date they're to be unmuted, start a Cron job, and store the Cron syntax/string (or just the unmuted Date) in your DB. When someone is unmuted, remove it from the DB.

When the bot starts, grab all Cron jobs from your DB.

earnest phoenix
#

ok i will see

heavy flame
#

@opaque seal I write on a website as part of an RP group and we have several characters we each write, along with 'common places' to have characters, things for them to do such as this; sometimes we like to just let things be random for place or have a random activity happen; could a bot be potentialy written to allow for the imput of say two writer names (or one character and a writer, or just two characters) and the bot pick out a character and location and/or action? I know you would haev to program all the locations, actions, characters, and writer in if possiable, but could it be possiably set up to function that way?

Also appolagies before hand if that doesn't make any sense

earnest phoenix
#
(async()=>{
let sortSelection = { Money: 1 };

let test = await bot.db.collection("Profiles").find()
test.sort(sortSelection).toArray(function(err, lb) {
message.channel.send(lb)
})
})()
``` not working please help
lusty quest
#

@heavy flame this seems to be not so easy to make. but its possible

heavy flame
#

don't mind not easy so long as it seems liek something that /could/ work in theory

opaque seal
#

@heavy flame so, if I understood correectly, you want a "random" generator of specific things? If that's the case then yes it's possible

hoary lily
#

@paper phoenix thank you so much sorry for late response I'm trying to fix it. Thanks a bunch bruv

earnest phoenix
#

can ppl please help me

heavy flame
#

@opaque seal yep pretty much I supply part of the input and based on what i give the Bot it gives me the rest of the random back

opaque seal
#

Yeah sure

#

I don't think it would be hard to do

lusty quest
#

ohh just a "database " thats easy

#

or wait you want to generate a random place from snippets if i see it right?

earnest phoenix
#

someone please hwlp

heavy flame
#

shiny thanks much just wanted to make sure the whole concept didn't seem to out of reach cause sadly I'm only familiar with a few bots so not sure of their entire capacity

lusty quest
#

this could end in ML terretory

old pilot
#

someone please hwlp
@earnest phoenix with what

earnest phoenix
#

;-;

#
(async()=>{
let sortSelection = { Money: 1 };

let test = await bot.db.collection("Profiles").find()
test.sort(sortSelection).toArray(function(err, lb) {
message.channel.send(lb)
})
})()
``` this
old pilot
#

i can’t read

heavy flame
#

sortta like a data base I guess, but it would be one that I only fed part of the info too and it returned me random results for the rest where I have varrables of A, B, C, & D I give it say 2 As, 1 A & 1B, or 2 Bs and it returns me a random C and/or D

old pilot
#

sorry

earnest phoenix
#

;-;

cobalt eagle
#

Hey

#

I'm working on a "language" command for my bot, because it's in french and i want the users to be able to switch between french and english

sinful belfry
#

hang on

cobalt eagle
#

but the problem is, i don't know how to make it save the language for each guild (server)

sinful belfry
#

@earnest phoenix are you getting any errors?

lusty quest
#

@cobalt eagle use a database and store settings in there

earnest phoenix
#

@earnest phoenix show code

sinful belfry
#

@earnest phoenix in the console?

cobalt eagle
#

@lusty quest ok i'll try that

earnest phoenix
#

try catch

#

?

#

try{}catch() ??

#

@earnest phoenix

#
try{
code .. . . . 
}catch(e) console.log(e)
#

?

cobalt eagle
#

ok

#

how do i create a database lmao ?

earnest phoenix
#

@cobalt eagle goodle

#

google

cobalt eagle
#

do i really need to use the mysql thing ?

heavy flame
#

@lusty quest @opaque seal thank you both

earnest phoenix
#

@cobalt eagle yes

cobalt eagle
#

ok !

earnest phoenix
#

if u choosed mysql

#

and ?

#

huh

#

nope

lusty quest
#

@cobalt eagle there are many ways. you could use a json based database(not recommended) or SQLite or SQL or NO-SQL based DBs

sinful belfry
#

there are many databases to choose from @cobalt eagle

earnest phoenix
#

@lusty quest or maybe MongoDB

lusty quest
#

mongodb is NO-SQL

cobalt eagle
#

i'll go with mysql

earnest phoenix
#

what

#

@cobalt eagle ok

#

@earnest phoenix show cose

#

Code

#

Show me ur code

#

Yes

#

only the command file

#

ONLY the Command file

cobalt eagle
#

also, another question, i have command logs in the console, how can i put them in a file ?

earnest phoenix
#

The command file

#

@earnest phoenix

cobalt eagle
#

maybe it could copy the logs before closing the file

pure lion
#

Oh boy

solemn latch
#

you want each command to log to its own error file?

#

or?

pure lion
#

:l

earnest phoenix
#

oh u dont use command handler

#

nvm

#

idk dude

pure lion
#

Omg why don't you use a handler it's literally 4 lines

earnest phoenix
#

i am on mobile

#

maybe kater

#

later

#

@pure lion his Index is 200lines +

pure lion
#

:l

solemn latch
#

my index is 200+ lines and i have a command handler KEKW

earnest phoenix
#

So ur command handler is bad

solemn latch
#

440 lines rn with a command handler

#

nah

earnest phoenix
#

my index.js is 20 lines

cobalt eagle
solemn latch
#

you might be obsuring your code then christmasthink

cobalt eagle
#

i would want it to get stored in a file before i stop the bot

#

or restart it

twin marsh
#

My eval command doesn't seem to work anymore. When I eval "message.channel" or doesn't know what "message" is, while the bot is in a "try" function and in "index.js".

if (message.content.startsWith("!eval")) {
if (message.author.id !== "207557174660956160") { return; }
 try {

        let codein = args.join(" ");
        let code = eval(codein);
  

        if (typeof code !== 'string')
            code = require('util').inspect(code, { depth: 0 });
        let embed = new Discord.RichEmbed()
        .setColor(0x0078D7)
        .addField(':inbox_tray: Input', `\`\`\`js\n${codein}\`\`\``)
        .addField(':outbox_tray: Output', `\`\`\`js\n${code}\n\`\`\``)
        message.channel.send(embed)
         } catch(e) {
        message.channel.send(`🆘\`ERROR\` \`\`\`js\n${e}\n\`\`\``)
   

    }
}```
earnest phoenix
#

look my index

#

15 lines

cobalt eagle
#

@twin marsh first replace RichEmbed with MessageEmbed everywhere in the code

earnest phoenix
#

if he ise v11

twin marsh
#

no

earnest phoenix
#

then keep iy

#

iy

twin marsh
#

I'm in 11.6.4

cobalt eagle
#

update

#

and replace this

twin marsh
#

no

solemn latch
#

v11 will be depricated

twin marsh
#

It has always worked before

earnest phoenix
#

@twin marsh i think

#
args.slice(0).join(" ")
cobalt eagle
#

idk i were still in v11 and everything stopped working until i updated to v12

earnest phoenix
#

v11 untill october

twin marsh
#

idk i were still in v11 and everything stopped working until i update to v12
@cobalt eagle weird, my other bot, @ocean carbon is also still in 11.6.4 and functions completely normal.

earnest phoenix
#

Yo

#

It will work but no more future updates

#

How do i upgrade from discordjs 8 to disvordjs12

#

WHAT

#

DJS 8

twin marsh
#

discord.js 8?!

earnest phoenix
#

WTF

twin marsh
earnest phoenix
#

I have an very old project in my harddisk

twin marsh
#

starting from 9 to 12

solemn latch
#

why are you making a new collection for each command alias @earnest phoenix wouldnt it be better to have one for each command?

#

🤔

#

then check for aliases

earnest phoenix
#

nope

solemn latch
#

less memory efficent

#

and likly less processing efficent

earnest phoenix
#

hmmm

#

idk

#

What time is it for you

#

Its totally not in the picture

pure lion
#

😳

earnest phoenix
#

Ots 12.31 AM

#

Its

#

Getting offtopic here

topaz epoch
#

how to edit a embed ?

magic jackal
#

What would be the proper way to upload 150 emojis to a guild?

since the rate limit is kinda harsh

solemn latch
#

🤔

#

one by one

amber fractal
#

well you can upload multiple in the client at a time

#

it's just slow

#

cant bypass the ratelimit

magic jackal
#

so its really just the ratelimit being harsh to me

delicate shore
#

How to check

#

If my bot has specific perm

#

I wanna check if he has Manage emoji

#

Perm

pure lion
#

Uhhhh

pale vessel
#

read docs

pure lion
#

^

pale vessel
#

oop

pure lion
#

Reach for the docs

delicate shore
#

Client.hasPermission

#

But I am not sure

pure lion
#

Maybe

#

Why don't you try it and see

#

:)

pale vessel
#

no.

delicate shore
#

ok

ruby condor
#

hey is it possible to have a bot get an attachment url from an attachment put into a channel?

earnest phoenix
#

Yes

#

<message>.attachments

#

Its a collection

#

can anyone help me with my fucking leaderboard as i have no clue how to amke one and also tried @torpid forge code and doesnt work

ruby condor
#

wait

solemn latch
#

get the top things from your database

#

display them

ruby condor
#

i dont mean it UPLOAD something

pale vessel
#

you don't just use other people's code wtf

earnest phoenix
#

I know

#

Get the message

#

Then

ruby condor
#

i mean i post a picture of flowers

earnest phoenix
#

<message>.attachments

#

you don't just use other people's code wtf
@pale vessel no he was helping lmfao

#

you don't just use other people's code wtf
facts 100

ruby condor
earnest phoenix
#

Look at the object it returns

#

And get that url from it

ruby condor
#

ok

#

thanks

earnest phoenix
#

Np

ruby condor
#

sorry if my question seemed a bit "noobish"

earnest phoenix
#

Nah

#

so can anyone help me or not?

earnest phoenix
#

hwo

#

how

solemn latch
#

🤷‍♂️

pale vessel
#

stop being a help vampire and rely on other people to help you

solemn latch
#

in mysql its just ORDER BY X DESC

#

in whatever you use, its probably something else

pale vessel
#

he uses mongodb

#

thing is it worked for him but it returned as Object object and he got confused and said iT dIdn'T wOrK

earnest phoenix
#

fuck off

pale vessel
#

mk

solemn latch
#

if you use eris or discordjs, youve worked with object object before

#

🤔

earnest phoenix
#

dunno

sudden geyser
#

what do you mean by you don't know

delicate shore
#

@pale vessel and @pure lion i used msg.guild.me and it worked

pale vessel
#

yes since hasPermission is a member attribute

#

guild#me is your bot as the guildmember

delicate shore
#

ok

#

can i get your pfp?

pale vessel
#

yes feel free to

delicate shore
#

ok

pale vessel
#

my nitro will run out

delicate shore
#

i would troll my friends

pale vessel
#

please do

delicate shore
#

ok

#

but how can i get

#

your pfp

pure lion
#

😳

earnest phoenix
#

for bot verification

#

if you're under 18 do you need like a guardians consent or anything of the sort

solemn latch
#

dont think so

earnest phoenix
#

No

#

so i can just submit it on my own

#

yeah

#

well even if it did require guardians consent

lusty quest
#

you need to be in the legal age in your country to make contracts

earnest phoenix
#

uhh

#

13..?

#

in america?

#

legal?

#

yes? no?

lusty quest
#

depends on the country

slender thistle
#

Depending on your state starting from 18

lusty quest
#

but idk for the US

earnest phoenix
#

ok so i was right

#

you do need to be 18

lusty quest
#

in germany it was 15 IIRC

earnest phoenix
#

well sady i dont live in germany

#

well i mean even if i did

#

im not 15 either

solemn latch
#

you can get married in the us at 16

slender thistle
#

If you're below that, yeah, you need a guardian's consent

solemn latch
#

🤔

#

i mean

earnest phoenix
#

not for another 13 months

#

well no problem

amber fractal
#

doesnt matter when you can get married

earnest phoenix
#

yes

#

no

solemn latch
#

marriage is a contract is it not?

earnest phoenix
#

it is

amber fractal
#

it's about when you can sign a binding contract without the consent of a parent

earnest phoenix
#

so 18

#

well

#

i mean

#

not in all places

lusty quest
#

18 to make sure. but you could google it

amber fractal
#

It's 18 minimum in the US

solemn latch
#

is it?

slender thistle
#

Varies for each state

solemn latch
#

^

slender thistle
#

May vary*

amber fractal
#

but no state is lower than 18

#

that's a federal thing

#

this is US only

lusty quest
amber fractal
#

other countries have different ages of majority

earnest phoenix
#

OK

#

so im still CONFUSED

#

what age do i have to be to get verified

#

I am a 13 year old male who will turn 14 in about a month and a half

#

is that good enough?

#

with guardians consent?

slender thistle
#

Aye

#

Below 13 is a no no
13-XX (legal age in your state) is a yes with guardian's (official?) consent
XX-YY is a big yes

solemn latch
#

honestly, contact discord support

misty sigil
#

i did that

#

and they said just get my parents to make an account

#

and then just get them to verify it mmulu

earnest phoenix
#

does it have to be parents?

#

my parents wouldn't trust discord 100%

misty sigil
#

parent/guardian

earnest phoenix
#

but my sister who is 20 years old would for sure

#

ok

#

phew

slender thistle
#

Official guardian

earnest phoenix
#

im good

solemn latch
#

sisters are not typically legal guardians

slender thistle
#

I don't think sister counts as official guardian

earnest phoenix
#

bruv

#

idc

slender thistle
#

Yeah

earnest phoenix
#

above 18

#

nah jk

#

oh i know

#

why is my IQ so high guys

misty sigil
#

unless they physically are listed as your guardian

#

ask your parents if she is

earnest phoenix
#

well i mean

#

she's done my school things instead of my parents

#

you know

#

the things where they're like

#

"ask ur parents or guardian to sign this this and that"

#

so

#

someone still needs to explain why my IQ is so high

misty sigil
#

it's probably alright

earnest phoenix
slender thistle
#

If your school accepted that, Discord might as well, but there's no real guarantees

earnest phoenix
#

also i dont get it

#

why is discord doing this?

#

things were fine just the way they were before verification

solemn latch
#

to protect themselves legally

#

more than likely

slender thistle
#

Oh this is development

solemn latch
#

no wait shiv

#

youll kill the conversation

slender thistle
#

muahaha

earnest phoenix
#

its ok

#

im pretty sure the conversation ended

#

['cooldowns', 'rateLimit'].forEach(x => bot.x = new Map()); doesn't create new Maps and I don't understand why not.

slender thistle
#

It literally overwrites bot.x

pale vessel
#

bot.x is literally bot.x, try bot[x]

earnest phoenix
#

thanks guys, it workes 👍

#

help

#

how i can parse String to Boolean

#

"true" to true

#

how

lusty quest
#

in what context?

#

usually node should recocnize them as boolean

thin turret
#

Can A Command Called "Spinbottle" fall under NSFW even though its not aimed to be a lude command

earnest phoenix
#

ok

balmy raptor
#

hi guys, without coding knowledge i'm trying to start fresh creating a bot and following the steps. but i stuck at the command part which i need to put "npm init -y" so i can download discord.js through NPM, any help please?

earnest phoenix
#

install node

tight plinth
#

You need to install node.js

earnest phoenix
#

one QA

#

@balmy raptor this might come off as rude but you need to hear this, i suggest you learn programming first because your gonna always run into errors without knowing how to solve them you're gonna need to learn how to use NPM and you're gonna need to learn what an API is and how to read documentations

#

after that you can start bot dev

#

if i have
bot.guild.get(message.guild.id).logs is true
so how i can change it to false

#

bot.guild.get(message.guild.id).logs.push(false) ?

ebon junco
#

Hello!!

still merlin
#

Hi?

hazy girder
#
@client.event async def on_message(self, message): 
if message.content == "<@643881402227621898": if message.guild.name:
await message.channel.send(f'Hi there. I am {self.user}. Current prefix is of {message.guild.name} is `-`') else: 
await message.channel.send(f'Hi there. I am {self.user}. Current prefix is of {self.user} `/` or mention prefix.') 
#

i got this error

app[worker.1]: await message.channel.send(f'Hi there. I am {self.user}. Current prefix is of {message.guild.name} is `-`')
app[worker.1]: IndentationError: expected an indented block
#

why

earnest phoenix
#

@earnest phoenix = false ?

digital ibex
#

its not an array, why would u use push?

proven lantern
#

when cloudflare had that issue my discord bot went offline and didn't come back online until i manually restarted the service. does discord.js not auto reconnect?

digital ibex
#

the issue wasn't with discord, the app was down. so there was no way for it to reconnect to the non-existent websocket

proven lantern
#

so it will only reconnect to the same socket?

digital ibex
#

and yeah, discord does auto-reconnect by default, unless you manually changed it in the clients options

#

im not too sure, but i dont think so

#

wait

#

yes

#

it does

#

my js websocket connects to the same one everytime anyways, so im guessing its the same with discords

proven lantern
#

https://discordapp.com/api/auth/login this is the url that my app was having issues with when cloudflare went down

#

i guess it was trying to reconnect and couldn;t

#

it only tried once though

digital ibex
#

@hazy girder python forces you to indent your code, press tab on ur keyboard before both await message.channel.send

dreamy cedar
#
 if(!mutedRole) {
      
      message.guild.roles.create({
        data: {
          name: 'Muted',
          color: 'BLUE', 
        }
      })
      let mutedRole = message.guild.roles.cache.find(x => x.name === "Muted")
     
         message.channel.overwritePermissions(mutedRole, {SEND_MESSAGES: false })
      
    }

i want to add muted role to text channel permission
but it didnt work where is the problem please

proven lantern
#
        data: {
          name: 'Muted',
          color: 'BLUE', 
        }
      }```
#

remove data

#
          name: 'Muted',
          color: 'BLUE', 
        }```
#

oh

pure lion
#

@earnest phoenix just use == and not ===

dreamy cedar
#

the command create the role but didnt add it to channel permissions

proven lantern
#

also await the message.guild.roles.create

dreamy cedar
digital ibex
#

why not the === ?

#

if anything, you should use === instead of ==

#

most cases anyways

proven lantern
#

use updateOverwrite instead

#

message.channel.updateOverwrite(mutedRole, {SEND_MESSAGES: false })

fathom patio
#

so i have this code

  1 import dbl
  2 import discord
  3 from discord.ext import commands
  4 import asyncio
  5 import logging
  6 class TopGG(commands.Cog):
  7     """Handles interactions with the top.gg API"""
  8 
  9     def __init__(self, bot):
 10         self.bot = bot
 11         self.token = 'token' # set this to your DBL token
 12         self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
 13 
 14     @commands.Cog.listener()
 15     async def on_dbl_vote(self, data):
 16         print("HIHIHIHIHI")
 17 
 18         logger.info('Received an upvote')
 19         print(data)
 20 
 21 def setup(bot):
 22     global logger
 23     logger = logging.getLogger('bot')
 24     bot.add_cog(TopGG(bot))
``` and when i go to test it by upvoting, nothing happens anyone have any idea why?(password and token are replaced)
proven lantern
#

          name: 'Muted',
          color: 'BLUE', 

      })```
dreamy cedar
#

ok ill try

misty sigil
#

You press test, don’t upvote @fathom patio

digital ibex
#

are you getting any errors?

fathom patio
#

press test?

#

nope no errors @digital ibex

#

@misty sigil wdym by test?

digital ibex
#

print something at the top of the listener, check if anything logs

fathom patio
#

wdym at the top of the listener?

digital ibex
#

oh wait mb. sorry

#

does the hihihihi

#

log?

fathom patio
#

nope

trail trout
quartz kindle
#

show your code

obtuse jolt
#

would this work in php?

digital ibex
#

is line 7 even valid syntax?

#

thats not php

obtuse jolt
#

it is

#

php

digital ibex
#

oh mb

#

i got it mixed up with sql

quartz kindle
#

need more context

#

doesnt look like valid php

trail trout
obtuse jolt
#

well $yes is a guild object

#

$yes->id is the guilds ID

#

and im getting the data from my sql database

#

the one called guildconfig

proven lantern
#

what does $yes->id do? is that how properties are accessed in php?

obtuse jolt
#

the result and guild i havent gotten to yet

quartz kindle
#

you're trying to define a double variable

#

$variable = "something", "somethingelse" is not valid

obtuse jolt
#

the id thing works

#

how do you do it in php

quartz kindle
#

you're not even using the $serv variable anywhere

obtuse jolt
#

ITS NOT FINISHED

digital ibex
#

chill....

quartz kindle
#

lol ok

obtuse jolt
#

ive only just added the select * thing

quartz kindle
#

anyway what database wrapper are you using? mysqli?

obtuse jolt
#

i have no idea some mysqli code works and some doenst

#

i dont get it

#

i guess

obtuse jolt
#

wow this is gonna be confusing

#

do i even need it for a SELECT *

#

statement

fathom patio
#

is there anyway to get upvotes without using a webhook?

digital ibex
#

no

quartz kindle
#

@trail trout those promises are static, they are never updated. everytime you run the postStatistics function, you will be posting the same number as before again

#

also, should be client.shard.ids[0]

#

also, you're basically sending a duplicated server count

#

if you send the shard information, it expects the server count for that shard only

#

not the server count for all shards

obtuse jolt
honest perch
#

my eyes

obtuse jolt
#

it doesnt work

quartz kindle
earnest phoenix
#

yo

#

any bot developer

#

i need help

slender thistle
#

-ask2ask

gilded plankBOT
#

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

earnest phoenix
#

lol

obtuse jolt
#

lol

earnest phoenix
#

screen

#

got

#

nulled

obtuse jolt
#

@quartz kindle none of them work

#

LOL IT TAKES SO LONG

#

maybe not do it 100 times

quartz kindle
#

if you're doing multiple operations, use transactions

#

or just have it the database do it for you if possible

#

for example SELECT * FROM bla WHERE id IN (array of all guild ids you want to fetch)

obtuse jolt
#

i think i know how i can make it not as slow

#

i mean

#

its not as bad

quartz kindle
#

btw if you're just starting, better go for PDO than mysqli

#

save the pain of switching later

earnest phoenix
#
            if (bot.guild.get(message.guild.id).logs == 'true') {
#

this is not working

obtuse jolt
#

frick now i have to check if the bots in the server

earnest phoenix
#
Map(1) { '701141875628834906' => { prefix: '/', logs: 'false' } }
obtuse jolt
#

this website is gonna take like 60 years for people with hella slow internet

quartz kindle
#

bot.guild is not a thing

earnest phoenix
#

this is bot.guild

#

it is a Map()

quartz kindle
#

ah you defined it yourself

earnest phoenix
#

yes

#
            if (bot.guild.get(message.guild.id).logs == 'true') {

but idk why this is not working

quartz kindle
earnest phoenix
#
Map(1) { '701141875628834906' => { prefix: '/', logs: 'false' } }

this

quartz kindle
#

thats bot.guild

#

log the get result

earnest phoenix
#
{ prefix: '/', logs: 'false' }
#

this

quartz kindle
#

if thats the actual result, then it should work

earnest phoenix
#

hmm let me try again

#

nope

#

@quartz kindle not working

knotty steeple
#

hi what client/driver should i get for postgres

amber fractal
#

just a question why are you using strings over booleans?

knotty steeple
#

node.js

#

but then there is pg

stuck scaffold
knotty steeple
#

ratelimit

#

probably

digital ibex
#

F

crystal socket
obtuse jolt
knotty steeple
#

ok are u being serious

digital ibex
#

read the docs?

knotty steeple
#

if not go in shitpost

#

it says how on the readme

obtuse jolt
#

im making my website if you decided to take 5 seconds to look up in the chat

crystal socket
#

is this the easiest way to check if a number is odd?

#

is there a easier way

#

this seems like the right way cause it has 121m downloads

knotty steeple
#

no

#

its the stupid way

digital ibex
#

npm downloads is fucked

knotty steeple
#

int % 2 !== 0

crystal socket
#

wait what

#

its that easy?

ebon kelp
#

yup

digital ibex
#

its like very inaccurate

crystal socket
#

then why is there a library with 121 million downloads

#

its got to be more than that right?

knotty steeple
#

because js devs are stupid

digital ibex
#

im talking about the amount of downloads

#

lol

#

it probably has something like 100k

knotty steeple
#

its weekly its obviously not going to be accurate

#

int % 2 !== 0
changed it

crystal socket
#

ok so how do i check if a number is even then?

knotty steeple
#

what i did before

#

int % 2 === 0

crystal socket
#

what does the % sign mean?

digital ibex
#

hahaha lmfaoo

#

the source code

earnest phoenix
#

Lol

knotty steeple
digital ibex
#

funniest shit i've seen kek

quartz kindle
#

you dont even need the ===

knotty steeple
#

mmm

quartz kindle
#

yup

digital ibex
#

this is probably gonna sound dumb

#

but

#

is there a maker thing to make tos? like with licenses there is

obtuse jolt
quartz kindle
#

there are many tos and privacy policy generators

digital ibex
#

ohok

knotty steeple
#

oh yea also

quartz kindle
#

many are pretty basic, but offer customizability for a small fee

knotty steeple
#

i want to use that postgres package since it seems simple and nice bug pg seems to be better

quartz kindle
knotty steeple
#

smfh

digital ibex
#

why thank you mr tim

unique shore
#

does anyone know why sometimes my bot stops connecting to my database? I'm hosting the bot on heroku and using mlab to host the database everything works fine for days and then suddenly the database keeps throwing a timeout error, I then restart the bot and everything works again, why does this happen?

opal plank
#

im going to blindly point fingers at heroku since heroku IS NOT a bot hosting service and shouldnt be used for such

unique shore
#

really? that's like the most popular option I've seen, they run node and the bot is written in node, what's the issue?

digital ibex
#

heroku isn't for websockets

cunning gorge
#

Is there anyway to do this? Im trying to have a health bar made with emotes
I want to repeat the emote based on the health for example:
❤️ ❤️ ❤️ ❤️ ❤️ for full health
❤️ ❤️ depending on the rage

So in otherwords, is there a way to repeat the emote based on a number?

#

Without having to do if statements

opal plank
#

js?

#

if its js just repeat string

#

'hello world!'.repeat(N)

#

@cunning gorge

cunning gorge
#

yes js

unique shore
#

so what's the alternative? I'm hosting it there cause it's free

opal plank
cunning gorge
#

wait its that simple, thanks! does it autojoin it?

unique shore
#

but if no other alternative is free I'll just restart the bot every few days

cunning gorge
#

for example if u do
'hello world!'.repeat(2)
does it respond
hello worldhello world?

opal plank
#

indeed

cunning gorge
#

Thank you!

opal plank
#

np

digital ibex
#

and good

unique shore
#

thanks @opal plank and @digital ibex

earnest phoenix
#

i figured out how to make clock

opal plank
earnest phoenix
#

for temp mutes

#

and temp bans

digital ibex
#

np

earnest phoenix
#

i can save temp mutes for months

#

😄

#

xD

digital ibex
#

good 4 u

unique shore
#

@digital ibex for some reason I can't access their site

digital ibex
#

wdym?

unique shore
#

502 bad gateway

#

libraryofcode

digital ibex
#

the subdomain is beta

knotty steeple
#

good
bad gateway

unique shore
#

yeah still same error

digital ibex
#

uh

#

1 sec..

#

do u mind if i dm u the discord?

#

@unique shore ?

unique shore
#

yeah no problem

digital ibex
#

ok

cunning gorge
#

What do I need to add on:
member.id to find the username?

sudden geyser
#

what is member and what library are you using

cunning gorge
#

js

sudden geyser
#

That's a programming language; not a library.

cunning gorge
#
var member = message.mentions.members.first() || client.user
#

discord.js sorry

sudden geyser
#

member.id will return the member's user ID. If you want the username of the member, you should use member.user.username instead.

cunning gorge
#

thank you!

sudden geyser
#

your welcome, though your code may throw an error if it defaults to the client user instead.

earnest phoenix
#

I want to set like a status for my bot

#

But I’m not sure how

#

I’ve tried a few things like setPresence and that and it’s not working

opal plank
#

which lib?

sudden geyser
#

I assume you're using Discord.js

earnest phoenix
#

Yes

sudden geyser
#

How are you trying to set the presence at the moment

honest perch
#

@digital ibex how would i look if the user has perms for a specific guild

opal plank
earnest phoenix
#

Thank you

opal plank
earnest phoenix
#

Oh yes

#

1 more question

opal plank
#

sup

earnest phoenix
#

So the bot like

#

Sends the same message like spams

#

but when I get a new token it fixes it

honest perch
#

let serverinfo = req.user.guilds.filter((e) => e.id == req.params.id && e.permissions & 0x00000008)

#

works right?

opal plank
#

dont spam

digital ibex
#

idk, try it

earnest phoenix
#

So if I do d!help once

#

It sends the thing more than once

opal plank
#

show code

#

cant help without seeing it

honest perch
#

yes it does

#

i have iq

#

yes

opal plank
#

if its big, put it on hastebin

digital ibex
#

ok

earnest phoenix
#

I’ll send the code

opal plank
#

put it here

#

^^

earnest phoenix
#

When I regen the token it fixes it so idk why that is

digital ibex
#

btw lol

#

u can just do 0x08

#

not 0x00000008

#

lmfao

#

@honest perch

opal plank
#

its likely because you are triggering spam flags

digital ibex
#

but both work ig

earnest phoenix
#

Ok

#

Let me put the code one second

opal plank
#

aight

earnest phoenix
#

Do you need the main

#

Or the commands also

honest perch
#

@digital ibex it shows some other servers for some reason

#

so idk

opal plank
#

likely only command

earnest phoenix
#

Ok

digital ibex
#

how r u doing it?

opal plank
#

unless other commands also send multiple times

earnest phoenix
#

ya des Français

opal plank
#

then its likely the handler(assuming you got one)

earnest phoenix
#

All commands do it ye

opal plank
#

then send me the handler

earnest phoenix
#

Okay

cunning gorge
#

Question: for the repeat function
I have a duel command where if the health goes into the negatives they lose:
However, when im repeating the health emote its going to break if its in the negative.

Is there anyway to restrict it if its negative to no hearts but for the rest Math.ceil(health)?

honest perch
#

@digital ibex it shows some other servers if i do 0x08 but if i do 0x00000008 it works fine so if it works it works