#development

1 messages Β· Page 1392 of 1

molten yarrow
#

@earnest phoenix you need to define args on top

rustic nova
#

Tim, your name though KEKW "Him"

molten yarrow
#

Elitezen posted you a guide

rustic nova
earnest phoenix
#

how do you insert an image in markdown

rustic nova
#

markdown? are you talking about your botpage or where?

earnest phoenix
#

is using webhook the only way to do something when a user vote?
@little meteor yes

little meteor
#

ty

earnest phoenix
#

markdown? are you talking about your botpage or where?
@rustic nova just plain old markdown

rustic nova
#

uno momento

quartz kindle
boreal iron
#

lmao

earnest phoenix
hard anchor
#
message.guild.members.cache.get("705731402972528690").send("hi")

That would work
@cosmic roost
can you give me the complete code?

rustic nova
earnest phoenix
#

@cosmic roost
can you give me the complete code?
@hard anchor no spoonfeeding mate spoonfeed

sudden geyser
#

Tim reversed is Mit. Your mind has been blown

past needle
#

@earnest phoenix here ```js
client.on('message', message => {
if(message.content === ${prefix}8ball){
if(!args[2]) return message.reply("Please type a full question");
let replies = ["Yes.","No.","i don't knowπŸ€”","Ask again later","I'm Busy","No."];

   let result = Math.floor((Math.random() * replies.length));
   let question = args.slice(1).join(" ");
   
   message.channel.send("Answer is "+replies[result])

}
});```.

hard anchor
#

someone tell me how i make my discord.py bot send random responses?

earnest phoenix
#

Tim reversed is Mit. Your mind has been blown
@sudden geyser god now i have to clean the floor because it's covered in shrapnel of my mind

sudden geyser
#

grab the mop

quartz kindle
#

lmao

sudden geyser
#

Blasep I think you can use the random module's choice function. ```py
import random

random.choice(["yes", "no", "maybe"]) # one of the three```

earnest phoenix
#

waitWhatwdym stuff like Math.random aren't really "random" but "psuedo-random"??

sudden geyser
#

There's no such thing as randomness.

#

It's the seed that counts.

#

For example, Python's random module is seeded by default as the current time.

hard anchor
#

but what do I say to the bot?

earnest phoenix
#

so they can be predictable so non-random?

sudden geyser
#

wdym

rustic nova
#

@coral trellis

sudden geyser
#

It can be if you reverse engineer it, but it's usually good enough.

earnest phoenix
#

is that why cloudflare uses a big block of lava lamps for randomness

rustic nova
earnest phoenix
#

@earnest phoenix fucking stop

rustic nova
#

@zinc fable

earnest phoenix
#

not funny

rustic nova
#

ΓΆh

#

ay

earnest phoenix
#

boomer humor

zinc fable
#

Sorry there you go

molten yarrow
#

thanks :3

rustic nova
#

thanks ElonThug

cinder patio
#

extra }

#

There are only 2...

pale vessel
cinder patio
#

you can delete either one of them

#

no you do the opposite

molten yarrow
#

you have only one { open but closes 2x

eternal osprey
#

TypeError: comFile.run is not a function

#

what is the meaning of this?

#

i just made a simple music bot

sudden geyser
#

@earnest phoenix although nothing is random, some implementations have their use cases. For example, Java's java.util.Random class uses a 48-bit seed based on a modified version of the linear congruential formula. However, Java also has the java.security.SecureRandom class, which uses unpredictable seeds.

cinder patio
#

You are trying to call comFile.run, which is not a function, so you cannot call it

lethal grail
#

module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${pingMessage.createdTimestamp - message.createdTimestamp}\`ms`).setTimestamp();

return pingMessage.edit({
embed: pingEmbed
});
}
};```
eternal osprey
#

huuhhhh

#

wait what

#

well, a part of it.

molten yarrow
#

yeah your command has only execute() function not a run()

eternal osprey
#

yeah i see

#

what should i do to get rid of the error?

#

remove the execute and replace it by run?

molten yarrow
#

change execute to run, your message event trying to run the run() function in all commands

earnest phoenix
#

However, Java also has the java.security.SecureRandom class, which uses unpredictable seeds.
they made unpredictable shit on predictable computers that don't even use an outside service like a big ass bunch of lava lamps???

lethal grail
#

nice, got ignored.

molten yarrow
#

your token is invalid

earnest phoenix
#

@molten yarrow nope

quartz kindle
#

thats not what "unexpected token" means lol

lethal grail
#

nope, its valid. its proved by the fact that the bot goes online for a split second.

molten yarrow
#

oh oke my bad than :3

earnest phoenix
#

nope, its valid. its proved by the fact that the bot goes online for a split second.
@lethal grail bro it can go online for a split second then crash because the error stuff is loaded AFTER client.login is executed (iirc from your code)

eternal osprey
#

hmm okay it worked

#

but i tried !play (link) but it sadly did nothing

#

not even logged anything

earnest phoenix
#

D.js Guild
*guide

pale vessel
#

You knew what he meant, no need to correct him

lethal grail
#

what does iirc mean?

eternal osprey
#

nothing worked

lethal grail
#

ingrone

pale vessel
#

"If I recall correctly"

molten yarrow
#

change the else if to if only

eternal osprey
#

@earnest phoenix brother have fucking patience

lethal grail
#

@lethal grail bro it can go online for a split second then crash because the error stuff is loaded AFTER client.login is executed (iirc from your code)
@earnest phoenix and how do i resolve that

pale vessel
#

That's not the problem here

earnest phoenix
#

fix the error code

pale vessel
#

"Unexpected token" is a JavaScript error

earnest phoenix
#

i only explained you why it can still go online

#

can you tell which line the error was thrown on?

neon heart
#

@eternal osprey you did'n have code to play url

sudden geyser
#

they made unpredictable shit on predictable computers that don't even use an outside service like a big ass bunch of lava lamps???
@earnest phoenix yes

molten yarrow
#

@lethal grail your execute function has 2x execute is that normal?

eternal osprey
#

@neon heart what do you mean

earnest phoenix
#

@earnest phoenix yes
@sudden geyser HOW πŸ‘ DA πŸ‘ FUCK

lethal grail
#

@molten yarrow yep it is

#

actually

#

lemme try remove it to see how it goes

#

it might just work

pale vessel
#

It doesn't matter

molten yarrow
#

idk how your command handler build up tho
but if i run it in mine i get an error on it

neon heart
#

@eternal osprey like use ytdl-core to play song url

eternal osprey
#

orchit what did you mean by you have no code to play?

#
            const connection = await channel.join();
            queueConstruct.connection = connection;
            play(queueConstruct.songs[0]);```
#

there is a play function implemented in it

neon heart
#

add queueConstruct.songs[0].url

lethal grail
#

checked using my editors anti syntax feature and nothing popped up

earnest phoenix
#

I'm bored

#

should i try to make a tic-tac-toe game on repl

lethal grail
#

meh should i just try learn python

unborn ridge
#

is sharing a link not allowed

earnest phoenix
#

is sharing a link not allowed
@unborn ridge it is allowed as long as it does not take you to smth that breaks #rules-and-info

