#development

1 messages · Page 1156 of 1

earnest phoenix
#

Those asses think imma go to fivver the place full of scammers 😂

opal plank
#

how's discord any better?

sinful belfry
#

-needdev @earnest phoenix

earnest phoenix
#

I’ve watched so many YouTube videos on people getting scammed

gilded plankBOT
#

@earnest phoenix

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

sinful belfry
#

dont ask here please

earnest phoenix
#

Hm

opal plank
#

and thats the thing i linked before

#

¯_(ツ)_/¯

amber fractal
#

Fiverr/freelancer has systems in place to protect buyers and sellers

sinful belfry
#

👀 yeah listen to these kind people here, they know what they're on about lol

amber fractal
#

discord doesnt even support that

earnest phoenix
#

@sinful belfry Fivver is full of scammers

sinful belfry
#

doesnt mean you should come here

earnest phoenix
#

I’ve watched so many YouTube videos on it

misty sigil
#

probs faked

amber fractal
#

Fiverr/freelancer has systems in place to protect buyers and sellers

earnest phoenix
#

Yes it does Because there is verified bot dev

#

Role

amber fractal
opal plank
#

there are scammers everywhere, asking people on discord to do it for you wont make anything better

#

bruh

amber fractal
#

Verified bot dev has nothing to do with anything...

earnest phoenix
#

So I shall n if u don’t like ist don’t pay attention

opal plank
#

there are legit people who copy paste pre-made bots and get verified roles

#

do you have the smallest hint of idea how little coding knownledge you need to get the role?

amber fractal
#

It doesnt mean someone is a good source for a bot, especially if you pay them

earnest phoenix
#

Yes it is

amber fractal
#

Lost cause

#

Not even worth talking to anymore

earnest phoenix
#

Because I can use these people as a middle man because they can add the bot here n they can test commands 😂

#

N shit

#

the badge is what's worth more than the role

solemn latch
#

nah the role is everything

#

screw the badge

opal plank
#

not even the badge

earnest phoenix
#

discord showed interest already into having a bot marketplace

solemn latch
sand condor
#

nah the role sucks

opal plank
#

a. You can get into a Team and do absolutely no work whatsoever for that badge
b. Copied bots, discord doesnt check your source code, only ask you general questions.

sand condor
#

lol

opal plank
#

you could prob fake growth till you hit 75 servers and simply submit verification if the servers its in arent empty with 3 or 4 people in it

#

badges dont mean shit

#

¯_(ツ)_/¯

sand condor
#

ur mad bc u don't have it

earnest phoenix
#

Me: is anyone looking for commissions
You people: ur not allowed to do that here blah blah
Mods: zoomeyes

opal plank
#

should probably ask for a portifolio or work recommendations/history if you properly need that

midnight blaze
#

wait, I think they actually trying to do against people who make sloppy bots only to get the badged. At least they said that, so I am sure that they are doing more then just reading the comments.

opal plank
#

they cant do anything about it tho pang

#

they dont check the source code

#

they only check metrics and ask general questions about what you store as far as data goes

earnest phoenix
#

@sinful belfry I know for a fact @misty sigil Takes commissions from people here

misty sigil
#

no

sinful belfry
#

@earnest phoenix maybe... don't cause drama here

#

you already know that this isn't a place to hire devs

#

if you have a problem with fiver, then consider looking for other sites

earnest phoenix
sand condor
#

LOL

misty sigil
#

bruh

#

you literally dm'd me first

earnest phoenix
#

Liar liar pants 👖 on Fire 🔥

#

Get ur ass exposed bitch 🤣

misty sigil
#

lol

midnight blaze
#

that is why I have my dm closed

misty sigil
#

i closed them

#

ages ago

sinful belfry
#

@earnest phoenix last warning

#

please stop causing drama

sand condor
#

yikes

sinful belfry
#

@earnest phoenix seriously???

ionic dawn
#

This kid lol

sinful belfry
#

stop

#

im serious

#

you'll find yourself unable to speak soon

ionic dawn
#

Matt, you up for script for money?

misty sigil
#

nah

opal plank
#

here we go again....

misty sigil
#

not anymore

ionic dawn
#

Its a serious thing not this kids stuff

earnest phoenix
#

I think i will soon after you stop me

slender thistle
#

Starman you know what

#

just do it

sand condor
#

surprised he isn't muted yet

#

dbl mods are strict

earnest phoenix
#

How much we talking, & whats the project?

ionic dawn
#

Isn't a project

#

just script

opal plank
#

rip channel topic

misty sigil
#

lel i got more money so i dont need even more mmulu

earnest phoenix
#

Whats the "script" supposed to do, lmao

quartz kindle
#

gib mi môney

twilit rapids
#

Fun is over guys, continue back to your normal conversations owoNice

amber fractal
#

Tim does commissions confirmed mmLol

twilit rapids
#

Imagine not doing commissions (Apart from just helping with a code snippet)

earnest phoenix
#

Exactly

opal plank
#

imagine working

ionic dawn
#

Well, I have a dc community and a few weeks ago we make a Nitro giveaway, the thing is that we make the people invite my bot to "ad" the bot, but people just build like 20 fake servers so... I need something to kick my bot out of there

#

So i can fix the verify issue

misty sigil
#

just get the ID's of them

twilit rapids
#

Check for guild membercount and owner ID I guess

misty sigil
#

wait

ionic dawn
#

Im reading about something a support member send yet

misty sigil
#

is this discord.js?

ionic dawn
#

y

twilit rapids
#

If you have like 10 servers with 2 members all owned by X user

quartz kindle
#

check the guild's creation date as well

twilit rapids
#

Easy leave

