#development

1 messages · Page 647 of 1

grave pilot
#

Like that?

quartz kindle
#

if you do it that way, you cant use t.id because t is already the id

#

you have an array, and .some goes through each item in the array and tests it

#

t in this case is the item being tested

grave pilot
#

.roles should be a array

quartz kindle
#

if roles is an array, yes, but roles is a d.js collection, not an array

grave pilot
#

Then ill make it a array

#

roles is a RoleStore

#

On master

quartz kindle
#

you can use .has there

grave pilot
#

.has would not work

#

I tought so originaly too

broken elm
#

uhh

#

ok

quartz kindle
#

it would

broken elm
#

so i've been tryig to make cooldowns

quartz kindle
#

.has is a method for .map

broken elm
#

since yesterday

quartz kindle
#

collections are built upon .map

grave pilot
#
    if (!message.member.roles.has(["594588784671064065", "594588905190326297", "594588967144390656"])) return message.reply("You need to have a premium subscription to use this command!");
broken elm
#

i got an answer, it worked a bit

grave pilot
#

That is my original code

#

Where .has should have been working

quartz kindle
#

because has doesnt accept arrays

#

has can only test one value

grave pilot
#

Waaaait

#
    if (!message.member.roles.some(t => ["594588784671064065", "594588905190326297", "594588967144390656"].includes(t))) return message.reply("You need to have a premium subscription to use this command!");
#

Would that work?

quartz kindle
#

in that case, you need t.id

#

because t is the role being tested

grave pilot
#

Ah ok

#

Ima test that then

#
    if (!message.member.roles.some(t => ["594588784671064065", "594588905190326297", "594588967144390656"].includes(t.id))) return message.reply("You need to have a premium subscription to use this command!");
#

That should work then

quartz kindle
#

yup

grave pilot
#

And this ```js
if (message.member.roles.has("594588905190326297")) cats = 3

quartz kindle
#

yes, that should work as well

grave pilot
#

I tought .has worked with arrays before

split hazel
#

It does

broken elm
#

but when i compare the times im using discord js commando

#

throtlting doesnt seem to be working... at all

#

i made a daily credits command for context on my question... im also using mysql

opaque eagle
broken elm
#

it

#

s

#

not working

#

i've tried that

#
module.exports = class Daily extends Command {
    constructor(client) {
        super(client, {
            name: "daily",
            aliases: ['dailies'],
            group: 'hero',
            memberName: 'daily',
            description: 'Gets your daily credits!',
            throttling: {
                usages: 1,
                duration: 50
            }
        });
    }
#

i can spam it

opaque eagle
#

Lmao whoever tried to advertise here... that was cute

broken elm
#

wat

#

anyways...

onyx summit
#

if the commando library is not working why are you here

#

go to the devs who made it (aka d.js support)

broken elm
#

...

split hazel
opaque eagle
#

that's a good thing

cerulean seal
#

@split hazel any reason the go library for the api is not found on github anymore?

opaque eagle
#

also non-dev conversations in #general @earnest phoenix

cerulean seal
#

so they just changed the name?

opaque eagle
#

idk

cerulean seal
#

the official link on their api page doesnt work anymore

opaque eagle
#

ik

cerulean seal
#

well thanks anyway

opaque eagle
#

np

mental stirrup
#

how can I do a bot?

covert turtleBOT
onyx summit
#

how 2 bot

cerulean seal
#

xd

broken elm
#

already in djs

#

their commando support is next to nothing

tight zealot
#

How do I start a bot on discord.js

broken elm
#
#

@tight zealot

tight zealot
#

Okay

earnest phoenix
#

@mental stirrup learn a language

opaque eagle
#

Honestly I don't mess around with commando at all... that thing sucks

broken elm
#
                if(rows[0].lastDaily + (24 * 60 * 60 * 1000) > Date.now()) return msg.channel.send("Your dailies are not ready yet!");
#

where last daily is a Date.now() taken when they last had credits added from daily

#

will that work?

west spoke
#

what lib

broken elm
#

wdym

mossy vine
#

pretty sure lib doesnt matter here

broken elm
#

well lastDaily is stored in ms inside of a table

#

on mysql

mental stirrup
#

@earnest phoenix what?

earnest phoenix
#

@broken elm try with a lower time

broken elm
#

i have

#

5000

#

which is five seconds

tight zealot
#

How do I add commands

#

I turned it on already

broken elm
#
#

read le docs

tight zealot
#

Oh okay

sand crown
#

Does anybody want to to do a new project together? I'd love to work with somebody else.

somber verge
#

no

tight zealot
#

Me

sand crown
#

nasty

tight zealot
#

Could we do it

sand crown
#

Depends on your experience. You would have to bring something to the table as well.

broken elm
#

asking if anyone wants to work with you willingly, then saying there are requirements

sand crown
#

"Looking for a full stack developer that can understand algorithms that consist of source based decoded symbols, pm for more info"

#

There is a difference between working and giving somebody else a project.

#

"Work" has a meaning to it, you know 😉

wicked pivot
#
const discord = require('discord.js')

module.exports = async (bot, message, args) => {
  let logs = message.guild.channels.find(channel => channel.name === "logs");
  if (message.guild.me.hasPermission('MANAGE_CHANNELS') && !logs) {
    await message.guild.createChannel('logs', 'text');
  }
  if (!logs) { 
    return console.log('The logs channel does not exist and cannot be created');
  }
  let messagedelete = args.join(" ")
  let user = message.author
  let embed = new discord.RichEmbed()
  .setTitle('Message supprimer')
  .addField(`Message écrit dans : ${message.channel.name}, écrit par ${user.username}`, `Message supprimer ${messagedelete}`)

  logs.send(embed)

}``` how to retrieve the delete message?
slender thistle
#

I don't really think this is a good idea thonkku

mossy vine
#

you use the messageDelete event

wicked pivot
#

yes

broken elm
#

KrybskyttenToday at 4:10 PM
Does anybody want to to do a new project together? I'd love to work with somebody else.
#

thats asking for very vague requirements

#

ahh

#

idrc anymore

#

do what you want

earnest phoenix
#

go into offtopic

#

off-topic

broken elm
uncut stirrup
#

wut do u mean no such option.

amber fractal
#

bruh

#

lowercase r

uncut stirrup
#

XD

#

Thanks tho ❤

amber fractal
#

@slender thistle you made the pylib right?

slender thistle
#

Yell at Tonkku

amber fractal
#

Oh

#

rip

slender thistle
#

I only have access to the GitHub repo

uncut stirrup
#

@bitter sundial i was told to yell at you by a moderator i must do it.

bitter sundial
#

y u yellin at me

uncut stirrup
#

The docs 😢 it doesn't have a lowercase R

#

pip install -R requirements.txt should be pip install -r requirements.txt

