#development

1 messages Β· Page 1714 of 1

carmine summit
#

now how do I fix this?

lament rock
#

roles is a Collection<string, Role>
Collection<K, V>.includes is not a function

#

if you strictly want a boolean for if the Collection has a key, use Collection.has(key)
Where key in this case would be the role ID

carmine summit
#

had set key to the string id role

lament rock
#

what is the value of the reference which displays as (intermediate value)
log it to the console to find out

#

oh wait

#

it would be roles.cache.has

#

I keep forgetting v12 changes since I use v11

sudden geyser
#

yucko

#

github previews look a lot better

quartz kindle
#

agree

earnest phoenix
#

how do i make this work?

ancient gulch
#

Hello, i'm trying to add a verification to one of my events, but didn't found a way to do it.

In my guildMemberUpdate.js everytime a role is added/removed to a member, i save it into a collection with the role name + guild name and the list of members with the role, it look like
client.backup.set(guild.id + role.id, userdata)

[
{ memberID: '77288827', roleID: '737838838' }, 
{ memberID: '7377927', roleID: '737838838' }
]

and in my roleDelete.js I made that from 2 role delete it recreates the role and it gives it to the person who had it, except that with 1 role it works perfectly, but with 2 role, it takes the members of the 2 array and I know not how to check since the role id to recreate is different from the one in the collection

My roleDelete.js

// Annulation des modifications
            await backup.map(async r => {
                const data = {
                    name: r.role.name,
                    color: r.role.color,
                    position: r.role.rawPosition,
                    permissions: r.role.permissions,
                    hoist: r.role.hoist,
                    mentionable: r.role.mentionable
                }
                var oldRole = await guild.roles.create({ data: data, reason: 'Anti-Role Enabled' })


             
                    let results = client.backup.get(guild.id + role.id)

                    results.map(m => {
                        guild.members.cache.get(m.memberID).roles.add(oldRole.id)
                    })
            })

Sorry for my english i'm french
The error come from results.map() he doesn't check if the new role id is the same as the deleted role, but it can be the same

sudden geyser
near igloo
#

you dont need to fetch

#

message.member

#

returns member obj

quartz kindle
#

also, id is already a string, no need for toString()

#

also fetch returns a promise, Promise.roles is undefined

cosmic forum
earnest phoenix
#

so i changed it to this but it doesn't work either

near igloo
#

but yes what you said

earnest phoenix
quartz kindle
#

well i started with "also", meaning to complete what you already said

#

:3

#

if there are 3 wrong things, i like pointing them all out, even if one fix would fix all 3

near igloo
#

what am i doing wrong this time freerealestate

#

there i fixed it by initalising it before the switch

#

dont get what was wrong tho

ancient gulch
#
Channel#updateOverwrite(message.guild.roles.everyone, { MANAGE_WEBHOOKS: false, MANAGE_CHANNELS: false, MANAGE_PERMISSIONS: false });

MANAGE_PERMISSIONS doesn't work, what is the correct setting?

tacit sequoia
#

MANAGE_ROLES ?

ancient gulch
tacit sequoia
#

πŸ‘

near igloo
#

someone help its saying cant convert from a type to the exact same type

#

da fuq

lyric mountain
#

That's not the same type

round cove
#

I return

near igloo
#
        resultArray = strictProbability(results, amount, batches, limit, bottom);

        for (int i = 0; i < resultArray.size(); i++){

            count = count + resultArray[i];

            std::cout << count << '\n' << resultArray[i] << '\n';

        }

        resultString = std::to_string((count/resultArray.size())*100) + "%";``` if result array has 3 floats of approx 1/3 shouldnt i not get a huge number printed out
round cove
#

I see C++ issues

#

lmfao

near igloo
#

c++ is difficult

round cove
#

Show us your function declaration for quantity

near igloo
#

rn i dont get why its adding wrong

round cove
#

Resultarray is a vector isn't it lol

near igloo
#

it is

#

i figured out the issue

#

count is an int

round cove
#

yes

near igloo
#

c++ gets funky when you put random shit into an int

round cove
#

it's not random tho

#

It just truncates

#

anywa learn ranged for loops with vectors

#

Like js

#
for(auto v: resultArray) {
  count += v;
}```
near igloo
#

interesting

#

dont have time rn

#

i gotta finish this

#

record and edit a video on it

#

shower

round cove
#

what lmao

near igloo
#

and show up for my class in 2 hrs

fierce ether
#

can you make a element fade out by id?

cinder patio
#

Make sure to give us some credit lmao

#

uuh doesn't that method only support Query Params

#

like ?a=...&b=...

#

make sure the content type is set to url encoded too

blissful coral
#

@slim heart you on?

#

or anyone who uses ts

slim heart
#

yeah?

blissful coral
#

I can't create a set

#

ts is yelling at me

slim heart
#

error and code

blissful coral
#

installed @types/node didn't fix it

slim heart
#

did you restart ts server?

blissful coral
#

tsc

#

Right?

slim heart
#

no

blissful coral
#

wdym then

slim heart
#

restart vscode

blissful coral
#

kk

true grove
#

hello

lavish bramble
#
if(message.content === "-fact"){
		let f = args.join(" ")
		if(!f)
		return message.channel.send("pls verify args")
		
		const facts = Math.floor((Math.random() * activities.length))
		message.channel.send(`**${f}** :- ${activities[facts]}`)
	}

It's giving me an error args not defined!

cinder patio
#

The error is telling you what's wrong

#

and it should be obvious to you how to fix it

lavish bramble
#

I have tried everything

#

But fale

true grove
#

hi

long crow
#

Hi

delicate shore
#

I am trying to connect my package to github repo

#

This is the errorr I get

near stratus
#

did you do npm publish ?

delicate shore
#

yes

near stratus
#

show your repo field in package.json

delicate shore
#

nvm

#

yes

#

that was the problem

#

I fixed it

#

works now!

near stratus
#

...

#

npm loves you

delicate shore
#

but

#

it still doesn't show up on my repo

#

wait it does now

#

wait

#

I didn't add this

#

was it important?

still sky
#

Does it ok when development starts with publishing?

#

path of executor for cli commands

delicate shore
#

wait

#

so now I have 2 packages?

#

one is named random-stuff-api

#

and other is @pgamrexdev/random-stuff-api?

#

because this

earnest phoenix
#

i want this https://cdn.discordapp.com/attachments/serverid/channelid/file.png link to link

cinder patio
#

Rust question:
I have this field of a struct:

pub on_output: &'a dyn Fn(i32, OutputType)

but how do I call it?

self.on_output(...);

gives me a field, not a method error

#

ok

#

wtf

#

(self.on_output)(...) works

modest maple
#

Type overloading tm

#

Or well