unborn ridge
#

basic website

#

lol

#

just has support server and invite button

earnest phoenix
#

wix sucks ngl

unborn ridge
#

its ok

clear arch
#

i use a base website made by nouridio

unborn ridge
#

cause i dont know html

earnest phoenix
#

wix is overpriced for their bullcrap

unborn ridge
#

just made small projects in school of html

#

its free plan lol πŸ˜† πŸ˜†

lethal grail
#

module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();

let pingMessage = await message.channel.send(pingEmbed);

pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();

return pingMessage.edit({
embed: pingEmbed
});
}
}```
#

diffrent code this time

earnest phoenix
#

@lethal grail umm why are you setting the timestamp twice for the same embed

outer perch
#

one is for the message

lethal grail
#

its a ping command-

outer perch
#

another is for the pingMessage

stable eagle
#

Is there any better way of translating your bot other than a giant as if/else if statement?

earnest phoenix
#

no they're still doing setTimestamp twice on pingEmbed

lethal grail
#

hm?

pale vessel
#

They're setting a new timestamp after it being sent

earnest phoenix
#

first here:

let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();

then here:

pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
pale vessel
earnest phoenix
#

They're setting a new timestamp after it being sent
@pale vessel ytho?

lethal grail
#

i dont see anything wrong with that tho

pale vessel
#

Who knows, maybe that 100 milliseconds matter

lethal grail
#

the ping command sends the message latency as well as the websocket latency

earnest phoenix
#

Whats the error?

pale vessel
lethal grail
#

so, anyone know the problem of the ping command?

#

I am idiot right ?
@earnest phoenix no

earnest phoenix
#

I am idiot right ?
@earnest phoenix no you are just not experienced with programming
nobody here is an idiot
we all started somewhere

except for among us ig it exploded out of nowhere

lethal grail
#

first here:

let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();

then here:

pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();

@earnest phoenix its an edited mesaage

#

2 embeds

#

1st embed stays for around for very little time

earnest phoenix
#

doesn't the timestamp get set according to the message's?

neon heart
#

module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();

var pingMessage = await message.channel.send(pingEmbed);

return pingMessage.edit({
embed: pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
});
}
}
```try this
pale vessel
#

Show your full code @earnest phoenix

#

Close your event

#

Add }); under a new line

#

Fix your indentation also

lethal grail
#

module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();

var pingMessage = await message.channel.send(pingEmbed);

return pingMessage.edit({
embed: pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
});
}
}
```try this

@π™Šπ™π˜Ύ not any better

tulip ledge
#

whats the issue?

pale vessel
#

@lethal grail Instead of escaping, you can try using js "WebSocket latency: `" + client.ws.ping + "ms`\nMessage latency: `" + (message.createdTimestamp - pingMessage.createdTimestamp) + "ms`"

west oyster
#

Anyone knows BCFD?

lethal grail
#

Anyone knows BCFD?
@west oyster shittiest bot making app

#

ngl

rustic nova
#

Anyone knows BCFD?
@west oyster Baltimore City Fire Department

tulip ledge
#

Why even use a bot making app

rustic nova
tulip ledge
#

There's no fun in coding a bot then

west oyster
#

Hmm

lethal grail
#

Why even use a bot making app
^

west oyster
#

That App requires coding

#

Java Script

lethal grail
#

cap

tulip ledge
#

prob the bare basics

lethal grail
#

big big cap

#

not even basics

pale vessel
#

Let them use whatever the fuck they want

rustic nova
#

Literally make a bot yourself when it requires javascript yikes

lethal grail
#

shittiest version of java

tulip ledge
#

not saying hes not allowed to I'm saying theres no fun in making a bot if u use an app

#

bruh what is that code tho ngl

molten yarrow
#

@lethal grail

module.exports = {
    name: "ping",
    description: "pong",
    usage: "ping",
    execute: async function execute(message, args, client) {
        
        let pingEmbed = new Discord.MessageEmbed()
            .setColor("RANDOM")
            .setDescription("Pinging...")
            .setTimestamp();

            message.channel.send(pingEmbed).then(msg => {
                return msg.edit(pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${msg.createdTimestamp - message.createdTimestamp}\`ms`).setTimestamp()
                    );
            })
            
    }
}
lethal grail
#

ty

tulip ledge
#

Not tryna be mean or anything but I think thats the ugliest looking code I've ever seen

river hinge
#

Not tryna be mean or anything but I think thats the ugliest looking code I've ever seen
@tulip ledge def def

north birch
#

One last thing, when i equip something, i use .filter to make the equipped weapon get deleted from the userweapons array, if there is more than one weapon with the same name it delete all of them, so, what can i do for make the code delete only one of the weapon with the same name?

tulip ledge
#

Oh shit I can help with this I'm making an RPG bot

north birch
#

Oh shit I can help with this I'm making an RPG bot
@tulip ledge Ty!

restive furnace
#

use .find

#

it finds the first occurence

#

and returns it

lethal grail
#

code doesnt work @molten yarrow

#

rip

tulip ledge
#

@north birch What I'd suggest doing is either using .find or using unique ID's for every weapon and saving that in the database or do what I'm doing:

[
  {
    name: "sword",
    damage: 10
  },
  {
    // other items
  }
]
molten yarrow
lethal grail
#

for me it doesnt work

#

hmm

north birch
#

@north birch What I'd suggest doing is either using .find or using unique ID's for every weapon and saving that in the database or do what I'm doing:

[
  {
    name: "sword",
    damage: 10
  },
  {
    // other items
  }
]

@tulip ledge I'll try .find first,

pale vessel
tulip ledge
#

What's the issue @lethal grail

lethal grail
#

where do i put that?

pale vessel
#

As the description

lethal grail
#

its probably not even a problem with a ping command, something in index.js but lemme try

pale vessel
#

Nah, it's in the error

molten yarrow
#

what does your log say?

tulip ledge
#
module.exports = class PingCmd extends Command {
  constructor(client) {
    super(client, {
      name: "ping",
      aliases: [
        "p"
      ],
      description: "Test my ping!"
    });
  }

  async run(message) {
    let start = Date.now();
    let msg = await message.channel.send(":ping_pong:");
    msg.edit(`:ping_pong: ${Math.round((Date.now()-start-this.client.ws.ping)*100)/100}ms\n:blue_heart: ${Math.round(this.client.ws.ping*100)/100}ms`);
  }
}

Here's my ping command if u need it

pale vessel
#

