#development

1 messages ยท Page 895 of 1

pale vessel
#

first line (async () => { ?

neat ingot
#

i think the await directories

earnest phoenix
#

no

#

await? not let?

pale vessel
#

you need readdirSync

neat ingot
#

await is not the variable type, it is what you are doing to get the directories, but whats throwing the error is that it cannot find the 'commands' folder within the current operating directory

pale vessel
#

readdir requires a callback

cinder patio
#

He promisified it though

pale vessel
#

can you promisify that way?

#

didn't know that

cinder patio
#

He used the Util.promisify function

quartz kindle
#

discord.js server is being raided lmao

neat ingot
#

however, util and readir are never decalred as const variables

earnest phoenix
#

So if it's still so complicated can someone give me a simpler code for command handler with multiple folders?

#

like /commands/directory/file.js ?

neat ingot
#

sec

earnest phoenix
#

ok

quartz kindle
#

util.promisify doesnt work well with all fs methods

neat ingot
#

is how i get the files

#

is how i load the commands

quartz kindle
#

because some of fs's callbacks do not follow a return parameter order as expected by promosify, so promisify ends up returning or passing the wrong values/parameters

neat ingot
#

wow slow images discord wth

quartz kindle
#

its better if you use readdirSync or regular readdir without promisifying it

cinder patio
#

I think you can also customize the promisify function but like, doesn't make sense for the fs' callbacks to not follow the promisify callbacks

quartz kindle
#

yeah its been a while, so i think most of them were fixed already

#

i've never actually used util.promisify because i can just create my own promises and have full control over it

wanton nova
#

so i was going to ask this in the discord.js server, but then the raid happened, and I dont think its gonna open back up anytime soon, so i'll just ask here

message.guild.channels.create(`${people.join("-").toLowerCase()}`, {
  type: 'text',
  topic: `Party including ${people.join(", ")}. Started on [DATE]`,
  permissionsOverwrites: [{
    id: message.guild.id,
    deny: ['SEND_MESSAGES'],
    allow: ['VIEW_MESSAGES', 'READ_MESSAGE_HISTORY']
  }, {
    id: id[0],
    allow: ['SEND_MESSAGES', 'VIEW_MESSAGES', 'READ_MESSAGE_HISTORY']
  }, {
    id: id[1],
    allow: ['SEND_MESSAGES', 'VIEW_MESSAGES', 'READ_MESSAGE_HISTORY']
  }]
})

I have this issue where, while it does create the channel with the proper name and topic, it doesn't set the permissions right. The ID array is [ '262410813254402048', '300331417634603010' ], which is me and my alt's id. What am i doing wrong here?

#

or am i using an outdated method of permissionOverwrites

#

and yes, it has all the permissions it needs to edit the channel

cinder patio
#

It's permissionOverwrites not permission**s**Overwrites

#

took me a minute lol

wanton nova
#

oh

#

darn im stupid lol

#

thank you

earnest phoenix
#

@neat ingot ```const cdirectoryFiles = fs.readdirSync(CONFIG.command_files);
^

ReferenceError: CONFIG is not defined```

restive furnace
#

read the error

#

"CONFIG" is not defined.

limpid raptor
#

Hi, I thing some of you will find it stupid but, I have a problem with messageReactionAdd ! Before 12.x, with a raw event, it always worked fine, but now, with the latest version, with raw and without raw, nothing work ! I just have : js bot.on("messageReactionAdd", (reaction, user) => { // My code })if someone can help me.. ๐Ÿ˜…

earnest phoenix
#

how should i define CONFIG? =))

restive furnace
#

by defining, let CONFIG = { command_files: "find urself" } for examole

#

example

earnest phoenix
#

i know how to define man but i dont know what should be after = ๐Ÿ™‚

neat ingot
#

i have my config defined like this..

#

but thats likely much more complex than what you need

copper cradle
#

why are you doing that tho

#

oh wait

#

I was reading old messages

neat ingot
#

lulz

earnest phoenix
#

so i should do const CONFIG = { command_files: __dirname + "/commands"
?

stone meteor
#

Does some one here know how to use dank memer api for image manipulation ??

neat ingot
#

it depends, that might work, but depends on how your directory is structured, and when/where you include the file. basically __dirname will be the directory of the currently operating file

#

so yes, as long as there is a 'commands' folder within the same directory the file that runs the code

#
const CONFIG = { command_files: __dirname + "/commands" };
#

would be sufficient

earnest phoenix
#

i have like /Bot/commands/directory/file.js

neat ingot
#

notice, my config file, and commands folder are in the same directory.

sudden geyser
#

Does some one here know how to use dank memer api for image manipulation ??
@stone meteor did you check out the docs?

earnest phoenix
#

I forgot how to make it so the status includes the amount of servers, is it client.guilds.cache.size or something in v12 djs

stone meteor
#

@stone meteor did you check out the docs?
@sudden geyser
Nah
I didn't found can you get me the link. ?

sudden geyser
neat ingot
#

that should work i think adam

#

in v12

earnest phoenix
#

@neat ingot
ReferenceError: Kommander is not defined ๐Ÿ˜›

#

@earnest phoenix

sudden geyser
#

You sure you spelt it right? It's in the error message.

earnest phoenix
#

just checking

neat ingot
#

ofc its not, your not supposed to copy my code word for word, you were supposed to use it as reference

#

lol

earnest phoenix
#

ayy it works

stone meteor
#

@sudden geyser oh
I read that earlier
But still I don't know who to use that thing in my commands

earnest phoenix
#

@neat ingot oh =)))

sudden geyser
#

well

neat ingot
sudden geyser
#

you make an http(s) requst to the service

#

with the authorization token you got

neat ingot
#

there is some of the code i didnt show which would help get it working i guess

sudden geyser
#

basic get with possible query parameters and boom

earnest phoenix
#

oh, i already did a collection, ty ๐Ÿ™‚

#

does anyone know where is the dblapi's test button ?

neat ingot
#

on the website

sudden geyser
#

it's on your bot's edit page

neat ingot
#

if you mean to test for voting

earnest phoenix
#

oh thanks

#

didn't think about it

#

yep

tight ferry
#