ionic dawn
#

Yeah, im taking all the guilds my bot is in

misty sigil
#

do you know the IDs of the servers?

ionic dawn
#

and now im trying to filter if the owner is the same

opal plank
#

i mean, the bot is in them

#

he should be able to fetch em

twilit rapids
#

Posting images instead of emojis when your Nitro ran out

ionic dawn
#

Just wanted to pay cause im working on something, sadly

opal plank
#

not my fault my clears throat FREE NITRO BOT cant send messages here

#

¯_(ツ)_/¯

twilit rapids
#

Do I smell ads

sand condor
#

do bids end tomorrow for the auction ?

#

wait wrong channel

twilit rapids
sand condor
#

i don't have that on this acc

opal plank
#

ey! im proud of my free nitro, its the ultimate meme

twilit rapids
#

Just have Nitro lol

opal plank
#

clearly any bot that does that is trustworthy

#

bold to assume i have money for that

#

specially with currency exchange prices rn

sand condor
#

i'll buy u nitro

#

nitro classic

#

tho

twilit rapids
sand condor
#

just don't use the big pics anymore

#

please

ionic dawn
#

Well, any1 can hook me up?

opal plank
#

fair

sand condor
#

ok brb

twilit rapids
#

@ionic dawn what exactly is it that you want to do

#

If it's in JS I'm down

ionic dawn
#

Kick my bot from the servers with the same owner, if it finds 5 or more servers with the same owner leave them

#

its djs yes

opal plank
#

for (g of cache) {
if(owner) g.leave()
}

ionic dawn
sand condor
#

no more big emojis

twilit rapids
#

Interesting

opal plank
#

indeed, ty bro

twilit rapids
#

Where are my nitro gifts when I need them

#

Anyways

opal plank
#

thats a general gist of what i mean

sand condor
#

idk why i gifted

opal plank
#

loop the guilds cache

#

and check memberCount

twilit rapids
#

@ionic dawn that isn't really that hard, just filter through <Guild>.ownerID

#

Not really enough to ask money for imo

#

But we're not gonna spoonfeed either KomaAbigailSip

midnight blaze
#

(message.guild.member(guild.owner) )? bot.guilds.cache.get('guildID').leave() : null

opal plank
#

not quite

ionic dawn
#

I don't want spoonfeed, im literally buying the spoon

twilit rapids
#

How much then TAkiritosip

opal plank
misty sigil
#

buy thy spoon

ionic dawn
#

Well, imma drink something and try it this night, i'll let you know if I need something

#

Well

slender thistle
#

aaee

ionic dawn
#

you said its "Simple"

#

how much you need for that?

twilit rapids
#

I'll be going to bed in like now so that would be tomorrow then™️

ionic dawn
twilit rapids
#

Uh

#

Like 2 minutes

opal plank
#

its prob 8 or 9 lines max

twilit rapids
#

Yeah

ionic dawn
#

really?

opal plank
#

yeah

ionic dawn
#

I was thnking about something complicated

opal plank
#

like TImo said, i wont spoonfeed, but this is the gist

ionic dawn
#

don't spoonfeed

opal plank
#

for (g of cache) {
if(owner) g.leave()
}

ionic dawn
#

with teorical info its enough, I appreciate the info

#

support also give me stuff to read about guilds

opal plank
#

idk which lib you on tho

twilit rapids
#

djs

#

A simple line like this already gives all the guild IDs X user owns

<Client>.guilds.cache.filter(guild => guild.ownerID === "the user ID you want to check");
midnight blaze
#