opaque eagle
#
/Users/sinistrecyborg/Projects/Bot/routine.js:31
    yield sheet.add({
    ^

SyntaxError: Unexpected strict mode reserved word``````js
export default async function(client) {
    "use strict";
    yield sheet.add({ timestamp: require("moment")().format("M/D/YYYY HH:mm:ss"), count: client.guilds.size });
}```
mossy vine
#

dont you need to write "use strict" at the top of your file for it to work properly? or is that just for readability?

opaque eagle
#

I'm pretty sure it can either be at the top of a function or the file... I have it at both spots

sudden geyser
#

If you put it in a function, strict mode will only apply to the scope. The top of the file is everything

opaque eagle
#

Yeah, then why do I get that error though

sudden geyser
#

@opaque eagle you're using a normal function, not a generator function. Add * after the function keyword

opaque eagle
#

Oh yeah my bad

lofty bane
#

hi guys

#

i need help coz i cant understand this

split hazel
#

Ok

lofty bane
#

ok please wait i will upload the screan shot

#

Screen shot

#

forgive me for the bad english

#
client.on("message",async message => {
    if(message.content === 'submit'){
    var channel = message.guild.channels.find("name","submit")
        let que = '';
          let fillter = m => m.author.id === message.author.id
          await message.channel.send("**what is your name ?**").then(e => {
               message.channel.awaitMessages(fillter, { time: 60000, max: 1                                    
    })
         .then(co => {
           que = co.first().content;
            co.first().delete();
         


let queee = '';
           
    e.edit("**Your Car ?**").then(e => {
      message.channel.awaitMessages(fillter, { time: 60000, max: 1 })
   
         .then(co => {
           queee = co.first().content;
            co.first().delete();



    let quee = '';
           
    e.edit("**How old are you ?**").then(e => {
      message.channel.awaitMessages(fillter, { time: 60000, max: 1 })
   
         .then(co => {
           quee = co.first().content;
            co.first().delete();
    e.edit("**Sent**").then(e => {
      channel.send(`**__New Submit - New__
 
  Name: ${que}
  Age: ${quee}
  Car: ${queee}
 
  Submited By ${message.author}
  ||@everyone | @here||**`)
      })
    })
      })
    })
      })        
    }
    });
split hazel
#

And what's the problem?

lofty bane
#

but i dont know what is wrong

#

i get processs exited with status 1

split hazel
#

Could i see the whole error? You seem to only be showing a part of it

lofty bane
#

how

split hazel
#

Heroku doesn't seem to have suffisticated logs mmulu

lofty bane
#

see

#

this

earnest phoenix
#

read your error please

#

you don't have to mindlessly directly copypaste it here without reading it

split hazel
#

That's more useful

#

You're missing an ) somewhere

lofty bane
#

yea

#

iam trying to find it

#

XD

split hazel
#

I can't really plop the code into vsc since im not on my oc

#

I recommend you download something like VSC and put your code there

#

It will pinpoint where the problem is coming

lofty bane
#

yea

split hazel
#

That's how i usually find my missing things

lofty bane
#

yea thx i will download it now

split hazel
#

Vsc is only like 40mb so it isnt that big

lofty bane
#

yea

#

48 MB

#

very good

#

it will take 8 mins only 😄

#

thx

#

oh i found it

split hazel
#

Im usually very bad at finding missings } or )s blindly

tulip wave
#

Oh god if it's a small block of code it's easy to find the error but a big one not so much

#

But according to the heroku log it's on line 76

#

72*

inner jewel
#

the line number for that kind of error is pretty useless

#

the missing )'s proper place could be anywhere before

fallow steppe
#

How can I make the bot send an embedded message in js?

sudden geyser
#

If you're using Discord.js, there's an example on MessageEmbeds on the website

earnest phoenix
#

!help

slim heart
#

@earnest phoenix #commands and don’t use common prefix commands

earnest phoenix
#

yeah i just realized. sorry

slim heart
#

@fallow steppe similar to what farmer said but depending on the version, if you’re using stable use the RichEmbed class and if you’re using master use the MessageEmbed class you can find em on the docs

robust acorn
#

bots cannot text here

nocturne hazel
#

How can you put an outline around text in canvas?

#

node-canvas to be more specific

earnest phoenix
#

If a repeat command that repeats a user's input up to 5 times is said to abuse Discord api, would having the bot wait a second or two in between each repeat solve that issue?

#

(Wasnt sure if that should be posted her eor in #topgg-api but oh well)

shy rose
#

normally some form of rate limit on commands is a good idea

#

cause things like self bot server exist where there sole purpose is to spam the 🦆 out of your bot hence exhausting your rate limits

earnest phoenix
#

The command repeats an input 5 times, then has a 30 second cooldown to prevent spam

#

I thought that might be enough but my bot was just declined because of it

shy rose
#

5 times per 30second period is another method to it yeah

#

odd 0_o

#

what was the cmd?

#

oh hang on

earnest phoenix
#

Jrepeat <times> <input>

shy rose
#

i think they are meaning they sent 1 command and your bot replied 5 times

earnest phoenix
#

Yeah

shy rose
#

it should always/normally be 1 message per command

#

some cases youl need more but unless its a but shouldnt have commands solely to spam

earnest phoenix
#

I guess the intention wasnt to spam, considering the cooldown on it. At least I dont see 5 consecutive messages as spam considering a lot of users in general send up to 5 if not more when regularly chatting in channels

#

But if it's considered api abuse I might as well just get rid of it

shy rose
#

better question what purpose/gain beyond spam does it serve

earnest phoenix
#

A fun command to emphasise a point, I guess?

shy rose
#

maybe sending 1 message with a line break then

#

i mean still dont see a point personally but that way its not api abuse

#

like
this
example

#

3 repeats in 1 message

earnest phoenix
#

Yeah, I could change it to that

shy rose
#

also handle when someone sets a massive text to repeat and you exced char limit 😉

earnest phoenix
#

I'll give it a think for now, then after changing resubmit my bot

#

Ye

#

Also, question, would this command also fall under api abuse? It's lengthy but it's only one message, also with a 30 second cooldown so it cant be used straight after to spam.

shy rose
#

not ideal but technically no not abuse

earnest phoenix
#

Right, okay

#

I'll probably shorten it anyway

#

Just to be on the safe side

shy rose
#

its the same kind of thing of what purpose/gain does it serve

#

beyond api abuse need to think of users

earnest phoenix
#

It doesnt really have a purpose besides being amusing

shy rose
#

cause rn i see that as a great way to spam/flood a server with text

earnest phoenix
#

Also a bit of a tribute to a friend ig

#

I see how the command can be seen as spam, but that's why I implemented a cooldown on it that applies to the whole server, not just the user

amber fractal
#

Uh

#

Well, that wouldnt really be amazing for users in other, smaller, servers tho would it?

earnest phoenix
#

Well, so far my bot is only in a few small servers and I haven't received any negative feedback from it, so I dont really have much to go off in that respect

cedar nymph
#

hello I'm writing with google translate because I don't have any english knowledge
to delete a letter from a user name
sample
A Marcopolonius to Marcopolonius
message.guild.members.get(message.author.id).displayName
please help

spare goblet
#

Use substring or slice

cedar nymph
#

can you give an example

spare goblet
#

message.guild.members.get(message.author.id).displayName returns a string, so if you wanna slice the first letter of the string off, message.guild.members.get(message.author.id).displayName.slice(1)

earnest phoenix
#

If anyone can help me make a stock bot pls dm me

spare goblet
#

@earnest phoenix Do you know how to program

#

Or know how bots work, minimally

earnest phoenix
#

I think ik how they work

cedar nymph
#

thanks i'm trying it now ❤

earnest phoenix
#

I mean i might be able to give something if someone can make one

earnest phoenix
#

How do you Turn on a bot?

robust acorn
#

you start your script depending on lib/lang

earnest phoenix
#

Uh

broken elm
#

whats your lang @earnest phoenix

proper inlet
#

Hello! How can i optimize this code for bot on discord.js? (It is more than 2000 characters, so the file)

broken elm
#

uhm

#

so

#

basically

#

my bot is currently running perfectly fine... except for mysql

#

im just started usin heroku (don bulli)

#

and i knew things would go wrong here

#

i need to know how i find the correct ip of my database

broken elm
#

nvm

#

jus gonna locally host bot until i get shit sorted out

twilit rapids
#

I believe Heroku doesn't support any data storage

split hazel
#

Yeah they don't allow write on disk

#

Your best bet is to use something like a mongodb provider

#

Bit stupid of a host not to have such a basic feature

twilit rapids
#

It's free...

cursive dagger
#

@twilit rapids @split hazel you get postgres

twilit rapids
#

Hm?

earnest phoenix
#

@proper inlet automatic set command

quartz kindle
#

heorku has a postgres integration

whole magnet
#

What library should I use for creating a bot?

cursive dagger
#

You decide

real helm
#

Hello

#
  var role = message.guild.roles.find("name", "Novato");
fringe radish
#

i need help

real helm
#

How I do it, but change the name, and put de ID

broken elm
#

ugh

#

i decided to scrap my entire bot project that i spent over 2 weeks making

#

although, it was strictly because 1. everything was so cluttered and unorganized. and 2. i wanted to research more efficient ways of doing things i did in the past.

#

@twilit rapids it wasnt for storage, i was trying to connect heroku to mysql on my computer. which wasnt working

earnest phoenix
#

@real helm message.guild.roles.get('id')

real helm
#

thanks

earnest phoenix
#

np qt

#

const client = new Discord.Client()

#

?

stray garnet
#

ah fml my brain

#

And now Discord is undefined

Tha fuck?

late hill
#

Maybe you didn't name it Discord

earnest phoenix
#
const client = new Discord.Client() ```
#

@stray garnet

tulip wave
#

^

#

Was about to type that out

proper inlet
#

How can I do so that when the channel rights change, the action that I need to take place? discord.js

earnest phoenix
#

And if your bot can't find discord.js

  • Run npm i discord.js in the terminal
#

@proper inlet what?

late hill
#

check discord.js documentation

earnest phoenix
#

He want the event Channel Update!

#

?

late hill
#

there's probably a channelUpdated event

proper inlet
#

Someone changes the rights of a certain channel and after that an action takes place, for example, a message is sent.

stray garnet
#

@earnest phoenix im hosting on glitch... and my fcking termial is not working :/

tulip wave
#

Don't like glitch >~< heroku is better

earnest phoenix
#

@stray garnet hm go in package.json

#

Click on add package

#

And write discord.js

stray garnet
#

K

earnest phoenix
stray garnet
#

@tulip wave Im to stupid to use Heroku. its Not working for me somehow

proper inlet
#

Thank you very much

earnest phoenix
#

I can send u a exemple code if you want @proper inlet

proper inlet
#

Come on

tulip wave
#

@stray garnet yeah it is a bit confusing to set up but once setup it's better than glitch

#

But you need 2 accounts to keep it running 24/7

stray garnet
#

@tulip wave Why 2 accs?

earnest phoenix
#
  console.log(`Old name : ${oldChannel.name}\nNew name : ${newChannel.name}`);
});```
#

@proper inlet

proper inlet
#

Thank you so much again!

earnest phoenix
#

np

tulip wave
#

@stray garnet you only have enough free hours for just under a month

stray garnet
#

how much?

tulip wave
#

You loose about 3-4 days a month to free hosting

earnest phoenix
#

Host your bot on your computer

#

Always better than a free hosting service

tulip wave
#

Yeah

#

Heroku doesn't have local storage

stray garnet
#

@earnest phoenix What if i turn it off?

earnest phoenix
#

Bot off

#

Just dont turn it off

stray garnet
#

Or get a Raspberry Pi or whatever :/

tulip wave
#

There are cheap vps providers just check pins

earnest phoenix
#

Earn money with your bot, and then buy a vps

stray garnet
#

Is it allowed to do a Command that sends you the Server Invites where the Bot is in?

tulip wave
#

Only of its locked for your bot developers

#

But I would recommend not to

stray garnet
#

What if its bound to my ID?

#

and no other

tulip wave
#

That's fine

#

As long as no normal user can get it

wind shore
#

vote hook help

#

please

#

<@&265158261945270273>

languid dragon
#

ok

#

no

wind shore
#

does not accept url webhook

#

@languid dragon

slim heart
#

TheYigit don’t ping people like that and especially not the role. and 2 you ask your question don’t say help please

nocturne hazel
#

Can you create an image in canvas
Like just create a solid colour
And then upload it?
In node-canvas

tulip wave
#

I think you can

nocturne hazel
#

How then?

tulip wave
#

Not too sure check the docs

nocturne hazel
#

Can you link the node canvas docs?

slim heart
#

Go to their npm package and there should be some useful links

nocturne hazel
#

Ok

latent oasis
#

Can anyone recommend me free vps server? ( or cheap vps) for d.js bot

slim heart
#

There isn’t gonna be anything free obviously

nocturne hazel
#

How much RAM are you looking for?

latent oasis
#

1-2

#

For now

tulip wave
#

Check pins

#

A few are listed there

latent oasis
#

Ty

tulip wave
#

👌

viscid ivy
bright spear
#

\n probably

viscid ivy
#

ok

#

i will test

#

works thx

stray garnet
#

@tulip wave Can u do an Example?

soft plaza
#

the player stop right after starting

stray garnet
#

Yo can someone explain why my fcking Bot logo dont changes?

twilit rapids
#

Are you changing it on the Discordapp developers portal?

#

@stray garnet

stray garnet
#

Yes @twilit rapids Where either

twilit rapids
#

That just changes the avatar of the app, you would need to Eval it

#

same goes for username

stray garnet
#

Wait how eval

twilit rapids
#

What language are you using?

stray garnet
#

discord.js

stray garnet
#

k what then?

#

@twilit rapids

twilit rapids
#

Did you follow the guide?

stray garnet
#

Wait

#

Ok, a bit complicated

twilit rapids
#

Follow the whole guide, it explains it all

bold dock
#

Wait what, how did the "my logo doesn't change"-topic change to "implement an eval command"

#

or am I missing something

stray garnet
#

Well isn't there an Other way?

#

@bold dock lmao

twilit rapids
#

@bold dock You cannot change the Bot's avatar via the DiscordApp developers portal , you would need to do it via the bot, so using an eval command you can change it to whatever you like.

mossy vine
#

you can

#

wtf

#

you need to change it in the Bot tab

#

and it changes

stray garnet
#

ah fck i said nothing

bold dock
#

wat?

mint cradle
#

Python 3.7
Is there any way this code can be more efficient/faster or better?

message = 'GOPBOT WELCOME CHECK'

#Check for the prefix
print(message.startswith(('GOP','ZWEK','GOPBOT','ZWEKKERBOY')))

#Check one of the args is after the prefix
print(''.join(message.upper().split(' ',1)[1:]) in ['WELCOME CHECK','WELCOME CHANNEL CHECK'])

#Shows you the arg that is in this code
print(''.join(message.upper().split(' ',1)[1:]))

#The next is where it's all about:
print(message.startswith(('GOP','ZWEK','GOPBOT','ZWEKKERBOY')) and ''.join(message.upper().split(' ',1)[1:]) in ['WELCOME CHECK','WELCOME CHANNEL CHECK'])
======== RESTART: /Users/ZL109819/Documents/PythonBot/botjes/testa.py ========
True
True
WELCOME CHECK
True
>>> 

The goal of this code is to check if the string starts with one of the prefixes followed by one of the commands.

earnest phoenix
#

@twilit rapids no you can

#

Now you can't via the bot

#

403 Forbidden when you try to change your avatar with .setAvatar('')

#

@bold dock yes change in the developper portal

#

Section bot

uncut stirrup
#

cloudflare is having issues so every website that uses cloudflare is having issues

#

including discord

#

i can't even get on cloudflares website rn or my own or discords but i can use all google and youtube features just fine.

#

cloudflare's website right now goes to a 502 error.

#

massive rip >.>

wheat jolt
#

;-;

earnest phoenix
uncut stirrup
#

It relates to development since it affected everything. it's on topic so i thought i'd save people the time of thinking they are doing something wrong when it's a service that's at fault.

west spoke
#

^

#

He got a point.

#

Affected my bot.

heady lichen
#

Hey can anyone tell me how to get discordbotlisttoken of my bot

earnest phoenix
west spoke
#

Know what

earnest phoenix
#

??

west spoke
#

Nvm

stray garnet
#

how to do a log

west spoke
#

Wdym

#

Like wood logs?

#

For burning?

stray garnet
#

😂 lmao

earnest phoenix
#

logs for what @stray garnet

stray garnet
#

@earnest phoenix When a User deletes a Message or Edit it

earnest phoenix
#

messageUpdate

#

messageDelete

#

Something like this

#

Wait

stray garnet
#

do an Example im to lazy to turn on my PC. Its 20 Meters Away from me :|

west spoke
#

...

#

then fucking turn it on

earnest phoenix
#
  console.log(`Old message : ${oldMessage.content}\nNew message : ${newMessage.content}`);
});```
#