So I make a role and store it in role like this

                    const role = message.guild.roles.create({data:{
                        name: 'Test',
                        color: '#26ff00',
                        hoist: 'false',
                        position: '1',
                        mentionable: 'false'
                    }})```

But when I try to use `role.id` it comes back as `null`... what did I do wrong?
earnest phoenix
#

@neat ingot still don't work

sudden geyser
#

Sleepless, any API action returns a promise.

neat ingot
#

what doesnt?

sudden geyser
#

You must resolve it first.

earnest phoenix
#

@neat ingot the commands don't work

neat ingot
#

well, assuming you have copied my kommander thing exactly, of course they dont, youarent executing any of the commands

cinder patio
#

Adam, you'll have to make a http request to the DBL API ^-^

neat ingot
#

like, you havent linked up the kommanders commands to actually run when a message triggers

earnest phoenix
#

@neat ingot i know i'm too dumb ๐Ÿ™‚

tight ferry
#

hmmm... alright, let me do some more research. Thank you

neat ingot
#

well, im not here to write other peoples bots for them ๐Ÿ˜—

earnest phoenix
#

oof how

#

oh

cinder patio
#

You can either do it with a library like dblapi.js or just make the request yourself with the http library / node-fetch

earnest phoenix
#

how do you get your top.gg token

cinder patio
#

Your bot must be approved afaik

earnest phoenix
#

that token makes it invalid

#

wait

#

it forced it to be spaced out

#

let me try again

surreal notch
#

i am getting issue in it

sudden geyser
#

is the file path correct

#

are you sure the file exists

#

One dot is for the same directory. Two dots is for the directory above you, so you may actually be trying to read /customisation.json

copper cradle
#

@neat ingot why are you even doing Object.create(Object) that's literally the same as doing {}

earnest phoenix
#

"Error: Cannot find module 'dblapi.js'"

#

I npm installed it do I need to upload that to github?

copper cradle
#

guess it

#

ofc you do

earnest phoenix
#

Yeah but I can't do that if the nodemodules are too big

#

folder

copper cradle
#

where are you hosting your bot

#

then get a new host

earnest phoenix
#

its on github so i can

sudden geyser
#

are you running it locally or hosting it somewhere

earnest phoenix
#

hosting it somewhere

copper cradle
#

then

earnest phoenix
#

its on github so i can use heroky

#

heroku

copper cradle
#

you need the module 'somwehere'

#

so you're hoping to install something on your machine and hope it works on your host out of the box

#

ok

earnest phoenix
#

should i remove it from nodemodules and just put it inside of the main bits

copper cradle
#

no

#

upload the node_modules folder

#

at some point your crap will get too big

#

so you'll have to get a real host

#

what you're doing is literally saying 'I installed google chrome on my pc why don't I have it in my phone?

earnest phoenix
#

well

#

tbf it is

#

should i remove the un-needed node modules that i dont need on github that work without

copper cradle
#

lol

#

remove everything you know you don't use

#

but wait

earnest phoenix
#

the other stuff work without being on github

copper cradle
#

some modules that are installed get installed bc another module you use needs them

earnest phoenix
#

wait cant i just upload in groups to get all the files onto github-

neat ingot
#

i do Object.create(Object) because it takes more space and makes my code look neater. (imo) im strange i know ๐Ÿ™‚

cinder patio
#

(wait... you have uploaded your node_modules folder to github? ๐Ÿ˜ณ )

copper cradle
#

lol dekita

neat ingot
#

basically because its predefined, rather than an object created on the fly, if that makes sense?

#

like, if iw as just passing a small object to some function for options or such, i'd go {things:stuff}

#

but yea, predefined stuff thats like, global, or large objects, particularly those with functions, i do object.create

earnest phoenix
#

my little noob brain -._.-

copper cradle
#

lol

maiden mauve
#

anyone familiar with behavior of urls as objects in rich embeds?

neat ingot
#

sure

maiden mauve
#

I was trying to sneak a string into an embed where user couldn't see it

copper cradle
#

well I mean

#

what are you even trying to do

neat ingot
#

^

maiden mauve
#

good question

neat ingot
#

lool

maiden mauve
#

I'm using this in a function that doesn't have access to my "game variables"

copper cradle
maiden mauve
#

so to find the player again i need the serverid and user name

copper cradle
#

but like

maiden mauve
#

so from the embed object

#

I want to find the player

copper cradle
#

you can just fetch the old embed and get the data from there

maiden mauve
#

more specifically, I'm in the add/remove reaction event

#

so I have my embed, and the user

#

but I need to find the guild id of what server the user is playing the game on

neat ingot
#

good start!

maiden mauve
#

the concept is that im refreshing the user's inventory

neat ingot
#

message.guild isnt doing it? ๐Ÿ˜›

maiden mauve
#

so they don't have to keep using a chat command

#

message.guild is a dm

#

the message is the embed which is a dm

#

there's the idea

neat ingot
#

i'd say for security reasons not to try getting things from embeds in dm's and sharing guild info with anyone via dm

#

unless its only the people in dm who the data is about

maiden mauve
#

yeah, so you see how its got user name and guild name

#

the database finds the player that way

#

user name + guild id

cinder patio
#

So, you want a user to be able to use the command in DMs with any of their serves?

maiden mauve
#

that gets me back to all my game information for that player

#

yes - so if a player had 3 inventory embeds up from different servers

#

each one would update

#

because the guildid is nested in embed somewhere

#

I could just flat out make it the description

#

but then people will tell me it looks like a bug

cinder patio
#

you should think of a better system ๐Ÿ˜›

maiden mauve
#

this is innovation!

neat ingot
#

so was my idea of having a command suffix instead of prefix, after about 3 commands i realized why it wasnt...

maiden mauve
#

lol

#

hey its creative

cinder patio
#

I'm still not sure 100% what you're trying to do

maiden mauve
#

here

#

ill give you the full ss

#

so that is a players inventory for the game

#

when the reaction is clicked

#

it updates with the current amounts based on what they've done in chat

#

that's the idea anyhow

#

rather than re-sending the embed over and over

neat ingot
#

just resend the embed

cinder patio
#

makes sense, here's my suggestion - do you do database caching? Like do you store database objects in-memory?

neat ingot
#

its like 20 bytes of data

#

lol

haughty spoke
#

hey guys

require(`./commands/${dir}/${cmd}.js`);

how to make cmd handler like this?
like commands/fun/file.js ??

maiden mauve
#

@cinder patio not exactly sure what that means, I'm building the embed from a mongodb and a function

sudden geyser
#

you read the directory of categories, then you read loop over those categories and read the directory of the categories.

neat ingot
#

if you dont know how to, then just use discord js's built in commad handler and examples

sudden geyser
#

Since when has Discord.js had a built-in command handler?

neat ingot
sudden geyser
#

Do you mean the example they have?

mossy vine
#

never, commando is a thing

sudden geyser
#

oh that framework

mossy vine
#

ikr

neat ingot
#

lol

mossy vine
#

no it is ugly

neat ingot
#

if they dont know how to make their own, its easier

maiden mauve
#

I never really looked into building my own, I work around the example

#

it makes a few things look weird but it works fine

sudden geyser
#

it is easier but if you go down the road you'll hit all the issues with frameworks not giving you much room to build with

neat ingot
#

i built my own, cause i didnt realize discord js had an option

#

no point going to theirs now

#

lol

cinder patio
#

aha, well you can store all embeds that could get updated in a map, along with the user who requested them, ex:

 watchedInventories.set(userId, {user: user, guild: guild, msg: theMessageEmbed});
const {user, guild, msg} = watchedInventories.get(userid);
...fetch the data from the database using guild.id + user.id
msg.edit(..edit the embed...)``` @maiden mauve
maiden mauve
#