(message.guild.member(arrayWithOwners.includes(guild.owner.toSrging()) ? bot.guilds.cache.get('guildID').leave(): console.log("legit");

@opal plank I dont have my ide open, but what is missing if you say not quite? It kinda looks ok to me.

#

oh

#

ok

twilit rapids
#

Then just continue on that and leave if it's more than 5

#

¯_(ツ)_/¯

amber fractal
#

I mean if you're leaving the guilds, no need to filter it then loop it again

#

you can do it in one loop

opal plank
#

reduce() or a for() prob work better in this case

#

@midnight blaze that'd only run per message

#

if you have 20 servers and they all inactive(spam server) i doubt you'll get messages in them

#

bad idea to run it that way

midnight blaze
#

I am just using message, because most people are used to that event

opal plank
#

its better to loop the guilds cache

midnight blaze
#

seems like easier for them to understand

#

ok^^

opal plank
#

works? yes? good? no

#

like i said, if they are inactive spam server they might not even be sending messages there

#

so that command wont work and you'll still end up being in those 'empty' servers

twilit rapids
#

Anyways I'm off to bed so have fun with this vo1d

opal plank
#

gn Timo

ionic dawn
#

gn mate

opal plank
#

@midnight blaze also that snippet up there prob wouldnt work.
guild.member() isnt a function afaik.
if you want member, access message.member
if you want the owner, the person sending the message isnt always that, so also not goo idea

#

if you want the owner you can access it via guild.ownerID

pale vessel
#

guild.member() is a function that resolves users to a member

opal plank
#

yup i checked

#

forgot to edit the message though

strange trout
#

Anyone have an array of Japanese/Korean words? Working on a typing test website

#

Otherwise I'll probably have to scrape a language learning website

pale vessel
#

that's a lot

strange trout
#

Found the perfect site

sweet ruin
#

hello euhm

#

how do I extract the string in this?
{ url: 'https://cdn.nekos.life/feed/feed_013.gif' }

pale vessel
#

extract the string?

#

what do you mean by that?

#

object.url?

earnest phoenix
#

Nekos.life returns a json response, just parse it

#

Google "how to parse json in X language"

#

@sweet ruin

#

How do I kick a specific user using eval with eval message.member.kick ? I've tried many different ways and have only managed to get it to kick me and me only lmao

opal plank
#

cuz message.member brings the member who is the author of the message @earnest phoenix

#

you'd need to get the user you want from your users cache

#

or fetch em

worthy glacier
opal plank
#

idk what is your code @worthy glacier

earnest phoenix
#

^

worthy glacier
#

ill paste

opal plank
#

we dont read minds

earnest phoenix
#

Args-info? I have that command, and it has a loophole

opal plank
#

use ahstebin

#

hastebin*

worthy glacier
#

module.exports = {
name: 'help',
description: 'List all of my commands or info about a specific command.',
aliases: ['commands'],
usage: '[command name]',
execute(message, args) {
const data = [];
const { commands } = message.client;

    if (!args.length) {
        data.push('Here\'s a list of all my commands:');
        data.push(commands.map(command => command.name).join(', '));
        data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);

        return message.author.send(data, { split: true })
            .then(() => {
                if (message.channel.type === 'dm') return;
                message.reply('I\'ve sent you a DM with all my commands!');
            })
            .catch(error => {
                console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
                message.reply('it seems like I can\'t DM you!');
            });
    }

    const name = args[0].toLowerCase();
    const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));

    if (!command) {
        return message.reply('that\'s not a valid command!');
    }

    data.push(`**Name:** ${command.name}`);

    if (command.aliases) data.push(`**Aliases:** ${command.aliases.join(', ')}`);
    if (command.description) data.push(`**Description:** ${command.description}`);
    if (command.usage) data.push(`**Usage:** ${prefix}${command.name} ${command.usage}`);

    data.push(`**Cooldown:** ${command.cooldown || 3} second(s)`);

    message.channel.send(data, { split: true });
},

};`

earnest phoenix
#

Use hatebin if its big or proper formatting if you do @worthy glacier

zenith knoll
#

wtf

earnest phoenix
#

Dear God

#

Yeah

zenith knoll
#

use PASTEBIN

earnest phoenix
#

Use hatebin please

worthy glacier
#

oh sorry

earnest phoenix
#

Not pastebin

zenith knoll
#

why

opal plank
#

DONT use pastebin

#

pastebin shit

zenith knoll
#

why :(

earnest phoenix
opal plank
#

cuz it doesnt format

zenith knoll
#

:(

#

so

#

?

earnest phoenix
#

So anyways, how do I fetch them?

zenith knoll
#

i like it :)

opal plank
#

so use hastebin

zenith knoll
#

m.m

worthy glacier
opal plank
#

@earnest phoenix dpends, are you caching your uses?

#

you welcome

earnest phoenix
#

Users? No

zenith knoll
#

Also r u like using discordjs.guied's template?

#

bc they ex[;ain the errrprs

#

if u r

worthy glacier
#

yes i am following the discord.js guide

opal plank
#

so you disabled cache? @earnest phoenix

zenith knoll
#

ok

opal plank
zenith knoll
#

well discordjs.guide look at their github

opal plank
#

you are joining your commands by comma, that bit is fine

zenith knoll
#

resulting coe

#

and compare it

#

to urs

ionic dawn
#

shouldn't <Guild>.iconURL() give the specified guild icon?

zenith knoll
#

Um

#

yes?

#

Like the url

worthy glacier
#

yea but i dont understand why the first output has 2 commas after it

zenith knoll
#

like attachment

#

like i were to put a gif

#

it would send a link of it

#

then show image

opal plank
#

only thing i can think of is that args-info has comma in it @worthy glacier

worthy glacier
#

i checked and it doesnt

opal plank
#

check that command and see if you didnt accidently put comma in it

#

hmmm

#

im not sure actually, the code syntax seems fine

#

mind logging the commands and checking that?

ionic dawn
#

oh my... i was with the "Test Bot", and the guild i was trying to get the icon from has no icon

#

imagine being that stupid

zenith knoll
#

I mean

#

relateable

ionic dawn
zenith knoll
#

when i make a good cmd then realize i forgot to inv the bot

#

:(

#

im likce

#

WHY DOESNT BOT RESPOND

sweet ruin
opal plank
#

pff imagine being me, having 2 bots and then trying to figure out why command isnt working till i eventually notice the beta branch isnt there

sweet ruin
#
 var testt = await JSON.parse(nekooo.sfw.feed())```
worthy glacier
#

mind logging the commands and checking that?
@opal plank wym

opal plank
#

@worthy glacier do console.log(commands) in the begginging

zenith knoll
#

It still wont parse
@sweet ruin Is there an 'o' in ur file?

#

show me the json file

#

img

sweet ruin
#
 var testt = await JSON.parse(nekooo.sfw.feed())```
#

this is all it is

zenith knoll
#

No like

#

the JSON file ur parsing to

opal plank
#

dont you need to await that nekooo?

sweet ruin
#

oh. euhhh

opal plank
#

or is that promise already resolved?

sweet ruin
#

already done

#

euhhh

opal plank
#

im assuming feed() is a fetch function

#

so you'd need to await that promise to resolve first

sweet ruin
#

its like hug

opal plank
sweet ruin
#

{ url: 'https://cdn.nekos.life/feed/feed_013.gif' }

#

it is supposed to return this

#

but only the string

#

so I can use it as an image

opal plank
#

again

#

feed() is likely a promise

#

await it

sweet ruin
#

i did

#
      var testt = JSON.parse(await nekooo.sfw.feed())```
opal plank
#

you didnt

#

oh

#

there

#

do this then