Really idk if its that

#

try

stray garnet
#

Then I have to go in my wheelchair and im to lazy for that

earnest phoenix
#

ok

west spoke
#

ok fair point

earnest phoenix
#

stop using your disability as an excuse

stray garnet
#

Well its usefull

earnest phoenix
#
  console.log(`${message.content}`);
});```
#

not sure again

west spoke
#

says the person who criticizes literally everyone for not coding their way

earnest phoenix
#

wat

stray garnet
#

@west spoke oof

earnest phoenix
#

how is that related to using a disability as an excuse

#

🤔

west spoke
#

Talking about you

#

@earnest phoenix

earnest phoenix
#

exactly 🤔

#

uwu stop

west spoke
#

uwu ok

earnest phoenix
#

everyone is lazy to do something, i just don't see why using a disability is an excuse, anyways continuation in #memes-and-media

amber widget
#

Is it normal that my try to post server count as an error

#

It failed internal server error

west spoke
#

Cloudfare died. Give it a moment.

amber widget
#

Oof

#

I was thinking it’s my code

earnest phoenix
#

guild.owner.tag doesn't work

delicate zephyr
#

try that

earnest phoenix
#

Okay

delicate zephyr
#

@earnest phoenix you'd want:

#
client.fetchUser(msg.guild.ownerID).tag
earnest phoenix
#

ah

inner jewel
#

await it

earnest phoenix
#

Can't I due msg.guild.owner.id though?

inner jewel
#

no

delicate zephyr
#

no

inner jewel
#

because guild.owner is null

delicate zephyr
#

Because that returns a guild member

inner jewel
#

which is the same reason owner.tag fails

delicate zephyr
#

and if its not cached, it cant get the id

earnest phoenix
#

Ah

delicate zephyr
earnest phoenix
#

client.fetchUser(guild.ownerID).tag doesn't work

split hazel
#

fetchUser returns a promise

earnest phoenix
#

ah

split hazel
#

which means you'd have to use something like await or then

earnest phoenix
#

How do I make this work then?

var serversMsg = [];
                    client.guilds.forEach(function (guild) {
                      var owner = guild.owner ? client.fetchUser(guild.ownerID).tag : "[could not find]";
                      console.log(client.fetchUser(guild.ownerID).tag);
                      serversMsg.push(guild.name + ": " + guild.members.size + " members, owner is " + owner);
                    });
                    msg.channel.send(serversMsg.join("\n")).catch(() => {});
#

I can't make forEach an async function

#

Therefore no await

split hazel
#

you can

earnest phoenix
#

Really?

split hazel
#

just put async behind the function

#

async function (guild)

earnest phoenix
#

hmm

#

I assumed that would make it skip over it

split hazel
#

it wouldn't

earnest phoenix
#

Using:

var serversMsg = [];
                    client.guilds.forEach(async (guild) => {
                      var owner = guild.owner ? (await client.fetchUser(guild.ownerID)).tag : "[could not find]";
                      serversMsg.push(guild.name + ": " + guild.members.size + " members, owner is " + owner);
                    });
                    msg.channel.send(serversMsg.join("\n")).catch(() => {});
split hazel
#

You should read a bit about async

earnest phoenix
#

Now it only shows the first server

inner jewel
#

that won't work

earnest phoenix
#

I can tell

inner jewel
#

it'll finish the forEach before the promises resolve

earnest phoenix
#

Exactly

inner jewel
#

you can't use a forEach there

earnest phoenix
#

huh

inner jewel
#

you could use a map and then await Promise.all

earnest phoenix
#

I'll just use a normal for

#

Oh wait

#

That won't work either

inner jewel
#
await Promise.all(client.guilds.map(async guild => {
    code inside foreach
}))```
slim heart
#