hm

#

so that "event" just sort of lingers in the memory of the server like a global variable?

cinder patio
#

well, sorta... you can clear the map every once in a while..

earnest phoenix
#

Is getting a list of guilds my bot in against tos?

#

Just wanna check before i add anything like that

maiden mauve
#

I don't see how its any different than logging what guilds it joins and leaves

cinder patio
#

Nex, afaik if the command is private, for owners of the bot only it's fine

neat ingot
#

i personally track how many times my bot is used in the guilds its in

earnest phoenix
#

Yeah tahts what i made it do

neat ingot
#

but its not available for others to just get

earnest phoenix
#

It makes sure it my id

neat ingot
#

should be fine then as your not sharing others personal data

sudden geyser
#

I don't know by its ToS but a good thumb rule is to keep it private (e.g. to yourself).

earnest phoenix
#

Yeah it only says names and the amount of people in the server

neat ingot
#

pff my bot spits that info out every bootup in the console

earnest phoenix
#

I have a private test server that i would use it in

maiden mauve
#

I'll keep that idea catalogued Google

#

But I like the integrity of an embed remote working even after bot restarts

#

My goal is that a user can load all the game menus and use reaction remote

neat ingot
#

reaction wouldnt hold after the bot reboots

#

it cannot respond to it after that

maiden mauve
#

the add/remove reaction does

#

the embed still has all its variables

neat ingot
#

but there is a limit to how long the bot can watch a particular emssage for reactions

#

which would be lost upoon shutdown

#

no?

maiden mauve
#

As far as I've tested its good after 24 hours

earnest phoenix
#

someone know how to show up the offline members of all the guilds? i know that i have to filter that, but i literally don't get it

#

there's any guide or smh?

digital ibex
#

sigh

#

what library and language?

maiden mauve
#

@neat ingot just loaded my "Test bot" and a menu remote from 3 days ago works

neat ingot
#

oh, nice

#

thats an interesting one

maiden mauve
#

as long as the menu footer is accurate

#

it can get the data necessary

neat ingot
#

thats pretty neat ๐Ÿ™‚

maiden mauve
#

this new idea of mine is adding in an extra problem

#

that's why im temporarily stumped

#

I was really banking on the url being a hidden string for the slam dunk

neat ingot
#

oh, well, regarding that

#

umm

#

sec

maiden mauve
#

If it was my own object I could just make up a string property

neat ingot
#

that is a utility function i have for displaying links in embeds

#

example ^

maiden mauve
#

is hover a tooltip supported by disc?

digital ibex
#

code looks kinda hot ngl

neat ingot
#

when i hover over them it displays a text field

sudden geyser
#

what is hover tooltip?

maiden mauve
#

I've never seen that before

grizzled raven
#

can you fetch a reaction/message from where you dont have access to?

#

well

neat ingot
digital ibex
#

nope

neat ingot
#

(hovering over vote)

sudden geyser
#

oh the title field.

#

yeah it's supported

grizzled raven
#

ok say oliy sends a message in #announcements and simeone reacts and ifs a partial reaction, can you fetch the reaction?

neat ingot
#

so there are a few ways you can have information there that isnt 'seen' by the user

maiden mauve
#

I could make a . that's a link and use the tooltip as a retrievable string

neat ingot
#

but it would still be there

maiden mauve
#

something like that?

neat ingot
#

yea pretty much

maiden mauve
#

that's a good idea in lieu of hidden

digital ibex
#

for someone like me, i won't be able to get it no because my bots not in the sevrer, for some1 like u, yes u can @grizzled raven

grizzled raven
#

hm

maiden mauve
#

but now that we're all in the loop

#

one of my questions was does setURL immediately dump it's string path if theres no image?

#

I guess it appears to

neat ingot
#

no eyed deer

#

maybe it does if its not a valid url schema

#

try something dumb like umm

maiden mauve
#

did you see what I tried? it made me laugh a bunch of times

neat ingot
#

png://my.fake.file.com/png

maiden mauve
#

was just gonna cut the string away to get it back

neat ingot
#

oh lol

#

add a field with this as a value

#

[shownname](${target.serbverId} "shownonhover")

#

?

maiden mauve
#

and grab the first field or something?

neat ingot
#

and without typos in server ofc

#

yea it shouldnt be able to link the url so the link shouldnt be valid

#

idk if it would still try to open it in the browser on click though

pale vessel
#

what are you trying to do

neat ingot
#

hes wanting to hide a bit of data in an embed so he can later retrive it

maiden mauve
#

lol

#

this could work

#

now to hid eit

neat ingot
#

noo wait, dont have the umm

maiden mauve
#

well, discord won't display it without that

neat ingot
#

cause that should invalidate the link and make it unclickable ~ maybe

maiden mauve
#

it does a validation check

earnest phoenix
#

lol

neat ingot
#

didnt you want it to be hidden? isnt that the point? lol

maiden mauve
#

im writing the code to see if i can grab an invalid url

#

when I tried using the thumbnail url

#

it turned my serverid into undefined

#

because it wasn't in a valid format

neat ingot
#

yea, but its not a thumbnail url now, its am embed thing, which contains everything else valid but a link to somewhere, the text shown and hover should still work i think

maiden mauve
#

ill get back to you in a short bit mining the embed object

neat ingot
#

the 'onhover' also isnt visible

#

so thats two places to hide data

