#development

1 messages · Page 1067 of 1

hearty wind
#

it just keeps changing back and forth and idk why.

#

like the 1 used to be a 2.

#

i made no changes to the reaction. and it went back to 1.

slender thistle
#

huh

hearty wind
#

yeah its so weird LOL

#

my logic sucks.

stiff stream
#

hey

#

so

#

someone here see any problem?

hearty wind
#

@stiff stream you should probably explain the problem lol

stiff stream
#

@hearty wind

#

so?

#

???????????

slender thistle
#

message.content.substring(PREFIX.length + 13) is empty

stiff stream
#

?

#

wdym?

slender thistle
#

That returns an empty string

#

aka literally ''

stiff stream
#

so what i need to do?

slender thistle
#

What do you want to enter in the field name

stiff stream
#

what the player sayed

#

its like say command

#

@slender thistle

#

what the player sayed

slender thistle
#

Why the + 13 part? What does that signify?

stiff stream
#

idk.. someone here told me to do that

slender thistle
#

Can you post the error

stiff stream
#

yes

#

oh

#

him

slender thistle
#

@stiff stream Just remove the + 13 part and try running it

nocturne grove
#

I think the command name has a length of 13

slender thistle
#

Why

#

are you DMing multiple members at once

stiff stream
#

work @slender thistle

#

but

#

then it says this

#

i dont want it to say announce

#

@slender thistle

earnest phoenix
#

How do i advertise my bot in top gg? it says i dont have any bots but i do have a bot

autumn aspen
#

Guys what is the light blue color id for an embed?

slender thistle
nocturne grove
#

You can do it the ugly way and slice 8 chars from the beginning @stiff stream

earnest phoenix
#

oh sorry

stiff stream
#

just tell me how to fix that

#

please

#

so it wont say announce

slender thistle
#

PREFIX.length + command.length

nocturne grove
#

Just google "js string slice function"

slender thistle
#

where command should be announce

autumn aspen
#

Oh

#

where command should be announce
@slender thistle Whats the light blue color id for an embed

nocturne grove
#

If he uses a command handler something like that will work yeah

slender thistle
#

Can you stop pinging me almost every 5 seconds

stiff stream
dark eagle
#

How do you bump???

slender thistle
#

@dark eagle Bump what and where

#

@stiff stream Not literally

dark eagle
#

Bump my server to get more people

#

How

slender thistle
nocturne grove
#

Probably asking something about a bump bot

dark eagle
#

Yes

slender thistle
#

command is just a placeholder I used where you enter a variable that's equal to "announce", Ron

digital ibex
#

what are u tryna do, sxpherr?

stiff stream
#

oh

#

let me try it now

nocturne grove
#

Why do you want to dm people with your bot?

digital ibex
#

wdym multiple dm?

nocturne grove
#

Doesnt sound right

slender thistle
#

Multiple dm command
I hope you do realize that's going to get you in trouble, Sxpherr.

stiff stream
#

says that announce is not define

#

says that announce is not define

digital ibex
#

just like

slender thistle
#

It's sending messages to everyone in a server

digital ibex
#

limit at 5 or something at a time

stiff stream
slender thistle
#

That includes all cached members

digital ibex
#

i can help with doing that, if u want

slender thistle
#

@stiff stream announce being a string, not a variable

stiff stream
#

saying that announce is not define

pure lion
#

What

stiff stream
#

@stiff stream announce being a string, not a variable
wdym?

digital ibex
#

yeah

stiff stream
#

k

pure lion
#

@stiff stream announce = String

earnest phoenix
#

sup i need some help with this thingy it when someone has no money the command aint working i dont know how to make it show 0 if they have no money

digital ibex
#

'string'
variable

#

no @earnest phoenix

slender thistle
#

"announce" - string
announce - variable

stiff stream
earnest phoenix
#

is there a way to check if someone has "aaa" in the status, python

stiff stream
#

oh

#

ok

pure lion
#

@earnest phoenix if (money == null)

nocturne grove
#

its members.cache.forEach

#

But still, why

slender thistle
#

@earnest phoenix "aaa" in user.activity.name

pure lion
#

You'd get ratelimited to oblivion

slender thistle
#

Ignoring cases when user's activity includes AaA, aaA, etc.

digital ibex
#
for member in discord.member: 
 
if 'aa' in <Status>:
    # do something
#

oh

#

whoops

slender thistle
#

member works too because it inherits User

#

no wait

#

I'm an idiot

pure lion
#

Yeah I was gonna ask about user/member objects

#

Can you send to a member

#

Or just a user

slender thistle
#

You can

digital ibex
#

users have that property?

slender thistle
#

Member class inherits User so Member.send works too

#

No, users don't have activities

earnest phoenix
#

@earnest phoenix if (money == null)
@pure lion FUCK doesnt work 😦

digital ibex
#

huh

#

then...

#

nvm

slender thistle
#

That's Member's and my brain being on cold water

pure lion
#

@earnest phoenix show code

digital ibex
#

oh right

earnest phoenix
#

@pure lion what happend to ur bot btw

pure lion
#

aleBot?

#

It's fine lol

earnest phoenix
#

yeha

#

not in server

#
let prevmoney = await bot.db.collection("Money").findOne({"User_ID": user.id})

    if (prevmoney == null) {
        prevmoney = 0;
    }
pure lion
#

Log prevmoney

earnest phoenix
#

k

#

null cuz they have no money

#

@pure lion

stiff stream
#

i think there is something wrong with my command, can someone join my server and say ron announce hey?

#

?

#

please

#

and then leave

digital ibex
#

use an alt

stiff stream
#

to make an alt in 5m or someone will join and say it in 10s

pure lion
#

@earnest phoenix log it after you set it to 0

earnest phoenix
#

k

stiff stream
#

please some one

#

i think there is something wrong with my command, can someone join my server and say ron announce hey?

#

please

#

its just 5 seconds

earnest phoenix
#

boi 12 yr old calm down

stiff stream
#

im 15

spice pier
#

Stop begging for people to join your server

earnest phoenix
#