^ but u can do for async(etc){}

#

Just fyi

mossy vine
#

that would be different

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

viscid ivy
#

Code:

@client.event
async def on_ready():
    print('INITIALIZING...')
    await client.change_presence(game=discord.Game(game='beta 03 | &help'))
    print('Bot presence set.')
    print('The bot is now ready.')```
#

everything else works fine

slender thistle
#

discord.Game(game='beta 03 | &help')

#

it's name, not game

wicked pivot
#

does anyone know how to detect the addition or removal of a role on a user?

viscid ivy
#

@slender thistle doesn't work

wicked pivot
#

For now in my event guildMemberUpdate I have this js roles = newMember.roles.map(role => role.name) if(oldMember.roles != newMember) { console.log(`${roles}`) } and I would like her to tell me that the roles that were add or delete on the user

limber swan
split hazel
#

This means that the server you're trying to connect to doesn't support ssl

#

I'm not sure really about PQSQL but if there's an option to disable ssl connections then that's your best bet

fallow steppe
#

not sure what I have dont wrong, but the bot doesn't reply when I run the command

#
    if (message.content == prefix + "embedhelp") {
        message.channel.send({embed: {
            color: 3447003,
            title: "This is an embed",
            description: "Description test.",
            fields: [{
                name: "Field1",
                value: "Field test 1."
              },
              {
                name: "Field2",
                value: "[Field test 2.](http://google.com)"
              },
              {
                name: "Field3",
                value: "**Field** `test` __3__."
              }
            ],
            timestamp: new Date(),
            footer: {
              icon_url: client.user.avatarURL,
              text: "© Example"
            }
          }});
    }
})```
split hazel
#