#
let a = await nekooo.sfw.feed();
console.log(a)
 var testt = JSON.parse(a)```
#

breakpoints would probably be best but that'll do for now

#

tell me the logged value

sweet ruin
#
(node:38072) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at Object.execute (C:\Users\CREEPA\Desktop\DukeBot\commands\actions\feed.js:23:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:38072) 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:38072) [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.
sudden geyser
#

you're trying to parse an object

opal plank
#

isnt that already an object?

#

yeah

#

that wont do

sweet ruin
#

oh

opal plank
#

its already returned objectified

sudden geyser
#

you already have the url and stuff so you probably can use it like that

opal plank
#

no need to parse it

sweet ruin
#

okay

#

then uehh

#

how do I get just the url and not the object part of it

#

cause it wont work as an image to an embed right now

opal plank
#

howcome?

sudden geyser
#

use it like you normally would. a.url would theoretically return the url

opal plank
#

its either proxy fucked or you diong something wrong

worthy glacier
sweet ruin
#

I didnt know .url was a thing

#

wow

opal plank
#

you dont know how object works then

#

@worthy glacier hmmm akkothink2

#

yeah that bit is fine

#

i cant think of why it'd be doing those 2 commands tbh

#

actualy

#

yes i do

#

look at your second value

#

its undefined

worthy glacier
#

ohh

opal plank
#

trace where thats coming from

worthy glacier
#

why is it throwing that

opal plank
#

its joining undefined too

worthy glacier
#

yea

opal plank
#

well, now you gotta trace where that undefined is coming from

#

likely where you have your commands mapped

worthy glacier
#

theyre mapping over the commands collection

opal plank
#

well yeah that bit i know

#

but you need to see which command is turning into undefined

#

im willing to bet you probably including some file other than .js or some .js in the commands folder that isnt a module.export

#

likely that it doesnt have a name property in it

#

@worthy glacier

#

the fact that its undefined, {} (empty), leads me to believe it isnt even a module.export and something else entirely. if only name was missing it'd still put the whole export in the value field

worthy glacier
#

oh wait i got it

#

i guess because i made a empty .js file at some point without any code in it

#

so that was wat was undefined

#

tysm @opal plank

opal plank
#

no problem

#

self high-five for guessing it right

ionic dawn
#

god bless

weary seal
#

how do you guys track how many servers your bot is in

earnest phoenix
#

in which library

weary seal
weary seal
#

cheers

earnest phoenix
#

if (command === 'test') {
client.commands.get('test').execute(message, args);
}
if (command === 'check') {
client.commands.get('check').execute(message, args);
}

This command handler works for the command test, but it does not work for check. test and check both are files, but test only works. It says that execute is not defined for the second one, but for the first the execute is a valid function. My terminal says this : TypeError: Cannot read property 'execute' of undefined

#

what's the point of having a command handler lookup if all you're doing is if checks in the end

#

anyways

#

get(...) returned undefined

#

It does not work

#

that seems like a you problem

#

COMe on

#

I am just trying to get some code

#

pay for it

vague kite
#

So if I get the webhook like the following example, how would I check the ID of the guild in which the webhook is.

const webhook = new Discord.WebhookClient(ID, Token);
earnest phoenix
#

const ID

#

you cannot

#

webhooks are not aware of their guild

summer torrent
#

you can get channelID iirc

#

no wait

earnest phoenix
#

@earnest phoenix i can't help you more other than tell you that get(...) returned undefined, like the error says so, make sure you added the commands properly to your collection and get rid of that ugly if

summer torrent
#

you can get guild id too

earnest phoenix
#

can you?

summer torrent
earnest phoenix
#

yes but is that from a webhook client

summer torrent
#

no, you have to fetch that

#

idk about webhook client

earnest phoenix
#

guildID is a nullable field meaning it's only available to other entities (bots/users)

#

if you fetch the info about the webhook from the webhook itself it will not return the guild id

#

nevermind

#

it's returned

#

don't know why it's nullable??

summer torrent
#

🤔

earnest phoenix
#

Thanks

vague kite
#

I get this when I try to get the webhook

earnest phoenix
#

you did not fetch the info

#

how tf do you fetch the info in djs

#

lol

summer torrent
vague kite
#

you did not fetch the info
Ohh yeah that would make sense

earnest phoenix
#

so you disabled cache? @Floof
@opal plank
I don't even know how that works, or what it is. So I'm assuming no.

opal plank
#

other way around

#

cache is enabled by fault

#

so you likely has it

earnest phoenix
#

Ok

#

So can we proceed?

ionic dawn
#

Shouldn't this return the username? or the user have to be in the guild?
<Client>.users.fetch('THE USER ID').username

pale vessel
#

resolve the promise first

#

use await

#

await (<Client>.users.fetch('THE USER ID')).username

earnest phoenix
#

How do I kick a specific user using eval with eval message.member.kick ? I've tried many different ways and have only managed to get it to kick me and me only lmao

you'd need to get the user you want from your users cache
or fetch em

So anyways, how do I fetch them?

pale vessel
#

use guilds#members#cache

#

you can either fetch or use the cache

earnest phoenix
#

Uh

pale vessel
#

assuming the member is in cache, you can do guild.members.cache.get("id").kick()

#

if you don't have the id, use find(), cache.find(x => x.user.username == "something") e.g.

earnest phoenix
#

So I replace id with their userid?

pale vessel
#

yeah

earnest phoenix
#

Thank

viral igloo
#

How do I make a bot

earnest phoenix
#

You need to use a programming language in order to do so @viral igloo

#

@pale vessel

ReferenceError: guild is not defined
at eval (eval at execute (/root/bot/commands/eval.js:11:37), <anonymous>👍1)
at Object.execute (/root/bot/commands/eval.js:11:37)
at Client.client.on (/root/bot/index.js:28:38)
at Client.emit (events.js:198:13)
at MessageCreateAction.handle (/root/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
at WebSocket.onMessage (/root/bot/node_modules/ws/lib/event-target.js:120:16)

pale vessel
earnest phoenix
#

Different languages are used for different things, but most common ones can be made to create a Discord bot, I'd suggest researching the differences in each language, in case you decide to use them to make a website for the bot in the future, or other projects @viral igloo

#

Yea I know

pale vessel
#

define guild if it's not defined smart

earnest phoenix
#

Lol how

pale vessel
#

where is that error from?

#

looks like an eval

earnest phoenix
#

What I evaluated

viral igloo
#

a what

earnest phoenix
#

Yes

#

\eval guild.members.cache.get("606986514509070423").kick()

pale vessel
#

what guild?

viral igloo
#

Uhh i will check it out

pale vessel
#

if you want to get the current guild, use <message>.guild

viral igloo
#

Where do I go to create

pale vessel
#

guild by itself isn't useful

earnest phoenix
#

O

glossy elk
#

so i have a problem with ejs

viral igloo
#

Where do I go to create one

pale vessel
#

so yeah, pseudo code

glossy elk
#

so Im looping through the user's guilds and im checking if they have permission for the guild or not

#
 const permsOnGuild = new perms(guild.permissions);
    if(!permsOnGuild.has("MANAGE_GUILD")) return;```