#

Funky attr logic

#

If you have a field you can make a function called the same thing

#

Rust decerns the two same named attrs via the call

#

With more advanced impls this can also become many functions on one name creating that type overloading style

cinder patio
#

I see

#

it makes sense

modest maple
#

The (self.attr)() is basically telling the rust compiler, trust me its a normal attr that im just calling

#

Interesting callback thoufh pithink

cinder patio
#

I'm writing a befunge interpreter :x

modest maple
#

Its alright for simple stuff ig

#

If i had more callbacks or tbh i would still do it to stop lifetime issues should you want to pass the struct around

#

Make a trait

cinder patio
#

ooh that's a good idea

#

hmm how can I ensure that the trait is implemented

modest maple
#

Just have it as a impl foe the type

earnest phoenix
#
      url = message.attachments.first() || message.Attachment.proxy_url```
```TypeError: Cannot read property 'proxy_url' of undefined```
modest maple
#

F: Trait

#

fn foo<T: Boo>()

earnest phoenix
#

anyone help me plz

prime glacier
#

`throw new DiscordAPIError(request.path, data, request.method, res.status);
^

DiscordAPIError: Invalid Form Body
embed.description: This field is required
at RequestHandler.execute (/home/ubuntu/secret/node_modules/discord.js/src/rest/RequestHandler.js:154:13)

`

still sky
prime glacier
fierce ether
#

req.client.states[req.query.state] any reason for it to return Cannot read property 'no' of undefined

earnest phoenix
#

How to write out a custom emoji?

#

with js

prime glacier
still sky
earnest phoenix
earnest phoenix
#

?

prime glacier
earnest phoenix
#

this

prime glacier
#

yeah

earnest phoenix
#

BRUH

prime glacier
#

remove > maybe

earnest phoenix
#

then what is this const emoji=message.guild.emojis.cache.get('793555548196700221');???

earnest phoenix
prime glacier
earnest phoenix
#

i have 10 command

slender thistle
#

message.attachments

earnest phoenix
#

i need attachments url to url

still sky
#

Array of urls?

earnest phoenix
#

like https://cdn.discordapp.com/attachments/272764566411149314/833943669920497674/Screenshot_2021-04-20_at_11.24.18_AM.png attachments

#

url

#

got?

#

@still sky

#

like me send image attachments link

#

not bot send

#

bot need fetch my link/url

prime glacier
still sky
#

If you dont have message.attachment.first() then there is no attachments i think

earnest phoenix
#

this only work with uploaded attachment

#

@still sky

#

not attachment link

still sky
#

not attachment link You mean where user just sends link?

earnest phoenix
#

like https://images-ext-2.discordapp.net/external/pibLYeIxFOk59uEuxQgcRQ95cUf7P1uoeY2aOOCLiEI/%3Fwidth%3D224%26height%3D300/https/media.discordapp.net/attachments/815951481823297569/833948438244098058/34d051688ea8d1019506802362bfd5a9.jpg or https://cdn.discordapp.com/attachments/272764566411149314/833943669920497674/Screenshot_2021-04-20_at_11.24.18_AM.png

still sky
#

Then you should parse message.content or message.embeds[].url if its exist

waxen bough
#

im not assigning CaseType but its enum members

earnest phoenix
#

@still sky

#

i need work with link or both

#

got it?

#

i using if (message.channel.id !== "815951481823297569") return; if (message.author.bot) return; var url; url = message.attachments.first() request(url, async function(err, res, body) { if (err !== null) return;

still sky
#

You need to test message for all kinds: attchmts, urls, embeds to be sure

earnest phoenix
#

i need without embed

#

yay

#

i did it

#

it write out custom emoji

#

const emoji=client.emojis.cache.get('793555548196700221').toString();

earnest phoenix
#

@earnest phoenix hey listen

earnest phoenix
#

I Know U Maded Happy Bot But How Did U Done That Vote Data Sending On Discord Using A Webhook?@earnest phoenix

earnest phoenix
#

weit

#

Its For Js I Guess

#

u need top.gg api "uske lie tera bot wha hona chahiye"

earnest phoenix
#

weit

#

@earnest phoenix ^

#

@earnest phoenix what is 'dbl_token' And /dblwebhook?

#
if(command === "troll") {
  if (message.channel.type == "dm") return;
  message.channel.bulkDelete(1);
  const emojie=client.emojis.cache.get('808733922376548402').toString();
  message.channel.send(emojie);
  }``` 
error:
const emojie=client.emojis.cache.get('808733922376548402').toString();
                                                            ^
TypeError: Cannot read property 'toString' of undefined
#

But why it cannot read?

earnest phoenix
waxen bough
#

get('id')?.toString() -- for node 14 above

earnest phoenix
#

got?

#

top.gg bottoken and bot token are different?

#

yup

#

@livid jackal go corona πŸ˜‚

#

Hm

#

I Hope My Bot Verify Soon

#

;_;

#

@earnest phoenix can u come vc

#

ok

#

which onem

#

done

earnest phoenix
#
      throw new DiscordAPIError(request.path, data, request.method, res.status);
            ^

DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (C:\Users\user\Desktop\discordbot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async RequestHandler.push (C:\Users\user\Desktop\discordbot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
  method: 'post',
  path: '/channels/831498979736813578/messages',
  code: 50006,
  httpStatus: 400
}```
#

bruh

still sky
#

?. returns undefined on fail, you can't send undefined

earnest phoenix
#

@earnest phoenix *

waxen bough
earnest phoenix
#

hmm

waxen bough
#

you should check if get('id') will return undefined

earnest phoenix
#

and can you tell me how? : )

waxen bough
#

you should do something like if(!emojie) return

earnest phoenix
#

thx

tepid agate
#

Why This Is Error?

zenith terrace
#

read the error

earnest phoenix
#

await must be in async

zenith terrace
#

yes

tepid agate
#

Ohh Ok

earnest phoenix
#

wait

#

bruh

#

i can't write out 808733922376548402 emoji but i can the 793555548196700221 emoji

#

:/

orchid lodge
#

can someone help me with my member count command?
Whenever i run it it will say undefined members heres the code


module.exports = {
    name: "membercount",
    description: "test command",

    async run (client, message, args) {


        const membercount = new Discord.MessageEmbed()
        .setColor('#0099ff')
        .setTitle(`There are ${message.guild.membercount} members!`)
        .setTimestamp()
        
        


        message.channel.send(membercount);
    }
}```
waxen bough
#

memberCount

orchid lodge
#

oh

waxen bough
#

camelCase

orchid lodge
#

hey it works now

waxen bough
#

enough testing for today

dusky lagoon
#

Cannot access 'client' before initialization i keep getting this error suddenly

waxen bough
cinder patio
#

const x = x

quiet topaz
#

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

async function getVidDesc(vidId=["dQw4w9WgXcQ"]) {
                        var retA = [];
                        var retB = [];
                    

                        vidId.forEach((v,i)=>{
                            retB[i]=ytdl.getBasicInfo(v);
                        });
                        return retB
                       
                    };

getVidDesc(seResIds).then((vv)=>{Promise.all().then((v)=>{
                            console.log(v);
                            v.forEach((va,i)=>{
                                seRes[i]=seRes[i].replace("%desc",va.videoDetails.description)
                            })
                        }).catch((err)=>console.error(err))
#

why

#

like i get the error at the line wih promise.all

waxen bough
#

wait what Promise.all()?

quiet topaz
#

oh

#

yea

woeful pike
#

guessing code goes brr

quiet topaz
#

i see

waxen bough
#

you didn't even pass arguments

quiet topaz
#

i notcced

#

now it works

#

i just noticed

modest maple
#

How does one update nodejs on Ubuntu

#

/ whats the latest nodejs version

near stratus
#

15 I guess

modest maple
#

Hmm

#

Im on v10 bloblul

near stratus
dusky lagoon
#

This is my command handler but im still trying to add aliases

const Discord = require('discord.js');
const client = new Discord.Client();
const { prefix } = require("../config"); // Load the config file

module.exports = class {
    constructor(client) {
        this.client = client;
    }

    async run(message) {
        // If the message author is a bot
        if (message.author.bot) {
            return;
        }

        // bind client
        let client = this.client;

        // Check if the bot was mentionned
        if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
            // return prefix info
            return message.reply("My prefix is " + prefix);
        }

        // Gets the prefix
        let prefix1 = getPrefix(message, prefix);
        if (!prefix1) {
            return;
        }

        let args = message.content.slice((typeof prefix === "string" ? prefix.length : 0)).trim().split(/ +/g);
        let command = args.shift().toLowerCase();
        let cmd = client.commands.get(command);
        if (!cmd) return;

        try {
            cmd.run(message, args);
        } catch (e) {
            console.error(e);
            return message.channel.send("An error occured ...");
        }

    }
}

/* Gets message guild prefix */
function getPrefix(message) {
    if (message.channel.type !== "dm") {
        if (message.content.startsWith(prefix)) {
            return prefix;
        } else {
            return false;
        }
    }
}``` can someone help??
quiet topaz
#

instead of matching with regex

#

and when you match with regex you dont need to do new Regex but you just can do .match(/regex here/)

exotic lotus
#
let ping = Date.now() - message.createdAt;
return message.channel.send(`Bot Ping: ${ping}`)```
How do i add db ping in this
Im using mongodb
still sky
#

Seems like you didn't set ('help', ...)

exotic lotus
#

How?

still sky
#
const start = Date.now()
// async request
const ping = // calc somehow
tepid agate
exotic lotus
#

okk

#
let start = Date.now();
let user = await User.findOne({id: message.author.id})
let end = Date.now();
let ping = end - start;
return `DB Ping: ${ping}`
``` Is this good?
still sky
# tepid agate How?

I see you assign all commands above client.commands.set(cmd.name ... and help command doesn't pass here

exotic lotus
#

@tepid agate u should Delete this image

#

Your token is visible in that

#

Its dangerous to reveal your token in public

waxen bough
#

time to reset

#

as soon as possible

rustic nova
#

@tepid agate reset your token

#

right now

exotic lotus
waxen bough
#

if getting help please only include enough code to determine problem

#

and hardcoding bot token is not a good idea

quiet topaz
#

so how can i pipe a videostream (ytdl) to http response in node js

quartz kindle
#

stream.on("end", () => res.end());
stream.pipe(res)

quiet topaz
#

my code```js
res.writeHead(206, "", { "content-type": "video/mp4" });
var stream = ytdl(whatGetArrKey["v"], { "quality": "highest"})
stream.on("end", () => res.end());
stream.pipe(res);

quartz kindle
#

try adding a content-length header

quiet topaz
#

is the content-l3enth header in seconds?

cinder patio
#

It's in bytes lol

quiet topaz
#

how do i get the bytes?

#

nvm

cinder patio
#

I mean, you can't really know the size until the stream ends, no?

quiet topaz
#

hmm

#

but then how can i set it to the header?

#

my code is ```js

ytdl.getInfo(whatGetArrKey["v"]).then((v1) => {

                        var stream = ytdl(whatGetArrKey["v"], { "quality": "highest"})
                        res.writeHead(206, "", { "content-type": "video/mp4", "content-length":stream.readableLength});
                        
                        stream.on("end", () => res.end());
                        stream.pipe(res);
                       
                    }).catch(console.error);
sinful trellis
#

Can someone please help me keep my bot online?

quiet topaz
cedar crow
#

get a stable host

tacit sequoia
#

Know how a program works

sinful trellis
quiet topaz
#

yeah

sinful trellis
#

But when I go to bed I have to close it.

#

My timing is Kuwait Timing.

cedar crow
quiet topaz
#

well then dont host it on your pc

tacit sequoia
#

Its never suggested to host your bot on a PC

quiet topaz
cedar crow
sinful trellis
#

Will it still work if my laptop on lock mode?

quiet topaz
#

like what could happen if i host it on my pc

tacit sequoia
#

Well first it takes performance, if it turns off bot turns off, and if you lose power your bot turns off

#

Essentially your bots uptime depends completely on your PCs uptime

#

Which is honestly a waste to keep a PC online idling just to host a bot

sinful trellis
#

Ohh!

#

I get it now

quiet topaz
#

@sinful trellis you could get a raspberry pi

sinful trellis
#

Seriously?

autumn compass
#

@sinful trellis there are some cheap host with panel to host your bot

sinful trellis
#

I asked a simple question.

#

Yes or no

quiet topaz
sinful trellis
tacit sequoia
#

Same thing...

quiet topaz
#

like how much does a raspberry pi consume power

sinful trellis
#

Bruh

tacit sequoia
#

Much less than a whole PC πŸ˜†

quiet topaz
autumn compass
quiet topaz
#

"how much power does the queen have"

#

some cheap bot hosts

#

oh

#

wrong pin

#

bruh

autumn compass
tired panther
sinful trellis
#

Thanks.

quiet topaz
#

pretty cheap

#

per year

tired panther
#

yes cheap lol

#

maybe Internet costs...

sinful trellis
#

Wait guys, do I have to pay for my bot?

#

I thought.

quiet topaz
#

i have bouth a motherboard with a intel celeron j4125 soldered on it, the cpu consumes like 10 watt per hour. i want to use it as a NAS, but i dont have money for the psu so i use a 600watt psu which i bouth few months ago... like 600watt for that is such a waste

#

wait he is using some botcreator app?

sinful trellis
#

No.

#

Bruh

#

Learning FROM

quartz kindle
#

dafuq is that

sinful trellis
#

Search the internet mate.

umbral zealot
#

If you want your bot to stay online 24/7 there's a good chance you'll have to pay something eventually. Hosting on free locations is usually not stable, so your bot would go offline in some circumstances. If it's on a local machine, then it'll shut down if you lose power. If it's on a free online host, you're going to have the occasional issue with that service going down, or blocking you.

#

You get what you pay for, and the cheaper you are on bot hosting, the shittier it's gonna be.

quiet topaz
autumn compass
#

i pay 2 euro for 1 gb ram and 5 gb storage blobsmilesweat

quartz kindle
#

i pay 2.75 usd for 1gb ram and 15gb ssd

umbral zealot
#

I pay about $20/month for my hosting right now but it's because I throw the occasional game server on there (minecraft, factorio, 7 days to die, etc). But I used to pay $3.50/month for a half dozen bots and a couple websites. Β―_(ツ)_/Β―

autumn compass
#

im ok with 5 gb storage

quiet topaz
#

man i payd like 6€ for 3gb ram and 10gb ssd

#

i think they scammed me

quartz kindle
#

nah the price is ok

#

ram is expensive

umbral zealot
#

That's capitalism πŸ˜›

quartz kindle
#

2gb ram usually ranges around $5

#

3gb ram a bit more

autumn compass
onyx hare
#

how can i get this to work?, it doesnt trigger, or error it sends the commands output but it doesnt check to see if its the channel its allowed in

    let game = "834016762986496032"
    if (message.channel.id === "834016762986496032") {
        return message.channel.send(
            `Sorry But You Cant Play **Would You Rather** Here Go To The Proper Channel; <#${game}>`
          );
        }