It has something to do with you not escaping the ` correctly

tulip ledge
#

oh

lethal grail
tulip ledge
#

Oh

#

I see now

#

ur using a ; insinde the .edit when you're returning

molten yarrow
#

i removed it already

tulip ledge
#

oh

pale vessel
#

It's a scope

tulip ledge
#

mmmh weird

#

He still has it in his code

pale vessel
#

It's fine?

#

No it's not

molten yarrow
#

oh you right tho

pale vessel
#

It's an object

#

Did you remove it? hmm

tulip ledge
#

and you can't use ; in an object

#

looking at the error he didn't

north birch
#

Rip idk how to use .find lmao

molten yarrow
north birch
#

Nice i was reading a wrong docs lol

#

Ok, idk what to do next, i tried:
const found = armi.find(newloadout => newloadout != armaequip);
But it's equal to using filter lmao

molten yarrow
#

does it return what u need?

north birch
#

Yes, the name of the weapon, but there are two weapon with the same name

molten yarrow
#

you can use .filter()

#

it matches your need more i think

#

.filter() return the filtered array with only same items

north birch
#

it's there a method to limit the find to 1 items?

crimson vapor
#

posting an incorrect shard count is not allowed, is it allowed to shard an unnecessary amount of times and post the correct values?

#

would send in #support but didn't feel safe doing that

molten yarrow
#

you can use .filter() and then just use .shift() or .pop() to get the last item in the array or the first one

restive furnace
#

probably more like api

full mortar
#
msg.channel.send(Embed).then((msg) => {
  msg.react('β—€').then((r) => {
    msg.react('β–Ά');

    const backwardsFilter = (reaction, u) => reaction.emoji.name === 'β—€' && !u.bot;
    const fowardsFilter = (reaction, u) => reaction.emoji.name === 'β–Ά' && !u.bot;

    const backwards = msg.createReactionCollector(backwardsFilter, { idle: 30000 });
    const fowards = msg.createReactionCollector(fowardsFilter, { idle: 30000 });

  });
});
#

can anyone help me with this?

thin turret
#

Error?

restive furnace
#

u don't need 2 collectors

full mortar
#

i don't know why it only collects reactions from the author of the message

#

u don't need 2 collectors
@restive furnace you're right

#

but still i don't think that it would solve the problem

tulip ledge
#

First of all you can just have 1 collector

const filter = (reaction, u) => reaction.emoji.name === 'β—€' || reaction.emoji.name === 'β–Ά' && !u.bot;
const collector = msg.createReactionCollector(filter , { idle: 30000 });

collector.on("collect", (reaction, user) => {
  console.log(reaction)
});
#

Oh I see why

#

a filter needs a return

#

Its a function

restive furnace
#

uhhh ur snippet doesn't work either/works every time even it was any other emoji

tulip ledge
#

why wouldn't it work then

pale vessel
#

(reaction.emoji.name === 'β—€' || reaction.emoji.name === 'β–Ά') && !u.bot

tulip ledge
#

well I usually just ["..."].includes(reaction.emoji.name)

#

Oh shoot I forgot the paranthesees

full mortar
#

a return where?

pale vessel
#

You don't need a return

tulip ledge
#

ok nvm then I'm being an idiot again

pale vessel
#

You only need it if it's a const filter = (reaction, u) => {}

#

Wait, you're ChickenDev?

full mortar
#

?

tulip ledge
#

maybe

crimson vapor
#

yea

tulip ledge
#

yes

pale vessel
#

Nice

tulip ledge
#

I changed my name

crimson vapor
#

I feel coppied

tulip ledge
#

Well not rlly

crimson vapor
#

ik lol

full mortar
#

You only need it if it's a const filter = (reaction, u) => {}
@pale vessel that's what i have

tulip ledge
#

I had this name for 2 years now

#

And I'm 10,5x bigger then you

#

no u dont have that

pale vessel
#

BILLION when

tulip ledge
#

U have const filter = (reaction, u) => //code it's different

crimson vapor
#

maybe ill do that for april 1st

#

normally I change something

restive furnace
#

i can be TRILLION

full mortar
#

U have const filter = (reaction, u) => //code it's different
@tulip ledge yeha, i just realized that

crimson vapor
#

no please don't

full mortar
#

so then what's the solution?

crimson vapor
#

yes

full mortar
crimson vapor
#

you forgot to define module.exports

#

how do you set properties of objects?

#

obj.value = {}

#

basically you forgot the =

surreal sage
#

How to see who created the channel? (Discord.js, channelCreate event)

crimson vapor
#

iirc you have to check the audit logs

#

yes

tulip ledge
#

Yeh I think u can check the audit logs and filter on the channel

crimson vapor
#

and I would also change execute() to execute: () =>

#

np

pale vessel
#

and I would also change execute() to execute: () =>
@crimson vapor Both work anyways

crimson vapor
#

oh

#

been a while since I put a function in an object

pale vessel
#

Same, I do it your way too

crimson vapor
#

makes more sense tbh

#

since you are setting execute to a function

#

instead of just adding a function with the name execute to it

tulip ledge
#

I'm that weird guy who uses execute() as a method in classes and execute: () => for objects dont ask me why

crimson vapor
#

don't classes require it done that way

#

idk

tulip ledge
#

Dont know haven't tried the other way

little meteor
#
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_protocol.py", line 275, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
``` anyone know know how to fix it ?
full mortar
#

why is the collector not working? notlikenoot

crimson vapor
#

whats your code?

tulip ledge
#

I just learnt it that way

#

its python tho

#

I'm bad at python

crimson vapor
#

look at the error tho

#

wait

tulip ledge
#

its a package error

little meteor
#

are you 2 talking with me ?

crimson vapor
#

kinda

tulip ledge
#

yes

little meteor
#

ooh

crimson vapor
#

where do you use http in the code?

little meteor
#

I was trying async def on_dbl_test(self, data)

#

and it always give me that error

crimson vapor
#

umm

#

no idea

little meteor
crimson vapor
#

I don't know any python

tulip ledge
#

try logging self and data

#

and seeing if it returns anything unexpected

#

I don't know python very well either, I did start with python but went to JS immediatly

crimson vapor
#

nah I learned a bit of node js and thats all

little meteor
#

i see

tulip ledge
#

but we can try to help you debug, then its up to u to find a fix as we won't find a fix

crimson vapor
#

just enough to understand how to make stuff

hollow sedge
#

you dont need to know python to understand that error

crimson vapor
#

yea but idk the code

#

that causes it

tulip ledge
#

Yes, but we can't fix the code

#

Thats what I'm saying

#

we can help them debug

#

just not help them fix the code

hollow sedge
#

alright

full mortar
#

sorry for bothering, but nobody knows how to solve my problem where the collector only collects the reactions of the author of the message?

crimson vapor
#

do you have a filter on the collector?

full mortar
#

yes

crimson vapor
#

show the filter

full mortar
#
const Filter = (reaction, u) => reaction.emoji.name === 'β–Ά' && !u.bot;

const collector = msg.createReactionCollector(Filter, { idle: 30000 });
crimson vapor
#

hmm

#

im not sure

#

someone else might

#

but I don't use collectors

full mortar
#

ok

#

thanks

restive furnace
#

someone literally few minutes ago sent you working snippet

full mortar
#

?

#

where?

drifting wedge
#

how can i dm users after they react to a specific message? dpy ping with responses pls

molten yarrow
#

@full mortar u still need a return for your Filter

earnest phoenix
#

pls hlp me

#

why async not work ?