Do you get any errors in console?

fallow steppe
#

nevermind I figured it out. Was using client instead of bot

split hazel
#

i see

amber fractal
quartz kindle
#

i've spent so much time working on a cache for my sqlite database, and it does no difference at all because sqlite is fast af

split hazel
#

yeah cache is best for slower databases

dusky marsh
#

Anyone who has a decently popular music bot, how much is your hosting on a monthly basis? Or perhaps a better question is how resource intensive is it?

slim heart
#

It all depends on the language, library, method, etc.

#

Your best bet is to try it on a local machine, see how much it takes up at first, do that, and as it grows, upgrade

unreal oxide
#

Niks Groovy uses a cluster of 4 dedis costing $200 each (think it was groovys)

#

Could dm him with any questions

tight heath
#

You can ask me

#

@dusky marsh henlo

#

I am the Groovy community man

#

We have 4 dedicated servers running k8s for audio processing and stuff

#

128GB/2x16c iirc

#

And we use about 80%

dusky marsh
#

Wowzas

tight heath
#

For a million discord servers.

#

$800 the dedis alone

#

We also have an extra server for db, k8s master, etc.

#

Total roughly $1000/mon

dusky marsh
#

Hmm, interesting, thank you for the information! I really appreciate it :)

loud salmon
#

@spice nymph you arent allowed to do that as per discord tos

#

if you do that

#

you will be banned

limber swan
#
rollbar: new (require('rollbar'))(process.env.ROLLBAR_ACCESS_TOKEN),```
3|PentaHub  | TypeError: Cannot read property 'minimumLevel' of undefined
3|PentaHub  |     at new Rollbar (/home/administrator_nico/PentaHub/node_modules/rollbar/src/server/rollbar.js:24:15)
3|PentaHub  |     at Object.<anonymous> (/home/administrator_nico/PentaHub/structures/client.js:76:12)
3|PentaHub  |     at Module._compile (module.js:653:30)
3|PentaHub  |     at Object.Module._extensions..js (module.js:664:10)
3|PentaHub  |     at Module.load (module.js:566:32)
3|PentaHub  |     at tryModuleLoad (module.js:506:12)
3|PentaHub  |     at Function.Module._load (module.js:498:3)
3|PentaHub  |     at Module.require (module.js:597:17)
3|PentaHub  |     at require (internal/module.js:11:18)
3|PentaHub  |     at Object.<anonymous> (/home/administrator_nico/PentaHub/index.js:4:16)
topaz fjord
#

the thing your calling minimumLevel on doesn't exist

limber swan
#

Im not calling anything minimunLevel

topaz fjord
#

are you doing .minimumLevel

limber swan
#

no.

#

Wdym

earnest phoenix
#

Know someone a command who can pick a number and a name and the result a link

#

Example : if(msg.content.startsWith(prefix + "astats")) { const name = msg.content.send(); if(nameapex) { const platform = ("1","2","5"); if(platform) { const embedprofile = new Discord.RichEmbed() .setColor("#FF0000") .setTitle("Your status link was created") .setAuthor("Click me", url("https://www.../platform/name")); msg.channel.send(embedprofile); } } }

#

wtf is message.content.send()

#

idk

#

i tried something =))

#

i'm a biginner with discord.js

#

i want it with 2 strings

#

i want it to be a status bot

#

for a game

#

afaik you cant mask hyperlinks in the author field

#

you can use .setURL() to set a masked hyperlink for the title

#

but i want the name to be like =astatus name

#

if you know how

#

Umm , hello?

warm marsh
#

Then do it?

earnest phoenix
#

...

spare goblet
#

@earnest phoenix I'm not sure why you want to do, could you explain again?

#

Ah I get it now

#

They're using a .addField property

#

So for example if you do like
=astats nameofyourlnk link here

#

Right

#

So just do something like

earnest phoenix
#

=astats username platform and then show into an embed

spare goblet
#

Wdym username platform

earnest phoenix
#

it's complicated

#

Cuz is for a game

spare goblet
#

Okay so what do you want it to be like

#

What is the usage

#

Send me example usage pls

earnest phoenix
#

ok

spare goblet
#

Or what

earnest phoenix
#

=astats TEdy Ps4

#

ok

#

let me explain

#

what i want to do

#

if you type =astats username ps4

#

to show like

#

https://www..../username/ps4

spare goblet
#

Okay what's the.... Supposed to be

earnest phoenix
#

apex.

#

😃

spare goblet
#

Can you gimme a complete link

earnest phoenix
#

ok

#

https://public-api.tracker.gg/apex/v1/standard/profile/[platform]/[username]

spare goblet
#
const args = message.content.split(/ +/g) //you split the message content into an array based off of spaces. 
const platform = args[1] //second item of the array,  args, is the platform
const username = args[0]

const emb = new Discord.RichEmbed()
.addField("Your status link has been created", `[Click Here](https://public-api.tracker.gg/apex/v1/standard/profile/${platform}/${username})`)
message.channel.send(emb)
}```
#

@earnest phoenix Do you understand this?

#

Sorry for delay, I'm on phone so coding on phone is not fun mirateehee

earnest phoenix
#

i understand

#

ty

spare goblet
#

Okay, good luck and have a good day blobsmilehappyeyes

earnest phoenix
#

but i wrote in node

spare goblet
#

This is node. blobsmilesweat

#

You were most obviously using discord.js so I wrote in discord.js node.js

earnest phoenix
#

oh , i was scared for a minute =)))))))))))) cuz i thought i maked you write for nothing

spare goblet
#

What? blobsmilesweat

earnest phoenix
#

nvm

spare goblet
#

You'll have to space it out properly because I can't do that on phone. blobsmilehappyeyes

earnest phoenix
#

i know , it's hard

#

small keyboard

spare goblet
earnest phoenix
#
                        ^

SyntaxError: Unexpected token (
    at Module._compile (internal/modules/cjs/loader.js:721:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
#

YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEY

#

i like to code so much

spare goblet
#

You need to put it under the right section

#

The place where you're gonna run the command

limber swan
#
rollbar: new (require('rollbar'))(process.env.ROLLBAR_ACCESS_TOKEN),```
3|PentaHub  | TypeError: Cannot read property 'minimumLevel' of undefined
3|PentaHub  |     at new Rollbar (/home/administrator_nico/PentaHub/node_modules/rollbar/src/server/rollbar.js:24:15)
3|PentaHub  |     at Object.<anonymous> (/home/administrator_nico/PentaHub/structures/client.js:76:12)
3|PentaHub  |     at Module._compile (module.js:653:30)
3|PentaHub  |     at Object.Module._extensions..js (module.js:664:10)
3|PentaHub  |     at Module.load (module.js:566:32)
3|PentaHub  |     at tryModuleLoad (module.js:506:12)
3|PentaHub  |     at Function.Module._load (module.js:498:3)
3|PentaHub  |     at Module.require (module.js:597:17)
3|PentaHub  |     at require (internal/module.js:11:18)
3|PentaHub  |     at Object.<anonymous> (/home/administrator_nico/PentaHub/index.js:4:16)
#