;-;

stiff stream
#

i want to see if the command works

pure lion
#

@earnest phoenix it's the first fucking line

nocturne grove
#

Seems clear

pure lion
#

It is on the first line

sonic lodge
#

DiscordAPIError: Cannot send messages to this user

spice pier
#

Cannot send message to this user

nocturne grove
#

Read what you sent please

pure lion
#

Read the first line

#

Because they probably blocked the bot

#

Or turned off server dms

#

:l

earnest phoenix
#

@earnest phoenix log it after you set it to 0
@pure lion tf it logs 0 but the thing says it is undefined

pure lion
#

Where are you using it derku?

stark abyss
#
const gifs = function(args, command){
    args = message.content
      .trim()
      .split(/ +/g);
    if(message.mentions.users.first() == undefined){
      return message.channel.send("You didn't mention the user!")
    }
    if(args[3] != undefined){
      return message.channel.send(`Incorrect useage! Please do ${prefix} ${command} [@user]`)
    }
    var userID = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    var username = userID.user.username;  
}
module.exports = {gifs};```
How can I  use message or args in a function I am exporting?
digital ibex
#

gifs(args, command)

#

boom

earnest phoenix
#

Where are you using it derku?
@pure lion bruh that is the code i gave u

stark abyss
#

ok

digital ibex
#

and why do u have a {} around the module.exports ?

pure lion
#

But where are you using prevmoney

earnest phoenix
#

But where are you using prevmoney
@pure lion out side of the if thingy

digital ibex
#

you're also assigning args to a different value no matter what you provide yikes

pure lion
#

:l

stark abyss
#

confusing

pure lion
#

@earnest phoenix show the entire command

digital ibex
#

you're doing this

earnest phoenix
#

@earnest phoenix show the entire command
@pure lion it wont fit in text file

pure lion
#

Use my bot to bin it

stark abyss
#

SyntaxError: Missing initializer in const declaration

pure lion
#

Use var

stark abyss
#

is what i got when i didconst gifs(args, command) = function(command){

#

oh ok

digital ibex
#
const gifs = function(args, command){
    args = message.content 
      .trim()
      .split(/ +/g); // if i put the args as ['hi'] the you're reassigning ti to be message.content.trim...
    if(message.mentions.users.first() == undefined){
      return message.channel.send("You didn't mention the user!")
    }```
earnest phoenix
#

@earnest phoenix "aaa" in user.activity.name
@slender thistle is this python or js

slender thistle
#

Python

#

just like you asked

digital ibex
#

dont use var

stark abyss
#

SyntaxError: Unexpected token '('

#

i got that

#

so confused

pure lion
#

'('

digital ibex
#

var is deprecated

pure lion
#

Almost

earnest phoenix
#

i did


@client.command()
async def status3(ctx):
    if "aaa" in user.activity.name:
        bruh = client.get_channel(721670310377816084)
        await bruh.send('hello')``` and it doesnt seem to work
stark abyss
#

var gifs(args, command) = function(){
args = message.content
.trim()
.split(/ +/g);

wheat vapor
#

Sa türk var mı

stark abyss
#

so what do u want me to do?

slender thistle
#

-notr @wheat vapor

gilded plankBOT
#

@wheat vapor

İngilizceden başka dillerde konuşmak için #memes-and-media kanalını, top.gg hakkında destek almak için #support kanalını kullanın.
BU KANALDA TÜRKÇE KONUŞMAYIN.

digital ibex
#

im pretty sure you'd need a for in loop

stark abyss
#

u said don't use const, or var

wheat vapor
#

tm

slender thistle
#

@earnest phoenix Get the user IN the command

stark abyss
#

me?

wheat vapor
#

ok

pure lion
#

Use leg

#

Let

digital ibex
#

i said dont use const or var???

stark abyss
#

same eror

#

someone did

digital ibex
#

🗿

#

im literally moyaying so hard rn

pure lion
#

Fuck it I'm changing the js compiler to say leg instead of let

stark abyss
#

lmao

#

what do i do god dammit

digital ibex
#

u just like

slender thistle
#

@earnest phoenix Also, disregard that. You, in fact, need guild.get_member (replace guild with whatever property of ctx you think stands for guild)

digital ibex
#

remove the args param in the gifs function

stark abyss
#

well then i am at the start

digital ibex
#

since you're not doing anything with that

stark abyss
#

args isn't defined

digital ibex
#

no

stark abyss
#

message isn't defined

digital ibex
#

then do const args = ?

stark abyss
digital ibex
#

then pass message instead of args

stark abyss
#

my guy i don't think you know this quite enough

digital ibex
#

what

stark abyss
#

i am module exporting it

digital ibex
#

do you understand what this does? js function bob (args) { args = 'ur mom fat'; });

#

thats essentially what you're doing

earnest phoenix
digital ibex
#

is what im saying

stark abyss
#

yes but then how do i export it?

digital ibex
#

module.exports = bob

stark abyss
#

okay let me try that

#

and how do i use it?

#

or how do i call it?

#

@digital ibex

earnest phoenix
stark abyss
#

const gifs = require("./../../function.js")?

#

gifs is function name and function.js is file

digital ibex
#

idk

stark abyss
digital ibex
#

it shoudl work

#

if u do ```js
const gifs = require('ur mom');
gifs(args, command)

earnest phoenix
#

do you guys have any recommendations for hosting
ive been using the free heroku tier but it's currently being real shitty

stark abyss
#

okay well i can use the function

#

but i can't use args or message or content

earnest phoenix
#

i dont have a job so i need something cheap

digital ibex
#

ask mommy or daddy

stark abyss
earnest phoenix
#

they only let me spend my money on gas and food D:

slender thistle
#

SkySilk have cheap tiers too

earnest phoenix
#

actually

#

i have a $100 credit on digitalocean

#

from the github student dev pack

tulip ledge
#

Does anybody know how when I like click on this it opens up and displays all the info?