earnest phoenix
#
if(message.metions.members.first().id == message.guild.members.get('id here'))```
so im trying to make it so my bot responds  with a specific thing if a certain user is mentioned and this is what im using but it doesnt seem to be working
sudden geyser
#

you're comparing a string to a guild member

earnest phoenix
#

that sounds like it wouldnt work pepePerhaps

sudden geyser
#

noop

#

members.get() will get you the guild member

neat ingot
#

remove the .id and see how that goes

sudden geyser
#

so you need to get its id after

#

That won't work either I believe.

#

As they're different instances (?)

neat ingot
#

i think they should both represent the same thing though

earnest phoenix
#

Wait are you trying to make the bot respond if a message has a specific mention? @earnest phoenix

sudden geyser
#

maybe but if they're different for some reason it won't work.

earnest phoenix
#

yes

maiden mauve
#

@neat ingot

#

can hide stuff in iconURL it just leaves a open area

neat ingot
#

and it doesnt try to show the icon or anything?

#

nice ๐Ÿ™‚

earnest phoenix
#

@earnest phoenix =>

if (message.content.includes('<@ID OF THE USER>')){
return message.channel.send("The thing you want it to say");
}
maiden mauve
earnest phoenix
#

ah nice

maiden mauve
#

the "I0" is the footer text

neat ingot
#

i showed above can also hide in the embed field link thing

maiden mauve
#

yeah pulling the data from fields

#

either way

#

i solved my problem ๐Ÿ˜„

#

thanks for tagging along

neat ingot
#

indeed

#

lol np, was a fun ride ๐Ÿ˜›

sudden geyser
#

dank, that won't work if the member has a nickname.

earnest phoenix
#

@sudden geyser wait what?

#

That's not how the mentions work

#

your way didnt work for me :(

sudden geyser
#

If the command was used in a guild and that member has a nickname, there will be a ! in the mention (<@!user-id>)

earnest phoenix
#

Hmm wait... What was the option to check if the user had a nickname or not? @sudden geyser

sudden geyser
#

member.nickname but I think it's safer to just check message.mentions

neat ingot
#

message.mentions.has(guild.me);

#

i use that to check if my bot is mentioned

#

guild.me could easily be replaced with a different member object

earnest phoenix
#

is there a way that i could just have the ID itself instead of a member object

#

i feel like that's slightly easier

neat ingot
#
const member = guild.members.cache.get('ID');
message.mentions.has(member);
#

whats wrong with doing something like that?

earnest phoenix
#

fair

sudden geyser
#

you don't actually need to get the member object as .members is a collection of mentioned members but I think they get the point

#

there are many ways to check if the member was mentioned. Just depends on how you want to check it.

earnest phoenix
#

ty

stoic quarry
#

I'm wondering if this is the correct place to look for someone to code a bot for me (with payment). Tbh I'm not sure if it's even possible to code, but just looking around. If someone could perhaps DM me if they're willing to give it a shot?

viral kayak
#

how are u not sure if its possible to code

#

what does that even mean

#

and yes this is the wrong place

stoic quarry
#

Because what I need it to do is.. some odd math + dice rolls and myself knowing no idea how to code I don't know if it's something possible to do. Could you point me towards a correct place? Unfortunately googling "Discord bot discords" doesn't exactly give very good results.

viral kayak
stoic quarry
#

Oh, I didn't even see that channel. Odd that it's locked.

modest maple
#

@stoic quarry wdym dice rolls?

#

you peak my interests being a dnd nerd

#

lmao

oak cliff
#

-verified @viral kayak and @stoic quarry

gilded plankBOT
#

@viral kayak @stoic quarry

#434058442764714002 Is for companies with actual jobs. Not simple bot requests.

viral kayak
#

ok

stoic quarry
#

Well, currently we use a dice roller and then add character stats to the number rolled. So say, they have a weapon they get 10% ontop of their attack roll. We math it all in a spreadsheet, adjust whatever rolls the dice bot has put out, then post that into the discord server. I'm wondering if it's possible somehow to have a bot do that work for us, not only rolling the attack/agility/etc number but also adding the %'s onto it based on the information we give it, then spitting out the adjusted number.

#

I don't think this would fit in Verified-jobs, since I'm asking for a bot request and not an actual job nor am I a company...

modest maple
#

Do you use somthing like DiceCloud for the character sheets or dnd beyond?

stoic quarry
#

No unfortunately it's not actually DND, it's a roleplay site and it's all handled on forum except the dice roll part which is done in a discord channel. And since each character has different attributes and such we enter it all manually per fight, I dont think there's a way at all for us to like.. link it so that the dice can collect the information itself.

modest maple
#

ah yh

#

Tbf its possible, one of mine used todo that sort of system but its in to fit state to be of any use to u rn im afraif

stoic quarry
#

Like we'll look at skill level, whether they have a weapon, a companion, roll 4 d100's and then depending on the character one might have 40% bonus to attack, 10% to perception, and we put the numbers into the spreadsheet to find the final value ourselves. It just takes a good amount of time per fight, I'm looking for a way to make it faster.

modest maple
#

avrae might have some custom modifiers you can add

#

if not avrae supports some custom commands so might be able to setup some customs for the characters themselves

stoic quarry
#

Hmmm, I'll take a look at it. Do you think it's simple enough for an idiot to do? Because I don't know much about coding at all.

modest maple
#

If i remember avrae is pretty simple

stoic quarry
#

But we do have few enough characters that I could potentially set up a custom per character, if I could like... tell the bot to roll character A 4 d100's and it does the math based on that.

modest maple
#

i dont know how much DND beyond has actually ruined it since then but should be possible

#

yh Avrae can support custom character sheets from G sheets

#

so would be possible todo it custom for yourself

stoic quarry
#

But in terms of coding I wouldnt know how to tell the bot that character A should have a 10% boost to attack and then a 40% boost to total score, or anything like that. Because after all 4 numbers are rolled and adjusted, they need to be added together and then another % needs to be added ontop of the total score.

#

Hmm I'll take a look, thanks! Hopefully it won't be too hard-coded to only work for DND things

modest maple
#

avrae used to be pretty versatile so should be fine

clear wraith
#
        throw e;
        ^
Error: The module '/rbd/pnpm-volume/c4ce2938-52f0-4ad4-aad3-2f01ac60dd27/node_modules/.registry.npmjs.org/quick.db/7.1.1/node_modules/quick.db/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1235:18)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at bindings (/rbd/pnpm-volume/c4ce2938-52f0-4ad4-aad3-2f01ac60dd27/node_modules/.registry.npmjs.org/quick.db/7.1.1/node_modules/quick.db/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/rbd/pnpm-volume/c4ce2938-52f0-4ad4-aad3-2f01ac60dd27/node_modules/.registry.npmjs.org/quick.db/7.1.1/node_modules/quick.db/node_modules/better-sqlite3/lib/database.js:6:40)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)```
#

What did i do wrong here??

#

I don't know what it wants me to do...

#

Can anyone help me with this?

pale vessel
#

have you tried reading the error

viral kayak
#

reading is a skill required as a human

tough relic
#

How can a bot give a role with python?

clear wraith
#

I read the error.....

viral kayak
#

u didnt

clear wraith
#

It wanted me to install node, but I already did it

viral kayak
#

u would know the problem if u djd

summer torrent
#

have you tried reading docs @tough relic

tough relic
#

Yes @summer torrent

#

Let me show what I've done

viral kayak
#

did*

#

u have to reinstall quickdb

tough relic
#
 if message.content == "give me admin":
       role = discord.utils.get(member.server.roles, name="admin")
       await client.add_roles(message.author.id, role)
``` But I have the error (member is not definied)
modest maple
#

well where are you getting memeber from

#

no where?

#

theres ur issue

queen needle
#

how do you add css to the top.gg website?

#

like where do you put it

summer torrent
#

long description

slender thistle
#

Long description, style tag

summer torrent
#

Long description supports HTML/Markdown

queen needle
#

but what would the name be?

#

like

#
<style>
whats the name{
color: red;
}```
viral kayak
#