Help?

cedar nymph
#

hello

#

Is there someone who can help?

limber swan
#

Depends

cedar nymph
#

is there a code for the bot to send a message when I tag someone

cinder tendon
#

can you specify more on that?

cedar nymph
#

I'll try with translate

#

I want to react when I write the first image I want

#

Did I tell you?

#
client.on('message', async message => {
  
  let prefix = await db.fetch(`prefix_${message.guild.id}`) || ayarlar.prefix
  let afkmarcopolonius =message.guild.members.get(message.author.id).displayName.slice(5)
  let kullanıcı = message.mentions.users.first() || message.author
  let afkdkullanıcı = await db.fetch(`afk_${message.author.id}`)
  let afkkullanıcı = await db.fetch(`afk_${kullanıcı.id}`)
  let sebep = afkkullanıcı
 
  if (message.author.bot) return;
  if (message.content.includes(`${prefix}afk`)) return;
  
  if (message.content.includes(`<@${kullanıcı.id}>`)) {
    if (afkdkullanıcı) {
      message.channel.send(`\`${message.author.tag}\` adlı kullanıcı artık AFK değil.`)
      db.delete(`afk_${message.author.id}`)
    }
    if (afkkullanıcı) return message.channel.send(`${message.author}\`${kullanıcı.tag}\` şu anda AFK. Sebep : \`${sebep}\``)
  }

  if (!message.content.includes(`<@${kullanıcı.id}>`)) {
    if (afkdkullanıcı) {
      message.channel.send(`\`${message.author.tag}\` adlı kullanıcı artık AFK değil.`)
      db.delete(`afk_${message.author.id}`)
      message.member.setNickname(afkmarcopolonius).delete
    }
  }
});
spare goblet
#

Just check if message.mentions.members collection .has anyone in the map of people in afk

#

And if yes make it reply

cedar nymph
#

did not work 😦

spare goblet
#

What do you mean hehe

#

It would work if you write it properly

#

How are you storing the AFK users?

#

The users who are in afk

cedar nymph
#

quick.db

spare goblet
#

If not I'm just gonna assume it's a map

#

Oh sorry I don't know how to use quick.db

cedar nymph
#

thank you so much ❤

spare goblet
#

If you use a map you can do it easily

cedar nymph
#

i don't know how to use map

spare goblet
#

map() is an object
A function in js

sinful lotus
#

map is litereally a key pair value

spare goblet
#

Ye

sinful lotus
#

like what you do in quick db

spare goblet
cedar nymph
#

i'm more a novice i don't even know english
😄

sinful lotus
#
//example of map
const cache = new Map();
cache.set('foo', 'bar')
cache.set('owo', { hi: 'hello' })
console.log(cache.get('foo')) // returns bar
console.log(cache.get('owo').hi) //  returns hello
cedar nymph
#

wow

spare goblet
#

Just set the user ID as key and guild ID as valur

#

Then check for both

#

And if they're in the map where it matches, then you send that message

inner jewel
#

forgot your quotes around hello

sinful lotus
#

oh

#

LMAOI

spare goblet
sinful lotus
#

Thanks qt @inner jewel

cedar nymph
#

I will start learning immediately

#

thank you

#

spare goblet
sudden geyser
#

Are there any good guides on caching and how to implement

inner jewel
#

caching can be as easy as storing data to a map

#

you'll have to be more specific

earnest phoenix
#

knows anybody to work with apex api

#

?

limber swan
#

Somone uses PQSQL?

#

Have a problem with ssl