stark abyss
#
function gifs(command){
    args = message.content
      .trim()
      .split(/ +/g);

    if(message.mentions.users.first() == undefined){
      return message.channel.send("You didn't mention the user!")
    }

    if(args[3] != undefined){
      return message.channel.send(`Incorrect useage! Please do ${prefix} ${command} [@user]`)
    }

    var userID = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    var username = userID.user.username;  
}

module.exports = gifs;```
So I can use this function, but args, message, and content aren't defined. If i put it as an parameters, I get TypeError: Cannot read property 'content' of undefined. So how can i use args/message stuff? please ping me
tulip ledge
#

you either need to pass the message as a parameter or hoist the function in your message event

stark abyss
#

putting message in parameter kinda worked but then it asked for content and eventually i get content is undefiend

#

so ill do the later one thx

quartz kindle
#

you only need message

#

nothing else

tulip ledge
#

Tim

#

Do you know how to do what I want to do?

digital ibex
#

u can make a div

#

with everything u want to show

tulip ledge
#

Already did

digital ibex
#

and as default, its opacity: 0; and when u click, opacity:1;

#

where r u now?

tulip ledge
#

The issue is just showing them will not work

#

As then it will overlap on the other divs I think

#

I can try

#

Oh yeah I could just do like listen for a click using JS and then remove the not-expanded class

#

Can I just do

$('.not-expanded').click(function(event){
    // Change the thing to remove not-expended
});
digital ibex
#

i'd just use regular js, but jquery could do it

tulip ledge
#

how would I do it in regular js then?

#

As I'm better at regular js

#

(I'm just using jquerry since the template I'm editing uses it)

earnest phoenix
#

how do i find out if my bot is on to.gg

tulip ledge
#

Its not

earnest phoenix
tulip ledge
#

Why did u ping Tim?

#

@digital ibex (sorry for ping) but how would I do it in regular js?

#

I don't even know how to do it in jquery

#

I just know how to look for a click

earnest phoenix
#

how to adv my bot ?

tulip ledge
digital ibex
#

im back

#

u can just do

tulip ledge
#

I basically need to look for a click on a div with the class not-expanded and then check wich one got clicked and then remove the not-expanded or add the not-expanded

digital ibex
#
document.getElementById('the id of the div').addEventListener('click', (data) => {
// do stuff in the DOM
});```
#

you'd assign it an id btw

#

you cant use getElementByClassName

tulip ledge
#

Wait no I need to do it with classes

#

But

digital ibex
#

why?

tulip ledge
#

Using ID

#

Will I still be able to add and remove the class?

quartz kindle
#

is it a one way expanding, or a toggle that you can expand/unexpand?

digital ibex
#

are we talking about a js class or html tag class?

tulip ledge
#

I want a toggle

#

html class

quartz kindle
#

then you need to loop through all elements with said class and add an event listener to each of them

pale vessel
#

getElementsByClassName?

tulip ledge
#

And how would I do that? I've never done js web app stuff

quartz kindle
#

something like document.querySelectorAll(".myclass").forEach(element => {})

tulip ledge
#

ok I'll try

#

Uncaught TypeError: document.querySelector(...).forEach is not a function

digital ibex
#

querySelectorAll

tulip ledge
#

Oh ok cool

#

😄

#

Thank you

#

I just event.addEventListener('click', (data) => {});

#

Or will that only fire once?

#

Well thgen element instead of event

digital ibex
#

this in the in the for each function?

tulip ledge
#
document.querySelectorAll(".not-expanded").forEach(element => {
    element.addEventListener('click', (data) => {
        console.log(data)
    });
})

This isn't logging anything when I c lick something

earnest phoenix
digital ibex
#

if it is, then assuming that theres only one html elemetnt with the class name urclassnamehere then it will only do it once, otherwise, it will do it however many times there is an element with urclassnamehere

#

idk chicken

tulip ledge
#

Yes but it's not logging

digital ibex
#

i'd just add an id instead of using the querySelectorAll function

#

id always works for me

quartz kindle
#

id doesnt work for multiple elements

tulip ledge
#

But I have like 40 different things to expand

digital ibex
#

oh yeah 🤦‍♂️

#

im clever

quartz kindle
#

@tulip ledge does it work if you paste it into the dev tools console?

#

btw any errors in the console?

tulip ledge
digital ibex
#

ur checking the client side console instead of server side?

#

oh

tulip ledge
#

No errors just that it can't find my fonts

digital ibex
#

it says undefined when u click?

tulip ledge
#

no when ever I press enter

digital ibex
#

click it

tulip ledge
#

Clicking does nothing

#

It does log the elements in the querySelectorAll tho

quartz kindle
#

and nothing logs when you click on those divs?

tulip ledge
#

nope

quartz kindle
#

works fine for me

#

¯_(ツ)_/¯

tulip ledge
#

wth

quartz kindle
#

you have something blocking it maybe? such as pointer-events:none

tulip ledge
#
   .work-request--information label {
    position:absolute;
    top:0;
    left:0;
    pointer-events:none;
    -webkit-transition:top .2s ease-in-out,font-size .2s ease-in-out;
    transition:top .2s ease-in-out,font-size .2s ease-in-out
   }

This maube?

#

Its from the template

quartz kindle
#

is that on a parent div?

#

or a child?

digital ibex
#

oh im late

tulip ledge
#

I did ctrl F and looked up work-request doesn't show anything neither does label

#

I did this:

.docs {
    pointer-events: initial !important;
}

Docs is the parent

#

And it doesn't work

stiff stream
#

need help

crimson vapor
#

what?

stiff stream
#

how do i make that it will delete that i sayed ron poll test

#

?

misty sigil
#

message.delete()

tulip ledge
#

message.delete() ?

stiff stream
#

yes but

crimson vapor
#

message or msg .delete().catch(e => console.log(e))

stiff stream
#

where?

misty sigil
#

any where

stiff stream
#

ok

tulip ledge
#

not in the .then() tho

stiff stream
#

message.delete()

#

?

#

k

#

message.delete()

#

?

tulip ledge
#

You're overwriting the message variable there so that will delete the message the bot sends

crimson vapor
#

ok so you did message.channel.send(polls), change the .then(message, ) to .then(m, )