little meteor
#
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_protocol.py", line 275, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
``` anyone know know how to fix it ?

@little meteor fixed 0pepedance it was a stupid error cry_2

earnest phoenix
#

???? can anyone help me ?

#

module.exports = async (client, oldChannel, newChannel) => {
    const fetchGuildAuditLogs = await newChannel.guild.fetchAuditLogs({
        limit: 1,
        type: 'CHANNEL_UPDATE'
    });

    const latestChannelUpdated = fetchGuildAuditLogs.entries.first();
    const { executor } = latestChannelUpdated;

    const logs = client.channels.cache.get('769656303747727360');

    const embed = new MessageEmbed()
    .setAuthor("Channel Updated")
    .setThumbnail(executor.avatarURL())
    .setColor("#000000")
    .setDescription(`Before : ${oldChannel.name} \nNow : ${newChannel} ${newchannel}\nBy ${executor.tag}`)
    .setTimestamp()
    .setFooter(newChannel.id, newChannel.guild.iconURL());
   

    logs.send(embed)
};```
molten yarrow
#

any errors?

earnest phoenix
#

they say

#

:

full mortar
#

@full mortar u still need a return for your Filter
@molten yarrow that wasn't only if i use const filter = (reaction, u) => {}?

earnest phoenix
#

DiscordAPIError : Missing Permissions

#

and they show me the async line

molten yarrow
#

@full mortar yes and u use it xD but never added it

full mortar
#

no

#

i use const filter = (reaction, u) => reaction.emoji.name === 'β—€' && !u.bot;

molten yarrow
#

just add a return in it

full mortar
#

i already did

#

it didn't work

molten yarrow
#

its still reacting only on author?

full mortar
#

i change it to const filter = (reaction, u) => { return reaction.emoji.name === 'β—€' && !u.bot};

#

its still reacting only on author?
@molten yarrow yes

molten yarrow
#

weird

hollow sedge
#

Use media queries @low orbit

full mortar
#

weird
@molten yarrow yeah

blissful fiber
#

im making a bot
how to find out who send the message
im using discord.net
c#

restive furnace
#

Context#Author

#

#ReadTheDocs #RTD

hollow sedge
#

float them left?

#

no im saying float: left

#

i cant really help you without seeing your current CSS

#

sure

#

although if it's private you probably shouldnt be showing it to me either lol

earnest phoenix
wraith haven
#

no @earnest phoenix , you need to use an event, not wait for

#
@bot.event
async def on_raw_reaction_add(payload)``` <https://discordpy.readthedocs.io/en/latest/api.html?highlight=on_raw_reaction#discord.on_raw_reaction_add>
earnest phoenix
#

why? what message are you comparing to?

wraith haven
#

When you use wait for it gets ugly when it comes to reactions

earnest phoenix
#

i mean, it depends on what he's trying to achieve

wraith haven
#

on_raw_reaction_add alerts you regardless of the cache state

#

no matter what you're doing, it would be best to use the event

earnest phoenix
#

no matter what you're doing, it would be best to use the event
@wraith haven no?

wraith haven
#

Ofc there are exceptions

steep socket
#

my translare command isnt working properly

#

it works sometimes and doesnt sometimes

wraith haven
#

but as a general rule of thumb, the event is the best way to do it
This is because he's trying to send a user a message when they react to they it.. which means that message can last years.. which wait_for is not ment for @earnest phoenix

steep socket
#
from googletrans import Translator
from discord.ext import commands

class Utility(commands.Cog):

    def _init_(self, client):
        self.client = client

    @commands.command()
    async def trans(self,ctx,arg,lang):
        translator = Translator()
        translated = translator.translate(f"{arg}", dest=f"{lang}")
        await ctx.send(f"{translated.text}")

def setup(client):
    client.add_cog(Utility(client))
wraith haven
steep socket
#

ye

earnest phoenix
#

wdym, you can use raw_reaction_add on wait_for

wraith haven
#

πŸ€” but why tho

#

theres no need

steep socket
#

hm?

wraith haven
#

I've said all I can, I cant change ur mind Β―_(ツ)_/Β―

earnest phoenix
#

if it was a command, and he's trying to check if the user reacts to what the bot sent, why not?

wraith haven
#

but its not a command

#

πŸ€”

earnest phoenix
#

he didn't even give us the context

#

i was just assuming

wraith haven
#

no, he gave you context

earnest phoenix
#

that's vague Β―_(ツ)_/Β―

steep socket
#

why isnt my translator working

#

i have tried a lot

midnight blaze
#

show code?

steep socket
#
from googletrans import Translator
from discord.ext import commands

class Utility(commands.Cog):

    def _init_(self, client):
        self.client = client

    @commands.command()
    async def trans(self,ctx,arg,lang):
        translator = Translator()
        await ctx.send(translator.translate(f"{arg}", dest=f"{lang}").text)

def setup(client):
    client.add_cog(Utility(client))
#

it works 50% of the time

#

the other 50% it throws this exception

drifting wedge
earnest phoenix
#

@steep socket try using only 1 instance instead of creating it each command invokation

steep socket
#

i will try that

#

good idea

hoary nymph
steep socket
#

it still happens :(

earnest phoenix
steep socket
#

oh

#

thanks!

#

https://pypi.org/project/translate/ found another library i will try it out

ember oak
#

discord.js v12

Hey! Is there a way to make bot take information from website and put it into embed? I would like to make Minecraft Hypixel stats bot. Please help.

umbral zealot
#

Sure but that has nothing to do with discord.js itself

#

In that discord.js can provide data, but it doesn't have features to "put on a website"

#

you'd have to create an API within your nodejs code for that

ember oak
#

Is there any tutorials on youtube how to do it?

umbral zealot
#

There`s tutorials on youtube on it yes, but it's about web development & design, not about bots.

cinder patio
#

There are two main ways of getting info from a website:

  1. If the website has an API, you can get the data from there via HTTP requests.
  2. If the website doesn't have an API, you can try web scraping the website. Always use 1) if the website has an API.
ember oak
#

Thank you.

pale vessel
#

But if their API is so shitty then you have to scrape trollpixel

bronze bramble
#

Alright

#
[2020-11-17 18:29:02.651200] Connected. Logged in as Lester#3371
[2020-11-17 18:29:04.654874] Ready!

#

She ain’t on yeet

hollow sedge
#

what?

rustic nova
hollow sedge
#

oh nvm

undone tundra
#

ty

bronze bramble
#

I’m tryna send my code so you can proof check it

hollow sedge
#

using heroku is discouraged for discord bots

umbral zealot
#

@bronze bramble you can post code to https://hasteb.in/ (paste, save, give us the URL). make sure not to include your token

bronze bramble
#

The token is ded but sure

#

Let me make sure my channel ID’s are right

umbral zealot
#

using heroku is discouraged for discord bots
False. Heroku is fine for bots, it works perfectly well if you have a CC registered, the only thing it can't really do is save data to disk.

#

Why? Channel IDs aren't secret.

bronze bramble
#

Well because I’ll need to ensure that isn’t the error

umbral zealot
#

We can't do anything with them

bronze bramble
#

although he should appear online

umbral zealot
#

If you modify the code in any way, you might introduce an actual problem to the code

bronze bramble
#

Gotcha

#

I’m very inexperienced

pale vessel
#

There's room for improvement, as Elon would say.

bronze bramble
#

Haha, I’m always in the middle of his 10 year plan