#

but perms isnt a constructor

#

I believe it was in v11

#

with ejs

pale vessel
#

what's perms

faint prism
earnest phoenix
#

@pale vessel ReferenceError: members is not defined
at eval (eval at execute (/root/bot/commands/eval.js:11:37), <anonymous>👍1)
at Object.execute (/root/bot/commands/eval.js:11:37)
at Client.client.on (/root/bot/index.js:28:38)
at Client.emit (events.js:198:13)
at MessageCreateAction.handle (/root/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
at WebSocket.onMessage (/root/bot/node_modules/ws/lib/event-target.js:120:16)

#

\eval members.cache.get("606986514509070423").kick()

pale vessel
#

geez

#

what

sand condor
#

<Guild>.members

pale vessel
#

you need guild

earnest phoenix
#

Shit, my ass be overlooking shit

glossy elk
#

@pale vessel wdym whats perms

#

im trying to loop for every guild to see if the user has manage guild or not

pale vessel
#

what did you define it as?

glossy elk
#

let me check

ionic dawn
#

@pale vessel CBCattoCry

async function gUser(){
let uName = await client.users.fetch('USERID').username
return uName
}
glossy elk
#

oh shit

#

im so stupid

#

i didnt define it

pale vessel
#

@ionic dawn (await client.users.fetch()).username

glossy elk
#

but how can i check

#

if user

#

has perms in server or not

#

by looping through all the guilds

pale vessel
#

your code should work though

glossy elk
#

wasnt there like a property for

#

to get a member

#

with a use

#

r

#

method*

ionic dawn
#

also tried but still returning undefined/[object Promise]

pale vessel
#

guild.permissions is a bitfield right?

glossy elk
#

let me check

sand condor
#

<Guild>.member()

pale vessel
#

@ionic dawn what's your code

glossy elk
#

yeah its a bitfield

ionic dawn
#

i read about it on stackoverflow and im doing the right thing but is not showin anythin

#

literally the code i send

pale vessel
#

so js const {Permissions} = require("discord.js"); const perms = new Permissions (bitfield); perms.has(); should work

glossy elk
#

kk

sand condor
#

include the await inside the parenthesis

#

instead of outside

glossy elk
#

but

#

how would i uh

#

get the member of a user

sand condor
#

<Guild>.member()

pale vessel
#

use the user id

#

are you making a dashboard?

glossy elk
#

yeah

#

using ejs

pale vessel
#

then you can fetch api/guilds/guildID/members/userID

#

i think that's the endpoint

glossy elk
#

kk

pale vessel
#

OR you can use your client

#

client.guilds.cache.get().members.cache.get()

glossy elk
#

um

#

why are u catching members

#

from client

#

wouldnt you want to catch it from the guild

pale vessel
#

ye

ionic dawn
#

okay and now by some reason is printin on console but returns [object Promise] at embed, do I have to send the embed inside the async?

sand condor
#

or you can just do client.guilds.cache.get().member()

#

using the user object but it's whatever

#

@ionic dawn can u send ur whole code

pale vessel
#

it's the same thing

glossy elk
#

weird

opal plank
#

do you not have that guild cached?

sand condor
#

is this code in an event ?

glossy elk
#

its ejs

sand condor
#

oh

opal plank
#

i was assuming its d.js

glossy elk
#

ic

opal plank
#

ejs not my area, though they are similar

glossy elk
#

yeah thats why i thought it would work

sand condor
#

yea i thought it was discord.js too sorry

pale vessel
#

i mean it is

glossy elk
#

it is

#

discord.js

opal plank
#

ejs or d.js?

glossy elk
#

ejs is-

#

omg

pale vessel
#

ejs for dashboard

opal plank
#

ERIS .js or DISCORD.js?

pale vessel
#

d.js for client

sand condor
#

eris ?

glossy elk
#

ejs

#

no

pale vessel
#

ejs, embedded JavaScript

glossy elk
#

not eris

#

tf

sand condor
#

ohhhhhhh

glossy elk
#

ejs is a language

opal plank
#

yeah ejs is not a discord lib

glossy elk
#

discord.js is a lib

#

soo

opal plank
#

i though you meant ejs as ERIS

pale vessel
#

lmao

sand condor
#

^

glossy elk
#

oh

#

LOL

opal plank
#

eris is another js library for discord

#

if its d.js

#

im assume its undefined

#

cache.get(undefined)...

earnest phoenix
#

funny how neither give you complete REST interaction, eris is more open with REST though

pale vessel
opal plank
#

idk how you running that code r how you defining guild.id

glossy elk
#

im catching

#

the user's

#

guilds

opal plank
glossy elk
#

k

earnest phoenix
#

yeah flazepe, but that's a thing that both libraries allow

#

some endpoints are just straight up not exposed

opal plank
glossy elk
#

so it gives me a list

pale vessel
#

just fetch with bot token

opal plank
#

thats why

pale vessel
#

not a problem

glossy elk
#

no its defined

opal plank
#

you cant use a list on a get()

glossy elk
opal plank
#

it uses a string

earnest phoenix
#

and i'm pretty sure you have to be logged in to the gateway in both eris and djs to use REST which is dumb lol

glossy elk
#

its not a list

#

like

#

its logging

opal plank
#

Reee

glossy elk
#

each guild id

#

my god

pale vessel
#

cry you don't

glossy elk
#

my english

earnest phoenix
#

oh?

opal plank
#

its logging per then?

glossy elk
#

user.guilds.forEach(guild => {
console.log(guild.id)

opal plank
#

template the guild.id then, it should be a string, but just in case

#

actually nah

pale vessel
#

fetch(endpoint, { headers: { Authorization: "Bot TOKEN" } }); should do

opal plank
#

dont even bother, its definetly string

glossy elk
#

it is

earnest phoenix
#

fetch(endpoint, { headers: { Authorization: "Bot TOKEN" } }); should do
@pale vessel keep in mind this is not ratelimit safe

pale vessel
#

yeah

#

isn't there RequestHandler?

opal plank
#

user.guilds.forEach(guild => {
let a = client.guilds.cache.get(guild.id)
console.log(a)

#

try that

glossy elk
#

bot.guilds.cache.get

earnest phoenix
#

not sure i'm not fluent in either of the libraries, what i know is just straight up from the docs

glossy elk
#

but ok

opal plank
#

well yeah

#

its your client instance

glossy elk
#

k it prints

#

every guild

opal plank
#

a prints every guild?

glossy elk
#

every guild

#

the user is in

opal plank
#

post screenshot

#

im just wondering how its returning undefined

glossy elk
#

wait

#

then it goes to that

#

so ill have to check if the guild is true

opal plank
#

show the full log on the right side

glossy elk
#

??

opal plank
#

this, so i see which line is producing those undefineds

glossy elk
#

that worked

opal plank
#

wait what?

#

i have no idea what you on about rn, trying to fix one thing at a time

glossy elk
#

basically

#

most of it returned undefined

#

because the bot was not in the guild

opal plank
#

you wont have access to the user guilds you are not in, so you SHOULD have the guild

#

OH

#

you fetching it with auth arent you?

#

you mentioned ejs

glossy elk
#

;-;

pale vessel
#

but he can still use client

glossy elk
#

my god

#

ok look

opal plank
#

you likely getting those guilds from an auth, thats why some guilds arent cached

glossy elk
#

if the bot isnt in the guild

#

i wouldnt know

pale vessel
#

that's what he's doing

#

it's from the client

opal plank
#

WHERE is your user guilds coming from?

pale vessel
#

client

#

you pass client to ejs

glossy elk
#

no

pale vessel
#

oh

glossy elk
#

not from the

#

client

opal plank
#

if you getting the user guilds frmo client, it should only return shared guilds, which you HAVE cache

glossy elk
#

from oauth

pale vessel
#

what

opal plank
#

they must be getting from auth like i said flaz

pale vessel
#

how did you resolve those to a guild-

opal plank
#

thats only way you can access non-shared guilds

#

then yes, since its not coming from cache, check with if(a) like you doing @glossy elk

#

since it might return a guild that you arent in

#

from auth you get the user guild ids flaz

#

depending on your scope

pale vessel
#

OH

opal plank
#

the user.guilds isnt coming from client/message, its returning from oauth

glossy elk
#

ok look

#

lets pretend

opal plank
#

if it was from client,yeah, you must have the guild cached

glossy elk
#

we were on the same page

#

ok

opal plank
#

which we are

glossy elk
#

its supposed to return

#
        if(!a.member(user.id).permissions.has('MANAGE_GUILD')) return;
#

but its still showing the guilds

pale vessel
#

yeah but he used the client to get the guilds, which the user could potentially not be in it, right? am i understanding this correctly

opal plank
#

did you check userid aswell @glossy elk ?

glossy elk
#

ok wait

opal plank
glossy elk
#

so i made it check if they do have manage_guild

#

and if they do it will return

#

which worked

#

but if i check if they dont

pale vessel
#

bruh

glossy elk
#

it doesnt return

#

and it still shows all the guilds

opal plank
#

well you still logging the guilds

#

its definetly not that snippet up there thats producing the console logs

#

also

#

i mean, it should

glossy elk
#

bruh

#

it works

opal plank
#

then whats the issue?

glossy elk
#

ok look

pale vessel
#

uwot

glossy elk
#

if they do have manage_guild

#

it supposed to show their guilds

#

if THEY DONT

#

it returns

#

so that didnt work

#

so i tried to check if THEY DO HAVE MANAGE_GUILD

#

and if they did

#

it returns and it doesnt show the guilds that they can manage

opal plank
#

you need to loop the guilds first

glossy elk
#

I DID

#

foreach

earnest phoenix
#

is this oauth

glossy elk
#

so that worked

pale vessel
#

it is

glossy elk
#
so i tried to check if THEY DO HAVE MANAGE_GUILD
and if they did
it returns and it doesnt show the guilds that they can manage```
#

that worked

earnest phoenix
#

why are you going through so much effort

pale vessel
#

then why not just use rest

glossy elk
#

it doesnt show the guilds they can manage

opal plank
#

filter

glossy elk
#

omg

opal plank
#

you got the guilds they CANT manage

earnest phoenix
opal plank
#

just return the guilds they can

earnest phoenix
#

see that link

glossy elk
#
user.guilds.forEach(guild => {
    let a = bot.guilds.cache.get(guild.id)
    if(a) {
        if(a.member(user.id).permissions.has('MANAGE_GUILD')) return;
    }
#

this worked

#

THIS WORKED

#

this made it so that they cant see the guilds that they can manage

karmic compass
#

working on something, trying to figure out how to do a config.json file with "guildWelcome":"enabled" as a thing, but it says it is undefined. can anyone help?

glossy elk
#
user.guilds.forEach(guild => {
    let a = bot.guilds.cache.get(guild.id)
    if(a) {
        if(!a.member(user.id).permissions.has('MANAGE_GUILD')) return;
    }
#

this didnt work

earnest phoenix
#

that's a dumb solution

glossy elk
#

all i did was add a !

earnest phoenix
#

you're wasting processing power and the member needs to be cached/you need to fetch the member for it to succeed

#

see the url i sent

opal plank
#

why you not checking instead?

glossy elk
#

I DID CATCH

#

the member

earnest phoenix
#

an endpoint to get partial user guilds exists and it returns their permissions in the guild

opal plank
#
user.guilds.forEach(guild => {
    let a = bot.guilds.cache.get(guild.id)
    if(a) {
        if(a.member(user.id).permissions.has('MANAGE_GUILD')) return a;
    }
earnest phoenix
#

an endpoint to get partial user guilds exists and it returns their permissions in the guild
@earnest phoenix

#

stop ignoring me

#

what you're doing right now is really bad lol

glossy elk
#

if i return

#

it will hide the guilds

opal plank
#

try what cry is saying

glossy elk
#

that they can manage

opal plank
#

thats not how return works

glossy elk
#

but it did

opal plank
#

return (something)

#

return (nothing);

earnest phoenix
#

how many times do i have to tell you to abandon the approach you're trying to do

opal plank
#

return (guild)

#

listen to cry

glossy elk
#

okay go on

earnest phoenix
#

partial guilds contain the user permissions in the guild

#

using bitwise operations (on the permissions field) you can check if the user has the permission

opal plank
#

make sure you dont be like me

#

and do a manual bitwise function

#

cuz i 100% did that bonkcat

earnest phoenix
#

take note of this Requires the guilds OAuth2 scope.

dire obsidian
#

guys i try to commit my files to github but this happen, anyone knows how fix it?

karmic compass
#

it seems to be with the :

earnest phoenix
#

why tf are you using strings

#

just use booleans which already represent on/off state

faint prism
#

what are booleans
||ik what they are||

dire obsidian
#

a bolean

opal plank
#

true/false

karmic compass
#

true/false

dire obsidian
#

aka true and false

opal plank
#

if you didnt know

dire obsidian
karmic compass
#

i don't know what is wrong with a semicolon

earnest phoenix
#

you didn't pull changes @dire obsidian

dire obsidian
#

let me

earnest phoenix
#

@karmic compass show code

#

stash your current changes

#

so you don't lose them when pulling

faint prism
#

or fetch and do a merge

karmic compass
#

this gonna look weird out of context

dire obsidian
#

guildwellcome: true,

faint prism
#

welcome*

earnest phoenix
#

@dire obsidian cough cough

karmic compass
#
const misterConfig = require('misterSettings.json')

register("chat", function(guildMember) {    
    if(misterConfig.guildWelcomeOn == true) {
        const guildMembers = guildMember.replace(/&./g, '')
        const guildMsgs = [
            `Welcome back ${guildMembers}!`,
            `Oh hey ${guildMembers}, how are you?`,
            `Doin good ${guildMembers}?`
        ]
        const theActMsg = guildMsgs[Math.floor(Math.random()*guildMsgs.length)]
        ChatLib.command(`gc ${theActMsg}`)
    } else {
        return
    }
})
``` for the main file
earnest phoenix
#

while we're at it, avoid using json as a database altogether

opal plank
#

omg

faint prism
#

^ this

opal plank
#

NO

#

NO

solemn latch
#

MisterConfig

opal plank
#

STOP

earnest phoenix
#

@opal plank what

opal plank
#

if(somethin == true)

karmic compass
#

and in the json file i have ```json
{
"guildWelcomeOn":true
}

opal plank
#

NO

solemn latch
#

Nice variable name

karmic compass
#

OH

#

GOD

#

CAUGHT THAT

opal plank
#

if(thing) //do stuff

faint prism
#

lel

opal plank
#

not if(this == true) //do stuff

karmic compass
#

FIXED

opal plank
#

yw

earnest phoenix
#

LOL

opal plank
earnest phoenix
#

LOL

#

LOL

pale vessel
#

but why

opal plank
#

he was matching against a string before

karmic compass
#

yeah

#

forgot to change that

opal plank
#

still bothers the fuck out of me to do that

karmic compass
#

lmaooooooo

faint prism
#

you don't have to check if a boolean variable is true or false, it IS either true or false

karmic compass
#

ye

opal plank
earnest phoenix
#

when it gets interpreted it literally gets interpreted as if(bool === true) anyways KEKW

karmic compass
#

and !variable == false

opal plank
#

bad

faint prism
#

if (someTrueBool) is the same as if(soemTrueBool == true), just slower since there is an extra comparison

karmic compass
#

okay sdo i still have the error

earnest phoenix
#

it isn't slower

#

like i said

#

it gets interpreted as == true

opal plank
#

post the new error

karmic compass
#

its the same as before

faint prism
#

there is an unnecessary conditional comparison

karmic compass
#

"guildWelcomeOn":true
/
|

earnest phoenix
#

if(bool) gets interpreted as if(bool == state) regardless of what approach you use

opal plank
#

just return if its not on

karmic compass
#

ye

#

did that

faint prism
#

hm

opal plank
#

if (!condition) return;

karmic compass
#

mhm

#

theres something wrong with the json file tho

#

nothing is wrong in the main

opal plank
#

are you sure misterConfig has that property in it?

#

and how you attaching it?

#

actually

#

just log it

pale vessel
#

how about you don't use json as a database

opal plank
#

and show full error

#

^^ that too

karmic compass
#
{
    "guildWelcomeOn":true
}
pale vessel
#

easy solution, i know

dire obsidian
karmic compass
#

nah

#

its not a database

opal plank
#

that looks like config not dataase

karmic compass
#

making a mc mod type thing

#

ye

#

its a config file

#

eventually im going to upgrade to a different one but for not

pale vessel
#

o

karmic compass
#

i want to test out using json

opal plank
#

log that before that command

karmic compass
#

log what?

opal plank
#

console.log(misterconfig)

karmic compass
#

kk

opal plank
#

see what the property guildWelcomeOn is

glossy elk
#
  const permsOnGuild = new perms(guild.permissions);
    if(!permsOnGuild.has("MANAGE_GUILD")) return;
#

perms is not a constructor

opal plank
#

indeed

pale vessel
#

what did you define perms as

opal plank
#

its likely a function

glossy elk
#

its not a function

opal plank
#

constructors usually starts with UpperCase

pale vessel
#

you can define those

glossy elk
pale vessel
#

just what is perms

glossy elk
#

i dont know

#

let m

pale vessel
#

what the fuck

glossy elk
#

check

opal plank
karmic compass
#

ok so

earnest phoenix
#

Discrd.Permission

#

you also

pale vessel
#

that's that i suspected

earnest phoenix
#

are making your code slower

pale vessel
#

but i'm not so sure

karmic compass
#

i tried to log it

earnest phoenix
#

you don't need to do that

karmic compass
#

but i found the error

#

no not really*

pale vessel
#

just use 1 << 5 or something

earnest phoenix
#

just use bitwise operations on the int itself

#

yes

glossy elk
#
    const perms = Discord.EvaluatedPermissions;
karmic compass
#

im using some module

#

wait

#

wait

pale vessel
#

1 << 5 is manage guild iirc

earnest phoenix
#

uh

#

no

#

that's shifting

opal plank
#

those are the permission bitfields

glossy elk
#

k fixed it

#

it was Discord.Permissions

pale vessel
#

can't you just perms & 1 << 5?

karmic compass
glossy elk
#

i fixed it

#

now

karmic compass
#

no error there

earnest phoenix
#

wait i need to see the one for manage guild

opal plank
#

0x00000020

earnest phoenix
#

that ^

karmic compass
#

so i logged it above i cant find anything wrong

opal plank
#

all perms listed here fyi

dire obsidian
#

what i should do?

earnest phoenix
#

git merge

faint prism
#

gotta pull and merge before pushing

earnest phoenix
#

git fetch
git merge

#

git push

faint prism
#

^

pale vessel
#

0x00000020 is 1 << 5

earnest phoenix
#

yeah i got confused on which field the manage guild perm was

dire obsidian
#

emm

#

nothingg happen

karmic compass
#

hey uh

pale vessel
karmic compass
#

anyone there?

#

did it on seperate file (one wouldn't let me run properly)
@karmic compass

opal plank
#

if you dont show code we can a=only assume

solemn latch
#

I'm not there

opal plank
#

how you importing it?

karmic compass
#

the settings?

opal plank
#

how you reading the file

#

either post the code or the snippet for us to see

#

also the error

#

saying its error'ing doesnt hlep us at all

karmic compass
#

const misterConfig = require('./misterSettings.json')

also the error is the exact same, with the colon.

opal plank
#

post it here pls

earnest phoenix
#

what do you mean you cant?? just use your electric boogaloo magic to see whats on my screen!

karmic compass
#
js: "file:/C:/Users/email/AppData/Roaming/.minecraft/config/ChatTriggers/modules/mistermod/misterSettings.json", line 2: syntax error
js:     "guildWelcomeOn":true
js: ....................^
#

line two is the setting

opal plank
#

WHOLE error pls

karmic compass
#

oh its displayed there

opal plank
#

dont cut it

karmic compass
#

that is

earnest phoenix
#

you more than likely have an extra invis char there

karmic compass
#

all of the error

#

i'm using a module btw

#

not a console

pale vessel
#

just use & @glossy elk

opal plank
#

hmm

karmic compass
solemn latch
#

A module that makes logs worse?

opal plank
solemn latch
#

Where can I get it

karmic compass
#

its a minecraft mod

earnest phoenix
#

i think they're scripting for a mod

karmic compass
#

ik so bad

earnest phoenix
#

lol

solemn latch
#

Ah

karmic compass
#

yep

#

using a module feature in CT

#

i'd ask them for help but

opal plank
#

using javascript with java loader

karmic compass
#

its with the JSON not the one that actually does things

opal plank
#

bold

timber plume
#

can yall help me

pale vessel
#

i wonder

timber plume
#

html