#development

1 messages · Page 883 of 1

valid frigate
#

generally no

#

constructors are used to assign properties or smth to classes

#

you can use static in a method like public static yourMethod()

glad charm
#

@knotty steeple are you using python or something?

knotty steeple
#

no js

valid frigate
#

if you dont need to access class properties

#

like utility functions

glad charm
#

Oh. Depends how you bind your functions.

valid frigate
#

e.g.

class Utils {
  public static reverseString(str) {}
  ...
}
#

wait i dont think you need public

glad charm
#

no lol

valid frigate
#

java brain

knotty steeple
#

vys im working on the economy functions for the bot

valid frigate
#

oh is that why

#

yeah ok one sec

glad charm
#

Sammy if you have properties it's a good idea to use a default constructor to default the values.

valid frigate
#

you sure you cant just do constructor(public asdadad)

#

without needing empty prop initialization

glad charm
#

That's not a default but yes you can.

valid frigate
#

i find it stupid how you still need {} after constructor if you do it like that

#

wack

glad charm
#

You need that for all languages?

#

It's still a function homie.

#

Can't just not have a body.

valid frigate
#

well yes but actually no

#

to an extent

#

oh well js is js

glad charm
#
class Yeet {
  public:
    Yeet() {}
};```
valid frigate
#

now thats funny

glad charm
#

C++ for example.

valid frigate
#

true

glad charm
#

I think I found some old lisp code. frogPog

earnest phoenix
#

what

knotty steeple
#

ok doing the static stuff worked

#

cool

sudden geyser
#

like what are you sorting and where's the prop

earnest phoenix
#

thanks that helped.... literally nothing

#

lol

#

"what do you want to sort?"
"haha vote go console.log 🤤 "

sick cloud
#

what do you want to sort it by @earnest phoenix

earnest phoenix
#

yes but WHAT PROPERTY do you want to sort by

sick cloud
#

read your own message

#

sort for top voters

ember atlas
#

@earnest phoenix What?

sick cloud
#

by the fact you deleted your messages i assume you worked out the code yourself @earnest phoenix

earnest phoenix
#

Yup i need to do it myself cause no one not helping

sick cloud
#

dude

#

i asked you what you want to sort by

earnest phoenix
#

Nvm

sick cloud
#

do you want to sort by user id, username

earnest phoenix
#

I want top voters you can understand how can we get
i think we need to sort by "<Object>.id.size"

tired nimbus
#

if theres something like:

"faces": [
        {
            "features": {
                "left_eye": {
                    "x": 0.6406,
                    "y": 0.3634
                },
                "right_eye": {
                    "x": 0.5594,
                    "y": 0.3714
                },
                "nose_tip": {
                    "x": 0.6031,
                    "y": 0.4748
                },
                "left_mouth_corner": {
                    "x": 0.6469,
                    "y": 0.5225
                },
                "right_mouth_corner": {
                    "x": 0.575,
                    "y": 0.5305
                }
            },
        }
    ],```




}
#

would accessing the X of nose_tip be

sick cloud
#

there's no way to sort by top voters easily

sudden geyser
#

@earnest phoenix I checked but I don't think there's a prop for checking who has the most votes

sick cloud
#

^

sudden geyser
#

grr too slow

earnest phoenix
#

there is, but you need to utilize webhooks and keep track of it yourself

sick cloud
#

you need to use the webhooks and track them yourself, yea

tired nimbus
#

xx['faces']['nose_tip']['x']

earnest phoenix
#

there is, but you need to utilize webhooks and keep track of it yourself
And store in my db ?

#

faces is an array @tired nimbus

sick cloud
#

yes

earnest phoenix
#

you need to index it first

#

K

knotty steeple
#

why do people put objects in arrays

#

i dont get it

sudden geyser
#

it's a list

high bough
earnest phoenix
#

ok

tired nimbus
#

xx.faces['noset_tip']['x'] ?

high bough
#

Someone help me, please, I can barely do CSS.

earnest phoenix
#

you still aren't indexing the array

knotty steeple
#

i mean it looks good i guess

earnest phoenix
#

Nope

#

no it doesn't omegalul

knotty steeple
#

i guess

earnest phoenix
#

Can you example plz

knotty steeple
#

the pink is too bright

#

other than that its ok

high bough
#

IC, okay, thanks

tired nimbus
#

xx.faces[0]

earnest phoenix
#

correct

atomic shuttle
#

Does it take a looooong time to learn to code? Lots of the words I hear are space words from the moon I don’t understand most conversation hahaha it’s almost like you are all speaking in code

knotty steeple
#

no

#

not really

atomic shuttle
#

Okie dokie

knotty steeple
#

depends on how much ur gonna do

earnest phoenix
#

it depends on you

#

the experience is different for everyone

atomic shuttle
#

I wanna make 3D graphics stuff

knotty steeple
#

3d model software? MegaThonk

high bough
#

Does it take a looooong time to learn to code? Lots of the words I hear are space words from the moon I don’t understand most conversation hahaha it’s almost like you are all speaking in code
@atomic shuttle It took me 2 weeks to make a bot, and 2 weeks to get it decent

earnest phoenix
#

programming depends a lot on maths and the ability to logically resolve problems

atomic shuttle
#

Okie dokie

high bough
#

I wanna make 3D graphics stuff
@atomic shuttle 3D is way harder I think

earnest phoenix
#

modelling is not developing

atomic shuttle
#

I want to make realistic shaders and stuff but just rely on Unreal Engine because it takes up lots of space

#

Not rely*

high bough
#

Yes, that's modeling bruh

#

We can't help you with non-developing stuff

atomic shuttle
#

No I already know how to model

earnest phoenix
#

you want to write your own shader engine?

#

oh honey

knotty steeple
#

gl lmao

valid gyro
#

Who can I talk to if my bot was falsley denied

knotty steeple
#

a mod

#

not in here

atomic shuttle
#

Yeah I wanna make something cool for fun

earnest phoenix
#

there's a reason UE and other engines have a giant team working on it

high bough
#

Who can I talk to if my bot was falsley denied
@valid gyro Ask in #general

atomic shuttle
#

Hmm

sudden geyser
#

contact the mod who denied your bot

earnest phoenix
#

shader engines especially rely a lot on evaluating equations and using correct math operations

#

including trigonometry

atomic shuttle
#

Okie dokie

#

That sounds like fun

earnest phoenix
#

it isn't

knotty steeple
#

it does not

#

sounds like hell

earnest phoenix
#

trigonometry makes me want to rip my hair out lol

atomic shuttle
#

Well it sounds like fun to me hmm

knotty steeple
#

any type of math makes me want to die

atomic shuttle
#

Oh my goodness

#

Exaggeration right?

knotty steeple
#

of course

atomic shuttle
#

Okie dokie

#

I don’t know much about maths but it’s fun for me when I do do it hmm

#

Hm m m m m m

#

Beep boop

sick cloud
#

try look into opengl

#

maybe you can make something with it

atomic shuttle
#

Hmm okie dokie

#

Unreal engine is cool but I think it’s missing some stuff for making it run faster hmm

#

I think they should try to make it so that screen space reflections can be done first and what’s left is ray traced

#

Instead of all or nothing

#

But maybe that’s a buffer problem like they need another layer if they do that

#

Hmm

#

Idk

#

It would be really cool if they went back to using real time cube maps for some reflections like the view model. Just make a dual parabolic map thing so filtering seams only show up horizontally