umbral zealot
#

Ah well. I can't help with that. I don't do python. πŸ‘

bronze bramble
#

Unfortunate. Neither do I

#

I’m too rusty atm

#

I’ll keep looking for a friend

umbral zealot
#

So you have a bot in python but you don't know python... Thonk

#

how did you write this then

drifting wedge
#

I do python

#

Lemme check code

#

@bronze bramble

bronze bramble
#

Yay

#

Thanks. I’ll give you a run down of what she does, if you can help me get her started back up for the community, I’ll be in debt

cosmic roost
#

So you have a bot in python but you don't know python... Thonk
@umbral zealot thats a pretty epic gamer move..

pale vessel
#

You should learn python from scratch and make a basic bot first

bronze bramble
#

I probably should, I just don’t have time at the moment

umbral zealot
#

So just write a bot in a language you know

drifting wedge
#

@bronze bramble u can’t have custom statuses

pale vessel
#

I understand that but it might get worse

umbral zealot
#

Expecting some people online to fix your code that you didn't write is a pretty shit move if you ask me.

drifting wedge
#

Like u can’t have prefix var

bronze bramble
#

Alright

#

I’ll look at that now

drifting wedge
#

Is this ur code?

bronze bramble
#

It’s shared, my friend @somber verge quit working on it

drifting wedge
#

Use cogs

bronze bramble
#

Haha I was just thinking so

#

It’s because qea used outdated py

drifting wedge
#

?

#

Oooo

#

That’s dumb

#

Use latest always

bronze bramble
#

I mean I’d have to familiarize with code base

solemn latch
#

hi moo πŸ™‚

drifting wedge
#

I have a pretty poggers dpy bot

#

Moo and woo

bronze bramble
#

Hi Woo πŸ™‚

pure lion
#

oops wrong channel

pale vessel
#

@pure lion facebruh

pure lion
#

but yes how meta

#

we have moo and woo

restive furnace
#

"M" + "W" + 2 * 3 * "o"

bronze bramble
#

So the situation is, i developed the bot as far as the ideas, the theming and central purpose

#

I payed him, or tried to but he refused citing it was experience for him

#

now he doesn’t do bot dev, and so she is outdated and broken

pure lion
#

never pay anyone
~Dice, 2020

solemn latch
#

oh yeah, intents update probably broke a lot of it.

bronze bramble
#

I have a few ideas how to make it popular again, it attracted a lot of people

#

Just need a dev willing to do minor updates now and again, I can strike an agreement

umbral zealot
#

Ah yes, you're an idea person, not a developer. Someone else does all the work then. πŸ‘

solemn latch
#

not that thats a bad thing

#

i suck at ideas

bronze bramble
#

Is this not acceptable here? I have a creative imagination, communities soak it up

#

They hate me for stopping the flow of content I had going with it

umbral zealot
#

Find someone that asks "Hey does anyone have any ideas what to put in my bot?"

#

there's always someone saying that somewhere out there.

bronze bramble
#

it was fun for everyone

#

Ya see, that isn’t any fun

#

not unless I have a love for its central purpose

umbral zealot
#

"Creative people" usually have no idea the amount of actual work that has to go into developing things.

solemn latch
#

the problem here, is most bot devs already have things they are working on.

bronze bramble
#

That is true

solemn latch
#

I have 2 major projects now, and atleast 10 small projects on my plate, and i just got bot reviewer

bronze bramble
#

And the sentiment goes, who said this, btw, something done best will be done by yourself

umbral zealot
#

I mean no, you can absolutely have teams of people. That's a thing

bronze bramble
#

I’ll just make time, I’m really focused on other hobbies and my career

#

and yeah, I like collabing with teams

umbral zealot
#

Except, what doesn't work is someone that literally is only there to throw ideas, and someone else that has to do all the actual work the "creative" thinks about.

bronze bramble
#

You see, I’m willing to learn

umbral zealot
#

Creative people are also the worst damn managers, trust.

bronze bramble
#

Very, I’ll watch listen and entertain while someone is working with me

solemn latch
#

0exe was looking for more team members awhile back, not sure if he filled them up.

bronze bramble
#

interesting

#

I just need structure

#

Everyone here is full of ideas and knowledge, as am I, except I have little understanding in this topic, but at least I have a core idea for motivation

#

I haven’t found a learning website I liked yet, but I’m a wonderful apprentice

restive furnace
#

first, start with it what language you want to learn

#

well look look up something like "python crash course" or "python books"

bronze bramble
#

Great

restive furnace
#

from google ^

solemn latch
#

once you get into it and being intrested in learning, docs are so amazing.

#

the discordpy docs are really good.

bronze bramble
#

Hm

#

Data analysis

#

Sounds scary

pure lion
#

if a docks is bad, do not lean the codig

lilac lodge
#

my mind is to young for this

earnest phoenix
#

ok what library did you use to create your bot

lilac lodge
#

discord.js? idk anything

pure lion
#

discord.js-light by Tim

earnest phoenix
#

hmm if its discord.js screenshot your library on top.gg

pure lion
#

what

#

its not discord.js

#

its discord.js-light

earnest phoenix
#

not you @lilac lodge

lilac lodge
#

wdym by screenshot it

earnest phoenix
#

go to your bot click edit got to where you created your library and screenshot it and show me

umbral zealot
#

oh god please not screenshots

#

you do know copy/paste exists right

earnest phoenix
#

or do that

umbral zealot
lilac lodge
#

i mean it is discord.js i dont know what else there is

pale vessel
#

Why do you want a screenshot of it anyway

outer perch
earnest phoenix
#

so i can help him

honest perch
outer perch
#

this link, gets you to the Docs

honest perch
#

discord.js docs bad

umbral zealot
#

no discord.js docs fine, your connection bad.

outer perch
#

discord.js docs bad
@honest perch ctrl+f5 the page

honest perch
#

nope

earnest phoenix
#

but go there you should be able to get it online and a few commands

honest perch
#

its blocked

#

the json

umbral zealot
#

that sounds like a personal problem you should fix personally.

honest perch
#

i cant unless i want to rewrite how firefox operates

umbral zealot
#

works fine for me so it must be your connection Β―_(ツ)_/Β―

earnest phoenix
#

oh i have had that before its easy to fix

honest perch
#

my connection is fine thanks

umbral zealot
#

clearly not

honest perch
#

clearly is

earnest phoenix
#

oof

lilac lodge
#

works fine for me must be ur connection Β―_(ツ)_/Β―

outer perch
#

it was just rejected

#

not lost

umbral zealot
lilac lodge
#

ok ima be reading this for a bit

honest perch
#

and yet my connection is fine

outer perch
#

have you reloaded the page at least?

earnest phoenix
#

@lilac lodge

honest perch
#

its been happening for months

outer perch
#

yikes

umbral zealot
#

Yes @earnest phoenix that's what they're doing.

lyric mountain
lilac lodge
#

ahhh

#

much text

honest perch
#

chrome loads it fine

earnest phoenix
#

i dont know i never use chrome

umbral zealot
#

So the problem is firefox, not the docs being bad. Good that we agree on that.

outer perch
#