u learn css

queen needle
#

okay

unborn steeple
#
const { RichEmbed } = require('discord.js')
const db = require('quick.db')

module.exports = {
  name: "messagelb",
  aliases: ["msglb", "mlb", "msgtop"],
  run: async (bot, message, args) => {

    let messages = db.startsWith(`messages_${message.guild.id}`, { sort: '.data'})
    let contentmsg = "";

    for (let i = 0; i < messages.length; i++) {
        let user = bot.users.get(messages[i].ID.split('_')[2]).username

        contentmsg += `#${i+1} - ${user} - ${messages[i].data}\n`
    }

    const embed = new RichEmbed()
    .setAuthor(`Message Leaderboard`, message.guild.iconURL)
    .setDescription(`${contentmsg}`)
    .setColor(0xabc123)

    message.channel.send(embed)
  }

}
#

For some reason it doesnt show the contentmsg stuff

#

And it doesnt show an error

cedar nova
#

Why me yt api usage limit always

mossy vine
#

yt api limit use

#

you no go more limit

#

never

grizzled raven
#

yes

languid frigate
#

hey, whats the difference between token and alpha token pls ?

earnest phoenix
#

Hi

#

how do you open files like I'm going to write all the commands in another file so i want to open how do you do that?

mossy vine
#

what language

earnest phoenix
#

discord.js

mossy vine
#

thats not a language

earnest phoenix
#

js

#

javascript

mossy vine
earnest phoenix
#

ok thx

craggy flower
#

Suck me off

#

Duke

#

Sike

maiden mauve
#

I wish programming was like a giant phone game

#

so I could pay $1 to hit the "Why?" button

#

for some reason every function from a require is suddenly being a delinquent

viral kayak
#

@craggy flower wrong place

earnest phoenix
#

i can add smth queue while bot is playing on another channel and dont know how to fix it

maiden mauve
#

I think I know what I did

#

files requiring each other

#

may have changed the load order

magic jackal
#

ah yes synchronous coding 5head

earnest phoenix
#

can anyone help me

magic jackal
#

What do you need help with?

earnest phoenix
#

i can add smth queue while bot is playing on another channel and dont know how to fix it

magic jackal
#

What do you mean? Can you explain a little better?

earnest phoenix
#

like

#

im on channel "a"

magic jackal
#

Two different bots?

earnest phoenix
#

my bot on channel "b"

#

no

#

while im on another channel

#

i can play smth

#

i dont want to

quartz kindle
#

just check if the voice channel the bot is in is the same as the voice channel you are in

magic jackal
#

Check the voice channel of the user and if it doesn't match then don't continue.

#

Are you using a specific lib for the bot? I can tell you.

earnest phoenix
#

discord.js

#

how to disform image in discord.js ??

magic jackal
#

@earnest phoenix Probably need to use a lib for that.