#

Oh now I’m ranting about graphics hahahahaha

#

Meow meow

wintry temple
#

anyone here decent in the v12 nodejs?

#

having some issues with it

sudden geyser
#

what issues

wintry temple
#

basically trying to fetch a message via message id and trying to edit it

#
message.channel.fetch({around: MessageID, limit: 1}).then(msg => {
  const fetchedMsg = msg.first();
  fetchedMsg.edit(`test`).catch(error => {
    console.log(error);
    return;
  });
});```
#

this works on v11, but i cant seem to understand why it doesnt on v12

#

issue is msg.first(); isnt a function.

earnest phoenix
#

Are you trying to fetch your own bot's message or other user's messages to edit? @wintry temple

wintry temple
#

bot's message

earnest phoenix
#

check the docs

wintry temple
#

wow, thanks for the help

bitter rivet
queen needle
sudden geyser
#

Does the mentioned user have a property in the crates JSON tree?

earnest phoenix
#

wow, thanks for the help
@wintry temple

what the fuck do you expect lol. there was a breaking change with the method you're using, check the docs to see the new return type.

queen needle
#

@sudden geyser wdym

wintry temple
#

@earnest phoenix ye, like i havent read the docs already

earnest phoenix
#

so where's the problem

wintry temple
#

already mentioned it, so if you are able to read, feel free to read

scenic kelp
#

no need to be rude

#

being a dick accomplishes nothing

sudden geyser
#

Does the mentioned user have a property in the crates JSON tree?
@queen needle, I don't really know how to get more specific than this.

#

also my internet died so I don't know if it sent twice.

wintry temple
#

you mean me or him? because i aint the one saying shit like "what the fuck do you expect lol" like a retarded fuck face who thinks they are helping but aint

queen needle
#

like do thye exist in the json file

scenic kelp
#

I'm mostly talking to you

sudden geyser
#

well you require the object then assign it. I don't know why you're doing it in two separate message listeners or why it's even in json.

scenic kelp
#

Calling people 'retarded fuck faces' isn't exactly productive

earnest phoenix
#

if you had read the docs then you would have seen that fetch returns a Channel object therefore proving you didn't bother to check the docs

wintry temple
#

"what the fuck do you expect lol" isn't exactly productive

queen needle
#

@sudden geyser too lazy to use databases

sudden geyser
#

should take the time

scenic kelp
#

You're right it isn't, so how about instead of you two continuing to argue, treat each other with some respect.

earnest phoenix
#

imagine being salty because someone wont spoonfeed you the solution omegalul

queen needle
#

its a bit annoying when they dont "spoonfeed you the solution" but it will help a lot in the long run cause then you wont have to ask for help as much

earnest phoenix
#

that's a stance i absolutely cannot agree with more

queen needle
#

and you understand how it works

earnest phoenix
#

it might seem like people are just lazy to not help you but they're pushing you to do it yourself, to learn it yourself, to think by yourself :p

queen needle
#

yeah

wintry temple
#

jesus fucking Christ i am retarded, why am i fetching when i already have the message object

knotty steeple
#

@wintry temple you can use a promise to edit a message ur bot sends

#

or use async/await

wintry temple
#

ye, i just realize

earnest phoenix
#

@earnest phoenix
I have a array with id's

//Example
const ids = ['2', '3', '3', '6', '2', '1', '6', '2', '4']

How can get duplicate value with count ?

#

the amount of duplicates?

#

Yes with duplicate id

#

Like 2: 3, 3:2, 6:2

copper cradle
#

is there a better way of doing this?

export function parseQuery(...params: string[][] | any): string {
    let output = "";
    for (const [[param, value]] of params) {
        if (!output.includes('?')) {
            output += `?${param}=${value}`;
        } else {
            output += `&${param}=${value}`;
        };
    };
    return output;
};
queen needle
#

my brain hurts

copper cradle
#

why

queen needle
#

from that code

copper cradle
#

are you saying it's bad code?

#

or wdym

queen needle
#

no the code looks amazing

#

like i dont understand it so my brain hurts from confusion

copper cradle
#

lol

earnest phoenix
queen needle
#

sorry

copper cradle
#

tho the code doesn't work properly

#

ok so it actually does work

#

I just have to modify the way it works

queen needle
#

what is it supposed to do if you dont mind me asking?

earnest phoenix
#

@earnest phoenix nvm i got that.

queen needle
#

or should i ask that in general

west raptor
#

@copper cradle

| any

#

why

earnest phoenix
#

oh my god im so sorry pk i started writing and got interrupted and just forgot about it lol

#

Lol nvm i got that

copper cradle
#

@west raptor I was testing

#

I removed it lol

#

I'm new to this ok?

west raptor
#

I was just pointing it out lol

#

found it weird to have a union type with any

#

anyways

copper cradle
#
export function parseQuery(params: string[][]): string {
    let output = "";
    for (const [param, value] of params) {
        if (output.includes('?')) {
            output += `&${param}=${value}`;
        } else {
            output += `?${param}=${value}`;
        };
    };
    return output;
};

let data = [
    ['someValue', 'its-data'],
    ['some-other-value', 'some-other-data']
];
console.log(parseQuery(data)); // ?someValue=its-data&some-other-value=some-other-data
#

this is the result

#

now it works

west raptor
#

huh why use a 2d array instead of a hashmap (or equivalent)

copper cradle
#

meh

#

I could do it

#

but I won't be using this too much

west raptor
#

fair enough I guess

bitter rivet
#

Help ?

#
async def giverole(ctx, user: discord.Member, role: discord.Role):
    await user.add_roles(role)
    await ctx.send(f"hey {ctx.author.name}, {user.name} has been giving a role called: {role.name}")```
#

discord.ext.commands.errors.MissingRequiredArgument: user is a required argument that is missing.

copper cradle
#

well

#

the error literally says

#

you're not passing a discord user

#

how are you running the command?

idle schooner
#

@copper cradle yo remember me ?

bitter rivet
#

@copper cradle im useing visual code

idle schooner
#

I told u i wrote shit in my bit description few days ago

#

and i was here for a few minutes

#

U said i dont have to worry about my bot being offline while testing since it wouldn't pass the description review

bitter rivet
#

@copper cradle im using visual studio code

pale vessel
#

irrelevant

idle schooner
#

@bitter rivet how does the command work

copper cradle
#

@optimus#7731 not really

idle schooner
#

wat

#

Am i allowed to link here ?

bitter rivet
#

@idle schooner it works by *giverole @idle schooner <@&264889767072628742> like that

ember atlas
#

-atmods @bitter rivet

gilded plankBOT
#

@bitter rivet

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
idle schooner
#

It says user missing

bitter rivet
#

i just realized that fack

copper cradle
#

@bitter rivet that's not what I asked

#

wait

#

@copper cradle im useing visual code
@bitter rivet I was answering to this message

bitter rivet
#

? yeah im using that

#

for my cmd

copper cradle
#

forget about that

pale vessel
#

he didn't ask tho

copper cradle
#

I said I didn't ask for your text editor

bitter rivet
#

whats ur q

#

?

copper cradle
#

instead of discord.Member try with discord.User

idle schooner
#

Oh i am allowed to link

copper cradle
#

@idle schooner oooohhh

idle schooner
#

Zsnails there u go

copper cradle
#

yeah I remember now