@lilac lodge click on GUIDE up there if you want a good guide on how to get started and more

honest perch
#

json itself works

lilac lodge
#

ok ty

umbral zealot
#

Firefox bad.

earnest phoenix
#

or firefox i only use one browser and thats it

#

haha

honest perch
#

firefox good

outer perch
#

firefox is fine for me

earnest phoenix
#

not really

lyric mountain
#

why did u censor the url tho?

honest perch
#

wait

earnest phoenix
#

me>

#

???

honest perch
#

was meant to censor bookmarks

solemn latch
#

LOL

lyric mountain
#

lul

#

you missed it by a few kilometers

earnest phoenix
#

oooooofa

honest perch
#
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://raw.githubusercontent.com/discordjs/discord.js/docs/stable.json. (Reason: CORS request did not succeed).
pale vessel
#

Big brain misly

lyric mountain
#

ig it's the same bug that happens when you're going to the bathroom then u open the fridge

#

"wait, what was I going to do?"

honest perch
#

ik now

#

my dns server was doing something

earnest phoenix
#

carrots

honest perch
#

nvm

#

firefox configs

#

ffs

lyric mountain
#

ah

#

ik the issue

#

welcome to the world of CORS

honest perch
#

firefox development is slower than discords

lyric mountain
#

unless the provider whitelist ur agent, cors will block your request

#

it was a pain to deal with when I built my bot's site

lethal grail
#

module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${pingMessage.createdTimestamp - message.createdTimestamp}\`ms`).setTimestamp();

return pingMessage.edit({
embed: pingEmbed
});
}
};```
earnest phoenix
#

that was accidental

honest perch
#

i mean, incognito fixes it

umbral zealot
#

Well, you didn't define a pingMessage variable, @lethal grail

lyric mountain
#

incognito fiddles with some headers

#

so it tricks cors sometimes

honest perch
#

odd thing is, it used to work before

#

and firefox does some weird request things sometimes

#

and its a pain

lyric mountain
#

yep

#

ironically firefox was meant to be THE development browser

earnest phoenix
#

This should work yes?

pale vessel
#

try it and see

lyric mountain
#

no no, not like that hoggers

#

do it like this:

earnest phoenix
#

if I vote i wont be able to vote

lyric mountain
pale vessel
#

I see

lyric mountain
#

if I vote i wont be able to vote
@earnest phoenix use "test" button

earnest phoenix
#

HuH?

lyric mountain
#

there are two buttons in ur bot's config page in top.gg

#

"save" and "test"

#

ah, wait

earnest phoenix
#

Guys

lyric mountain
#

you're using the api

#

well, you gotta vote then

earnest phoenix
#

Who’s a bot dev and willing to let me edit they’re bot with the,

#

Them

#

no one

#

no one will l;et you touch there bot code

lyric mountain
#

90% of the people here, and no one

earnest phoenix
#

Ok

lyric mountain
#

respectively

earnest phoenix
#

It’s fine

lyric mountain
#

unless u want to research the code

earnest phoenix
#

pingMessage is not defined

lyric mountain
#

in this case my bot is open-source

#

there are more OS bots here too

#

but pretty sure noone will accept modifications to prod code

earnest phoenix
#

Can you tell me hot to make ur bot verified

lyric mountain
fierce arch
#

On my bot it says unknown table error because it doesn't own a table. How can I change the owner of my table to my bot using Postgres?

earnest phoenix
#

how would I send a message to a user who voted

lyric mountain
#

"unknown table" isn't about missing permissions

earnest phoenix
#

I have the embed but now that I think about it

#

the APi would need a way no?

lyric mountain
#

how would I send a message to a user who voted
@earnest phoenix use top.gg webhook

earnest phoenix
#

brUh

lyric mountain
#

...?

pale vessel
#

brUh

molten yarrow
#

you didnt define client

sudden geyser
#

or just message.client to get the client

molten yarrow
#

he passing it to function already, need only to add it above

#

nope

lyric mountain
#

NaN = not a number

molten yarrow
#

can u run console.log(typeof(client.ws.ping))
after message.channel.send

lyric mountain
#

it's either dividing by 0 or it's returning something unparseable

molten yarrow
#

yeah

#

oh and you added client wrong tho

#

you can add it to execute (client, message, args) {

lyric mountain
#

Still NaN
@earnest phoenix look at the log

#

it'll print the value type there

molten yarrow
#

yeah he creating new Client

#

remove the client on top and add mine

#

you have 1x } to much

#

np

#

keep your index clear xD

#

oh

sudden geyser
#

he passing it to function already, need only to add it above
@molten yarrow what's the point though? There's no advantage to passing it as a parameter over message.client from what I've seen.

umbral zealot
#

It's just what the tutorial does bruh

lyric mountain
#

there isn't, what's being passed in the parameters is the reference, so it won't matter which way u get the client

#

oh my

#

don't create 11 listeners

molten yarrow
#

you index probably has more than one client.on("message") event

lyric mountain
#

where are you adding the listeners?

#

you index probably has more than one client.on("message") event <<<<<
this

#

a listener

molten yarrow
#

you only need one

lyric mountain
#

11 actually

blissful coral
lyric mountain
#

bruh

umbral zealot
#

make sure you don't have a client.on("message") added inside any other file, like in a command or some other event.

hoary nymph
#

Hey does anybody know how to tmake my mysql connection not time out?

#

kills my bot every 8 hours. working with discordjs

rustic nova
#

change the timeout on your mysql connection

#

take a look at your mysql library on how to do that

molten yarrow
#

use connection pool

earnest phoenix
umbral zealot
#

Well, member.defaultChannel isn't valid and doesn't make sense

#

defaultChannel is not a thing.

regal creek
#

Never understood what connection pools work but I copied something from stackoverflow 😎

molten yarrow
regal creek
#

hi, when someone join my server my bot crash and send this error :
@earnest phoenix your accessing the member object. You can do member.guild.id to check if the server is your support server and say hello by doing something like:
` client.channels.cache.get('channelid').send('e')

earnest phoenix
#

general rule of the thumb is that each query should have its own connection

#

but on a large scale

#

that impacts performance

#

that's where pooling comes in*

regal creek
#

So, basicly alot of data processed in one query/connection instead of multi connections? Sort of thing?

earnest phoenix
#

well yes and no

#

so what should i do

#

but basically connection pooling splits the stress of queries into multiple connections

#

once a query is done, the connection is returned back in the pool

#

by what should i replace member.defaultChannel.send(...)

regal creek
#

Ah

#

by what should i replace member.defaultChannel.send(...)
@earnest phoenix my guy. I sent a message about that already

earnest phoenix
#

client.channels.cache.get('channelid').send('e') that

regal creek
#

Make your bot check a database for a channel ID and send the welcome message there

earnest phoenix
#

but i want him to send message on all the servers

regal creek
#

If not Get the system messages defualt Location

#

You want what

molten yarrow
#

make the welcome channel customizeable by user
and if no channel is saved return

regal creek
#

once a query is done, the connection is returned back in the pool
@earnest phoenix so more pools or whatever more connections can be processed at once?

molten yarrow
cerulean ingot
#