earnest phoenix
#
if(message.member.voice.channel != voiceChannel.channel) return message.reply(check your channel").catch(console.error);
#

i did this but

#

i donโ€™t find lib ^^

#

i tdidnt work

#

Hey can we put an embed in a webhook ifttt ?

#

please ping me if you answer me

magic jackal
#

@earnest phoenix Can you pass application/json through IFTTT, if so just pass the embed there.

earnest phoenix
#

@magic jackal could you help me?

magic jackal
#

@earnest phoenix yeah one sec

earnest phoenix
#

But this don't work idk whyy

#

it's on zapier*

magic jackal
#

Then diagnose it, what is it passing ? Have you tested to a requestbin

#

One sec

#

@earnest phoenix You're missing a " and I'm spinnin up my bot one sec

earnest phoenix
magic jackal
#

Okay let me work on ths other guy first one sec

earnest phoenix
#

the webhook send this

#

ok ok thanks

#

i wait

#

@magic jackal

#

still not working

#

i cannot pause while im on the same channel

magic jackal
#

one sec

#

I'm making a music bot real quick so I can give you some code

earnest phoenix
#

wow

delicate zephyr
#

please dont spoonfeed.

magic jackal
#

ok, so basically you need to check against the bot voice channel ID and your voice channel ID in order to prevent this.

#

@earnest phoenix

#

What is voiceChannel.channel can you show me the var for that.

earnest phoenix
#

hey so anyone can help me ๐Ÿ™‚ ?

#

sup. ?

#

how i can put an embed in zapier ?

magic jackal
#

Yes, how can I assist?

#

Oh yes, one moment.

earnest phoenix
modest maple
#

@earnest phoenix what lib

magic jackal
#

Can you paste what you are passing now?

modest maple
#

oh

magic jackal
#

oh, uhh lets see I think this is like some Zapier weird tricky thing.

earnest phoenix
#

mmmhhh i have deleted this but can you send me an exemple ?

#
run(message) {
    var voiceChannel = message.member.voice.channel;
    if (!voiceChannel) return message.reply('Join a channel and try again');
#
{
  "content": "@everyone",
  "embeds": [
    {
    "footer": {
      "text": "Ceci est un footer.",
      "icon_url": "https://vignette.wikia.nocookie.net/spiderriders/images/d/dd/Discord.png/revision/latest?cb=20171218232913"},
    "thumbnail": {
      "url": "http://ec.europa.eu/eurostat/cache/infographs/youthday2016/img/embed.png"},
    "title": "Ceci est un titre !",
    "description": "Ceci est une description.\n\n[Ceci est un lien cliquable.](url.com)\n\n:web: Cette icone est un emoji.",
    "color": 16777215
  }
 ]
}
#

@magic jackal ^ this

magic jackal
#

I think you should try out the embed generator real quick with your ZAP

earnest phoenix
#

txj

#

sent the var

magic jackal
#

sec

earnest phoenix
#

@magic jackal the embed generator ?

magic jackal
#

@earnest phoenix try this one

#
{
  "content": "Test body text",
  "embeds": [
    {
      "title": "this is a test title",
      "description": "test",
      "color": 7506394
    },
{
      "title": "this is a test title",
      "description": "test",
      "color": 7506394
    }
  ]
}```
earnest phoenix
magic jackal
#

@earnest phoenix Right now you are checking against the users voice channel and thats it, check the voice channel against the bot user and say this

if(bot.voiceChannel.id != userRequesting.voiceChannel.id){

}```
earnest phoenix
#

how to do

magic jackal
#

something like this. take a look at the voiceChannel doc page for help on making it.

earnest phoenix
#

@magic jackal idk how to fix my problem ๐Ÿ˜

magic jackal
#

Okay so there is something wrong with how you are passing the information (JSON) to the webhook

quartz kindle
#

@earnest phoenix are you using discord.js?

pale vessel
magic jackal
#

@quartz kindle yes

pale vessel
#

can't you add embeds data?

quartz kindle
#

and you want to post the data in discord as an embed?

pale vessel
#

you're putting the object in content

earnest phoenix
#

@quartz kindle i use ZAPIER

quartz kindle
#

ie: send a message containing the embed

earnest phoenix
quartz kindle
#

is that what you want?

pale vessel
#

if i understand correctly

quartz kindle
#

or what do you want?

buoyant stirrup
#
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);

const DBL = require('dblapi.js');
const dbl = new DBL("(MY DBLTOKEN)", { webhookPort: 3000, webhookAuth: '(MY AUTH)', webhookServer: server });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
server.listen(process.env.PORT, () => {
  console.log('Listening');
  console.log(process.env.PORT)
});```
#

hello , it's not working

pale vessel
#

state why it is not working

earnest phoenix
#

and you want to post the data in discord as an embed?
@quartz kindle YESSSS

quartz kindle
#

@earnest phoenix what do you want to do with this data?

earnest phoenix
#

send in discord

quartz kindle
#

send it as a message on discord?

earnest phoenix
#

but in webhook with zapier automatic

quartz kindle
#

then first of all, you cannot send multiple embeds in a single message

buoyant stirrup
#

@pale vessel idk. there is no message in console

quartz kindle
#

its embed: {} not embeds: [{}]

#

second, show the code that is sending the message

earnest phoenix
#

when i create card in trello, zapier send a webook in discord with all informations of the card created

#

i want to do this ^^

pale vessel
#

it's actually embeds if you're sending it through the api

#

embeds is an array

earnest phoenix
#

i know x)

quartz kindle
#

he said he wants to post a message

pale vessel
#

well it worked, but the message is literally the embed object

earnest phoenix
#

yeah i want to post a message in webhook with all informations

quartz kindle
#

show your channel.send

pale vessel
earnest phoenix
#

@quartz kindle me ?

quartz kindle
#

yes

earnest phoenix
#

send the code

#

@pale vessel why you post my image ?

pale vessel
#

because it worked, just something is wrong with the code

#

i thought tim didn't notice

earnest phoenix
#

uhh i don't think x)

pale vessel
#

content

quartz kindle
#

no

earnest phoenix
#

yeah i have put content

quartz kindle
#

there are two wrong things

earnest phoenix
#

(sorry of my language i'm french)

#

send me a code simple for exemple

quartz kindle
#

the first wrong thing is that you have to use embed not embeds
the second wrong thing is that you're sending the object stringified, thats why its not an embed

#

show your code

pale vessel
#

he wanted your code

earnest phoenix
#

like this i can try and after modify the code

#

TypeError: Cannot read property 'id' of undefined

#

am i stupid

#
{
  "content": "Test body text",
  "embed": [
    {
      "title": "this is a test title",
      "description": "test",
      "color": 7506394
    }
  ]
}
quartz kindle
#

embed is not an array

#

its an object

pale vessel
#

this is not a lib tho

earnest phoenix
#

send a exemple for me like i have send and i test if work

quartz kindle
#

embed:{} not embed:[{}]

#

and i said show code

#

you didnt show code

earnest phoenix
#

@quartz kindle can you send me the code correcly for exemple like i have send ^

quartz kindle
#

no

earnest phoenix
#

and i try if work

quartz kindle
#

i have no idea what your code is

#

i cant send you something without knowing your code

#

else it will likely not work

earnest phoenix
#

Hi, I need to know what I should write to make a command that shows all the servers the bot is in.

Example as if it was a feature (any ids and numbers are being used as if dbl was it's only server):
Input-
$servers
Output-

264445053596991498 (Discord Bots List)

Within json, as it needs to go into the commands.json file

#

what code ?

quartz kindle
#

your discord.js code

#

channel.send()

earnest phoenix
#

BRO It's on zapier what you speak me channel.send()

#

it's not a bot

#

but a webhook

quartz kindle
#

oh...

#

thats why i asked if it was discord.js

#

and someone said yes

pale vessel
#

embeds and it's an array

#

maybe i'm dumb

earnest phoenix
pale vessel
#

shouldn't it be embeds instead of content?

earnest phoenix
#

idk

#

this is correcly

quartz kindle
#

this is how discord webhooks look like

earnest phoenix
#

but i don't want just : test

#

but a embed

quartz kindle
#

whats the url you're sending to? this? /webhooks/{webhook.id}/{webhook.token}

delicate zephyr
#

this will provide you with the JSON you would need to post to the webhook in order to get your output

quartz kindle
#

the problem is that his embeds are not getting embedded, its just posting raw text

earnest phoenix
quartz kindle
#

discord says this

earnest phoenix
#

the code

quartz kindle
#

which suggests you cannot use embeds together with content

earnest phoenix
#
{
  "content": "this `supports` __a__ **subset** *of* ~~markdown~~ ๐Ÿ˜ƒ ```js\nfunction foo(bar) {\n  console.log(bar);\n}\n\nfoo(1);```",
  "embed": {
    "title": "title ~~(did you know you can have markdown here too?)~~",
    "description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
    "url": "https://discordapp.com",
    "color": 7977332,
    "timestamp": "2020-04-27T22:48:34.364Z",
    "footer": {
      "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
      "text": "footer text"
    },
    "thumbnail": {
      "url": "https://cdn.discordapp.com/embed/avatars/0.png"
    },
    "image": {
      "url": "https://cdn.discordapp.com/embed/avatars/0.png"
    },
    "author": {
      "name": "author name",
      "url": "https://discordapp.com",
      "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
    },
    "fields": [
      {
        "name": "๐Ÿค”",
        "value": "some of these properties have certain limits..."
      },
      {
        "name": "๐Ÿ˜ฑ",
        "value": "try exceeding some of them!"
      },
      {
        "name": "๐Ÿ™„",
        "value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
      },
      {
        "name": ":thonkang:",
        "value": "these last two",
        "inline": true
      },
      {
        "name": ":thonkang:",
        "value": "are inline fields",
        "inline": true
      }
    ]
  }
}
delicate zephyr
#

because webhooks are embeds unlike messages which are embed

#

because you can have more than one embed in webhook messages

quartz kindle
#

@earnest phoenix do like you did before, with embeds:[{}] but remove content

delicate zephyr
#
{
  "content": "Test body text",
  "embeds": [
    {
      "title": "this is a test title",
      "description": "test",
      "color": 7506394
    }
  ]
}```
#

should work

quartz kindle
#

without content

earnest phoenix
#

okokokokk, i literraly don't understand

#

thanks luke

#

i try

quartz kindle
#

without content

#

remove content

delicate zephyr
earnest phoenix
quartz kindle
#

ah

delicate zephyr
quartz kindle
#

of course

delicate zephyr
#

OH

quartz kindle
#

you're sending EVERYTHING as content

delicate zephyr
#

that should be body

earnest phoenix
#

@quartz kindle what i need to put

#

it's body i need to put ?

#

(sry i'm french)

delicate zephyr
#

@quartz kindle tbf, once you figured that out you woulda needed to change embed to embeds

pale vessel
#

smh i already pointed that out ๐Ÿ˜”

delicate zephyr
#

@earnest phoenix yea

#

rename "content" -> "body"

earnest phoenix
quartz kindle
delicate zephyr
#

oh

#

what the hell is that panel

pale vessel
#

shouldn't it be embeds instead of content?
@pale vessel oof

earnest phoenix
#

like this ?

#

@quartz kindle ^

quartz kindle
#

yes

earnest phoenix
#

and i put my code in embeds ?

pale vessel
#

yes

quartz kindle
#

only the embeds code yes

earnest phoenix
#

ok

quartz kindle
#

no

#

i said

#

only the embeds code

earnest phoenix
#

where ?

quartz kindle
earnest phoenix
pale vessel
#

content: a

quartz kindle
earnest phoenix
#

i have this the } but it's same

#

it's same

pale vessel
#

why is content a

delicate zephyr
#

get rid of content

quartz kindle
#

try content: "a" instead of a

#

or remove it

pale vessel
#

i feel like he has been ignoring me

earnest phoenix
quartz kindle
#

if you remove content, you need to remove the entire field

#

you cannot have empty content

earnest phoenix
quartz kindle
#

i give up

#

do this

earnest phoenix
#

i've not understand

quartz kindle
#

use custom request

earnest phoenix
#

where ?

quartz kindle
#

there should be a button for it

#

actions -> custom request

tough relic
#

I have the code: ```
import discord
from discord.ext import commands
from discord.utils import get
import asyncio

bot = commands.Bot(command_prefix = '.')

@bot.event
async def on_ready():
print("Bot is ready")

@bot.command(pass_context=True)
async def add_roles(ctx, member: discord.Member = None, role: discord.Role = None):
await bot.add_roles(member, role)``` and I get the error

earnest phoenix
#

@quartz kindle do you have time to do something ?

quartz kindle
#

?

earnest phoenix
#

๐Ÿ˜‚

#

it's hard

quartz kindle
earnest phoenix
quartz kindle
#

i dont wanna create an account just for this

earnest phoenix
#

Repost:

Hi, I need to know what I should write to make a command that shows all the servers the bot is in.

Example as if it was a feature (any ids and numbers are being used as if dbl was it's only server):
Input-
$servers
Output-

264445053596991498 (Discord Bots List)

With json, as it needs to go into the commands.json file

#

@quartz kindle i'm so confused omggg

#

but no problem i gonna search solo

#

thanks you for help

languid heart
#

I have a question

#

How i program a good bot

#

With termux

summer torrent
#

termux is not for "programming"

languid heart
#

Yes it is

#

Beacuse you can use other apps inside it

quartz kindle
#

its a terminal emulator lol

#

its like the command prompt on windows

languid heart
#

But i can open javascript there

#

And program

summer torrent
#

on mobile, yes

quartz kindle
#

you can open a lot of things there, not necessarily related to programming

scenic kelp
#

You can also run javascript in your browser

summer torrent
#

coding on mobile is bad idea

languid heart
#

I program on mobile

summer torrent
#

๐Ÿ™„

languid heart
#

And i dont have nothing bad

summer torrent
#

small screen and keyboard

quartz kindle
#

autocorrect

languid heart
#

And?

scenic kelp
#

If you can avoid it definitely code on a non-mobile device

languid heart
#

Its possible

scenic kelp
#

It took me like 3 hours to make a 30 line python script

languid heart
#

I cant beacuse this is all i have

summer torrent
#

ยฏ_(ใƒ„)_/ยฏ

languid heart
#

I have a bot active

#

But idk how to better up it

summer torrent
#

๐Ÿ‘

quartz kindle
#

anyway a good bot means a bot coded by someone who knows what they're doing, ie: at least 1-2 years of coding experience

languid heart
#

Ok

#

I am starting to lesrn programing

quartz kindle
#

if you're a beginner, there are probably a lot of things you can improve, but we cant tell you exactly what you need and where to make changes

languid heart
#

But i dont find a mobile tutorial

quartz kindle
#

mobile is not different from pc

#

a programming language is the same everywhere

languid heart
#

Ok

#

Ok

quartz kindle
#

if you're using javascript, then learn javascript

languid heart
#

I am trying to learn but is a bit hard

quartz kindle
#

you're using discord.js right?

languid heart
#

Yes

quartz kindle
#

discord.js is an advanced discord library made with javascript

languid heart
#

Ok

quartz kindle
#

basic knowledge of javascript itself is needed to understand discord.js and use it effectively

summer torrent
quartz kindle
#

look for javascript tutorials, classes, courses, lessons etc

languid heart
#

I use mybot guide to active it

quartz kindle
#

once you learn the basics, you will be able to better understand what your code is doing

languid heart
#

Ok

quartz kindle
#

and once you understand it, you will be able to see what possibilities you can do with it

languid heart
#

Ik

#

I have 11 years

#

XD

summer torrent
#

what

languid heart
#

Yes

quartz kindle
#

lol...

languid heart
#

I am a kid

quartz kindle
#

you know that discord is 13+ right?

summer torrent
#

^^

languid heart
#

I want to study coding

summer torrent
#

you can

languid heart
#

Ik @quartz kindle

quartz kindle
#

so im sorry but you cant be here

languid heart
#

But i am not an immature kid

summer torrent
#

but discord is 13+ pandasad

quartz kindle
#

yes but rules are rules, and big discord servers like this one must follow discord's rules, or we get in trouble

languid heart
#

You are going to ban my account

#

XD

quartz kindle
#

the mods will once they see this

languid heart
#

Emmmmmm

quartz kindle
#

sorry =P

#

he left lol

summer torrent
#

๐Ÿ”จ

quartz kindle
#

poor kid

summer torrent
#

yeah

delicate zephyr
rare mist
#

Will it be a privancy breach a command that will show a random emoji from any guild that the bot is in?

summer torrent
#

no

clear wraith
#

I have a question.... How are the following not functions??

#

TypeError: client.guilds.map is not a function
&
TypeError: member.guild.channels.find is not a function

summer torrent
#

what is your d.js version

clear wraith
#

12

pale vessel
#

guilds is now a manager in v12

#

the property cache holds all the gulids

summer torrent
#

guilds.cache.map

#

channels.cache.find

pale vessel
#

yep

lost cave
#

I've got a question regarding IDEs for java development, I've gotten used to using Netbeans to code in java due to my courses, is it worthwhile to figure out how to code a bot for maven in netbeans, or should I just move to intellj?

clear wraith
#

Awesome, Thanks!

pale vessel
grizzled raven
#

imagine needing a guide to know the changes

clear wraith
#

Lol

neat ingot
#

pffft, v12 has so many changes, if there was no guide i wouldnt have bothered upgrading

clear wraith
#

Fr

grizzled raven
#

just to make sure, you're able to do something like this, right?```js
let m = require(require.resolve("discord.js").replace("index.js","managers/PresenceManager.js"))
m.add = () => null
//...

copper cradle
#

yeah I think

#

I've never used require.resolve

grizzled raven
#

i really just mean if you can like change stuff with requiring the file

clear wraith
#

Whats up with Cannot read property of 'find' of undefined That used to work before...
same with Cannot read property of 'get' of undefined

grizzled raven
#

cache

#

cache

#

.cache.find, .cache.get

#

just add cache to replace every collection, except message attachmefns and message memtions

clear wraith
#
    channel => channel.name === "welcome"
  );```
quartz kindle
#

@grizzled raven yes you can, i do that in light lmao

clear wraith
#

I do have cache in it

grizzled raven
#

just wanted to make sure

#

as you were using the delete keyword idk i was just thinking

#

in fact i got that from you anyway xd

turbid bough
quartz kindle
#

haha

grizzled raven
#

string

#

or not

#

but i assume

#

string

#

-idsshouldbestrings tag when

#

jk thats useless lmao

#

wait

#

no im bubble gum dum dum

#

yeah idk

turbid bough
#

ill test that

grizzled raven
#

try it anyway

quartz kindle
#

is that actual gmail?

#

or what is that?

grizzled raven
#

js

quartz kindle
#

thats not gmail is it? i thought it was gmail for a sec lmao

turbid bough
#

yep that fixed it lol

grizzled raven
#

see im not a bubble gum dum dum

clear wraith
grizzled raven
#

no

#

client.users.cache.get

quartz kindle
#

lmao

clear wraith
#

Wtf

turbid bough
#

get cached clients

copper cradle
#

dude...7

clear wraith
#

client.cache.map

copper cradle
#

console.log(client.users)

summer torrent
#

client isn't a collection

copper cradle
#

wait

#

I know

#

I just want to see if client is also undefined

#

that would mean they copied some code

#

and maybe they have bot instead of client

earnest phoenix
#

Hello
I'm trying to implement a music feature to my bot, DirectX. Can anyone help me please?
Here's code:

#

That easy errors that when they don't get resolved gives me a headache lmao

nocturne dagger
#

So im using discord.js

#

Im working on a mute command

#

if im using settiemout how can I set the time to wait

#

and then remove the role

copper cradle
#

setTimeout

#

tho the time will not be saved if you end kill the process

quartz kindle
#

the timeout syntax is like this js setTimeout(function to execute, time to wait in millisconds)

#

but you're gonna have bigger problems than that

copper cradle
#

yeah

quartz kindle
#

timeouts are stored in memory, which means they will be deleted when your bot restarts

#

if you mute someone, and then restart the bot, they will never be unmuted

#

you will need a database to store mute information

earnest phoenix
copper cradle
#

?

#

I ain't opening that file

quartz kindle
delicate zephyr
#

its generated by discord

quartz kindle
#

lmao

copper cradle
#

yeah I won't be reading that either

sudden geyser
#

when they said async function execute I really felt that

copper cradle
#
#inclue <iostream>

int main() {
  int c = 0;
  c++;
  std::cout << c << std::endl; // 1
  return 0;
}

I really felt that

tough relic
#

I've made 2 bots but is there a way that one will output something to trigger the other bot?

copper cradle
#

yeah

tough relic
#

how?

#

In python btw

neat ingot
#

your c++ is missing an ;

copper cradle
#

fuck

#

done

grizzled raven
#

whitenames say "im having trouble, here's my code" like they didnt just copy it word for word off of someone's github or from an idiot guide's guide lmao

copper cradle
#

lmao

copper cradle
#

Imagine writing code like this

#include <stdio.h>

int main() {
  int c = 0
  ;c++
  ;printf(c)
  ;return 0;
}
#

it works tho

neat ingot
#
int main() 
{
  //...
}```
copper cradle
#

that looks clean

#

but I'm used to () {

neat ingot
#

shoot yourself ty ๐Ÿ˜—

#

i cannot stand code written like that, its so ugly ๐Ÿ˜„

copper cradle
#

It just comes out natural

#

bro that's crazy

lyric mountain
#

Also IDEs like intellij format to () {

neat ingot
#

ha

grizzled raven
#

ew no

#

() { is better change my mimd

copper cradle
#

I prefer ()
{

}
tho

neat ingot
#

no

copper cradle
#

it's like a standard for the C family

grizzled raven
#

well okay

copper cradle
#

but like

grizzled raven
#

understandable

#

but then what about if statements

copper cradle
#

if ()
{
}

#

it still works

neat ingot
#

you dont even wanna know...

grizzled raven
#

i mean surely you dont do if(true){

#

oh yeah it still works ik

#

but i

#

rh

#

eh

copper cradle
#

just fucking use nim and then you get rid of {}

lyric mountain
#

This is better. Period.

public void knowWhat() {
 System.out.println("Time to move to off-topic guys!");
} 
copper cradle
#

bc nim has python-like syntax

grizzled raven
#

well this is dev stuff so

neat ingot
#

i like ruby syntax

lyric mountain
#

This is personal preference stuff

copper cradle
#

libdiscord

#

done

#

now we're talking about botums

neat ingot
#
$ruby.is_a?(Object)  {|oriented| language}```
#

โค๏ธ

copper cradle
#

that looks ugly ngl

#

I prefer go

neat ingot
#

lol

#

why dont we just agree that assembly is prettiest language?

earnest phoenix
#

emojicode is the prettiest language.

copper cradle
#
package main

func goIsntA(object ...interface{}, oriented string) (language string) {
  return "yes, it isn't"
}
neat ingot
#

lmao

copper cradle
#

I think it is more readable than

$ruby.is_a?(Object) {|oriented| language}
neat ingot
#

that ruby line won a competition back in i think 2013

copper cradle
#

good for it

neat ingot
#

its valid syntax to get 'true'

copper cradle
#

lol

neat ingot
#

and displays how you can manipulate rubys 'blocks' ({})

copper cradle
#

I'll look more into ruby tho

neat ingot
#

i used to use it a bunch for rpg maker back in the day ๐Ÿ˜„

#

really nice to write with, but not so performant ๐Ÿ˜ข

broken matrix
#

badge#2222

lyric mountain
#

?

earnest phoenix
#

How do I use json to receive the ids of all the servers my bot is in?

simple barn
#

Hey everyone

#

I've seen that alot of the discord bots on top.gg have a a server count that shows how many servers the bot is in

#

My bot shows "N/A" in the server count

#

How do I configure it?

oak cliff
simple barn
#

Ok

#

Thanks

lyric mountain
#

@earnest phoenix do a POST request to discord api

#

Check discord developer dashboard for actual endpoints