#

lol

#

did u fix it?

idle schooner
#

It actually passed description review

copper cradle
#

wait really?

idle schooner
#

And they did decline it because it was off

copper cradle
#

well tbf you never said what the desc was

#

lol

bitter rivet
#

@copper cradle now it saying discord.ext.commands.errors.CommandNotFound: Command "addrole" is not found

idle schooner
#

I swear it was shit

copper cradle
#

@bitter rivet well bc discord.User doesn't have that method

#

I just told you to do it to see what happened

#

change it back to discord.Member

idle schooner
#

I wrote things like "please accept my bot, idk what to write here"

GWlulurdMegaLul

copper cradle
#

hmm

bitter rivet
#

ok

#

now what or you just wanted to try that

copper cradle
#

if you're passing the first argument as a mention it should work

bitter rivet
#

wdym'

copper cradle
#

don't know why it doesn't lol

#

the command is being run like this right?
*giverole @bitter rivet @rolementionhere

bitter rivet
#

yes @copper cradle

copper cradle
#

hmm

#

it should be working

#

set its default value to an empty dict and try again

bitter rivet
#

wdym

copper cradle
#

user: discord.Member = {}

bitter rivet
#

not working FACK

copper cradle
#

lol

#

did you try googling your issue?

#

@bitter rivet

bitter rivet
#

i justed fixed

#

legit

#

@copper cradle im retarded so umm yeah thats how i fixed it

copper cradle
#

lol

bitter rivet
#

i was spelling it wrong i kept doing addrole but i meant to type giverole i would of never known until a guy mention me and said your spelling it wrong

#

....

#

@copper cradle

copper cradle
#

lmao

opaque seal
#

Guys I need to create a database, if I use SQLite, will I have to switch from it in the future, if my bot get's big enough?

pale vessel
#

yes

earnest phoenix
#

how long does it take to approve bots

feral heath
#

a few weeks

spice pasture
#

2 or 3 weeks ish

#

Mine just got approved today

#

It took 11 days for mine

earnest phoenix
#
if(!member.guild.me.hasPermission("MANAGE_CHANNELS")) return;```

Why is not good?
copper cradle
#

what are you even trying to do wtf

real niche
#

^^

#

Need a bit more info. Put in a bit more code, tell us what your trying to do, and what error your getting. No one can really help with the info given.

copper cradle
#

^^

finite bough
#

the event and the 2nd line are not of any use combined alone as far as i can see

green kestrel
#

anyone have any idea why that does what it does?

modest maple
#

just use postgres if youre gonna go through the effort of mysql

restive furnace
quartz kindle
#

you dont need console.log({c}) you can just do console.log(c)

#

c is an array with two items, because looping over collections treats each item as an entry, the same as doing Object.entries()

#

so c = [key,value]

#

so you need to do c[1].name

earnest phoenix
#

yes please

#

console say me ‘cannot read proprety ´hasPermission’ of undefined’ ‘

digital ibex
#

hi hello all

#

i am trying to log it when a message got edited

split prawn
#

Sry that i am asking here but I forget css how to change the front and the color at one time.

digital ibex
#

leon, use css

#

not html lol

split prawn
#

Oof I'm sry i mean css anyway..

green kestrel
#

font and colour are separate css

#
.mydiv {
font-family: Arial, Something-Serif, Blah;
font-size: 2.3rem;
}```
split prawn
#

Ok thanks

green kestrel
#

no problem 🙂

lapis stirrup
#
color: color;

for color

green kestrel
#

yeah and that

split prawn
#

Thanks

green kestrel
#

where the colour can be a named colour, rgb(), rgba() or #rrggbb hex etc

split prawn
#

ok

digital ibex
#

anyone know how to fix this?

grizzled raven
#

@earnest phoenix that wont work

#

the bot isnt in the server anymore

#

@digital ibex context please

digital ibex
#

in the messageUpdate event fires, i get that

#

thats all i know

#
module.exports = async (client, message, oldMessage) => {
    let oof = require('../../models/Guild');
    let guild = await oof.findOne({ id: message.channel.guild.id });
    let alchannel = guild.alchannel;

    client.createMessage(alchannel, {
        embed: {
            title: 'Message Edited'
        }
    })
}
#

haven't finished it and i get that

grizzled raven
#

then alchannel is undefined

digital ibex
#

wot

#

no

#

other events work

grizzled raven
#

consolelog it

digital ibex
#

ok

earnest phoenix
#

i need help about system files. Do DLL have classes?

digital ibex
#

logs the channel

#

now i get this @grizzled raven

slender thistle
#

data typessss

grizzled raven
#

string

#

not number

digital ibex
#

ok

#
module.exports = async (client, message, oldMessage) => {
    let oof = require('../../models/Guild');
    let Guild = await oof.findOne({ id: message.channel.guild.id });
    let alchn = Guild.alchan;

    let embed = {
        title: 'Message Edited'
    }
    console.log(alchn)
    client.createMessage(`${alchn}`, { embed })
}
#

i still get that

#

and it spams

tiny grotto
#

Why can't the bot find the owner of this server?

quartz kindle
#

owner is not cached

royal portal
#

how would I make it so if you join a server, you get a 'verified' role in all servers

#

but then once you leave that server it gets taken away

tiny grotto
#

Other bots can see, why? @quartz kindle

quartz kindle
#

listen to memberAdd and memoberDelete events

#

@tiny grotto you need to fetch the user/member

royal portal
#

@quartz kindle its just that I can't figure out how to give it in all servers

#

the role

restive furnace
#

to my problem: c is "enmap" named npm package list or smh, and it worked before i did edit the embed, i just added some fields

royal portal
#

and if it exists or not

quartz kindle
#

@royal portal js for(let serverID in listOfServerIDs) { let member = await client.guilds.cache.get(serverID).members.fetch(userID) await member.roles.add(role) }

royal portal
#

I'll try that

sweet spade
#

(node:2484) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead
how I can solve this problem ??? I try everything I think... :/

mossy vine
#

read the error

royal portal
#

use setActivity

#

not setGame

sweet spade
#

vait

royal portal
#

so

sweet spade
#

omg stonks :d

royal portal
#

client.user.setActivity("dbl is cool")

#

not client.user.setGame("bla bla")

sweet spade
#

(node:2484) DeprecationWarning: Collection#find: pass a function instead
I get this problem now :/

restive furnace
#

its deprecation warning

#

not error tho

#

but if you wanna solve, pass a function instead

#

like collection#find(c => c === "example")

sweet spade
#

oh

#

k thx

restive furnace
#

function instesd ("id", "836628382727")

earnest phoenix
#

@signal acorn so what kind of help do you genuinely need?

#

@queen violet

#

Crap

#

Uh sorry

queen violet
signal acorn
#

@earnest phoenix i need help in bots cmd i have made some cmds and working nice i need more for fun and also for nsfw

earnest phoenix
#

I meant to send that with context

#

But dep, I can't try and see

#

I have no access to the bot, it's my friends bot

#

@signal acorn hmm like what kind of commands? Explaion some

signal acorn
#

for fun and nsfw

earnest phoenix
#

For example 8ball... Or claptext... Or what?

#

Incase your wondering dep

#

@earnest phoenix what was your issue?

signal acorn
#

for example in nsfw .(i rly cant explain) l

#

@earnest phoenix can u suggest me a link from where can i get some new cmds