zenith terrace
#

.-.

umbral zealot
#

I'd assume it doesn't do anything because your channel ID isn't exactly the right one?

#

I think you have your condition wrong here...

tacit sequoia
#

You want !==

umbral zealot
#

=== means "EXACTLY EQUAL TO"

tacit sequoia
#

Not ===

zenith terrace
onyx hare
#

so when "!game1" is used it should prompt that message (ChanID is correct)

#

oh

sinful trellis
umbral zealot
#

That's a great place to learn I'm sure.

#

Code.org is also real good to start off with.

tacit sequoia
#

You're using that to code a discord bot?

sinful trellis
#

No.

umbral zealot
#

Guys don't start fucking shaming this dude for taking the time to learn, ffs, that's what we want people to do.

quiet topaz
#

i didnt said that its wrong to learn

#

i mean everyone once learned how to code/ is still learning

umbral zealot
#

look at init ending a sentence with a contraction dogekek2

#

I like it!

quiet topaz
#

what is a contraction

torpid otter
#

${this.client.user.username} it said that user TypeError: Cannot read property 'user' of undefined

umbral zealot
waxen bough
quiet topaz
#

just use client.user.username

#

without this

umbral zealot
#

I mean... it depends on their code

#

there's no "use X or Y", it depends on their entire setup

umbral zealot
quiet topaz
#

hmm well right

still sky
#

of course if it defined by function keyword

waxen bough
#

he probably used a function and lost this context

umbral zealot
#

Y'all really shouldn't help people on assumptions or guesses. It's usually not helpful, tbh.

#

Ask for precision, wait for answer, then give them more constructive responses, please ^_^

waxen bough
#

right... hhaa

torpid otter
#

sorry i am back

#

message.channel.send(embed)
^

ReferenceError: Cannot access 'embed' before initialization

umbral zealot
#

show your code please

torpid otter
#
const { MessageEmbed } = require('discord.js');

module.exports = {
 name: "botinfo",
 description: "info about the bot ", 



 async run (client, message, args) {
  let embed = new MessageEmbed()
  .setAuthor(
    `Infomation about the bot ${client.user.username} bot`,
    client.user.displayAvatarURL()
    )
   .addField(
       {
         name : 'bot tag',
         value : client.user.tags
       },
        {
         name: "server's command prefix",
         value: message.guild.commandPrefix, 
        },
        message.channel.send(embed)
    )

 }
}
umbral zealot
#

you put the message.channel.send inside the addField function

#

put it outside of it

torpid otter
#

i am dumb

umbral zealot
#

You're not. You're just inexperienced.

torpid otter
#

why keep [object Object]
[object Object]

umbral zealot
#

the what now

torpid otter
#

it working but keep say [object Object]
[object Object]

umbral zealot
#

Where does it say this

#

show us

near stratus
#

wtf

umbral zealot
#

Right, so, you have addField here but you're trying to add 2 fields?

#

you need to start reading docs, man.

near stratus
#