stiff stream
#

done

#

works

#

ty

tulip ledge
#

So @digital ibex (srry for tag) what do I d othen

untold folio
#

is discord api down

#

?

tulip ledge
#

yes

untold folio
#

oof

tulip ledge
#

im gonna go sleep if anyone has a solution to my issue please @me so Ican find it esily

frigid cave
#

(node:2988) UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOTFOUND discordapp.com discordapp.com:443

#

I am confused

#

is discord down ?

#

or what

untold folio
#

yes it is

#

everyone's getting that error

frigid cave
#

my friend told me to change to discord.com but I said ''wtf No'' lol

#

so we just wait now ?

pale vessel
#

that's for november 7th

frigid cave
#

yes we have time for that

#

correct?

pale vessel
#

yeah

gleaming willow
pale vessel
#

just wait until it cools down for a bit

frigid cave
#

okay great

buoyant grove
#

I don't know if everyone received the notification, but the discord team will abandon the main url that the bots used 'discordapp.com', but it was supposed to be on November 7th, but there must have been some mistake that caused it.

pure lion
#

Aaaaa discord server down

gleaming willow
#

when does it open?

pure lion
#

:((((

earnest phoenix
#

cf has a bit off an issue

#

wait for a while

shut dew
#

.

frigid cave
#

my bot is still offline, is it normal?

#

I am not getting this error it is just Attempting to load commands lot of time

true trail
#

@frigid cave Could be because massive cloudflare downtime?

#

Legit every bot went offline

#

All you can do is wait

errant perch
wintry wing
#

unsure why but my bot is saying there was a memory leak and 11 message listeners were added, though in my code I don't have anything that could make new message listeners and only have 1 message listener (just a client.on('message', msg => {) Is there a way to stop this from happening?

quartz kindle
#

what is the event listener

#

the error should show which one is being created

wintry wing
#

unsure why but my bot is saying there was a memory leak and 11 message listeners were added, though in my code I don't have anything that could make new message listeners and only have 1 message listener (just a client.on('message', msg => {) Is there a way to stop this from happening?
@wintry wing

#

(node:28478) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [process]. Use emitter.setMaxListeners() to increase limit

quartz kindle
#

are you sure you only have 1 on("message")?

wintry wing
#

yes

#

I don't have any listening events within message either.

quartz kindle
#

try this

#

console.log(client._events.message.size)

wintry wing
#

Oh ok

quartz kindle
#

do you have an eval command?

wintry wing
#

yes

#

and the bot disconnected due to discord api being down today

#

im going to wait until it gets back on

#

undefined?

#

When I evaled that it states undefined

quartz kindle
#

.length sorry

#

not .size

wintry wing
#

it logged 1

quartz kindle
#

then there is no leak anywhere

wintry wing
#

I'm unsure how I got the error then

quartz kindle
#

does that warning appear when you start the bot?

wintry wing
#

Nope

#

it's later in the bot

#

Wait

#

I think I know why it happened

quartz kindle
#

do you have message collectors?

wintry wing
#

Not sure if this is the reason but

#

No

#

I don't use awaitmessage

#

I do use reaction collectors though

#

I think the reason was because of the discord api going down since the bot was spamming errors of the econnect thing and thats when the memory leak occured

earnest phoenix
#

anyone know how to code in 'english'?

#

I wanna make a discord bot in it

pure lion
#

Bruh was this server temporarily down

warm marsh
#

Discord was down.

#

Hence why bots might be having issues with connecting.

pure lion
#

Ik but when it came back up it said "temporarily unavailable"

warm marsh
#

Yeah usually happens.

earnest phoenix
#

gg

pure lion
#

😏

chilly sphinx
#

Wow, I had a big bug with my bot a few hours ago...
It was kicked from about 20 guilds and immediatly invited in these guilds...

Discord API fail?

misty sigil
#

yes

slender thistle
#

Start checking if the guild becomes unavailable

#

It wasn't "kicked", the guilds became unavailable

#

therefore triggering guildRemove event

chilly sphinx
#

Ok

summer torrent
#

which library th

chilly sphinx
#

Discord.js

summer torrent
#

discord.js fixed this bug on v12

chilly sphinx
#

I'm still on v11

summer torrent
#

thats why

earnest phoenix
#

i think i made my code

#

too organized

#

like way too organized

#

its gone too far lmfao

#
module.exports = _.plugin({
    enable: data => {
        data.command = $new("bot/command/Command", {
            name: "help",
            aliases: ["commands"],
            usage: [],
            desc: "Shows a list of commands.",
            perms: [],
            type: "Information",
            run: (args, msg) => {
                const types = {};
                const scope = $("bot/scopes/global/scope");
                scope.commands.forEach(cmd => {
                    let newline = true;
                    if (!(cmd.type in types)) {
                        types[cmd.type] = {
                            name: cmd.type,
                            value: ""
                        };
                        newline = false;
                    }
                    const text = (newline ? "\n" : "") + "`" + cmd.name + "` " + cmd.desc;
                    types[cmd.type].value += text;
                });
                msg.channel.send({
                    embed: {
                        color: 0xFF00FF,
                        title: "Commands",
                        fields: Object.values(types)
                    }
                });
            }
        });
        $("bot/scopes/global/scope").add(data.command);
    },
    disable: data => {
        $("bot/scopes/global/scope").remove(data.command);
        delete data.command;
    }
});```
#

kek

#

send help

sudden geyser
#

oh god

earnest phoenix
#

lmfao

#

at least i can reload my scripts

#

so there's that

opal plank
#

better organized than not

#

¯_(ツ)_/¯

#

good job

earnest phoenix
#

lmao

#

three global variables though

#

😢

digital ibex
#

Wow, I had a big bug with my bot a few hours ago...
It was kicked from about 20 guilds and immediatly invited in these guilds...

Discord API fail?
@chilly sphinx no

#

regions of cloudflare died

#

nothing to do with the api itself

slender thistle
#

Discord affected by incident on Cloudflare's end

chilly sphinx
#

Yes

earnest phoenix
#

it feels so good being able to do this

#

r$eval _.manager.reload("bot/bot")

#

lol

digital ibex
#

why do people define things with a _ ?

#

its stupid

sudden geyser
#

lodash moment

earnest phoenix
#

how is it stupid

digital ibex
#

unless its a language like python ofc, but otherwise stupid

earnest phoenix
#

its a global variable

digital ibex
#

i mean like

#

bob_name

earnest phoenix
#

I use it as a standalone name

digital ibex
#

thats stupid

earnest phoenix
#

I don't use it in the middle of names

digital ibex
#

ok

earnest phoenix
#

_ is a global variable which contains everything the bot needs to function
$ is a global variable which acts as a helper for _.manager.plugin("...").data["..."]
$new is a global variable which acts as a helper for new ($(...))(...)

#

those are my three globals

pure lion
#

bobName > bob_name

slender thistle
#

casing falls under preferences

warm marsh
#

PascalCase > camelCase. (imo)

slender thistle
#

I leave that for C#

amber fractal
#

I only use that for C# and classes in js/java, I use snake_case in python and camelCase in the majority of things I do

earnest phoenix
#

of course

opal plank
#

SpoNgEBoBCAse >

earnest phoenix
#

I use camelCase

#

except for classes

#

and constants

#

methodNames
variableNames
ClassNames
GLOBAL_CONSTANT_NAMES

#

Even in C#

#

I don't follow the C# convention

south coyote
#

hello

pure lion
#

Hi

south coyote
candid hill
#

I'm having trouble uploading images to embeds in discord.js. Here's what I have so far:

console.log(fs.existsSync('./Images/Thumbnails/completion.png'));
embed.attachFiles(['./Images/Thumbnails/completion.png'])
  .setThumbnail('attachment://completion.png')

When I run the code, the embed shows up without a thumbnail (or attachment). The console log is outputing true, so I don't think it's a problem with my file path. I've also tried switching out .setThumbnail() for .setImage() to match with the guide, but still no dice.

earnest phoenix
#

you need to load the attachment

candid hill
#

load the attachment? that's different from .attachFiles()?

digital ibex
#

you dont need to do that

#

u can just simply do it without fs

candid hill
#

right, I have fs in there to check if the file path is valid

digital ibex
#

i was responding to rigidity

#

but what u can do as an alternative

#

is just make it a js file and with the url of that image u want

candid hill
#

instead of using the literal string?

digital ibex
#

wdym

candid hill
#

confirming that the url from the js file goes into .attachFiles(), not .setThumbnail()

#

i'm trying to get a local file to upload, if that wasn't clear

digital ibex
#

idk how attatchFiles works, but what u can just do is module.exports = 'url here'; in the separate js file, and then just .setThumbnail(require('path to module.exports...'))

#

oh

#

well

#

you're gonna have to convert the png image into a url

sonic lodge
#

you could host your image online, and set the thumbnail to be the link of the image

digital ibex
#

since .setThumbnail takes a url, and im assuming .attatchFiles also takes a url, not too sure about that one tho

candid hill
#

yeah, getting stuff from a url was working fine. it was just getting local images that was giving me trouble. maybe i'll look into hosting instead

digital ibex
#

seems like the best solution, yeah

quartz kindle
#

@candid hill the attachment needs to have a name defined

#

.attachFiles([{attachment:"path to img",name:"name.png"}])

earnest phoenix
#

why lmao

quartz kindle
#

titles cant have emojis

earnest phoenix
#

ive seen them

slender thistle
#

Author field probably

earnest phoenix
#

oh

#

author: {text: emoji}?

#

or is it name

#

didnt work

candid hill
#

ok, i'll give it a shot

earnest phoenix
#

ohhh

#

i forgot to add the a

#

because its animated

candid hill
#

no dice with a name added

embed.attachFiles([{ attachment: './Images/Thumbnails/completion.png', name: 'completion.png' }])
  .setThumbnail('attachment://completion.png')
earnest phoenix
#

there are tons of tutorials online for that

#

and stackoverflow posts

candid hill
#

yeah, after copying those, i was thinking maybe more eyes could spot the mistake. oh well

earnest phoenix
#

so

#

im trying to start my bot with a good foundation this time

#

should i shard it right off the bat

amber fractal
#

no

#

that's not the point of sharding

#

in fact, sharding right off the bat is probably one of the worst things you can do

#

build it with sharding in mind and implement it when you need to

quartz kindle
#

i mean, you should code with sharding in mind, for compatibility, and turn it on for testing

#

just to make sure you wont have problems when you actually need it

#

also depends what kind of sharding

#

internal sharding doesnt even need anything to be done

quaint hornet
#

how can i blur a image on canvas on nodejs

earnest phoenix
#

ok

chilly bison
#

@quaint hornet its slow

quaint hornet
#

i has sending in the wrong channel sorry

still badge
#

how do i turn the emoji id into the emoji?

#

711585977185075301 i need this turned back into emoji?

opal plank
#

you can fetch it on the cnd

still badge
#

i mean in general

#

like in a chat

opal plank
#

you cant, unless you have the name

still badge
#

not in code

earnest phoenix
#

<:name:id>

#

oh

#

:name:

opal plank
#

with only id, you can only use cnd to fetch it

still badge
#

@earnest phoenix i only got id of it

opal plank
#

then use cnd

earnest phoenix
#

dafuq is cnd

opal plank
#

this is your emoji

#

CDN*

earnest phoenix
#

why

opal plank
#

CDN is stored with id

earnest phoenix
#

thats not using the emoji

opal plank
#

you dont need the name

earnest phoenix
#

thats using the gif

opal plank
#

the emoji IS a gif

earnest phoenix
#

you're pasting the link

#

not the emoji version of the link

opal plank
#

i told him, without name you can only fetch it with the cdn

earnest phoenix
#

r u sure

opal plank
#

what part did u not understand?

#

he has id

#

only way to see which emote that is, is checking the CDN of discord for that ID

earnest phoenix
#

not true

opal plank
#

unless you have name, which then you can do name:id

earnest phoenix
#

<:a:any_id>

#

try this

#

it legit works

opal plank
#

sure does

merry fulcrum
#

something like

:ubow:
opal plank
#

not*

earnest phoenix
#

you need colon @opal plank

merry fulcrum
#

damnit it didn't work

earnest phoenix
#

colon a colon

#

<:a:622740523203035176>

#

paste this

merry fulcrum
#

yes

earnest phoenix
#

that literally puts this emoji

opal plank
#

hmmm thats odd

earnest phoenix
#

here's a vid

opal plank
#

since when is this a thing?

earnest phoenix
#

just the way it works

opal plank
#

i wonder if thats client onl

earnest phoenix
#

you didnt put the colon before the a

#

this is the desktop client

merry fulcrum
#

just like how adding :: between "smile" gives you 😄 but when you do ask the bot to write that it just adds plain text instead of the emoji.

earnest phoenix
#

ill try on phone

#

yeah bots need the id

#

<:a:622740523203035176>

#

works on mobile too

merry fulcrum
#

works for users in general.

earnest phoenix
#

yup

muted radish
#

hm

opal plank
#

¯_(ツ)_/¯

valid frigate
earnest phoenix
#

you didnt ask about in code

opal plank
#

i didnt ask anything

earnest phoenix
#

if you're writing code, why cant you just fetch the emoji

#

and get the name

#

?

valid frigate
earnest phoenix
#

^_^

earnest phoenix
#

to turn it back into an emoji

#

do

valid frigate
#

but apparently i cant make functions in an impl block async

opal plank
#

i didnt say it would return the name

#

i said if you only have id, you can use CDN to get it

earnest phoenix
#
const emoji = guild.emojis.cache.get(id);
const text = "<" + (emoji.animated ? "a:" : "") + emoji.name + ":" + emoji.id + ">";
#

try this

#

if its not exactly correct, its close

#

so dont @ me lmao

opal plank
#

lemme do a manual request

earnest phoenix
#

why?

opal plank
#

cuz i wanna see the unparsed response

earnest phoenix
#

why?

opal plank
#

cuz i want?

earnest phoenix
opal plank
#

you really getting on my nerves with the sass mate

merry fulcrum
#

Hi, I'm having a problem with running my bots. I am using Python, on a windows operating system. Every time I try to run my bot, I get this error:

"aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)')]"

How can I fix this..?

earnest phoenix
#

you really getting on my nerves with the sass mate
@opal plank ?

merry fulcrum
earnest phoenix
#

welcome to nodejs async errors, where they tell you absolutely nothing about where to find it, what to do about it, and how to prevent it

#

wdym so

merry fulcrum
#

can you like

#

copy and paste it

sudden geyser
#

you need to show us the whole error

merry fulcrum
#

or is it 100% of the error

sudden geyser
#

there should be more text above the screenshot you sent us

earnest phoenix
#

the extra text will say something like MISSING PERMISSIONS but not the location

#

no ur not stupid lmao

#

oof

merry fulcrum
#

oof

earnest phoenix
merry fulcrum
#

I'm also getting an error but it's on all of my bots, it says "certificate verify failed: certificate has expired) for some reason..?

"aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)')]"

earnest phoenix
#

your SSL Cert has a Verification error because the certificate has expired for discordapp.com:443 using ssl and so therefore it cant connect

merry fulcrum
#

Okay,

what's a certificate though? And how can I renew it..?

#

(If renewing it is even possible)

earnest phoenix
#

which library

merry fulcrum
earnest phoenix
#

what if you try updating

#

i wonder if its because they switched domains

#

idk

merry fulcrum
#

yeah prob

#

I reinstalled it an hour ago with pip,

#

didn't work but it did go from 1.3.3 to 1.3.4

#

(the version)

#

Thanks still, I'll look into it.

earnest phoenix
#

hope u figure it out

errant perch
#

is there a way to send a message when a user leaves the discord server

#

using .js

opal plank
#

hook onto the event

#

lemme get the docs rq

#

@errant perch

errant perch
#

thank you broþther

opal plank
eternal echo
#

My dream is to be a developer

merry fulcrum
#

If you want to learn how to program bots I recommend Tech With Tim's tutorial on how to use Discord.py but it involves Python which you can learn with a 4 hour video by just typing "Python tutorial" which will show up a nice vid made by freecodecamp.org. @eternal echo

#

Or you can just use Node.js this is just where I began personally.

crystal bison
#

anyone got bot idea... i dont know what to make lmao

eternal echo
#

I favourite java script

#

Python nah

merry fulcrum
#

Make a bot that spams random sentences when you do a command it's really nice for a first bot since it's just so simple. @crystal bison

If you have some kind of experience though, I'd recommend a bot with a currency system, that'd be interesting.

crystal bison
#

@merry fulcrum i have a anti ad and NSFW lol

#

currency system

#

emmm i might actually try that

#

wait does python have array lists?

merry fulcrum
#

Well yeah of course Python has lists like every single other programming language.

#

Do you mean like

#

a module that can arrange a list into an array?

crystal bison
#

yea

merry fulcrum
#

I kinda forgot the name of the module it's used in Machine Learning to manage data but I think it's Numpy

#

and your list must be read by pandas

crystal bison
#

i know i have a function called list

merry fulcrum
#

(another module)

crystal bison
#

so... my plan is. level up earn coins and temp channel that you can join by using coins XD

merry fulcrum
#

Pretty good idea.

#

Btw a function is not a list lol

crystal bison
#

why it blue

#

xDDD

merry fulcrum
#

ohh

#

that

#

Idk what it does

crystal bison
#

hahahaa

merry fulcrum
#

but the kind of list I'm talking about is

example = [1, 2, 3, 4, "five"]

crystal bison
#

like that?

merry fulcrum
#

yes

crystal bison
#

ignore bottom text

#

lol

merry fulcrum
#

I've never made a currency bot,

crystal bison
#

but imagine paying discord currency to have private vc or general 🙂

merry fulcrum
#

but I think you'll have to have the memory on your computer to manage the currency numbers

crystal bison
#

i have a vps it be fine

merry fulcrum
#

Seems legit.

#

Would be nice to have a bot that stimulates the stock market.

crystal bison
#

you sir gived me a challenge

#

im still learning bots but more advancee it is the quicker il learn

merry fulcrum
#

But you gotta learn how the stock market works in the first place.

#

Well uh I wouldn't recommend a stock market as your first bot

crystal bison
#

not my first bot

eternal echo
#

I want a bot system code

crystal bison
#

its my second

merry fulcrum
#

Wdym? @eternal echo

eternal echo
#

With pakage

merry fulcrum
#

@crystal bison Lol second still is beginner

#

ultra beginner

eternal echo
#

@merry fulcrum system bot code

crystal bison
#

CEO its fine if i have a challenge i can use that as a big side project i can keep adding

eternal echo
#

And i want a code for credits

merry fulcrum
#

I don't understand lunZ

#

oh wait

#

so you want free bot scripts..?

eternal echo
#

Yeah

merry fulcrum
#

Yeah seems like a fine goal @crystal bison

crystal bison
#

well he aint ganna learn that way

merry fulcrum
#

and also no lunZ make your own scripts that's how you learn

eternal echo
#

Ok

#

Thnx

merry fulcrum
#

I'd recommend for your first bot to just to replies

#

like

crystal bison
#

emm lunz what language you using

eternal echo
#

Js

merry fulcrum
#

if bot says "Hi"
reply with "Hello, how are you?"

crystal bison
#

EWWW js

merry fulcrum
#

wowowowowo

#

no bullying programming languages

crystal bison
#

;-;

#

sorry hahaha

#

im not a js fan

earnest phoenix
#

I am not a js fan

#

But java fan

merry fulcrum
#

Personally I don't care about what programming language is being used as long as it does the job better than the other on that specific area.

earnest phoenix
#

But i use js anyways

merry fulcrum
#

If you're going to opt for a fast program,

#

python is really bad

#

but C is perfect

#

if you want a Machine Learning algorithm,

crystal bison
#

idk that language 😐

merry fulcrum
#

Python is perfect for that

#

C is a really easy programming language and it's the fastest one out there.

crystal bison
#

better than c++?

merry fulcrum
#

faster yes.

crystal bison
#

O.o

merry fulcrum
#

Not better,

#

there's no "better" programming language in general,

#

but there is a better programming language depending on certain fields.

crystal bison
#

well... i beleive c++ on top right now since its most powerful except too complex XD

merry fulcrum
#

Isn't it C?

#

Wait let me check

#

apparently Java is

frigid lichen
#

i tried to scream but my head was underwater

merry fulcrum
#

rip

crystal bison
#

i know java 😄

merry fulcrum
#

But are you fluent in it?

compact kite
#

C is faster than C++

frigid lichen
#

proof?

merry fulcrum
#

yeah that's what I thought

crystal bison
#

which is better C or C++????

frigid lichen
#

my bot tried to scream but the server was underwaterrr

compact kite
#

C

merry fulcrum
#

There's no better programming language wtf

#

it depends on what field

crystal bison
#

i sais c or c++ i didnt mention others

merry fulcrum
#

C++ has its advantages just like C

frigid lichen
#

yes i am development a depression command

compact kite
#

I mean it really comes down to preference

merry fulcrum
#

so it depends

#

exactly

#

(afk)

crystal bison
#

well ima get started on currency bot

compact kite
#

Eh

frigid lichen
#

Eh

crystal bison
#

currency bot like it gives coins everytime you lvl up and get to pay for private channels 🙂

frigid lichen
#

does web development count @earnest phoenix

crystal bison
#

for like a day

frigid lichen
#

currency bot like it gives coins everytime you lvl up and get to pay for private channels 🙂
@crystal bison a glorified lvl up bot?!?!!

crystal bison
#

well how i plan it

#

like having MEE6 bot ;p

frigid lichen
#

i think it look nice

compact kite
frigid lichen
#

ignore the scroll bar, google sites doesnt know how to deal with it

merry fulcrum
#

a currency bot should have a list

frigid lichen
#

What is the prefix for @gilded plank again
@compact kite yes your going to off topic epic

merry fulcrum
#

like a text list

#

and its objects are seperated with ,

crystal bison
#

ima add json file

frigid lichen
#

hmmm

turbid pivot
#

SENTRY DOWN!

frigid lichen
#

i tried my best to make it good as possible lol

merry fulcrum
#

something like:

Romvnly, LurkingPsycho, CEO of the CEO = Users

numbers = amount of money

List:

Romvnly,LurkingPsycho,CEO of the CEO
400,500,300

Let's say Veld participates to your currency bot and now must be added to the list, there's now a new range with a specific number for that user.

@crystal bison Like it?

frigid lichen
#

something doesnt feel right hmmm

#

why keeo users balances in a json again

#

and not use sequelize or sqlite

compact kite
frigid lichen
#

excuse me?

#

im talking about development, what are you talking about

sudden geyser
#

which is better C or C++????
@crystal bison late answer, but languages are just tools. There is a time and place to prefer one language over the other, so there's no answer to it.

crystal bison
#

fair enough. but i rather do python much simple but i can do a lot

merry fulcrum
#

Python and Javascript are pretty much the only present programming languages for Discord bots currently anyway. @crystal bison

crystal bison
#

get(message.server.roles, id='<role id>') this proper way grabbing roles of client?

merry fulcrum
#

Idk maybe you should try it on your server.

crystal bison
#

ok

#

wait a min i just seen msg from discord... i have til october to verify bot

#

O.o

merry fulcrum
#

Lol rip

#

make the bot application on the discord API rn

#

and make a dozen just in case you don't run out of bots to bots to verify for future projects.

crystal bison
#

lmao

#

i mean i seen bot that grabs console of minecraft server and placed in channel like its it own console

merry fulcrum
#

You've only programmed TWO bots,

crystal bison
#

only 1 but currently learning cogs

merry fulcrum
#

you can't go from programming basic bots to some hyper complicated bot except if you use the power of CTRL + C and then CTRL + V

crystal bison
#

lol

sudden geyser
#

Python and Javascript are pretty much the only present programming languages for Discord bots currently anyway.
There are many. Those are pretty much the languages that are mostly used. For example, JDA is for Java.

crystal bison
#

im doing your idea as side project but right now i need to learn cogs xD

merry fulcrum
#

@sudden geyser I didn't know, thanks for the answer.

#

yes but learn how basics works

#

before trying to hack into the US government and launch the Nuclear bombs towards Russia to innevitably end the Human Race with a Nuclear war.

crystal bison
#

thats kinda easy lol make a bomb threat in area 51 then watch them all focus on that then do your attack

merry fulcrum
#

what

crystal bison
#

idk were coming off topic xDD

sudden geyser
#

Why go through all that when you could just rm -rf /

merry fulcrum
#

ok guess you're a hacking genius now

#

LOL

crystal bison
#

LOL i use kali linux for that

#

i mean i can only sql inject and social engineer a computer thats all i can do XD

merry fulcrum
#

you can't social engineer a computer

#

the very point of social engineering is to make someone give you sensitive information without them realizing it

#

it doesn't involve computers...

crystal bison
#

well all idone with it is absolutly nothing because i cant do shit right now

#

even tho we talking about illeagal activity on this discord server so il stop talking before i get warned or banned xDDD

merry fulcrum
#

Yeah...

#

Sure........

#

Well

#

it's not exactly illegal

#

it depends if you have consent from the company

#

or the user

#

to hack into their account or company

#

some companies will engage ethical hackers to try to hack into their own companies

#

to test the cyber security

#

and inform the employees on social engineering tactics

#

so it's not always illegal.

crystal bison
#

yes but try saying that to some russian hacker

#

XD

merry fulcrum
#

Wdym?

#

Russian hackers aren't any better

#

they're just really reputable because they supposedly "hacked" into the 2016 elections but let's not get political since it's against the rules

crystal bison
#

lmao there only one dream if i could hack and thats activate Emergancy Alert System arround globe say world ending to watch panic

#

and i see

merry fulcrum
#

there's no global emergency alert system

#

there is a national nuclear emergency for each nation (assuming that's the case)

#

but not international

#

but yeah funny dream lol just hope not to happen irl.

crystal bison
#

well if i go to each country and hack each bases then maybe i could

merry fulcrum
#

You can't just "hack" into a government

#

especially good luck hacking into governments like

crystal bison
#

lmao il be shot before i make it to border

merry fulcrum
#

North Korea and China

#

where their internet are completely closed off

#

so you can't communicate with their servers

crystal bison
#

im sure people can visit north korea with phones

merry fulcrum
#

yeah but you have to have a guide and you're under government surveillance 24/7 this is North Korea after all.

crystal bison
#

depressing life living in north karear

#

well i wish i could live in china xDD shiolin temple to visit 😛

#

all i want is to be in peace but im serounded by hate

merry fulcrum
#

Well I would give my point of view but I can't get political.

crystal bison
#

but your listening to some men who sit arround talking nonsence and dressing up in fancy suits as they probs be doing somthing illeagal

merry fulcrum
#

Chinese people are not usually doing illegal business they mostly have a culture of obedience but also

#

this is a channel about development

#

why are we talking about China

crystal bison
#

-.-

#

developpinng a discord bot to hack china got it XDDD

#

lmao sorry i had to

merry fulcrum
#

Lol

crystal bison
#

ok ima have a rest -.- i stayed up from 10am to 4am xDDDD

merry fulcrum
#

Lol

crystal bison
#

bloody hell its 4am and im talking about chinese

#

LMAO

merry fulcrum
#

Go to sleep

crystal bison
#

ok

merry fulcrum
#

why are you even awake at 4 am

crystal bison
#

-.-

#

i have no clue

merry fulcrum
#

this isn't a channel for talking about your bed time

#

we're gonna get warned

crystal bison
#

-.- shhh we dont have to keep takling

earnest phoenix
#

This channel looks incredibly off-topic, Imma have to ask you guys to move

crystal bison
#

already are

night bridge
#

how to get guilds size?
i tried bot.guilds.size() bot.guild.size() bot.guilds.cache.size()
but all error

sudden geyser
#

.size is a property, not a method.

#

Try removing the parentheses and see what happens.

merry fulcrum
#

what if this server made a bot that helps people find solutions to their problems without asking by just typing "-buglist" and it will open a whole list of bugs and solutions tied to them which were each written by the users after finding the solutions to their bugs using "-addbugtolist"

sudden geyser
#

we do have one: google

merry fulcrum
#

(that bot would only be for this server of course)

#

ah shit

#

why didn't I think of that

merry fulcrum
#

YES! I managed to fix the SSL certificate error!

Here's how you fix it (just in case someone looks it up):

  1. Go to start, type internet explorer. Run as admin.
  2. Go do https://discord.com click on the padlock icon.
  3. Click view certificates
  4. Click install certificates, choose either user or local machine.
  5. Click Place all certificates in the following store
  6. Choose Trusted Root Certification Authorities
  7. Enjoy.
Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

winter basalt
#

then ask it

merry fulcrum
#

wouldn't you just

#

and I'm not a professional software developper

#

like

#

change it from image.png

#

to image.svg

#

Imagine it works

#

ye that's pretty much it.

#

I tried it

#

OOF

sonic lodge
#

of course, you can't "read the text content" of an image

merry fulcrum
#

I'm sorry for that

sonic lodge
#

use some image conversion api

#

how doesn't it work

#

the output is in the wrong file format?

merry fulcrum
#

Well if you want to actually run the website you programmed turn the file from txt to html

#

so website.txt to website.html (website can be any name btw)

#

oh lol

#

idk then

#

step 2. Click on it

#

Jk

hazy sparrow
#

how can i see how many guild my bot is in?

#

d.js

sonic lodge
#

client.guilds.cache.size

hazy sparrow
#

ty

sonic lodge
#

i misspelled guilds,