hey im trying to make a website for my bot, i was wondering if anyone knows of an api or html thing i can use

umbral zealot
#

I mean there's millions of resources out there on how to learn web design

#

you'll have to be a bit more precise.

earnest phoenix
#

make the welcome channel customizeable by user
and if no channel is saved return
@molten yarrow how pls

cerulean ingot
#

you'll have to be a bit more precise.
@umbral zealot i mean like a way to show the guild count on the website

umbral zealot
#

you have to start by making a web server that can retrieve that information

#

and ifgure out how to make a website

#

then figure out how to query the server

#

If you thought making bots was hard, boy do I have news for you about websites... πŸ˜„

earnest phoenix
#

Uncaught TypeError: Cannot read property 'send' of undefined
Process exited with code 1
i have this error when someone join a server and my bot crash

obtuse barn
#

@earnest phoenix

#

Change .setColors to .setColor

thick gull
#

Uncaught TypeError: Cannot read property 'send' of undefined
Process exited with code 1
i have this error when someone join a server and my bot crash
@earnest phoenix send code

obtuse barn
earnest phoenix
thick gull
#

member.defaultChannel is not a channel

umbral zealot
#

Literally what we said... what, an hour ago? lol

thick gull
#

damn i just scrolled up

#

lmao

earnest phoenix
#

previously i had that

#

Client.on("guildMemberAdd", member => {
console.log("Un nouveau membre viens de nous rejoindre");
member.guild.channels.get('753704150851649559').send("" + member.displayName + ", bienvenue a toi. \nNous sommes dΓ©sormais " + member.guild.memberCount + " sur le serveur ");
member.send("Bienvenue sur le serveur bg")
member.roles.add('587660184638455809').then(mbr => {
console.log("Le rôle a été attribué avec succès pour " + mbr.displayName);
}).catch(() => {
console.log("Le rΓ΄le n'a pas pu Γͺtre attribuΓ©");
});
member.roles.add('738220068017668138').then(mbr => {
console.log("Le rôle a été attribué avec succès pour " + mbr.displayName);
}).catch(() => {
console.log("Le rΓ΄le n'a pas pu Γͺtre attribuΓ©");
});
});

Client.on("guildMemberRemove", member => {
console.log("Un membre viens de nous quitter");
member.guild.channels.get('753704150851649559').send(member.displayName + ", nous a quitté trop tôt 😭");
});

umbral zealot
#

You simply can't send to a "default channel" beacuse that's not a thing

#

so, find an alternative, for example, figuring out how to ask the server admins what channels they want, if they even want one, and saving that to a database.

earnest phoenix
#

should i let that member.guild.channels.get('753704150851649559').send("

umbral zealot
#

only if your bot is in one single server and will never be in more.

earnest phoenix
#

this is the thing

#

my bot is on other servers

#

so what should i do pls

umbral zealot
#

Then you can't do that, no. you can't hardcode a channel ID

#

so, find an alternative, for example, figuring out how to ask the server admins what channels they want, if they even want one, and saving that to a database.
This is what you should do.

earnest phoenix
#

so i have to change the old one by that :
client.settings.ensure(member.guild.id, defaultSettings);
let welcomeMessage = client.settings.get(member.guild.id, "welcomeMessage");
welcomeMessage = welcomeMessage.replace("{{user}}", member.user.tag)
member.guild.channels
.find("name", client.settings.get(member.guild.id, "welcomeChannel"))
.send(welcomeMessage)
.catch(console.error);
});

umbral zealot
#

You have to READ

#

and UNDERSTAND

#

don't just shovel code. actually read and understand what this does and says.

#

you'll have more than this one bit of code. this is an entire setup for your bot.

main trench
#

hey im trying to get my bot to check if a specified user is a bot for the mod commands if (message.mentions.members.first().bot) return message.channel.send(botdm); this is my code but it doesnt work and i dont get any errors anyone know what is wrong with it?

#

@earnest phoenix also to get your bot to send a welcome message on multiple servers you will 1. Need a database and 2. Need a set channel command

sudden geyser
#

@main trench your code doesn't work because GuildMember (.members.first()) does not have a .bot property (from the User class). You probably meant to do .members.first().user.bot, which will be a boolean.

You may be able to shorten your expression to message.mentions.users.first().bot so you're only looking in a collection of mentioned Users instead of GuildMembers.

main trench
#

aight

normal sage
#

I need help with something, I'm using CSS for my bot's description, but somehow it uses it for the entire page.
How do I fix this?
@normal sage

hollow sedge
#

just rename your ids or classes

normal sage
#

o ok ty

hollow sedge
#

or use classes and ids if you're just styling elements using their tag name

normal sage
#

yeah thats what im doing

elfin vortex
#

so, which library for which language is the most efficient? Like which one should I choose when I want to get away with the bot running on something low spec like a raspberry pi

opal plank
#

so, which library for which language is the most efficient? Like which one should I choose when I want to get away with the bot running on something low spec like a raspberry pi
@elfin vortex thats a little bit too wide of a question to ask, unless we talking pre-historic hardware, you should have no issue whatsoever running it with the major languages

#

js, c, cpp, py, even go should give you no problem at all hosting it on a pi

amber thistle
opal plank
#

css

amber thistle
#

do i edit it in the widgets section?

opal plank
amber thistle
#

but isn't that for description only?

opal plank
#

whole page

amber thistle
#

oh

#

is there docs for that

opal plank
#

you need to learn css/html

#

so, no, there are not docs on how to do it. But you can learn those 2 from a ton of difference sources

amber thistle
#

yea i know abit of css and html but i need to know the button's class / id name no?

opal plank
#

right click, inspect element

#

or better yet

#

ctrl + shift + i, then use the selector

amber thistle
#

oh ty

opal plank
#

np

#

πŸ‘

ocean cedar
#

okay i am here

outer perch
#

ye

ocean cedar
#
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});```
#

i domt need this anymore?

outer perch
#

no delete

ocean cedar
#

done

outer perch
#

copy all that I sent, but changing the Auth string to yours

#

ignore const ref

#

and everything after

ocean cedar
#

so i copy your screen from const data included to ref excluded?

outer perch
#

yes

ocean cedar
#

where do i put thos lines?

outer perch
#

until u have the line from userID

#

there says es.onmessage

#

so clear inside the es.onmessage

#

and get that inside

blissful coral
#

Ok so

#

Never

#

Spoonfeed code

#

Please and thank you

sick cloud
#

so in my site i'm using flex and justify-between to spread 3 elements evenly in a div, how do i make one of the 3 elements (the middle one mainly) larger so it takes more space up then the others

blissful coral
#

You can help them and guide them but do not just give them all the code

#

Because then they do not understand how it actually works

earnest phoenix
blissful coral
#

@earnest phoenix just add a catch

sick cloud
outer perch
#

@blissful coral I am explaining

#

but after the code

blissful coral
#

@sick cloud You would assign it a class aswell and then edit it's margins and sizes

outer perch
#

@ocean cedar what u r pasting is basically variables getting info from the .json

blissful coral
#

Or if you are attempting to move it alone and not the other stuff you can use align-self

sick cloud
#

it's flex so i don't think margins would help

ocean cedar
#

i see i see

sick cloud
#

how does align self work

outer perch
#

data.event is the data from the event

#

the rest is filtering to what u want

earnest phoenix
#

@earnest phoenix just add a catch
@blissful coral can i add this
let error;
function writeOut(message) {
if (!error) {
error = require('internal/console/global').error;
}
error(message);
}

sick cloud
blissful coral
#

@sick cloud align-self takes properties of justify-content and then align-items

outer perch
#

the type, so u can verify if it's an upvote, and the Auth, to check if it's yours @ocean cedar

blissful coral
#

and only applies them to the single element within the div you assign it

sick cloud
#

so how would i use it in my case roughly

#

i just need to make the middle item have a bigger area

blissful coral
#

change the width and height of it I think

#

For that

outer perch
#

.user is just the user's id, so it goes into a variable called userID @ocean cedar

sick cloud
#
<div class="flex justify-between">
  <div>1</div>
  <div>2 (should take up more area)</div>
  <div>3</div>
</div>

that's roughly my markup

ocean cedar
#

i see

sick cloud
#

changing the width does nothing

outer perch
#

after u have those variables just add the code to access your database

#

check the user if it exists in your database

blissful coral
#

@sick cloud For the div 2 have `<div class="whateverclassforit">info</div>