earnest phoenix
#
    at Promise (E:\somestuff\node_modules\apex-api\src\Client.js:32:42)
    at new Promise (<anonymous>)
    at Client.user (E:\somestuff\node_modules\apex-api\src\Client.js:23:12)
    at Client.bot.on.msg (E:\somestuff\index.js:34:19)
    at Client.emit (events.js:198:13)
    at MessageCreateHandler.handle (E:\somestuff\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (E:\somestuff\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
    at WebSocketConnection.onPacket (E:\somestuff\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (E:\somestuff\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (E:\somestuff\node_modules\ws\lib\event-target.js:120:16)
#

i'm gonna freakout

earnest phoenix
#
    {
        const args = msg.content.split(/ +/g);
        let username = args[0];
        let platform = args[1];
        let data = apex.user(username, platform).then (data => {
            console.log(data);
    

    }).catch(e => {
        console.log(e);
        msg.channel.send("No database was found");
    })

    }```
#

i need help

#

i get everytime this [APEX-API] Platforms must be PC, XBOX or PSN

#

AND i don't know why i put he args

#

...maybe you should check whether the platform is pc, xbox or psn

#

inspect your variables

#
      if (platform.toUpperCase() === 'XBOX') nbr = 1; 
      if (platform.toUpperCase() === 'PSN') nbr = 2; ```
sinful lotus
#

@sudden geyser tbh cache in map is the easiest form of cache

#

if you are working with something like sql settings, then on boot, get the stuff you need then cache it

sudden geyser
#

Okay, thanks. I'll probably just extend map

#

then work from there

sinful lotus
#

enmap works the same way irrc

#

you can probably adapt that but instead use your db

#

or make it a bit diff. choice is yours

earnest phoenix
#

umm i solved 50% of the code

nocturne hazel
#

Is there any way you can display the amount of commands your bot has?

#

Apart from going through the files and counting them

wooden lance
#

Hello! Is there a way, for me to run a command, then a user's userID gets stored to a .json file and then when they run a command, it checks for them on that list and if they are, say something instead of running the command? My bot is discord.js. Please ping me if you respond. Thank you!

earnest phoenix
#
if(!json[message.author.id]) return;
``` @wooden lance
wooden lance
#

Aha! Thank you! 😄

earnest phoenix
#

idk if its what do you wang exactly

wooden lance
#

A blacklist system is what i'm looking for.

#

And databases just don't seem to work for me

#

Do you know how to add a userID to that record and how to lay out the file @earnest phoenix?

earnest phoenix
#

hmm add a level to the blacklist

wooden lance
#

K thanks

rugged kelp
#

.setTitle(`**:tada: Hi ${message.author.name} :tada:**`)

#

It's not good why ?

wheat jolt
#

@rugged kelp what error do you get?

earnest phoenix
#

@rugged kelp message.member.username

#

@nocturne hazel len(client.commands) is what my bot uses I believe

nocturne hazel
#

For the commands size?

earnest phoenix
#

Like, in my botinfo command it outputs the number of total commands

#

forEach your commands file and fetch the size

nocturne hazel
#

Oh cool

slender thistle
#

Python != JS

earnest phoenix
#

Its in py?

slender thistle
#

But your point is still on

#

isn't len py

earnest phoenix
#

oh k

#

Yeah

#

Though idk what the author uses so

#

If it's python, that should be it. If not then idk

tulip solar
#

paying anyone to make my bot page look sick through markdown, msg me.

earnest phoenix
rugged kelp
#

Why ?

latent spoke
#

How can i modify the pitch with Lavalink? 🤔

tulip wave
#
if(!message.author.id === "165811958828761089") return message.reply("you do not have permission to reload commands") 
    
    if (!args[0]) return message.channel.send("Please give me a command to reload")

    let cmd = args[0].toLowerCase()

    try{
        delete require.cache[require.resolve(`./${cmd}.js`)]
        bot.commands.delete(cmd)
        const pull = require(`./${cmd}.js`)
        bot.commands.set(commandName, pull)
    } catch(e) {
        return message.channel.send(`failed to reload ${cmd}.js due to \n${e}\npls fix`)
    }

    message.channel.send(`reloaded ${cmd} you're welcome`)

anyone know why this wont work? it gets to bot.commands.set(commandName, pull) then commandName is undefined and idk why

mossy vine
#

@tulip wave how are you declaring commandName

tulip wave
#

it should be from the command collection

mossy vine
#

one sec, i think i might know what the issue is but i kinda wanna make sure before saying anything dumb

tulip wave
#

ok

earnest phoenix
#

or message.member

#

${message.member}

mossy vine
#

message.member would return a huge object, so have fun sending that lol

warm marsh
#

Nope.

earnest phoenix
#

What? @warm marsh

warm marsh
#

Would return the .toString()

#

inside of ${}

mossy vine
#

yes

#

and you cant send that

#

because of character limits

warm marsh
#

...

#

Did you read?

rugged kelp
#

message.member it's ID

earnest phoenix
#

message.member return a ping

#

no @rugged kelp

warm marsh
#

${message.member} would return @warm marsh

earnest phoenix
#

Yes

#

This is what he want

rugged kelp
#

with embed ?

#

look

earnest phoenix
#

Yes with embed

rugged kelp
warm marsh
#

<@!?${message.member.id}>

#

if it doesn't work.

mossy vine
#

@tulip wave my best guess is that commandName isnt declared in the scope; you arent passing it in the command function or however you have it set up

warm marsh
#

bot.commands.set(cmd, pull)

#

or define commandName

mossy vine
#

but it already gets deleted at that point

#

wait no

#

that could work

#

but maybe its not what they need

warm marsh
#

cmd doesn't.

#

It's most likely what they meant.

tulip wave
#

ill try it

mossy vine
#

they would just use cmd then, aliases exist as well roeesip

warm marsh
#

They're clearing cmd from the list and re-setting it so cmd is current.

mossy vine
#

eh probably

warm marsh
#

If they've got aliases.

earnest phoenix
#

What is the best db for a rpg games?

#

I'm using sql rn but idk if its the best to store game data

mossy vine
#

sql is good but i personally dont use it because its way too easy to fuck up

#

if you have experience with it and no significant problems, just use it

tulip wave
#
message.author.id != "165811958828761089"

now gives me id as undefined >.>

#

worst of all it works in other commands

earnest phoenix
#

and !==

quartz kindle
#

could be a system message

exotic tapir
#

anyone able to point me to where the issue is?

tulip wave
#

TypeError: Cannot read property 'id' of undefined

exotic tapir
#

i cant find the string

earnest phoenix
#

'MongoParseError'

tight heath
#

@exotic tapir pm2 logs 0 --err --lines 200 pls

latent spoke
#

@tulip wave try it

earnest phoenix
#

member ??

#

wth

latent spoke
#

nvm

earnest phoenix
#

idk

cerulean seal
#

hey, i noticed that my bot is often quickly removed from a server after it has been added, but there are no errors shown, or atleast not in that amount. What is good way to fix this?

#

or what could the reason for that be?

earnest phoenix
#

module.exports.run = async (bot, message, args) => {
	
		let variable_salon_users = message.guild.channels.find(`👥 Utilisateurs : ${message.guild.memberCount}`, 'voice')
		if(!variable_salon_users) return message.channel.send("**⚠ Le compteur d'utilisateurs n'existe pas.**")
		if(variable_salon_users) {
			variable_salon_users.delete()
			message.channel.send("**✅ Le compteur d'utilisateurs à été retiré avec succès.**") 
		}
}

module.exports.help = {
	name:"remove users"
} ```

Why doesn't her take the channel out?
tulip wave
#

@cerulean seal sometimes people add your bot to a server for testing

cerulean seal
#

yea i thought of that but its like per 10 servers added only 1 remains

#

So i just added more information about the commands it provides to the page on the site. So people can better judge if the bot is a good fit

earnest phoenix
#

@earnest phoenix what?

#

I put the code at the top, but when I make the command, its not removing the vocal lounge

cerulean seal
#

have you tested each single component of it and made sure that they all worked on their own?

tulip wave
#

@earnest phoenix btw it's still not working but it is in other commands im actually confused

plucky sun
limpid raptor
#

What returns undefined ?

plucky sun
#

results

#

result*

inner jewel
#

you're running query() before the connection is established

plucky sun
#

euh ok

#

what is the solution ?

#

I'm not expert of node.js/mysql

#

sorry xd

cerulean seal
#

i think the connection.connect function is async, so you either need to await for it to finish or you need to put your query insdie the callback of it

#

so like ```connection.connect(function(err) {
// Some error handling

connection.query('your query', function(error, results, fields)  {
    // processing the data
});

});```

#

@plucky sun

plucky sun
#

ok i try

#

doesn't work 😢

cerulean seal
#

hmmm

plucky sun
#

hmm

#

Ah

#

a new error : Error: Cannot enqueue Query after invoking quit.

naive gull
#

Does “monthly upvote” mean the total of this month

earnest phoenix
#

Yes

cerulean seal
#

@plucky sun put the connection.end() at the end of the query callback

plucky sun
#

already done

cerulean seal
#

in the callback?

plucky sun
#

AH

#

wait

#
results :
fields : [object Object]
#

It's a little better xd

cerulean seal
#

yea

#

you do select a database when connecting right?

#

in the createConnection function

plucky sun
#

yes

cerulean seal
#

and you do have something in the database

plucky sun
#

yes

#

it's strange

cerulean seal
#

do you output the raw result of the query

plucky sun
#

no

#

i try

#

undefined

cerulean seal
#

hmmm

#

can test your query in another way to verify that its actually working ?

plucky sun
#

I already test with the creation of a table works, and yes it works.

cerulean seal
#

i mean the selection query

plucky sun
#

So, fields give the exact number of tables but with [Object, Object]

cerulean seal
#

hmm idk anymore

plucky sun
#

ok ty to try help me

#

😃

cerulean seal
#

np

#

at least you can connect and query now xd

plucky sun
#

😃

quartz kindle
#

[Object,Object] means its working, you just need to extract data from the object

#

if you want to output the entire object, you need to convert it to a string

earnest phoenix
#

What is the name of the event when a role has been added or removed?

#

which library

#

ok

tight heath
#

@earnest phoenix in d.js guildMemberUpdate

earnest phoenix
#

How do I make a welcome official command?

heady lichen
#

@earnest phoenix which language are you using?

#

Py or js

earnest phoenix
#

discord.js

heady lichen
#

Hmm welcome message on joining guild of dm on joining guild

#

Or just simple ans to command

earnest phoenix
#

just simple ans to command

heady lichen
#

@earnest phoenix

#

Create a variable and put in front of command then use this format

earnest phoenix
#

it's a github?

heady lichen
#

Yup

earnest phoenix
#

hm okay :d

heady lichen
#

Or crrate a file

#

Containg msg

#

And put its location like above format

earnest phoenix
#

It's Hard to Get From the Picture

#

But I'il try

heady lichen
#

Ya i just clicked it from my desktop

earnest phoenix
#

Do you have the link to throw it out or I'll stay for a hour or so afk

heady lichen
#

Okay

#

WIt

earnest phoenix
#

Thanks ❤

opaque eagle
#

Make the repo public

#

Rn it gives a 404

earnest phoenix
#

Yes

heady lichen
#

Oh sry

earnest phoenix
#

Private Project

heady lichen
#

See this then

#

@earnest phoenix

earnest phoenix
#

Very Very Very Thank Youuu ❤

heady lichen
#

Np

earnest phoenix
unique nimbus
#

spoonfeed bad

fallow steppe
#

okay, the bot is not responding to this

#
  // Ignore messages that aren't from a guild
  if (!message.guild) return;

  // If the message content starts with "!kick"
  if (message.content.startsWith('!kick')) {
    // Assuming we mention someone in the message, this will return the user
    // Read more about mentions over at https://discord.js.org/#/docs/main/stable/class/MessageMentions
    const user = message.mentions.users.first();
    // If we have a user mentioned
    if (user) {
      // Now we get the member from the user
      const member = message.guild.member(user);
      // If the member is in the guild
      if (member) {
        /**
         * Kick the member
         * Make sure you run this on a member, not a user!
         * There are big differences between a user and a member
         */
        member.kick('Optional reason that will display in the audit logs').then(() => {
          // We let the message author know we were able to kick the person
          message.reply(`Successfully kicked ${user.tag}`);
        }).catch(err => {
          // An error happened
          // This is generally due to the bot not being able to kick the member,
          // either due to missing permissions or role hierarchy
          message.reply('I cannot kick the user. Either I do not have the `Kick` permission, or my role is lower than the user. ');
          // Log the error
          console.error(err);
        });
      } else {
        // The mentioned user isn't in this guild
        message.reply('That user isn\'t in this guild!');
      }
    // Otherwise, if no user was mentioned
    } else {
      message.reply('You didn\'t mention the user to kick!');
    }
  }```
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fallow steppe
#

whats the problem with that?

sage bobcat
#

One message removed from a suspended account.

fallow steppe
#

I actually need help on what's wrong in the code.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

fallow steppe
#

If you actually look above, alot have been doing the same without running into a response like yours so stop.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fallow steppe
#

you mind stop talking about that?

slender thistle
#

Let's not fight

fallow steppe
#

well I actually asked a question

#

look up

slender thistle
#

Where did message.guild.member(user) come from

fallow steppe
#

from the kick command

slender thistle
#

And I hope you realize that that's wrong

fallow steppe
#

hm?

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

DV please

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

Help or stop

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

guild.member isn't a thing, first of all

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
spice nymph
#

What is the code for member count please ?

somber verge
#

what lib?

sinful lotus
#

guild.memberCount on d.js

slim heart
#

why when i do

const { resolve } = require("path");
const d = __dirname;
const r = resolve.bind(d);
r()

it gives me something different than if i do path.resolve(__dirname)?

bold dock
#

Because the first arg of .bind is the this-object.

#

and not the argument

#

@slim heart

slim heart
#

oh

#

oops

fallow steppe
#

what's the code that allows the bot to create a role with perms and color? ( js )

slender thistle
#

Spoonfeeding is bad WeirdEyes

steel drum
#

@fallow steppe

#

anything you'll ever need to find is (probably) in the documentation

west spoke
#

just make api calls. Ez

#

xddd

wide ruin
#

html/js:

#

i have a program that uses a js file

#

how can i run x.bat from said js?

earnest phoenix
#

You can't if you're talking about browser js

#

For obvious security reasons

wide ruin
#

no it uses node electron

earnest phoenix
#

Ah

#

I think I asked this before but how do I remove the bot roles after I delete a bot

smoky mica
#

Do bots like Dank Memer use Canvas?

mossy vine
#

no

smoky mica
#

O

earnest phoenix
#

How do I remove them?

mossy vine
#

banning the bot should work

#

literally the top answer on the thread

plain bough
#

kick bot from the server

#

and re add with no perms

earnest phoenix
#

the bot is deleted though christmasthink

west spoke
#

^

#

F

plain bough
#

f

mossy vine
#

oh

earnest phoenix
#

Yes

#

So what now?

hushed berry
#

hi

split hazel
#

Hi do you need help with anything related to development?

smoky mica
#

He's a certified and library developer, I don't think he does lmao

cerulean seal
#

hey, i got a question, when using the go-dbl lib i always get an error when updating the Bot stats but it just says Remote request failed with non 200 status code but i dont know what the problem is

#

the code im using for it is the exact same as the one in the example just with my credentials

west spoke
#

200 means oo

#

Ok

#

So if non 200 it means something either client end or server end did something wrong

cerulean seal
#

yea but i dont know what, since i just used the example code (with my own credentials obviously)

#

i already checked and i entered them correctly

west spoke
#

try altering the code a bit. Never take examples raw and assume they will work.

cerulean seal
#

well the guides should work

#

especially when its basically only 2 lines + error checking

quartz kindle
#

Well, the error checking should give yoi the status code

#

Which will tell you what the problem is

cerulean seal
#

the error it returns is just the Remote request failed with non 200 status code

smoky mica
#

How can I make the bot create a channel and then send a message to it?

mossy vine
#

create a channel and then send a message to it

smoky mica
#

helpful af ly man

#

xd