restive furnace
earnest phoenix
#

@signal acorn you can store nsfw files for it to show as a random pick but you can also fetch them from the stored subreddits with a module

restive furnace
#

for js

earnest phoenix
#

He told me to listen to the person that said to try and see what code peice could work for the bot, but I have no access to the bot whatsoever, it's not my bot, it's my friends bot

#

It's all good!

#

Hmm

signal acorn
#

oh ok

slender thistle
#

Please regenerate your token

still merlin
#

ok

#

my bot is broken can someone help
my only code is

const Discord = require("discord.js");
const client = new Discord.Client();
const token = "*token*";

var prefix = `-`;

client.on("ready", () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on("message", (msg) => {
  if (msg.content === "ping") {
    msg.reply("pong");
  }
});

client.login("token");
#

I type node . and it dosent load and my terminal says:
\Users\Jon\Desktop\Discord Bot\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:961:17) at Function.Module._load (internal/modules/cjs/loader.js:854:27) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (C:\Users\Jon\Desktop\Discord Bot\index.js:1:17) at Module._compile (internal/modules/cjs/loader.js:1128:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32) at Function.Module._load (internal/modules/cjs/loader.js:891:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\Jon\\Desktop\\Discord Bot\\index.js' ] } PS C:\Users\Jon\Desktop\Discord Bot>

split hazel
#

Looks like discord.js isn't installed

still merlin
#

ok thanks

#

I installed discord.js and regenerated my token as I forgot to censor it the 1st time I sent my error and my terminal is saying my token is invalid

split hazel
#

From the code above it looks like you're passing the token string

#

To make it pass from a variable remove the quotations

#

And it should work

still merlin
#

ok tysm

split hazel
#

Not your token, in the top variable token you're defining your token, which is a string and should have quotation marks around it

#

The bottom line where you're referencing token, should not have quotation marks

still merlin
#

oh

modest maple
#

nice token leak

#

lmao

still merlin
#

I can regenerate it .-.

modest maple
#

also token should be a string

#

and yeah u should regen it

#

lmao

#

what-

slender thistle
#

basic programming

#

wrap the token around with either apostrophes or quotes

modest maple
#

ill wrap you round in quotes Wink @slender thistle

still merlin
#

wait my token has " around it

slender thistle
still merlin
#

and it still won't come on

slender thistle
#

not fully

earnest phoenix
#

s

rare mist
#

Can a mod tell me if:
A command that shows information about a cerain role with its permissions included, should be avalible to anyone or not

slender thistle
#

It's not a privacy breach, such data is stored publicly. You just can't access it with the Discord client without proper permissions. blobshrug

rare mist
#

Ohh ok, i will make it without req then, thx for anwsering

restive furnace
#

anything, you can only find with the client, example guild names, they should be private.

rare mist
#

huh?

#

i didnt understand that

#

u mean guilds that the bot is in?

restive furnace
#

like you make command where u see all guilds, that should be private

#

yes

rare mist
#

ohh ok

bright meadow
#

Should they

slender thistle
#

Yeah, we consider non-consensual listing of guild names a privacy breach

iron steeple
#

If you want, you can have a command to show how many servers, but not the specific servers

rare mist
#

Ok, i dont have a command that shows all guilds so im fine, i only show the number of guilds the bot is in

iron steeple
#

Yeah that’s fine then

rare mist
#

Thx for taking ur time guys 😄

digital ibex
#

hello

#

its coming from: ```js
client.on('messageUpdate', async (message, oldMessage) => {
let gu = require('./models/Guild');
let guild = await gu.findOne({ id: message.channel.guild.id });
let alchan = guild.alchan;
client.createMessage(alchan, {
embed: {
title: 'Message Edited'
}
})
})

split hazel
#

Is that sequelize? @digital ibex

digital ibex
#

eris.js

split hazel
#

Actually doesn't look like it

#

The database?

digital ibex
#

mb

#

mongoose

#

mongo

split hazel
#

Can we see the model file for guild

digital ibex
#

its not that

#

other events, 19 other, events work

blissful scaffold
#

Are you trying to set the timeout to that huge number?

digital ibex
#

no

#

when i start the bot i get error + spam that because of that code

quartz kindle
#

if you remove the code, it doesnt happen anymore?

digital ibex
#

everything works perfectly fine without that

#

when i add it, i get them errors

quartz kindle
#

or this error doesnt happen anymore?

digital ibex
#

oh, thats smthing else

#

thats smething to do with can't send a message to the action log

#

because there is none set up for that guild

quartz kindle
#

remove the lines and re-add them one by one

#

see which line causes the error

digital ibex
#

kk

#

tim, its ```js
client.createMessage(alchan, {
embed: {
title: 'Message Edited'
}
})

summer torrent
#

what is alchan

earnest phoenix
#
print('o----')
print(' ||||')

@wary needle

summer torrent
earnest phoenix
#

it's was a drawing of a dog

digital ibex
#

its my action log channel

#

for the guild

earnest phoenix
#

@wary needle gimme a challenge of something to make, i'm hella bored

surreal wind
#

I got a quick question. i used the Discord.js guide to set up a Bot but now that I'm at it programming, i cant find any role or roles argument.

earnest phoenix
#

sure

#

@wary needle bro those are easy

digital ibex
#

wdym u can't find any roles?

surreal wind
#

Liek i want to programm, member.roles as example

#

there is no roles or role

digital ibex
#

uh

#

wot

opaque kite
#

Hm got it

surreal wind
#

Yeah Lemme show you

digital ibex
#

show me wot u want to happen

earnest phoenix
#

i'll do them tho mr sylte

digital ibex
#

not the code part, or if u hav sum then show it

surreal wind
#

i want to add a role to a user or memebr of the discord

digital ibex
#

i don't kno much djs, but from what i remember its <member>.roles.add

opaque kite
#

member.addRole(role).catch(console.error)

surreal wind
#

yeah but wnn i type members.role or AddRole isnt there

#

its like not gettign showed as a possible command

opaque kite
#

Use v11

mossy vine
#

intellisense doenst have the type hint

#

are you writing in a differnt file

digital ibex
#

@quartz kindle do you know why ```js
client.createMessage(alchan, {
embed: {
title: 'Message Edited'
}});

#

gideon

#

it doesn't have to show there

#

its all in the docs

mossy vine
#

@digital ibex is alchan a string or number

quartz kindle
#

@surreal wind member or members is not a free-floating global variable, you still need to access it from somewhere depending on the context

digital ibex
#

string

#

i also done ${alchan},

quartz kindle
#

@surreal wind in your current context, you have access to message, and you can access the message author's member object via message.member then you can access this member's roles via message.members.roles

#

and so on

surreal wind
#

Ah ty

quartz kindle
#

@digital ibex console.log(alchan,typeof alchan)

digital ibex
#

kk

#

686997585541726264 string spams it

#

in the console

#

oh, it only sent it twice, nvm

knotty steeple
#

ok so im gonna be setting up a shop for my bot and i want to know if this might be a good way to store the things that can be bought

"shop": [{
  "item1": {
    "price": 69
  },
  "item2": {
    "price": 111
  },
  "item3": {
    "price": 256
  },
  "item4": {
    "price": 420
  },
}]```
iron steeple
#

that looks like it should work @knotty steeple

coarse topaz
#

just put Date.now() in a variable
@earnest phoenix Oh, thank you very much for that 🙂

earnest phoenix
hasty sparrow
#

Do what on WhatsApp?

earnest phoenix
#

my page in embed

quartz kindle
#

the same way

earnest phoenix
#

dont work

quartz kindle
#

look into opengraph, twitter cards, oembed etc

earnest phoenix
#

ok

quartz kindle
earnest phoenix
#

is lang="es" or lang=es ?

knotty steeple
#

the first

signal acorn
#

can anyone tell me why its not working

#

const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {

const { body } = await snekfetch.get('https://random.dog/woof.json');
const embed = new Discord.RichEmbed()
.setColor("#00ff00")
.setImage(body.url);

message.channel.send(embed)

}
module.exports.help = {
name: "dog"
}

#

oh ok i get it

knotty steeple
#

"can anyone tell me why its not working"

#

if ur gonna ask for help next time provide more details

#

like if u are getting an error and what it is

scenic kelp
#

Also snekfetch has been deprecated, might wanna use node-fetch instead

knotty steeple
#

also why are u using commando

#

in that code u dont need it

#

seems as though u have ur own command handler

#

or most likely a stolen one

#

u dont need args either

signal acorn
#

@knotty steeple na its from my frnds bot nut i get it

#

its not stolen

#

we are working on a project i was try some new cmds but i got the solutionn

knotty steeple
#

i hate when people do module.exports.whatever

#

either export it once or do exports.whatever for each one

static sable
#

currently I'm a bit puzzled.
I'm trying to get STDOUT of my discord.js Shards, because they can print some useful information to process.stdout.
Does anyone know if I can attach to every shard and listen to their stdout?

surreal wind
#

So if o try to use this code:
let role = message.members.roles.get("700852729739870309");
message.members.addRole("role");

#

I recive this error:
TypeError: Cannot read property 'roles' of undefined

#

but why?

quartz kindle
#

@static sable does their logging not appear in your console/terminal?

#

it should by default

static sable
#

I'm usign the ShardManager to spawn Shards. very basic everything.

my shard is having a ready listener:

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

which get's lost since that process is a child_process and it's output won't get redirected to the main process stdout

quartz kindle
#

are you running on windows or linux?

#

you can try this ```js
shard.stdout.on('data', data => {
console.log(data.toString());
});

static sable
#

are you running on windows or linux?
@quartz kindle yes. (I mean, both)

calm coyote
earnest phoenix
#

what is that? ```html
<meta property="og:updated_time" content="1440432930" />

knotty steeple
#

timestamp of when something got updated

static sable
#

okay I could fix it.
monkey-patched ShardManager and Shard to spawn with silent:true so I can listen for stdout of each shard.
which enables me to log my shard's outputs

manager.on('shardCreate', shard => {
  console.log(`Shard [${shard.id}]: created.`);
  shard.on("spawn", shardProcess => {
    shardProcess.stdout.on("data", chunk => {
      console.log(`Shard [${shard.id}]: ${chunk.toString()}`);
    })
  });
});
hasty sparrow
#

@static sable Which JS library are you using?

static sable
#

discord.js

hasty sparrow
static sable
#

yeah that's what I was trying first, but that just works if I'm using process.send() instead of console.log() though

#

But I want to listen for errors etc and those would get swallowed else

earnest phoenix
#

How2embed

sudden geyser
#

Whatlibrary

earnest phoenix
#

Node.js

amber fractal
#

not a library

surreal wind
#

Alright, i give up. i cant find anything about that error. and i dont know how to fix it, he keeps saying:
message.members.addRole("700852729739870309e");
^

TypeError: Cannot read property 'addRole' of undefined
nevermind how i change it, there is always something that's undefined for him

earnest phoenix
#

@sudden geyser

amber fractal
#

message.members doesn't exist

sudden geyser
#

Not a library.

frozen valve
#

Alright, i give up. i cant find anything about that error. and i dont know how to fix it, he keeps saying:
message.members.addRole("700852729739870309e");
^

TypeError: Cannot read property 'addRole' of undefined
nevermind how i change it, there is always something that's undefined for him
@surreal wind its message.member

earnest phoenix
#

It's basically js

amber fractal
#

Still not a library

sudden geyser
#

still not a library.

#

stop!!!

amber fractal
#

it's a language

sudden geyser
#

Discord.js, Eris, etc.

surreal wind
#

But i am within an area wher i have to use message.member

amber fractal
#

then use message.member

#

not message.members

earnest phoenix
#

Ig discord.js

amber fractal
frozen valve
#

But i am within an area wher i have to use message.member
@surreal wind which library are u using? discordjs, or discordio?

earnest phoenix
#

Does it make a difference

#

?

amber fractal
#

yes

split hazel
#

yes

#

huge

sudden geyser
#

what version

surreal wind
#

Discordjs

amber fractal
#

all libraries work differently

earnest phoenix
#

Uhhh

sudden geyser
#

discordio is deprecated btw

split hazel
frozen valve
#

Discordjs
@surreal wind then change your code to: message.member.addRole("700852729739870309e");

earnest phoenix
#

I guess I'll dig through my own code

surreal wind
#

Jsut tried it

#

now its tellign me its not a function^^

frozen valve
#

then should work

sudden geyser
#

In Discord.js, either create a new message embed class then send it, or send the raw object. https://discord.js.org/#/docs/main/stable/examples/embed

frozen valve
#

does ur bot has permissions to add roles?

sudden geyser
#

The example is for v12. If you're v11, you'd use RichEmbed instead of MessageEmbed

surreal wind
#

He should have. let me double check

frozen valve
#

btw, anyone here is a tester or admin on this? i need to clear soemthing about a bot i had rejected

#

i had no chance to tell anything 😦

gilded plankBOT
#

Your bot was likely declined because it broke one of the "bot rules" listed in #rules-and-info.

To find out why your bot was declined and by who, use the search feature in #mod-logs:

surreal wind
#

@frozen valve yeah he has permission to Manage Roles

frozen valve
#

@frozen valve yeah he has permission to Manage Roles
@surreal wind whats the log on ur bot?

surreal wind
#

you mean the error message?

frozen valve
#

the log

#

i need to see more context

#

can you share more of the usecase?

#

code and stuff

surreal wind
#

client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;

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

if (command === 'ping') {
    message.member.send('Pong.');
}
else if (command === 'role') {
    message.member.send('please select the role !player if you are a participant or !watcher if you a here to cheer them on..');
}
else if (command === 'player') {
    message.member.send('Thank you for signing up for the event - good luck to you..');
    // let role = message.members.roles.find("700849600973766667");
    message.member.addRole("700849600973766667");

}

#

message.member.addRole("700852729739870309e");
^

TypeError: message.member.addRole is not a function
at Client.<anonymous> (D:\Discord Bot\DiscordBot\Lumi\Index.js:30:24)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (D:\Discord Bot\DiscordBot\Lumi\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (D:\Discord Bot\DiscordBot\Lumi\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\Discord Bot\DiscordBot\Lumi\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (D:\Discord Bot\DiscordBot\Lumi\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (D:\Discord Bot\DiscordBot\Lumi\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (D:\Discord Bot\DiscordBot\Lumi\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (D:\Discord Bot\DiscordBot\Lumi\node_modules\ws\lib\websocket.js:801:20)

knotty steeple
#

how tf do u not know what library ur using

#

more likely u just stole it and followed some instructions

surreal wind
#

I got told to follow the fguide i did

#

Righth ere in this chat yesterday

knotty steeple
#

im not talking about u

split hazel
#

And please format your code

#

``` code ```

pale vessel
#

no.
```js

frozen valve
#

lient.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot) return;

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

    if (command === 'ping') {
        message.member.send('Pong.');
    }
    else if (command === 'role') {
        message.member.send('please select the role !player if you are a participant or !watcher if you a here to cheer them on..');
    }
    else if (command === 'player') {
        message.member.send('Thank you for signing up for the event - good luck to you..');
        // let role = message.members.roles.find("700849600973766667");
        message.member.addRole("700849600973766667");
   }
pale vessel
#

nice

opaque kite
#

*client

knotty steeple
#

pls make a command handler

frozen valve
#

u should add commands instead of handling the message this way

#

but thats another refactor

surreal wind
#

Uhm, yeah about that, i tried after teh Guide

#

and it didtn work at all, so i wetn back

knotty steeple
#

pls take ur time typing

frozen valve
#

btw, this should work only for guild messages

#

not DM's

#

you cant add roles via DM

pale vessel
#

do you know the version of the library you're using?

frozen valve
#

you need to be in a guild environment

sudden geyser
#

like come on, the library is even in the stacktrace error

frozen valve
#

if (!message.guild) return;

#

add this line after checking if the message comes from a bot.

#

or add it to the if.

wheat jolt
#

how can I make a promise-mysql connection that I can use in multiple modules?

pale vessel
#

(!message.guild || message.author.bot) return;

frozen valve
#

how can I make a promise-mysql connection that I can use in multiple modules?
@wheat jolt create a module, try using TypeOrm if you're with TypeScript, otherwise you can use Sequelize

surreal wind
#

And with that added, i can use guild functions, to addRoles as example?, nice let me try that

pale vessel
#

no, it prevents users from DMing your bot

wheat jolt
#

@wheat jolt create a module, try using TypeOrm if you're with TypeScript, otherwise you can use Sequelize
@frozen valve I never used sequelize

#

can't I just use promise-mysql?

frozen valve
#

can't I just use promise-mysql?
@wheat jolt you can use whatever you feel comfty with

#

if you know many libraries that will help you, thats fine, but im telling you, you need to create a module in order to reuse it everywhere

split hazel
#

But yeah if you're not good with SQL, use a wrapper like Sequelize

#

I'm sure there's more awesome ones aswell

frozen valve
#

there are a lot

#

but always depends on what stack you're using

#

i saw it.

#

lol

wheat jolt
#

i don't care

frozen valve
#

i was supposed to

wheat jolt
#

you can't connect on root only from localhost so

frozen valve
#

i dont care about your server

wheat jolt
#

and you don't even know the ip :)

frozen valve
#

you're testing

#

im trying to help lol

wheat jolt
#

I tried this but ofc it's not good

frozen valve
#

u have to use async await or then

#

how do u use it?

#

show me the code where u use it

wheat jolt
frozen valve
#

the problem is that you are not fullfilling the promise

#

try this:

#

db.then((conn) => console.log(conn));

wheat jolt
#

that makes sense

#

Yes

#

I did remove that

frozen valve
#

u always will need to use it that way

#

everywhere

wheat jolt
#

welp

#

thanks

surreal wind
#

yeah this wont add up. trying the addRole command with Guild instead i get the same error, that guild is not defined. i give up. apparently I'm to new to JS to understand that right away. Welp it was a nice Try to get to understand it, but just wont make any sense for me. Ill rather go back programming in ABAP xD

trim nexus
#

what's so difficult lol

frozen valve
#

yeah this wont add up. trying the addRole command with Guild instead i get the same error, that guild is not defined. i give up. apparently I'm to new to JS to understand that right away. Welp it was a nice Try to get to understand it, but just wont make any sense for me. Ill rather go back programming in ABAP xD
@surreal wind we didnt ask you to use guild, we told you to use the command within a guild

#

its still message.member

#

thanks
@wheat jolt all ok

wheat jolt
#

yeah

surreal wind
#

but that's what i don't get, if i add message.member.guild.addRole("role"); it tells me the function doesn't exist, but i need it to be within the entire setup, after answering to add the chosen role to the person that received the message.

pale vessel
#

please read the docs

frozen valve
#

please read the docs
@pale vessel lol ur avatar makes me think you're angry lol

pale vessel
#

i am

frozen valve
#

i am
@pale vessel is that your secret? hulk style?

surreal wind
#

the discord.js docs? i used discordjs.guide so far but that didn't really help at all otherwise i wouldn't be asking

frozen valve
#

ok Gideon, quick question

#

where are you testing your bot?

#

did you made a test server and invited the bot?

surreal wind
#

yes

frozen valve
#

or did you direct message the bot?

surreal wind
#

No im communication via a channel in a discord to the bot

#

the respnse is sent to me in a DM

frozen valve
#

ic

earnest phoenix
#

Can someone help me with a JDA issue?

late hill
#

someone

#

yes

slender thistle
#

-ask2ask

gilded plankBOT
#

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

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

late plank
#

who here is experienced with discord.js v12? If I need to message into a specific guild in a way that is shard-safe; do I use Client#guilds#resolve?

pale vessel
#

fetch

late plank
#

It conserns me that this method doesn't return a promise

amber fractal
#

well that doesn't look cross shard

pale vessel
#

use fetch

late plank
#

guilds has no fetch, unfortunately

#

GuildManager*

amber fractal
#

and mine wont embed

#

I love it

pale vessel
#

no ssl

amber fractal
#

I have ssl

#

or did

pale vessel
#

btw, is it just me or discord.js docs is dead

amber fractal
#

it's github

pale vessel
#

yeah

amber fractal
#

yeah I have ssl

#

weird

earnest phoenix
#

GitHub is being an issue rn

split hazel
#

ssl appears for me too

#

lets encrypt 💪

#

lets do it why not

amber fractal
#

weird, cloudflare might be having an issue

#

or my proxy

#

hm

#

it just embeded in my server

#

oh well

late plank
#

but fetching is safe with sharding right?

#

instead of looking for the guild I can just have the channel snowflakes in my configuration

#

and fetch those

proper mist
#

i need help with making a command that runs and embed when sent

#

so far i have this

#
const Discord = require('discord.js');
module.exports = {
    name: 'testembed',
    description: 'Testing an embed',
    execute(message, args) {
const exampleEmbed = new Discord.MessageEmbed()
    .setColor('#0099ff')
    .setTitle('Some title')
    .setURL('https://discord.js.org/')
    .setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
    .setDescription('Some description here')
    .setThumbnail('https://i.imgur.com/wSTFkRM.png')
    .addFields(
        { name: 'Regular field title', value: 'Some value here' },
        { name: '\u200B', value: '\u200B' },
        { name: 'Inline field title', value: 'Some value here', inline: true },
        { name: 'Inline field title', value: 'Some value here', inline: true },
    )
    .addField('Inline field title', 'Some value here', true)
    .setImage('https://i.imgur.com/wSTFkRM.png')
    .setTimestamp()
    .setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
        message.channel.send(exampleEmbed);
    },
};
#

i don't know why this isn't getting executed

#

when i type my command

wheat jolt
#

why

earnest phoenix
#

Is it possible to mix js and JSON into a bot?

hasty sparrow
#

@late plank Yes, just make sure to check whether the guild you are looking for was found/returned

mossy vine
hasty sparrow
#

If you want client to be available to every method inside your class, then no

earnest phoenix
#

js and JSON are two entirely different things, @earnest phoenix

mossy vine
#

ye makes sense aight thx

iron steeple
#

lol JSON is a file type yeah

earnest phoenix
#

js is a language, while JSON is a notation

slender thistle
#

JS is used to lose sanity, JSON is used as a database.

earnest phoenix
#

K @earnest phoenix

#

@slender thistle thx u too

mossy vine
#

@slender thistle are you shitposting in development

#

oh did u just mislead a newbie

slender thistle
#

JSON can be used as a database, still. It's just not recommended in comparison to actual proper databases

heavy marsh
#

Do you have any good hosting suggestions?

earnest phoenix
#

@heavy marsh host.pls works good but requires some effort and it's paid, heroku requires minimal effort and is free, glitch puts hard limits on your bot but is also free but sucks

hasty sparrow
#

Wouldn't recommend Glitch either, DigitalOcean/Vultr/Linode all work

earnest phoenix
#

I use host.pls

heavy marsh
#

I mean paid onces. Reliable, safe, fast and not that expensive

earnest phoenix
#

I pay $3.45

#

Per month

#

Works perfect

heavy marsh
#

What is this

earnest phoenix
#

Derp idk

#

¯\_(ツ)_/¯

hasty sparrow
#

Vultr's smallest instance

heavy marsh
#

@earnest phoenix Can I get the link to check your hosting complany

#

company*

late plank
#

@hasty sparrow got it; thanks

earnest phoenix
late plank
#

alright folks; one more question

#

I'm getting these every once in a while

(node:6689) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
    at RequestHandler.execute (/home/headline/bots/discord-compiler/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:6689) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6689) [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.

This makes it very difficult to track down where access is missing, I believe nearly all of my code should be covered to handle permissions errors, but there must be one case that I'm forgetting or otherwise missing. Any tips for tracking this down or do I just have to scour my codebase and nitpick

surreal wind
#

@frozen valve Any other Ideas ,what it might be? No matter what i try, going through with a guide it always ends up telling me something isn't a function or its not defined.

glad charm
#

-dotpost

gilded plankBOT
#

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

late plank
#

@glad charm that message was accidental

glad charm
#

NICE

late plank
#

@glad charm there's a grammatical error in that warning, by the way

#

You're missing the period after causes spam

glad charm
#

Lol thanks.

late plank
#

Lol, np

#

god forbid someone gets confused

earnest phoenix
valid frigate
#

hi yall im trying to figure out how to log info-level messages from jda and this wasn't working, what can i replace net.dv8tion.jda with?

<configuration debug="true">

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="net.dv8tion.jda" level="INFO" />

    <root level="warn">
        <appender-ref ref="STDOUT" />
    </root>

</configuration>
earnest phoenix
#

how i do hyperlinked image

#

in html a image tag inside of an anchor tag

#

reading comprehension 🌈

knotty steeple
#

what about markdown cuz i forgot

earnest phoenix
#

iirc [![alt text](image url)](hyperlink)

#

how i add ads for win money? :v

#

adsense

topaz fjord
#

ads on bot site

#

ee

#

ew

earnest phoenix
#

dbl has them

#

they use adsense

#

lol

topaz fjord
#

adblock™️

earnest phoenix
#

ublock origin and anti adblock killer script equals profit

gilded gazelle
#

how would i send a message to a user without initiating the bot in discord.js?

topaz fjord
#

I use ublock origin

earnest phoenix
#

i'm not sure if discord.js allows you to use REST alone

topaz fjord
#

you can't send a message without starting the bot

gilded gazelle
#

oof

#

then i guess i'll have to use discord's api directly then

earnest phoenix
#

or switch to a not trash lib

#

make sure to handle your ratelimits children

frozen valve
#

@frozen valve Any other Ideas ,what it might be? No matter what i try, going through with a guide it always ends up telling me something isn't a function or its not defined.
@surreal wind please do console.log(message.member.addRole)

#

and show me whats the output

gilded gazelle
#

haha, would want to but it's the only framework i know (for a quick discord bot deployment), any suggestion on a good framework/library for discord apis?

jovial nexus
#
        case("k/play"):
          const voiceChannel = message.member.voiceChannel;
          if(!voiceChannel) return message.channel.send("**No voice channel**");
          try {
            var connection = await voiceChannel.join();
          }catch (error) {
            console.error(error);
            return message.channel.send(`Error -> ${error}`)
          }
``` help im using v12
earnest phoenix
#

what

#

is

#

the

#

error

#

we can't read your mind

jovial nexus
#

It tells me im not in a voice channel, but im in one

earnest phoenix
#

haha, would want to but it's the only framework i know (for a quick discord bot deployment), any suggestion on a good framework/library for discord apis?
@gilded gazelle
it really depends on what languages you're willing to work with

mossy vine
#

when a shard gets the ready event the guilds field will only contain guilds for that shard right?

hasty sparrow
#

Yes

sudden geyser
#

@jovial nexus what version of Discord.js are you using.

jovial nexus
#

v12

summer torrent
#

that is voice.channel on v12

sudden geyser
#

<Member>.voiceChannel was replaced with <Member>.voice.channel in v12

surreal wind
#

@surreal wind please do console.log(message.member.addRole)
@frozen valve got an undefined

jovial nexus
#

Thxxx

#

@sudden geyser is this good? js case("k/play"): const voiceChannel = message.member.voice.Channel; if(!voiceChannel) return message.channel.send("**Necesitas estar en un canal de voz para usar este comando**"); try { var connection = await voice.Channel.join(); }catch (error) { console.error(error); return message.channel.send(`Log del error -> ${error}`) } break

sudden geyser
#

check the docs! Channel should not be capitalized.

frozen valve
#

@frozen valve got an undefined
@surreal wind thats the problem, the bot can not add roles

surreal wind
#

Okay, then i gotta look, i know he has the permission but ill recheck, thank you

earnest phoenix
#

addsense is +18?

modest maple
#

yes...

#

because thats how most things with payment etc are

earnest phoenix
#

sh*t :v

modest maple
#

lol

#

you dont even get much from it unless the site is big

earnest phoenix
#

i know

modest maple
#

like pennies per click

earnest phoenix
#

oh

#

clicks in the ad or the page?

modest maple
#

depends

earnest phoenix
#

which is better?

modest maple
#

neither

#

they both pay fuck all

earnest phoenix
#

ok

frozen valve
surreal wind
knotty steeple
#

hi hi im doing some stuff with sql

const Database = require('better-sqlite3');
const db = new Database('././src/Bakery.db');

const rows = db.prepare("SELECT * FROM users order by money desc limit 10;").get()
console.log(rows)
#

im trying to get the top 10 users based on money

#

thing is rows only actually logs 1

#

but i literally tested that query and it does return multiple rows

#

so idk why its not working in code

jovial nexus
mossy vine
knotty steeple
#

whatever ur putting is undefined

jovial nexus
#

how do i fix it?

earnest phoenix
#

define it 🤔

knotty steeple
#

make it not defined

jovial nexus
#

im defining it...

unique nimbus
#

You did not define it as a string

neat mulch
#

Hi

#

Your bot @invalid-user was declined. Reason: Your bots help command gets rate limited instantly due to the number of messages you send so quickly, please limit the number of messages your bot sends.

knotty steeple
#

wrong place

split hazel
#

Preferably

knotty steeple
#

u can say off-topic for anything

jovial nexus
#

how do i define it as a string?

knotty steeple
#

"string"

split hazel
#

You learn js

#

but thats how

signal acorn
#

suggest me cmds plz

knotty steeple
#

no

signal acorn
#

xD

#

ok

digital ibex
#

hi helllo

#

how would u get how long a member has been in the guild with eris?

knotty steeple
#

joinedAt()?

copper cradle
jovial nexus
#

@copper cradle i already fixed that

#

      if (message.content.startsWith("k/play")) {
          const voicechannel = message.member.voice.channel;
          if(!voicechannel) return message.channel.send("**Necesitas estar en un canal de voz para usar este comando**");
          try {
            var connection = await voicechannel.join();
          }catch (error) {
            console.error(error);
            return message.channel.send(`Log del error -> ${error}`)
          }
          const dispatcher = connection.play(ytdl(args[1]))
            .on('end', () => {
              console.log('Canción terminada');
              voicechannel.leave();
            })
            .on('error', error => {
              console.error(error);
              return undefined;
            });
          dispatcher.setVolumeLogarithmic(5 / 5);
        }
``` my new code
earnest phoenix
#

nice code from github lol

copper cradle
#

@jovial nexus what's the error? are you getting any errors?

jovial nexus
knotty steeple
#

stop using var

jovial nexus
#

this is the error

knotty steeple
#

args[1] is undefined

sudden geyser
#

Are you sure it's not args[0]?

copper cradle
knotty steeple
#

are u sure u dont want to join the args

copper cradle
#

*occurring

jovial nexus
#

if i put args[0] it crashes

copper cradle
#

fuck I can't type today

#

...

knotty steeple
#

well fix that issue

copper cradle
#

how are you calling the command?

#

use args[0] and show the error

jovial nexus
#

ok

#

wait

copper cradle
#

you can't just say uuuh args[0] crashes I'm gonna use args[1]

#

without even knowing that the number means

jovial nexus
#

the error with args[0]

copper cradle
#

that's not the err

#

show more

#

of the log

#

I mean it is

#

but the entire err

jovial nexus
#

it doesnt show more

quartz kindle
#

how about you console.log(args) to see what your args actually are?

jovial nexus
#

okok

copper cradle
#

I was gonna say that

quartz kindle
#

then args[0] is correct

copper cradle
#

ofc it is

jovial nexus
#

but it still crashes

ember echo
#

Hey, do I need to have a bot in order to get an API key

digital ibex
#

how would u get how long a member has been in the guild with eris?

copper cradle
#

@jovial nexus that doesn't matter

#

your code is erroring somewhere else

#

show your code again

jovial nexus
#

      if (message.content.startsWith("k/play")) {
          const voicechannel = message.member.voice.channel;
          if(!voicechannel) return message.channel.send("**Necesitas estar en un canal de voz para usar este comando**");
          try {
            var connection = await voicechannel.join();
          }catch (error) {
            console.error(error);
            return message.channel.send(`Log del error -> ${error}`)
          }
          const dispatcher = connection.play(ytdl(args[0]))
          console.log(args)
            .on('end', () => {
              console.log('Canción terminada');
              voicechannel.leave();
            })
            .on('error', error => {
              console.error(error);
              return undefined;
            });
          dispatcher.setVolumeLogarithmic(5 / 5);
        }
quartz kindle
#

well, your console.log broke it lmao

copper cradle
#

lmao

#

siquiera sabes lo que haces? Ender

jovial nexus
#

a medias

quartz kindle
#

the reason you can put .on() in a new line, its because you're actually doing connection.play().on() because connection.play() returns a dispatcher

#

which means .on() can only be used on a dispatcher

jovial nexus
#

dispatcher.on()?

quartz kindle
#

you put console.log in the middle of them, causing it to become console.log().on()

jovial nexus
#

aaahhh

#

ok wait

quartz kindle
#

yes, just do dispatcher.on()

#

on both of them

jovial nexus
#
      if (message.content.startsWith("k/play")) {
          const voicechannel = message.member.voice.channel;
          if(!voicechannel) return message.channel.send("**Necesitas estar en un canal de voz para usar este comando**");
          try {
            var connection = await voicechannel.join();
          }catch (error) {
            console.error(error);
            return message.channel.send(`Log del error -> ${error}`)
          }
          const dispatcher = connection.play(ytdl(args[0].url))
          console.log(args)
            dispatcher.on('end', () => {
              console.log('Canción terminada');
              voicechannel.leave();
            })
            dispatchers.on('error', error => {
              console.error(error);
              return undefined;
            });
          dispatcher.setVolumeLogarithmic(5 / 5);
        }```
quartz kindle
#

also, there is no args[0].url

#

its just args[0]

jovial nexus
#

oh ok

copper cradle
#

args[0] is just a string, not an object, where did you get that code from?

jovial nexus
#
      if (message.content.startsWith("k/play")) {
          const voicechannel = message.member.voice.channel;
          if(!voicechannel) return message.channel.send("**Necesitas estar en un canal de voz para usar este comando**");
          try {
            var connection = await voicechannel.join();
          }catch (error) {
            console.error(error);
            return message.channel.send(`Log del error -> ${error}`)
          }
          const dispatcher = connection.play(ytdl(args[0]))
          console.log(args)
            dispatcher.on('end', () => {
              console.log('Canción terminada');
              voicechannel.leave();
            })
            dispatcher.on('error', error => {
              console.error(error);
              return undefined;
            });
          dispatcher.setVolumeLogarithmic(5 / 5);
        }``` like that?
#

i got it from a tutorial from the docs of the discord.js server

copper cradle
heavy anchor
#

I am trying to make a bug report command that sends the report to my guild to a specified channel and I keep getting this error TypeError: Cannot read property 'cache' of undefined and idk what I have wrong

copper cradle
#

show your code

#

tim I'll take care of this kthx

#

and your code is ...?

heavy anchor
#

var myGuild = bot.guilds.cache.find(g => g.id == '694557723978891344');
var logChannel = myGuild.channels.cache.find(c => c.id == '701924697289523291')

const bugReport = new Discord.MessageEmbed()
.setTitle("Bug report")
.setDescription(`<@${msg.author.id}> reported\n${argsresult}`)
.setColor('#FF0000')
.setTimestamp()
.setFooter(msg.author.username, userAvatar)

logChannel.send(bugReport);

},
copper cradle
#

first

#

don't use == always ALWAYS use ===

#

and async

#

iirc find returns a promise

#

but I'm not sure tho

#

ok tim you can take this I can't think right today

#

wait

#

which one is the undefined one

#

show the rest of the log

heavy anchor
#
    at Object.execute (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/commands/bugreport.js:22:34)
    at Client.<anonymous> (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/bot.js:76:15)
    at Client.emit (events.js:323:22)
    at MessageCreateAction.handle (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:435:22)
    at WebSocketShard.onMessage (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
    at WebSocket.onMessage (/Users/macbookpro/Desktop/GoogleDrive/KnightBot/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:311:20)```
copper cradle
#

what's on line 22

heavy anchor
#

var myGuild = bot.guilds.cache.find(g => g.id == '694557723978891344');

copper cradle
#

console.log(bot.guilds);