#

So you can edit the single one only

outer perch
#

or in the cache

#

depends on what u want

sick cloud
#

and then what css do i need to apply to it

outer perch
#

then give them what u want

sick cloud
#

i'm still a noob on anything flex basically lol

blissful coral
#

width and height I think if I remember what worked for me

sick cloud
#

well i've tried it already

#

changing the width doesn't work

blissful coral
#

hmmm

#

there should be a flex element for it

#

one sec

outer perch
#

@ocean cedar hope u read those up there ^

ocean cedar
#

i read and finished to copy it too

sick cloud
ocean cedar
#

so now i have to add the database check and give the reward

blissful coral
#

@sick cloud

ocean cedar
#

inside the index right?

outer perch
#

well, I use the vot info to give my users, if they have a profile, 150G

#

@ocean cedar inside the if statement u just copied

#

right after defining userID

#

access the DB, make the changes and close the If

sick cloud
#

did that right

blissful coral
#

Now apply it to the single element

ocean cedar
#

okay

blissful coral
#

Pretty sure

sick cloud
#

flex-grow on the single one kinda breaks it

#

moves the centre item to the far left

blissful coral
#

hmmm

sick cloud
blissful coral
#

Weird

ocean cedar
#

```if(authorization === xxxx) {
if(type != upvote) return;

  userID = data.event.body.user;

}```

outer perch
#

inside that if

ocean cedar
#

here?

sick cloud
#

i have no idea really

outer perch
#

yeah, inside

ocean cedar
#

so after if(type != upvote) return;

outer perch
#

after userID

lyric mountain
#

Btw, is your code private?

ocean cedar
#

ah okok

lyric mountain
#

Because....well, hard coded auths and tokens are a security leak

outer perch
#

Because....well, hard coded auths and tokens are a security leak
@lyric mountain this is for a simple upvote data system

#

he gets the info, and checks the auth

lyric mountain
#

Still

outer perch
#

the auth is custom on DBL Bot settings

lyric mountain
#

I could fake requests if I got my hands on that auth

#

Custom auth is no less important than, say, discord token

outer perch
#

just change it :)

#

same as the token, regenerate

#

and yeah, my code on github is private

#

no one will ever get it

lyric mountain
#

You don't even imagine how much collateral damage people could cause in the time between leak and regeneration do you?

outer perch
#

unless I show it by myself

lyric mountain
#

Anyway, stay safe

outer perch
#

I do, but I leaked an auth for the voting POSTs

#

and my bot doesn't get any other data than upvotes @lyric mountain

lyric mountain
#

Dddos

outer perch
#

u cant, it's in pipedream

#

not in the bot host

#

:v

#

pipedream goes down, but the bot is up

#

:^)

lyric mountain
#

I prefer not to risk anyway

outer perch
#

dw, my good heart often doesn't fuck me up

tepid grove
#

(node:7524) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
at Function.normalizeFields (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
at MessageEmbed.addFields (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/structures/MessageEmbed.js:266:42)
at MessageEmbed.addField (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/structures/MessageEmbed.js:257:17)
at commands.forEach (/app/others/help.js:104:25)
at Array.forEach (<anonymous>)
at Object.execute (/app/others/help.js:103:22)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7524) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7524) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:7524) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Emoji
at RequestHandler.execute (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7524) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

#

help

outer perch
#

fields.flat is not a function

#

up there at the first line u get that

lyric mountain
#

Didn't u mean flatmap?

#

The op, in this case

tepid grove
#

how to fix

quartz kindle
#

update node.js

lyric mountain
#

Didn't u mean flatmap?

#

Is flat even a thing?

quartz kindle
#

are you hosting on glitch?

tepid grove
#

yea

quartz kindle
#

you need to chnage the node version to 12

#

in your package json

#

under engines

tepid grove
#

how to change

ocean cedar
#

@outer perch MessageEvent is not defined

outer perch
#

hmmm

#

1 sec.

earnest phoenix
#

Ok is there a way so that discord.py can upload a image that a user sends at the same time

hollow sedge
#

there is a way

outer perch
#

@ocean cedar

earnest phoenix
#

hi guys should i add this to fic the error :
let error;
function writeOut(message) {
if (!error) {
error = require('internal/console/global').error;
}
error(message);
}

ocean cedar
#

lets see ^^

earnest phoenix
#

stop taking and copy pasting code without understanding what it does

#

take a second out of your day to read your error

#

you can't fix it, you can't force a user to accept DMs

#

no but just to have a small messsage on the cosole log like user can't receive dm

ocean cedar
#

it worked

#

so Mr Deadly thank you really really really really a lot

outer perch
#

well, it was hard for me

#

it would take 10 min. instead of 40

blissful coral
#

@earnest phoenix What library are you using

outer perch
#

if I was on my pc chillin'

blissful coral
#

Because honestly what you are doing here looks way over the top

ocean cedar
#

thank you really a lot

earnest phoenix
#

Because honestly what you are doing here looks way over the top
@blissful coral ?

ocean cedar
#

wich bot did you develop?

blissful coral
#

@earnest phoenix What library are you using
@blissful coral

outer perch
#

wich bot did you develop?
@ocean cedar me?

ocean cedar
#

yes

outer perch
#

@earnest phoenix

sick cloud
#

one other random question
how does z-index work

outer perch
#

this bot

#

ur client may haven't cached it xD

sick cloud
#

because my 3 elements kinda overlap when the browser is resized so i want to bring the middle element "forward"/over the top of them

ocean cedar
#

no, but rewards are assigned correctly

quartz kindle
#

give it a bigger z-index value, however z-index only works for "floating" elements, such as position:absolute

#

it doesnt work for inline stuff

sick cloud
#

uh

#

i'm using flex

#

will that affect it

#

all 3 are flex and justified-between

quartz kindle
#

what about those hovers?

#

are they absolutes?