Just use .addFields(

tacit sequoia
torpid otter
#

thanks helping me

still sky
# torpid otter

Show where you assign client.user.tags and message.guild.commandPrefix

tacit sequoia
torpid otter
#
const { MessageEmbed } = require('discord.js');

module.exports = {
 name: "botinfo",
 description: "info about the bot ", 



 async run (client, message, args) {
  let embed = new MessageEmbed()
  .setAuthor(
    `Infomation about the bot ${client.user.username} bot`,
    client.user.displayAvatarURL()
    )
   .addFields(
       {
         name : 'bot tag',
         value : client.user.tags,
       },
        {
         name: "server's command prefix",
         value: message.guild.commandPrefix 
        },
       
    )
    message.channel.send(embed)
 }
}
torpid otter
#

try that give the name of bot

still sky
torpid otter
#

so my priefix is in config

umbral zealot
#

addFields takes an array

#

you don' t have an array there

#

learnjs moment right there

waxen bough
#

where's your old message

umbral zealot
still sky
torpid otter
#

ik

exotic lotus
torpid otter
#

like const{config) = ('../config'

exotic lotus
#

const config = require("../config")

torpid otter
#

i am sorry for be dumb

exotic lotus
#

You're not. You're just inexperienced.

earnest phoenix
#

How to make currency system with json?

torpid otter
#

i have problem with my botinfo command

#

where keep saying server's prefix
undefined

exotic lotus
#

Show config.json and botinfo.js

torpid otter
#

const Discord = require('discord.js');
const { MessageEmbed } = require('discord.js');
const config = require("../config");
module.exports = {
name: "botinfo",
description: "info about the bot ",

async run (client, message,) {
let embed = new MessageEmbed()
.setAuthor(
Infomation about the bot ${client.user.username} bot,
client.user.displayAvatarURL()
)
.addFields(
{
name : 'bot tag',
value : client.user.tag,
},
{
name: "server's prefix",
value: config.prefix,
},
console.log(config)
)
message.channel.send(embed)
}
}

exotic lotus
quartz kindle
#

you did config.prefix as the key lol

torpid otter
exotic lotus
#

Make it prefix in config.json

quartz kindle
#

{} <- this is an object
{"a":10} <- this is an object that contains they key "a" and the value 10

#

your config file is an object

#

config = require("./config.json") means your config variable is now an object

#

your object contains the key "config.prefix", not the key "prefix"

torpid otter
#

what should i change

quartz kindle
#

so config (the object) .prefix does not exist

#

because your key is not named "prefix", you named it "config.prefix"

#

if you do config.prefix in your code, it will look for "prefix":"something" in your json file

#

not "config.prefix":"something"

torpid otter
#

i have change back to prefix

quartz kindle
#

then it should work now

delicate shore
#

Guys

torpid otter
#
const { MessageEmbed } = require('discord.js');
const prefix = require("../config");
module.exports = {
 name: "botinfo",
 description: "info about the bot ", 



 async run (client, message,) {
  let embed = new MessageEmbed()
  .setAuthor(
    `Infomation about the bot ${client.user.username} bot`,
    client.user.displayAvatarURL()
    )
   .addFields(
       {
         name : 'bot tag',
         value : client.user.tag,
       },
        {
         name: "server's  prefix",
         value:  prefix,
        },```
quartz kindle
#

no

earnest phoenix
#

i want to make an lock command ```js
message.guild.roles.cache.forEach(rooo => {

    message.channel.updateOverwrite([
        {
           id: rooo.id,
           deny: ['SEND_MESSAGES', 'ADD_REACTIONS'],
        },
      ])

})```
quartz kindle
earnest phoenix
#

why lol?

waxen bough
#

why json

torpid otter
#

i don't know what to put in the vlaue

earnest phoenix
#

idk

quartz kindle
earnest phoenix
#

Then what is the best to make currency system?

umbral zealot
#

use a database.

quartz kindle
umbral zealot
#

don't use json for currency systems.

earnest phoenix
#

Why?

umbral zealot
earnest phoenix
#

oke

#

But can i use json plz?

quartz kindle
# torpid otter i don't know what to put in the vlaue

lets try again:
when you do const something = require("../config") it means that the name something now represents the FULL config file, not any specific value inside it
so you need to use something.KEYHERE to get the specific value you want from your config file.
the KEYHERE part has to be exactly what you wrote INSIDE the config file

umbral zealot
#

If you want to shoot yourself in the foot and make a noose for later, sure.

earnest phoenix
#

or mongo-db?

torpid otter
#

i fix it

umbral zealot
#

Mongodb is fine

torpid otter
earnest phoenix
#

can you give me tutorial? I can't find it

quartz kindle
torpid otter
#

yes thanks for the help

waxen bough
#

hmm

earnest phoenix
#

hmmm

waxen bough
#

then the prefix is not specific to guild

umbral zealot
#

For a prefix to be per-guild, you need to have a settings system, thus you need a database.

earnest phoenix
#

hmmmm

#

Gimme mongodb tutorial video or link please : )

waxen bough
#

this one

drifting wedge
#

how do i move a html element to the right

#

while still like being affected by others

errant flax
#

It wont be online,
I just restarted the bot and suddenly wont work
No errors in console

drifting wedge
#

so like not pos: fixed

earnest phoenix
quartz kindle
drifting wedge
#
  display: flex;
  
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 4.7rem;
  align-items: center;
  padding: 25px;

  background-color: var(--bg-color);

  border-bottom: 1px solid var(--border-color);
}``` this is the container
#

i want to make the dropdown

#

next to the name

#

while moving when name changes

#

so if name is longer

#

the dropdown moves more to the left

still sky
#

Name is arch or 0exe?

#

Add 0Exe container margin-left: auto

#

Or dropdown container margin-right: auto

drifting wedge
#

ive tried that lol

#

the name would be 0Exe

still sky
#

what styles of navbar childs

drifting wedge
#

wdym

still sky
#

Show your html start from navbar

#

collapse internals

errant flax
#

But it works for some reason now

tired panther
errant flax
#

I cant make .env file now

#

Bc of it

drifting wedge
#

how can i make the dropdown move depending on the name

#

i use fixed, right 0, translateX

#

so it is jut there

#

and doesnt move

still sky
#

First, if your .navbar fixed there is no reason to assign fixed or absolute for dropdown

#

Dont use translateX for such things to

drifting wedge
#

its all fixed

still sky
#

Any of transform styles

drifting wedge
#

no absolute

still sky
#

Keep fixed only what your need, in this case your name, dropdown and left name should be placed inside .navbar

drifting wedge
#

they are

still sky
#

Then remove fixed from all .navbar childs

drifting wedge
#

then how would i align them?

still sky
#

For left name flex: 1 1;, dropdown and name flex: 0 0;

#

Or for left name margin-right: auto

#

Your dropdown automatically sticks to right name

drifting wedge
#

ok the flex thing doesnt help

#

i just wanna maek it be on the right

still sky
#

And try not to use width: 100%, left: 0; right: 0 do the same

drifting wedge
#

like i literallt only wanna make it move next to the name on the right

#

ignore the left thing

drifting wedge
#

margin-left auto doesnt work for me

#

it puts it in the middle

cosmic forum
#

Hello, I'd like to make a loading screen for my website, anyone know how I can cover the whole screen with an image for a set number of seconds, and make it fade away after those seconds have finished?

still sky
#

Remove margin-left for name or smth
Can you show your code?

drifting wedge
#

html or css

#

or both?

still sky
#

both

drifting wedge
#

html: ```html
<div class="navbar">
<h2>
Arch
</h2>

            <div class="serverdrop" onclick="serverdrop()" id="drop">
                <img src="https://cdn.discordapp.com/icons/744386877045604374/04341fc976fc11629eaac09f1b70d9a5.jpg" class="dropicon" id="drop2">
                <span id="drop2">Arch Developers</span>
                <ion-icon name="caret-down-outline" class="ddbtn" id="caret"></ion-icon>
            </div>
            <div class="displaydrop" id="displaydrop">
            <div class="droplist" id="droplist">
                <div class="serverdroplist">
                    <img src="https://cdn.discordapp.com/icons/744386877045604374/04341fc976fc11629eaac09f1b70d9a5.jpg" class="dropicon">
                    <div>Arch Developers</div>
                </div>
                <div class="serverdroplist">
                    <img src="https://cdn.discordapp.com/icons/744386877045604374/04341fc976fc11629eaac09f1b70d9a5.jpg" class="dropicon">
                    <div>Arch Developers</div>
                </div>
                <div class="serverdroplist">
                    <img src="https://cdn.discordapp.com/icons/744386877045604374/04341fc976fc11629eaac09f1b70d9a5.jpg" class="dropicon">
                    <div>Arch Developers</div>
                </div>
            </div>
            </div>
        
        <!--<div class="loginbutton user_login">
            <div class="navbar_links">Login With Discord</div>
        </div>-->
        <div class="user_login">
            <img class="avatar" src="IMAGE">
            <div class="login_text">0Exe</div>
        </div>
    </div>```
#

css:

.user_login {
  color: var(--sub-color);
  margin-left: auto;
  display: flex;
}

.login_text {
  margin-left: 7px;
  font-size: 1.1rem;
  transform: translateY(10%);
}

.avatar {
  border-radius: 50%;
  height: 30px;
  width: 30px;
}
.sidebar {
  transform: translateY(2.7rem);
  position: absolute;
  left: 0;
}

.serverdrop {
  border: 1px solid var(--dark);
  background-color: var(--light-color);
  padding: 10px;
  color: var(--sub-color);
  border-radius: 4px;
  width: 16rem;
  height: 3rem;
  cursor: pointer;
  display: flex;
  margin-left: auto;
  /*position: fixed;
  right: 0;
  transform: translateX(-13.5rem);*/
  align-items: center;
  color: var(--white-color);
}
.serverdroprad {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 0px;
  border-bottom-left-radius: 0px;
}
.dropicon {
  border-radius: 50%;
  height: 25px;
  margin-right: 0.6rem;
}
.displaydrop {
  display: none;
}
.droplist {
  display: flex;
  position: fixed;
  transform: translateX(-13.5rem) translateY(1.44rem);
  width: 16rem;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top: none;
  right: 0;
  padding: 10px;
  gap: 1.3rem;
  flex-direction: column;
  border: 1px solid var(--dark);
  background-color: var(--bg-color);
  color: var(--white-color);
}
.serverdroplist {
  display: flex;
  cursor: pointer;
}
.ddbtn {
  margin-left: auto;

.navbar {
  display: flex;
  
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 4.7rem;
  align-items: center;
  padding: 25px;

  background-color: var(--bg-color);

  border-bottom: 1px solid var(--border-color);
}
}```
#

@still sky

still sky
#
.user_login {
  color: var(--sub-color);
  margin-left: auto; // remove
  display: flex;
}
drifting wedge
#

removed

#

ooh

#

pog

#

ty

#

and i have the actual dropdown

#

how can i align that?

#

its a div

#

and if the name length changes

#

how would i align it?

still sky
#

align what exactly?

#

and in witch axis

drifting wedge
#

x

#

like this bottom thing

still sky
#

Remove fixed sltyles

drifting wedge
#

alr

#

but like this isnt connected to anything

#

this div is moved

#

like set here

still sky
#

Add postion: relative for .serverdrop

#

and postion: absolute for .droplist

drifting wedge
#

so the y works

#

but the x

still sky
#

remove transform

drifting wedge
#

but i need transform for the y?

#

i removed the x from it

#

but for the y

still sky
#

show how it looks right now and edit message with code

drifting wedge
#

html didnt change

#
.droplist {
  display: flex;
  position: absolute;
  transform: translateY(1.44rem); /* translateX(-13.5rem) */
  width: 16rem;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top: none;
  margin-left: auto;
  right: 0;
  padding: 10px;
  gap: 1.3rem;
  flex-direction: column;
  border: 1px solid var(--dark);
  background-color: var(--bg-color);
  color: var(--white-color);
}
.serverdrop {
  border: 1px solid var(--dark);
  background-color: var(--light-color);
  padding: 10px;
  color: var(--sub-color);
  border-radius: 4px;
  width: 16rem;
  height: 3rem;
  cursor: pointer;
  display: flex;
  margin-left: auto;
  margin-right: 2rem;
  position: relative;
  /*position: fixed;
  right: 0;
  transform: translateX(-13.5rem);*/
  align-items: center;
  color: var(--white-color);
}
still sky
#

Add left: 0 for .droplist

still sky
#

And right: 0

#

sry wrong, it's for .serverdrop

drifting wedge
#

nothing hanged

#

oh ok

#

still

still sky
#

It's wrong too πŸ˜„

drifting wedge
#

lmao

still sky
#

add left: 0; right: 0 for .droplist

drifting wedge
#

also?

#

nothing is changing

still sky
#

from serverdrop remove that properties

drifting wedge
#

still nothing change

#

but alr

#

for the x axis

#

the thing is that the div

#

its not connected to anything

#

i positioned it

#

like it's its own thing

still sky
#

I didnt mention that
Place .displaydrop inside .serverdrop

drifting wedge
#

inside css

#

or inside html?

still sky
#

html

steel heath
#

@glacial trench taking a look at your website in #memes-and-media here, you should've asked here tbh but I can't write there since there's a cool down so I'll just use here.

drifting wedge
#

wait lol it is inside

#

.droplist

steel heath
#

Second, you have these 3 typer elements in a single parent element. So one affects all of them. You should either center the text or use separate elements for each.

#

Your "go top button" has issues in both dark and light mode.

#

There's a weird margin of that button and text gets invisible when you hover over it

#

You shouldn't use JS to redirect user here, use <a>, it'd be better.

still sky
glacial trench
#

;-;

steel heath
#

And please don't disable right click/F12, you can't really block it, there's always a way, you just make it more annoying for people.

drifting wedge
#

wdym?

steel heath
steel heath
glacial trench
#

I’m still kinda new to html and css

still sky
drifting wedge
#

@glacial trench ur skills tab

#

the percentage thnig

steel heath
#

Oh and just found this, your navbar's background isn't the same color as the bg of the content inside in dark mode

drifting wedge
#

it doesnt help

glacial trench
drifting wedge
#

nobody knows that 20% is

drifting wedge
#

like i can think ur 50% and joe thinks ur 20%

glacial trench
glacial trench
drifting wedge
#

pog

#

it works

#

ty

steel heath
#

I thought it's a mistake since it's all same in light mode.

drifting wedge
steel heath
steel heath
drifting wedge
glacial trench
#

Fix

steel heath
#

sure 🦊

glacial trench
drifting wedge
#

what do you guys think?

glacial trench
#

for 🦊 sake autocorrect is being a clown rn

glacial trench
tiny ridge
#

uhh so anyone know how to stop bot from getting added to random spam servers?

#

my bot servers are going up like crazy after getting verified on here
but not the commands usage
i think they're just spam servers

pale vessel
#

do a little eval and look for servers that have the same owner

tiny ridge
#

hmm ok
not really sure if they'll have the same owner but ill give it a shot

lyric mountain
#

for better insight, group individual commands per server

earnest phoenix
#

hello

#

How can I delete topgg npm [dblapi.js] this

#

I have no token, I cannot start my bot before the error is gone

crimson vapor
#

npm rm dblapi.js to remove the package but you should be removing the code that posts

lyric mountain
#

the lib won't auto-start tho

#

just comment out the constructor

#

// comment that out

earnest phoenix
#

tΓΌrkmΓΌsΓΌn

crimson vapor
#

why the hell do you create the class in a fucking command

pale vessel
#

it's not in a function at least

crimson vapor
#

what are the odds that its a clone?

tiny ridge
#

sad
does this happen to all bots added on top.gg

lyric mountain
#

probably

pale vessel
#

Mine didn't

#

and I got the verification message after some advertising through auctions

#

I guess it depends

lyric mountain
#

the spam servers I mean, not the verification lock

pale vessel
#

Ah

cinder patio
#

jesus christ debugging a befunge interpreter is a pain in the ass

#

I have a snippet of code which only sometimes works 😭

sterile lantern
#

im new to this so what am i missing

#

error is coming from

#
<?php
    try{
        $database = new PDO("mysql:host=".DATABASE_HOSTNAME.";dbname=".DATABASE_NAME.";charset=utf8mb4", DATABASE_USERNAME, DATABASE_PASSWORD);
    }catch(PDOException $e){
        die("Error: ".$e->getMessage()."<br/>");
    } 
?>```
analog yoke
#

<?php
try{
$database = new PDO("mysql:host=".DATABASE_HOSTNAME.";dbname=".DATABASE_NAME.";charset=utf8mb4", DATABASE_USERNAME, DATABASE_PASSWORD);
}catch(PDOException $e){
die("Error: ".$e->getMessage()."<br/>");
}
?>

sterile lantern
#

?

#

thats the same exact thing

#

as i just posted

solemn latch
sterile lantern
#

how would i install it

#

via shell?

#

idk how php works that much so yea

solemn latch
#

I think its just apt-get. I dont really php, but if you google the error plenty of answers come up.

sterile lantern
#

huh

odd stratus
#

Try signing in as root or use sudo in front of apt-get

rare sierra
#

Hey i need help with mongo db

#

if i want to add a field

#

to an object

#

but i have already put it is the db

#

what should i do?

#

should i use mongo shell?

autumn mist
#

Hi, how much would a vps cost me, if I want to have just one bot to be on it? It doesn't need to be expensive configuration, just basic.

glacial trench
sterile lantern
steel heath
#

Great!

sterile lantern
#

singing in as root

#

via replit

glacial trench
#

The logo thingy I failed to fix it

steel heath
#

I'm on mobile and won't be home tonight, sorry, maybe I can check it later

glacial trench
#

I tried adding margin to the top but it didn’t work even with 900px

autumn mist
vocal trellis
#

does anyone have experience with pug:jade

#

i am trying to use in an external script a variable

glacial trench
vocal trellis
#

in the pug file

#

script()#[ var userid = #{userid}; ]
include script.js

#

how does something like this work?

autumn mist
#

Thank u, it means alot to me ❀️

vocal trellis
#

hello?

#

i want here to give a variable with it that i can use in script.js

#

it is pug

exotic lotus
dusky sundial
#

Pinned messages has a bunch of good options, I'd recommend to just go through it and find the one you like most

snow urchin
umbral zealot
#

Typescript causes those types of errors.

last tapir
#

Ayo.

I usually check my user if he has premium or not with this code.

if (timeout - (Date.now() - premium.premium) > 0) { /* If so, do something */ } else { /* If not */ };

Could I do it like this?

const premium = timeout - (Date.now() - premium.premium) > 0;
if (premium) {} else {};
umbral zealot
#

yeah, absolutely

last tapir
#

aight, thanks

tardy hornet
#

i always use: var random_money = Math.floor(Math.random() * number here) +number here to get a random money, is there an easier way to do it, that i can just do 1000 < 10000, so like if will be between 1k to 10k

umbral zealot
#

There's no easier way than math.random, no

#

Unless you use a lib you find on npm, in which case, your code will be smaller but you're also importing a lot of other code and running it.

still sky
#

Something weird occurred. React Native installed with errors and file save watcher start to detect file accessing or indexing, not sure
That when I ran ls -l -R at root

lament rock
#

There is a method you can find online using a similar method to yours where you can return a random number between a range. Just look it up on google and stackoverflow will most likely be the first result

last tapir
#
const findingPremium = await Premium.findOne({ userID: message.author.id });
const premium = findingPremium.premiumTime - (Date.now() - premium.premium) > 0;
if (findingPremium && premium) {
    console.log("PREMIUM! :)")
} else {
    console.log("NOOOOOO! :(")
};

premiumTime is the time the premium time was given.

#

doesn't work.

#

doesn't even log anything.

fleet radish
#

hey

#

how do i use split in send()
i srsly dont understand
can someone gimme an example

last tapir
#

how can i fix that

tardy hornet
#

how can i get an emoji's id with out nitro

dusky sundial
#

You can just rightclick the emoji and "Copy ID"

last tapir
#

bruh it was false lmao

tardy hornet
fleet radish
#

hey

umbral zealot
#

without anyone sending it, how do you know the emoji exists?

fleet radish
#

how do i use split in send()
i srsly dont understand
can someone gimme an example

fleet radish
#

tf its a single msg

#

wdym spam?

last tapir
#

you sent it already

#

stop sending it again

fleet radish
#

what abt u

umbral zealot
#

Chill, chill.

fleet radish
#

u have been asking ti over and over again

#

aah nvm

tardy hornet
fleet radish
#

ill do it myself

tardy hornet
umbral zealot
tardy hornet
#

no like, not in a command

last tapir
#

πŸ™‚

dusky sundial
#

Shouldn't you be able to send it if you're in the server though?

umbral zealot
#

yeah

tardy hornet
#

i dont have nitro

#

its moving

#

so i cant

umbral zealot
#

you don't need nitro to send an emoji in a guild where it's added

last tapir
#

i think you can get it before sending

umbral zealot
#

"local" emojis are useable by everyone

#

the fuck do you mean by "a moving emoji"

#

Is it in the guild or not

dusky sundial
#

A gif?

tardy hornet
umbral zealot
#

Do you mean like this

tardy hornet
#

yes

umbral zealot
#

"Animated" is the word

tardy hornet
#

sorry my bad...

#

anyways

#

how do i get its id

#

i cant send it because i dont have nitro

umbral zealot
#

without a bot I don't think you can Β―_(ツ)_/Β―

dusky sundial
#

Open developer tools window (Control + Shift + I)

Open the emoji window, scroll emoji into view

Enter element selector mode (Control + Shift + Z, or through the box with cursor in the top left of the dev tools window)

Click on the emoji

The window on the left should highlight an element that starts <li role

This element should have a drop-down arrow to the left of it, so click on that to show the element's children

You should now see an <img... element. This should have a src="..." text. You can right click on the URL/link, and then "Copy link address"

The link should appear like

https://cdn.discordapp.com/emojis/681048970004267011.png?v=1

The number after emojis/ should be the ID

#

That's what I found

#

oop

fleet radish
lyric mountain
#

spaxter failed to escape the url

fleet radish
#

its not working

dusky sundial
#

I failed

lyric mountain
#

we'll get 'em next time

fleet radish
#

hey can someone else tell me

deft forge
#

Lal

umbral zealot
#

What, exactly, do you not understand in the use of split in send()?

#

it's a boolean toggle, there's not much to understand

sly sierra
fleet radish
#

yea i tried it

lyric mountain
#

unless you have nitro

sly sierra
lyric mountain
#

no you cant

fleet radish
#

i did {split :true}

umbral zealot
fleet radish
#

but idk im not getting it

lyric mountain
#

you'd need to send the emote for that to work

dusky sundial
#

The emoji won't show up unless you have nitro

umbral zealot
#

not getting what ?

fleet radish
#

wait ill show ss

umbral zealot
#

message.channel.send("large message here", { split: true })

#

that's... it

lyric mountain
#

see

fleet radish
sly sierra
umbral zealot
#

oh yeah

fleet radish
umbral zealot
#

that's not gonna work in an embed

fleet radish
#

and when i used this split

#

im getting this

lyric mountain
fleet radish
umbral zealot
#

You have to manually split it, when using embeds

fleet radish
#

ohk

sly sierra
fleet radish
#

then its fine

lyric mountain
#

discord won't parse the emote into a mention if you cant send

#

it'll always be :name:

sly sierra
#

not hard

lyric mountain
#

except you typed the whole thing

sly sierra
#

you do this copy it then paste it in chat

#

not hard my guy

fleet radish
#

yea obv lmao

#

its like 0.5 sec

#

task

#

skksd

sly sierra
#

my point is now proven

lyric mountain
#

hm, curious but yeah, it does work

#

but not if you're mobile

sly sierra
#

fuck mobile

fleet radish
#

lol

cosmic forum
#

Anyone know how to get rid of all this extra height? (It's a css grid)

fleet radish
#

who uses mobile

lyric mountain
lyric mountain
#

you could try using flex

still sky
cosmic forum
#

Yes, I'd like the height of that section to be till the content reaches, not the whole way down.

umbral zealot
#

do you mean you want some of the content to appear underneath your ToC?

cosmic forum
#

No, I'd like the height to just be the height of the content.

#

not 100%

still sky
umbral zealot
#

so when you have lesS content, then

still sky
#

To that div you can assign bg, paddings whatever

umbral zealot
#

Actually

#

your ToS is literally always the height of your content lol

lyric mountain
#

to sum what he wants

umbral zealot
#

I'd like the height to just be the height of the content.

#

the height is currently the height of the content

#

So we have a miscommunication

#

@cosmic forum can you rephrase what you want

#

because it looks a lot like what you're asking is what you have right now

cosmic forum
umbral zealot
#

So you meant the height of the table of contents

lyric mountain
#

btw, you don't need to use <div> for that ToC list, html has <ul>

umbral zealot
#

yeah this is probably due to the use of grid

#
      main {
        display: grid;
        grid-template-columns: 1fr 3fr;
        grid-gap: 10px;
        margin: 10px 0;
      }
soft glade
#

does anyone know how to make a bot in python to send a message in a channel name for example Logs

cursive oracle
#

tadahype My bot just got approved!

umbral zealot
#

Congrats thumbs

cursive oracle
#

ty

earnest phoenix
#

hello

#

who knows how to do something like that

severe pike
#

Is it possible to search through my entire github repo code for a specific word?

craggy pine
earnest phoenix
craggy pine
#

Then idk what you're asking mexShrug

earnest phoenix
#

but can you show me how to do for the background please

#

body
{
background-image: url(the url);
background-repeat: no-repeat;
}

craggy pine
#

"body" is not the ID of the bg

earnest phoenix
#

i don't know were to put that

earnest phoenix
#

ohhhhhh now i get it

#

thx a lot

craggy pine
#

Hold on I'll link you something to help you out for the future.

earnest phoenix
#

oh thx

craggy pine
earnest phoenix
#

thx

craggy pine
#

So you don't have to press "preview" a million times.

#

and it can find classes / ids of top.gg

earnest phoenix
#

thx

earnest phoenix
craggy pine
#

well i hope you're putting css in
<style>
</style>
in the long description

earnest phoenix
#

ya

#

but i don't know what's the id

craggy pine
#

ok so i'll teach u a trick with that plugin

#

one moment

earnest phoenix
#

kk

craggy pine
#

What this shows is how to get ids of things

#

where I click is the BG of the page.

earnest phoenix
#

ok

last tapir
#

hi

#
const source = [1,2,3,4,5,6,7,8,9,10];
function removeFirstTwo(list) {
  // Only change code below this line
  const [a, b, ...arr] = list; // Change this line
  // Only change code above this line
  return arr;
}

... while learning, is this the rest or spread operator?

umbral zealot
#

That is the rest operator, because it gets the rest of the array elements

last tapir
#

But doesn't spread take multiple parameters and spread them?

lyric mountain
#

but you can clone the repo and use find in files

umbral zealot
#

If you were to do const arr2 = [a, b, ...arr]; then that would actually be the spread operator

quartz kindle
#

spread expands something, rest contracts something

#

in the above case, its contracting the items into a single variable

earnest phoenix
#

The ... is originally called the spread operator, in cases of applying rest parameters which means as many parameters as you'd like and also when deconstructing from arrays, it is called the rest operator

quartz kindle
#

if you did ...source then it would expand the variable into a new array

earnest phoenix
last tapir
#
// Rest
const [,, ...arr] = list;

// Spread.
const hi = [...arr];
#

like that?

lyric mountain
obsidian plume
#

ayo

#

bot develops

quartz kindle
#

ye

obsidian plume
#

can someone help me

lyric mountain
#

I mean, I knew about spread

obsidian plume
#

im gonna post some images here

craggy pine
last tapir
last tapir
#

bruh

lyric mountain
#

but contracting arrays/objects into a single variable is useful af

lyric mountain
obsidian plume
#

original language japa but idk how to fix

#

look at images

#

the other languages the font goes inside the background

#

so u cant read well

lyric mountain
#

set div width maybe?

obsidian plume
#

idk wtf that is

#

i just used a fucking a fucking site to do this

lyric mountain
#

who owns that site?

last tapir
#

weebly

obsidian plume