#development

1 messages · Page 1252 of 1

silver lintel
#

agreedc

ionic shard
#

also for ban

#

cheers

silver lintel
#

naisu

carmine summit
#

typeerror function.prototype.apply was called on # object which is a object and not a function

#
                message.channel.awaitMessages({
                        max: 1,
                        time: 30000,
                        errors: ['time']
                    })
                    .then(async collected => {
                        let num = message.content
                        console.log(num)
                        if (isNaN(num)) return message.channel.send(`\`${num}\` is not a number.`)
                        message.channe.send(await stats(uuid, num, ign))
                    })
                    .catch(collected => {
                        message.channel.send('Timed out.');
                    });
            });```
ionic shard
#

line?

silver lintel
#

^

ionic shard
#

Not sure butthumbnail: { url: member.user.displayAvatarURL({ dynamic: true, size: 400}), },

#

try size 400

carmine summit
#

cant find which line...

ionic shard
#

dynamic has nothing to do with the size?

silver lintel
#

UnhandledPromiseRejectionWarning: RangeError [IMAGE_SIZE]: Invalid image size: 400

slender thistle
#

512, 1024, or 2048

silver lintel
#

oh

ionic shard
#

256

carmine summit
#

please help

ionic shard
#

give more info

carmine summit
#

I have never encountered this error before

silver lintel
#

its hard to help when we dont know where to look at

eternal osprey
silver lintel
#

lmao

#

simpjs

carmine summit
#
                message.channel.awaitMessages({
                        max: 1,
                        time: 30000,
                        errors: ['time']
                    })
                    .then(async collected => {
                        console.log('collected')
//collected didnt go through.
                        let num = message.content
                        console.log(num)
                        if (isNaN(num)) return message.channel.send(`\`${num}\` is not a number.`)
                        message.channe.send(await stats(uuid, num, ign))
                    })
                    .catch(collected => {
                        message.channel.send('Timed out.');
                    });
            });```
amber thistle
#

Can anyone break it down to me on how do u make a now playing cmd that shows u how long the song has been played

earnest phoenix
#

what do u use

#

yt-core

amber thistle
#

Ye

silver lintel
#

@carmine summit

amber thistle
#

Ytdl

earnest phoenix
#

or Lavalink

#

ok

silver lintel
#

@carmine summit

message.channe.send(await stats(uuid, num, ign))

earnest phoenix
#

hmm

silver lintel
#

channe?

earnest phoenix
#

@amber thistle hmm idk cuz i am bad in Music

amber thistle
#

Oof

earnest phoenix
#

verry verry bad

#

idk anything about music

#

or vc

amber thistle
#

I think thats about math

#

Or idk

earnest phoenix
#

nah

#

try console.log(song)

carmine summit
#

uj

amber thistle
#

I thought u take the time the song is being played and minus the duration

earnest phoenix
#

and maybe u will get usefull info about it

amber thistle
#

Hmmm

carmine summit
#

@silver lintel i still have the error

#

same error

#

how do I add a filter that only the person who sent the command, and the bot will ignore others

#
                            return user.id === message.author.id;
                        };```like this
eternal osprey
#

Errors found:
ReferenceError: message is not defined

#
var rand = require("./random");
if (message.channel.id == '756807110620217374'){
function ToInteger(card) {
    if (card == "A") {
        return 11;
    }
    else if (card == "base") {
        return 0;
    }
    else if (card == "J" || card == "Q" || card == "K") {
        return 10;
    }
    else {
        return Number(card);
    }
}

function aceCheck(value, total) {
    if (total + value > 21 && value == 11) {
        return 1;
    }
    else {
        return value;```
carmine summit
#

there is no user input

#

thats why message is not defined

eternal osprey
#

hmm okay

#

how would i fix that?

carmine summit
#

by adding a command?

silver lintel
#

how do I add a filter that only the person who sent the command, and the bot will ignore others
@carmine summit filter m => m.author.id === message.author.id

carmine summit
#

that will trigger that

cinder patio
#

The first parameter of awaitMessages/awaitReactions/createMessageCollector/createReactionCollector is the filter function

silver lintel
#

you can define filter like let filter = ... then put it message.channel.awaitMessages({filter, or you can do directly

carmine summit
#

uh?

silver lintel
carmine summit
#

message.channel.awaitMessages(m => m.author.id === message.author.id,
{max: 1, time: 30000, errors: ['time']}).then(collected => {
@silver lintel I want to define filter

silver lintel
#

let filter = m => m.author.id === message.author.id
message.channel.awaitMessages(filter,
{max: 1, time: 30000, errors: ['time']}).then(collected => {

#

filter is basically, well, the filter

carmine summit
#
                message.channel.awaitMessages(m => m.author.id === message.author.id,{
                        max: 1,
                        time: 30000,
                        errors: ['time']
                    })
                    .then(async collected => {
                        console.log('collected')
                        let num = message.content
                        console.log(num)
                        if (isNaN(num)) return message.channel.send(`\`${num}\` is not a number.`)
                        message.channel.send(await stats(uuid, num, ign))
                    })
                    .catch(collected => {
                        message.channel.send('Timed out.');
                    });
            });``` typeerror function.prototype.apply was called on # object which is a object and not a function
silver lintel
#

idk sry

earnest phoenix
#

Main question here is, what's stats defined as

carmine summit
#

its a function

#

async function stats(uuid, profile, ign) {
})

earnest phoenix
#

And what's the body of that function

carmine summit
#

you wouldnt understand

pale vessel
#

no like is it a string

carmine summit
#

but it works on a different command

#

it returns a string yes

#

the stats function works perfectly on a different command with the same input

earnest phoenix
#

I'm pretty sure the function isn't for the parameters you provide

carmine summit
#

btw collected didnt go to the console

pale vessel
#

which collected OMEGALUL

carmine summit
#

console.log('collected')

fresh matrix
#

Is there a way to make music comamnds without using discord.js and if so what website?

earnest phoenix
#

your question is uh

#

way too confusing

#

You mean make a music command with a different library?

silver lintel
#

make commands without using discord.js???

fresh matrix
#

Yh

earnest phoenix
#

you don't have to use djs, there's a fuck ton of different libraries for a fuckton of different languages

carmine summit
#

star that BS lol

misty sigil
#

just use eris

fresh matrix
#

Yeah but I need to know coding website and code

earnest phoenix
#

That's nothing funny to be starred actually

#

L

fresh matrix
#

I'm not starring anything

#

I was muted for 5 days for nothing

silver lintel
#

how do i take absolute of an integer?

earnest phoenix
#

A wot of integer

silver lintel
#

|-5|

#

=

#

5

#

yk, maths

earnest phoenix
#
Math.abs(<Number>)```
misty sigil
#

not for nothing

#

it was for starting random messages

carmine summit
#

Mi cod no work

#

plz help

#

i get eror from cod

misty sigil
#

if this isn’t satire I swear

earnest phoenix
#

Just use collectors instead of promise based awaiters

carmine summit
#

plz mi ned help

#

@worldly prairie

#

help

silver lintel
#

you just pinged some random guy

carmine summit
#

xD

earnest phoenix
#

Several people are typing...

fresh matrix
#

Lol

silk chasm
#

how do i take absolute of an integer?
@silver lintel print (abs(number))

earnest phoenix
#

I literally said how and that's python not js

silk chasm
#

hmm...oh i didn't seen it lol

restive furnace
#

Math#abs probably would be js equivalent

silver lintel
#

yes

earnest phoenix
#
Math.abs(<Number>)```
silver lintel
#

^

restive furnace
#

it's only one line part of code, but ok

earnest phoenix
#

No i mean i said it before lol

restive furnace
#

ah

fresh matrix
#

How do u make a music command?

restive furnace
#

didn't notice

earnest phoenix
#

Which library

fresh matrix
#

Any

silk chasm
#

How do u make a music command?
@fresh matrix js or python?

fresh matrix
#

Js

misty sigil
#

@fresh matrix use lava link

#

music bots are not for first bot project

fresh matrix
#

Mk

silk chasm
#

then u can take help from these imma python guy...

misty sigil
#

you need to deal with rate limits

#

changing IP addresses

fresh matrix
#

Ok

restive furnace
#

use lavalink or then just practice and make your own player

fresh matrix
#

Kk

carmine summit
#

HoW dO i MeRgE JaVaScRiPt AnD PyThOn AnD JdA??

silk chasm
#

changing IP addresses
@misty sigil i don't get it

restive furnace
#

HoW dO i MeRgE JaVaScRiPt AnD PyThOn AnD JdA??
@carmine summit dont merge them and #nostar

misty sigil
#

You need to change IP address to avoid rate limit

slender wagon
#

how do i send badges as a pic in embed?

restive furnace
#

cAnvas

silver lintel
#

canvas npm

slender wagon
#

yep i got that

silver lintel
slender wagon
#

yeah i'm using canvas but does it say anything about the bdages?

#

badges*

silver lintel
#

wdym badges?

misty sigil
#

Just check for userflags

slender wagon
#

like show the discord profile badges

misty sigil
#

And draw the badges

restive furnace
silver lintel
#

oh

#

ok

restive furnace
#

i recommend canvas' official docs

slender wagon
#

Just check for userflags
@misty sigil oh okay

silver lintel
#

that angri doggo is so cute

earnest phoenix
#

Awh doggooooo

carmine summit
#

he dead

earnest phoenix
#

Nuuuu

carmine summit
earnest phoenix
carmine summit
#

Can someone explain why am I getting weird errors???

slender wagon
#

does client.emit calls a action?

earnest phoenix
#

Emits an event

#

I cant find doggo :<

slender wagon
#

event my bad

carmine summit
#

plz help

#

pls help

silver lintel
#

whats incrementMaxListeners

carmine summit
#

I DONT KNOW

#

THATS WHY IM ASKING HERE

silver lintel
#

look at logs, it should have more info

honest perch
#

You need to change IP address to avoid rate limit
@misty sigil or just dont get banned

carmine summit
#

I DONT ******* KNOW WHY IS IT THERE

slender wagon
#

stop screaming in caps lol

silk chasm
#

@carmine summit did u have any variable named = maxlisteners

carmine summit
#

NO

silk chasm
#

wait which type of bot u making?

#

"listeners" a music bot..

eternal osprey
#

hey peeps

#

var ret = `Hey ${user.username}, you ran out of turns and lost $${bet.toLocaleString()}. The Correct location was:\n\n${displayBoard(user)}\n(Row: ${shipRow}, Column: ${shipCol})`;

#

how do i put this in a code block>

#

because they are variables

#

i can't just add ` 3x to them

#

or can i ?

tight plinth
#

\`

eternal osprey
#

`this`

#

hmm

#

\```test```

#

what

fluid basin
eternal osprey
#

`test`\

#

\test\

#

@tight plinth it doesn't work sadly

tight plinth
#

u don't get it

eternal osprey
#

nope

carmine summit
#

uh why are you using the library message collector class, there is a function to let the channel create that for you, https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=createMessageCollector @carmine summit
@fluid basin I dont get it

eternal osprey
#

anyone that can help me?

carmine summit
restive furnace
#

```js
some code
```

eternal osprey
#

i know

restive furnace
eternal osprey
#

ut i already have the variables inside ``

#

so

#

wait

#

````Create a profile first with ${prefix}create'````

#

omg

#
`Create a profile first with \`${prefix}create\``;```
#

how do i make this in a code block ffs

untold plover
#

Who?

eternal osprey
#

this

#

i can't put ` 4x

untold plover
#

im New at coding :D not know everything

#

Hey Can Make a Command For only ID?

silver lintel
#

@eternal osprey return "Create a profile first with `" + prefix + "create`"

untold plover
#

Hey Can Make a Command For only ID?
@untold plover

silver lintel
#

what library

carmine summit
#
            let collector = new Discord.MessageCollector(filter, {
                max: 1,
                time: 30000,
                errors: ['time']
            })
            console.log(collector)
            collector.on('collect', async message => {
                console.log('collected')
                let num = message.content
                console.log(num)
                if (isNaN(num)) return message.channel.send(`\`${num}\` is not a number.`)
                message.channel.send(await stats(uuid, num, ign))
            })```
TypeError: cannot read 'incrementMaxListeners' of undefined
untold plover
#

JavaScript

eternal osprey
untold plover
#

Hey Can Make a Command For only ID?
@untold plover can?

silver lintel
#

@eternal osprey that would

honest perch
#

what library

eternal osprey
#

this would work right?

untold plover
#

what library
@honest perch do u mean bot.js?

honest perch
#

no

earnest phoenix
#

You mean make a command only work for a specific ID or something @untold plover

honest perch
#

what library

#

like what discord lib

untold plover
#

You mean make a command only work for a specific ID or something @untold plover
@earnest phoenix ye

honest perch
untold plover
#

No has discord.js only using bot.js :D

eternal osprey
#
 return "Create a profile first with" + `${prefix}create`;```
#

this would be all good right?

earnest phoenix
#
if (<message>.author.id === "Your ID") {
// Your code
}```
honest perch
#

@untold plover please learn a bit of nodejs

untold plover
#

@untold plover please learn a bit of nodejs
@honest perch ONLY İ HAS FCİNG LOW ENGLİSH

honest perch
#

if you dont know what a lib is im concerned

eternal osprey
#
return `${user.username}` + "busted; Croupier wins," + `**${user.username}` + "loses**.";``` is this well coded?
#

or would it give problems?

silver lintel
#

there wont be any problems, but easier way

eternal osprey
#

okay

earnest phoenix
#

I don't see the point of using string concaters while using template literals

honest perch
#
return `${user.username} busted; Croupier wins, **${user.username} "loses**.`;
earnest phoenix
#
return `${user.username} busted; Croupier wins, **${user.username} loses**.`
``` this is what you could have done
honest perch
#

first

earnest phoenix
#

E

honest perch
#

also you forgot ;

silver lintel
#

no need

carmine summit
#

Can I ask something/???

earnest phoenix
#

Js doesn't care bruv

honest perch
#

yes but looks nicer

#

its supposed to be there

earnest phoenix
#

I always actually use them but yea

#

Can I ask something/???
@carmine summit thonkku

untold plover
#

if (<message>.author.id === "Your ID") { // Your code } do i Must copy paste mu Code to "Your Code"

#

delete Your Code Thing first

earnest phoenix
#

You have to put the code of the command that should work if the author's ID is your ID

honest perch
earnest phoenix
#

@carmine summit That's not how you create a message collector

carmine summit
#

how?

untold plover
#

You have to put the code of the command that should work if the author's ID is your ID
@earnest phoenix Code of Command like !say (example)

#

Rip eng

honest perch
#

get args

#

send the args

#

ez

carmine summit
#

BRUH

earnest phoenix
silver lintel
#
let content = JSON.parse(fs.readFileSync('../file.json', 'utf8'));
content[message.guild.id].muteRole = muteRole.id;
fs.writeFileSync('../file.json', JSON.stringify(content[message.guild.id].muteRole));

does this work? and how do i do it if muteRole doesnt already exist

tired panther
#

hi

earnest phoenix
#

@gilded plank what is prefix?

honest perch
#

its -

carmine summit
#

@earnest phoenix im still confused

tired panther
#

How can u show how many guilds your bot is on the top.gg page?

honest perch
#

@silver lintel dont use json

earnest phoenix
#

@carmine summit You have to create one like the one shown in the docs

let collector = message.channel.createMessageCollector(filter, {
max: 1,
time: 30000
});```
#

What Commands are there ( @gilded plank )

carmine summit
#

how do i put timeout???

earnest phoenix
#

how i can make a bot ?

#

how i can install js ?

silver lintel
earnest phoenix
#

pls help me

#

-prefix, -botinfo, -owners, -bots @earnest phoenix

sinful belfry
#

pls help me

earnest phoenix
#

work ?

#

thx @earnest phoenix

#

how do i put timeout???
@carmine summit Timeout is literally right there

#

pls help me

sinful belfry
#

ah got it

#

ty

earnest phoenix
#

np

carmine summit
#

no i mean

silver lintel
#

@silver lintel dont use json
@honest perch then what should I use?

carmine summit
#

message.channel.send('timeout')

earnest phoenix
#

Umm

honest perch
#

an actual database

silver lintel
#

Like?

#

I'm nokb

honest perch
#

mongodb

silver lintel
#

Noob

honest perch
#

redis

#

sql

earnest phoenix
#

MongoDB

silver lintel
#

I don't need to store that much data

fluid basin
#

redis is not really a db lol

#

just a KVS

earnest phoenix
#

I don't need to store that much data
@silver lintel Doesn't matter

silver lintel
#

Is setting up MongoDB easy? Can someone please send a guide

honest perch
tired panther
#

mongo db

earnest phoenix
#

https://google.com/?q="How+to+set+up+mongoDB%22

tired panther
#

is the best selection

#

here is the best link

#

to learn

flint yew
#

TypeError: message.error is not a function

#

anyone help

honest perch
#

code

flint yew
earnest phoenix
#

message.error is not a thing at all

hazy girder
#

how can i delete one thing from model in mongodb example:

id: guild.id,
autorole: role.id,
welcomechannel: channel.id

i want delete only autorole how can i?

earnest phoenix
#

Just use

message.say("Error message");``` as you're using commando @flint yew
flint yew
#

yea

#

commando i use

#

@earnest phoenix commando is ez for many things

earnest phoenix
#

Not for maintaining huge commands

flint yew
#

Just use

message.say("Error message");``` as you're using commando @flint yew

@earnest phoenix where that use

earnest phoenix
#

commando suck

flint yew
#

no

earnest phoenix
#

make ur own command handler

misty sigil
#

yes 4ce ur right

earnest phoenix
#

message.say = message.channel.send

#
return message.error("Error message");```
↓
```js
return message.say("Error message");```
#

message.say doesn't even make sense tho

#

ye

#

commando is only for nabs

misty sigil
#

message.say pepe_think

#

commando for noobs even my first bot had a command handler

earnest phoenix
#

me 2

#

i never and never use commando

carmine summit
#

@earnest phoenix how do i put message.channel.send('timeout')

earnest phoenix
#

@carmine summit wdym ?

#

just add it to ur function

#

<What exactly are you trying to do>

#

@earnest phoenix how u got vertified ?

carmine summit
#
            let collector = message.channel.createMessageCollector(filter, {
                max: 1,
                time: 30000,
                errors: ['time']
            })
            collector.on('collect', async message => {
                console.log('collected')
                let num = message.content
                console.log(num)
                if (isNaN(num)) return message.channel.send(`\`${num}\` is not a number.`)
                message.channel.send(await stats(uuid, num, ign))
            })```
#

where to put

earnest phoenix
#

wut

#

the heck

#

@earnest phoenix how u got vertified ?
@earnest phoenix By making a bot and reaching to 75+ guilds

#

And submitting to the verification

#
collector.on("end", () => {
message.channel.send("timeout")
}

@carmine summit ^^

#

By making a bot and reaching to 75+ guilds
@earnest phoenix now is 100+

#

sad

#

Well that sucks

flint yew
#

commando for noobs even my first bot had a command handler
@misty sigil k

eternal osprey
#

hey

earnest phoenix
#

How can I see how many rank it my bot

#

?

eternal osprey
#
  .setColor('#FF0000')
  .setTitle(`*Blackjack Casino Game!!*`)
  .setFooter("Command hosted for King's Family!")
  .setDescription()```
#

i have this

earnest phoenix
#

@earnest phoenix do command console.log(client.guilds.cache.size first

eternal osprey
earnest phoenix
#

if ur bot is 1000+

eternal osprey
#

so the mebed changes

earnest phoenix
#

then maybe u are in rank 1000+

eternal osprey
#

possible or not?

earnest phoenix
#

@earnest phoenix not

#

How can I see how many rank it my bot ( this dbl server )

#

idk

#

there are no rank in this server

#

@eternal osprey what are u trying to do ?

#

: /

#

where are you from?

#

????

flint yew
#

@earnest phoenix TypeError: message.error is not a function

#

wtf

earnest phoenix
#

it does effect anything with ur problem

#

message.say()

#

bruh

#

I literally said what to change it to

flint yew
#

i did

fluid orbit
#

is it possible to edit webhook message?

flint yew
#

ahh

earnest phoenix
#

THEN why is it message.error()

#

smh

#

Absolutely not

#

:))

flint yew
#

no

#

its only didnt edit it

#

in other line

earnest phoenix
#

ik

#

just kidding

#

Commando is just a command handler constructor

#

But doesn't even look that good

#

@earnest phoenix do u use commando

#

No

#

then

#

?

#

that mean it suck

#

cuz nobody use it

flint yew
#

Commando is just a command handler constructor
@earnest phoenix it have many things cool

earnest phoenix
#

for example ?

#

Not as feature rich as a native command handler

#

message.say() instead message.channel.send()
wow big change

#

i think the commando dev will call me cyber abuse

#

:))

#

Commando has to go through hundreds of constructors just to get a commando and execute it, but a native one can get it less than 1 second, just iterates through a collection

#

so when u use commando, it makes ur code slower

#

and the changes are not big

#

so what we have learn today is :
DONT USE COMMANDO

flint yew
#

nah

#

that wrong

#

use commando

earnest phoenix
#

nvm

#

it is ur bot

#

ur choice

#

not my bot

#

so u have all perms to do what ever u want

flint yew
#

yea

earnest phoenix
#

so keep use commando

flint yew
#

@earnest phoenix ik c# but for JavaScript basic that why use commando ez for me

earnest phoenix
#

and when ur bot grew

#

it is verry hard to change back

#

and u have to keep use commando

flint yew
#

yea

earnest phoenix
#

and it makes ur bot verry slow

flint yew
#

wdym very slow

earnest phoenix
#

like min is 100ms

#

from Voltrex master:
Commando has to go through hundreds of constructors just to get a commando and execute it, but a native one can get it less than 1 second, just iterates through a collection

flint yew
#

hmm

fickle arch
#

any good server hosting for bot ?

silver lintel
earnest phoenix
#

any good server hosting for bot ?
@fickle arch
Affordable hosting providers:
• OVH Starting at $3.35/mo for 1 core, 2GB RAM, 20GB SSD
• DigitalOcean Starting at $5/mo for 1 core, 1GB RAM, 25GB SSD
• Linode Starting at $5/mo for 1 core, 1GB RAM, 25GB SSD
• Vultr Starting at $2.50/mo for 1 core, 512MB RAM, 10GB SSD
• AWS Lightsail Starting at $3.50/mo (first month free) for 1 core, 512MB RAM, 20GB SSD
• Time4VPS Starting at €3.99/month for 1 core, 2GB RAM, 20GB SSD
• VIRMACH Full Windows and Linux Desktop VPS starting at $7/mo and $1/mo respectively
• Netcup Starting at €2.62/mo for 1 core, 2GB RAM, 20GB SSD
• GitHub education Free credit and other offers for students
• Microsoft students Free credit for students
• Google Cloud free tier

flint yew
#

vps

earnest phoenix
#

??

#

they are all of the vps hosting providers

fickle arch
#

It is possible to host it on your own, with server.

untold plover
#

Can anyone Give me Reboot Command? :d (on the dm pls)

silver lintel
#

Don't expect to be spoon fed, you always ask can someone give me thjs

still merlin
#

If I was going to store some config stuff for my bot, I would be using something like this

[
   "Test! ", {
        
      "id": "whatever a id is, or something"
    },
  "Nerds",  {
      "lmao": "lmao"
    }
  ]``` How would I access something from "Nerds" in indexjs?

`**filename**.Nerds.lmao`?
#

Also @untold plover use client.destroy, use a .then to log into your client and lock it to your id only

earnest phoenix
#

No

#

Nothing after client.destroy() gets executed

still merlin
#

o

#

That explains why my restart command never worked

earnest phoenix
#

If I was going to store some config stuff for my bot, I would be using something like this

[
   "Test! ", {
        
      "id": "whatever a id is, or something"
    },
  "Nerds",  {
      "lmao": "lmao"
    }
  ]``` How would I access something from "Nerds" in indexjs?

`**filename**.Nerds.lmao`?

@still merlin That syntax is incorrect

still merlin
#

thanks

earnest phoenix
#

Or not

#

It's supposed to be an array?

silver lintel
#

You did Json formatting which means you probably wanted it to be a Json, but this is an array

earnest phoenix
#

If so then

Array[3]["lmao"]```
#

If it's actually supposed to be an array

fickle arch
#

Don't expect to be spoon fed, you always ask can someone give me thjs
@silver lintel how about we change the question to, could you teach me how to make it 🤔

#

Ah, yes teach me I use module.exports on my old bot and don't know how to change it to exports.run

earnest phoenix
#

module.exports just exports things you pass it through for a file

woven gale
#

+help

earnest phoenix
#

For example, here i have this file called example.js and this is what it has

module.exports.obj = {
bruh: "moment"
};``` and guess what happens when i require it as
```js
require("./example.js");```, it returns this
```js
{
obj: {
bruh: "moment"
}
}```
#

@fickle arch There

fickle arch
#

hm

silver lintel
#

I want to make a command where the user has to guess a number and using message collectors. How do I find the number of times it takes for the user to guess the number?

earnest phoenix
#

you may have to make your own "collector" for that

fiery hamlet
#

how do i host a discord bot for free

silver lintel
#

Check pins

fiery hamlet
#

ok

earnest phoenix
#

or not

fiery hamlet
#

can someone send me a glitch bot, i made one for 2 and a half hours and found out that it dosent work

earnest phoenix
#

no

fickle arch
#

I tried to do

  name: "play",   
  cooldown: 3,
  aliases: ["p"],
  description: "Plays audio from YouTube or Soundcloud",
  async execute(message, args) {
    const { channel } = message.member.voice;

replacing module.exports with exports.run

summer sandal
#

Anyone know how to keep my bot up all the time?

fiery hamlet
#

i use js but im not that experienced with scripting yet

#

yes

untold plover
#

Anyone know how to keep my bot up all the time?
@summer sandal me

fickle arch
#

Anyone know how to keep my bot up all the time?
@summer sandal server hosting

fiery hamlet
#

theirs a discord bot

summer sandal
#

@untold plover Can u teach me how?

untold plover
#

Yep

restive furnace
#

pins

earnest phoenix
silver lintel
#

Mhm okay

fiery hamlet
#

can someone make me a discord bot

silver lintel
#

No

earnest phoenix
#

if you pay me

fickle arch
#

ooo robux

#

😆

fiery hamlet
#

998-999

silver lintel
#

obly 1k

#

No

zenith terrace
#

£1000? Deal KEKW

fickle arch
#

A bot without script, okay.

earnest phoenix
#

9 bobux, deal

fiery hamlet
#

ok

#

deal

#

lol

carmine summit
#

can someone help me?

earnest phoenix
fickle arch
carmine summit
#
prntIn(str)```
Doesn't work
fickle arch
silver lintel
#

Lool

restive furnace
#
let str = "Hello World!";
console.log(str);```does
fickle arch
#

wait, how you command to update npm package ?

earnest phoenix
#

npm i

fickle arch
#

I mean node

carmine summit
#
public class Bot {

    public static void main(String[] args) {

        int number = 10;

        console.log(number);
    }

}
```Doesn't work
earnest phoenix
#

what

restive furnace
fickle arch
#

ah

earnest phoenix
#

wait, how you command to update npm package ?
I mean node
learn how to ask your questions properly

fickle arch
#

learn how to ask your questions properly
@earnest phoenix my bad

summer sandal
#

Anyone here use Visual Studio code with discord.js here?

fickle arch
#

M

carmine summit
restive furnace
#
public class Bot {

    public static void main(String[] args) {

        int number = 10;

        console.log(int)
    }

}
```Doesn't work

@carmine summit java public class Bot { public static void Main(String[] args) { int num = 36; System.out.println(num); } }does

carmine summit
#
int number = 10
let sum = number + number
print(sum)
```Doesn't work
untold plover
#

How do i do that?;
I already did playing status on my bot but i want change it every 5-10 seconds

thin turret
#

That looks like 3 languages in one block to me lol

carmine summit
#

How do i do that?;
I already did playing status on my bot but i want change it every 5-10 seconds
@untold plover thats API abuse lol

earnest phoenix
#

the minimum is every 15 seconds, otherwise you're going to hit a ratelimit

#

also in what language

untold plover
#

JavaScript

earnest phoenix
#

use setInterval

untold plover
#

1 min

restive furnace
#
int number = 10
let sum = number + number
print(sum)
```Doesn't work

@carmine summit python number = 10 sum = num + num print(sum)does

#

discord has bad python formatting cough

carmine summit
#

i tried it in node still doesn't work

restive furnace
#

u can't declare int in node

carmine summit
#

i quit code

#

its too hard

earnest phoenix
#

stop trolling

thin turret
#

What language was that supposed to be

earnest phoenix
#

you're annoying

untold plover
#

How do i Make it change every 15 seconds;

const moment = require('moment');
const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');

var prefix = ayarlar.prefix;

module.exports = client => {
  console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] Bot Dosyalari Korunuyor`);
  console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}]  Koruma Calisiyor.`);
  console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] Sunucu Aktif!`);
  client.user.setActivity(`Tyardım | Tdavet 🔥 v0.6.0`, {
  type: "PLAYING",})
  console.log(`Hazir Sunucuyu Baslatin...`);
  console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] T.`);
  console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] Sunucu Aktif!`);
				  
				  
};
#

Lol

carmine summit
#

lol

earnest phoenix
#

i told you to use setInterval

thin turret
#

My dude had java javascript and python all in one at first

carmine summit
#

My dude had java javascript and python all in one at first
@thin turret include java lol

untold plover
#

i told you to use setInterval
@earnest phoenix how the fc

earnest phoenix
carmine summit
#

setTimeout(function(){ alert("Hello"); }, 3000);

thin turret
#

Set interval runs a function every x ms

carmine summit
#
setTimeout(function(){
// do stuff every 3 seconds
}, 3000);
thin turret
#

setInterval(<Function>, ms)

untold plover
#

Uh

#

Where i will add?

#

:D

restive furnace
#

you can do arrow fn too () => console.log("hi")

earnest phoenix
#

take a guess

carmine summit
#

outside the client.on

#

outside everything really

#

lol

fiery hamlet
#

how do i make a loop bot status

earnest phoenix
#

read above

fiery hamlet
#

?

earnest phoenix
#

the person above you asked the same question

#

ergo, the same answer

carmine summit
#

how do i make a loop bot status
@fiery hamlet can you even generate a random word???

thin turret
#

😳

fiery hamlet
#

idk

carmine summit
#

thats what i thought

restive furnace
#

can you guys learn even basics of basic before asking here, thanks.

thin turret
#

I dislike the idea of people with no language exp just diving into bot making

#

Like what did they expect

#

God to guide them?

fiery hamlet
#

yes

#

lol

restive furnace
fiery hamlet
#

i dont know how to loop bot status for java script

#

i can for py

#

python

carmine summit
#

I dislike the idea of people with no language exp just diving into bot making
@thin turret me

#

lol

fiery hamlet
#
@test_bot.event
async def on_ready():
    print('Logged in as')
    print(test_bot.user.name)
    print(test_bot.user.id)
    print('------')
    await change_playing()


@test_bot.event
async def change_playing():
    threading.Timer(10, change_playing).start()
    await test_bot.change_presence(game=discord.Game(name='Currently on ' + str(len(test_bot.servers)) +
                                                          ' servers'))
    threading.Timer(10, change_playing).start()
    await test_bot.change_presence(game=discord.Game(name='Say test.help'))```
carmine summit
#

but I learned on my way

fiery hamlet
#

that is how u do it for python

silver lintel
#

Can you even understand what's happening in that code?

fluid basin
#

I dislike the idea of people with no language exp just diving into bot making
@thin turret theres a diff between not knowing the lang and not knowing a single lang

fiery hamlet
#

yes

silver lintel
#

Where did you copy and paste it from

thin turret
#

@thin turret theres a diff between not knowing the lang and not knowing a single lang
There be homies who dont even know if statements

fiery hamlet
#

idk

#

ur mum

#

this lol

silver lintel
#

-_-

thin turret
#

So you just copied it?

hasty mulch
#

Yeah, Overstack is known to provide outdated code

fluid basin
#

tbh you could ask on stackoverflow

hasty mulch
#

Andddd time to do this

fiery hamlet
#

well how do i do it

hasty mulch
#

@split hazel @coral trellis

fluid basin
#

but expect downvotes

fiery hamlet
#

i can script but not that good, im new to js

#

i just wanna know how i loop the status

silver lintel
#

What's the difference between Number() and ParseInt()?

fiery hamlet
#

porque?

fluid basin
#

What's the difference between Number() and ParseInt()?
you have google for that

fiery hamlet
#

ok

thin turret
#

This mans post got destroyed over random picture sending

fiery hamlet
#

Konnichiwo, watashinanamaeha Jofudesu. Sutetasu o roopu saru hoho om oshietekudasai

#

not good at japanese

thin turret
#

Especially in english

summer sandal
#

I coded a bot on Visual Studio code but cannot find a way to keep it on when my app closes any helps pls

thin turret
#

おはよう

fiery hamlet
#

use a bat file for it

#

so it stays online and on

summer sandal
#

@fiery hamlet Whats a bat file?

fiery hamlet
#

batch

summer sandal
#

sorry i am new to coding

thin turret
#

@summer sandal thats where bot hosting could help

fiery hamlet
#

same here

summer sandal
#

@thin turret I have no clue how to do it lol

fiery hamlet
#
node nameofbot.js
pause```
thin turret
#

Google search

fiery hamlet
#

u get notepad ++

fluid basin
#

I coded a bot on Visual Studio code but cannot find a way to keep it on when my app closes any helps pls
@summer sandal a bot is just like any other program, once you close it, it stops running

fiery hamlet
#

then u make it so u can see the exstension file names

#

make it a txt file

#

paste @echo off //not cap sensitive node nameofbot.js pause

fluid basin
#

I mean, what did you expect

#

just keep Visual Studio code open

fiery hamlet
#

then ctrl shift s

summer sandal
#

just keep Visual Studio code open
@fluid basin I sometimes have to sleep too lol

fiery hamlet
#

it will say name.txt

summer sandal
#

so pc will turn off

fiery hamlet
#

then change it to bat

fluid basin
#

then keep ur pc on

summer sandal
#

@fluid basin lol

fluid basin
#

if you cant

thin turret
#

Or host it

fluid basin
#

get a vps

#

a vps will run your bot program for you 24/7

earnest phoenix
#

wow rlly

#

what is that

fluid basin
#

wow rlly
then you have bigger problems

#

find a better provider then

earnest phoenix
#

LoL

fluid basin
#

I sometimes have to sleep too lol
I mean, you sleeping has nothing to do with your pc sleeping mmulu

hasty mulch
#

PCs nowadays are built to be left on non-stop. Only to be turned off for upgrades

earnest phoenix
#

power bill

#

it's more worth it to rent a vps

fluid basin
#

network bill

earnest phoenix
#

that too

#

and network downtime

fluid basin
#

which is also why vps isnt free

earnest phoenix
#

hey anyone knows how i can install discord.js v11?

fiery hamlet
#

how do i make status change every 10 seconds

#
fluid basin
#

@earnest phoenix use v12 unless you have a very good reason not to

earnest phoenix
#

i told you to read above when you asked your initial question but ok

#

10 seconds is way too often, you'll hit a ratelimit

#

15 seconds is the minimum

#

use setInterval

#

i was accustomed to develop on v11

hasty mulch
#

@earnest phoenix If he asks again, just ping a Moderator

fluid basin
#

v11 is likely to not work after oct 7th

earnest phoenix
#

^

fluid basin
#

so I really recommend you to upgrade

earnest phoenix
#

:\ ok

#

domain change + intents change

#

also api v6 is going to be deprecated very soon

fluid basin
#

how do i make status change every 10 seconds
also a tip, if you change your status every 10 seconds, your bot will be denied if you apply on DBL/top.gg

carmine summit
#

When you forked a v11 code and run it on v12 KEKlaugh

fiery hamlet
#

also a tip, if you change your status every 10 seconds, your bot will be denied if you apply on DBL/top.gg
oof why would it get denied?

fluid basin
#

bots are not allowed to change status too frequently

#

told you already

pine aspen
#

Hey

#

How could I make this. Or can someone let me know the name. I'm not sure how it's called.

#

wait

fluid basin
#

what? you mean a bot?

pine aspen
#

The link with an embed.

#

Like above ^^.

fluid basin
#

uh forgot what it was called

sudden geyser
#

So you want to make the link preview.

pine aspen
#

Yes.

fluid basin
#

ah yes meta tags

pine aspen
#

That's it.

delicate zephyr
#

use the meta tags:

og:title
og:description
og:image
og:thumbnail
pine aspen
#

Thanks!

earnest phoenix
#

@pine aspen ^^

pine aspen
#

I should put this in my dashboard files?

delicate zephyr
#

ye

pine aspen
#

Thanks!

delicate zephyr
#

@earnest phoenix He wanted the meta tags lol

earnest phoenix
#

yes it has

delicate zephyr
#

@pine aspen just put it on any page you can link to

#

@earnest phoenix doing it yourself > using something to do it for you

pine aspen
#

Yeah, I got it.

sudden geyser
pine aspen
#

Do I need a domain for meta tags?

cinder patio
#

I mean, a domain is pretty much required to have a dashboard, or a website, otherwise the address to the site is gonna be an IP address

pine aspen
#

right.

#

Ty

quartz kindle
#

for the meta tags to work you likely dont need a domain tho

#

thats basically it

earnest phoenix
#

how long it takes u make that :))

quartz kindle
#

make what

earnest phoenix
#

the photo

#

is that pain ?

quartz kindle
#

its lightshot

delicate shore
#

Why does this happen

karmic storm
#

hi i am trying to make ad and bad message filter i have quesiton how can i store message and username like this
User: @karmic storm
Message: Hello World

earnest phoenix
#

wdym ?

#

i dont understand

#

nope

delicate shore
#

Nvm

earnest phoenix
#

for example snipe

delicate shore
#

I thought he said every message

#

My bad

cinder patio
#

You can use a Map, use the user id's as the key, the message as the value

fluid basin
#

uh that only works if you only have 1 msg per user

delicate shore
#

Any idea ?

sudden geyser
#

429 means too many requests, meaning you got rate limited.

faint prism
#

The screenshot?

fluid basin
#

plus it only has been 10 messages, dont repost

#

we see them

earnest phoenix
#

Help me plis

sudden geyser
#

What version of Discord.js are you using? It looks correct.

earnest phoenix
#

v11

faint prism
#

Oof

#

V11 is deprecated. Don't use it

sudden geyser
#

You should migrate to v12. It'll also fix your current problem.

earnest phoenix
#

But I would have to do it all over again, right?

faint prism
#

No, just follow the changelog and you'd have to update just the breaking changes

#

The other stuff would work

earnest phoenix
#

Ah ok ok thanks

willow yoke
#

Help me.
I am poor at English because of Japanese.
I use discord.js.
message.guild.members only gets a part of the whole

earnest phoenix
#

I'll make a backup of v11 just in case

sudden geyser
#

version control is your friend

#

@willow yoke .members returns a manager. To get the data, you need to access the .cache property.

maiden mauve
willow yoke
#

I also tried cache

maiden mauve
#

this isn't fair

#

im coding a super nintendo

#

😭

cinder patio
#

cache doesn't include offline members, also, some members may not be cached if they haven't been interacting with the bot if the server is very big

maiden mauve
#

oh wait

cinder patio
#

I believe the first 200 members get cached

maiden mauve
#

the value can be 1024 chars i think

sudden geyser
#

MainOx what are you trying to do in the first place? More than just look in a collection?

#

Are you trying to get everyone, including offline members like Feud said?

willow yoke
#

Of the 6 people on the server and 3 people online, it was me and the bot that I got with cache.

sudden geyser
#

Do you have guild member intents enabled

willow yoke
#

I want to make a list of members using npm's discord-reaction-controller.

#

Guild member intent?

#

new discorod.Client(here?)

worn badge
#

Can anyone help me, I'm trying to edit a message by it's ID on discord.js v12.

quartz kindle
#

fetch it first

willow yoke
#

I've never heard of editing by ID
Sorry

worn badge
#

yeah so i do:
client.channels.cache.get('CHANNEL ID').messages.fetch('MESSAGE ID') and then what do I do?

fluid basin
#

its a promise, await it

midnight blaze
#

anyone here knows about bootcamps such as codesmith?

willow yoke
#

I don't know

worn badge
#

so uhm this would work

        .then(message => message.edit('owo'))
        .catch(console.error);```
#

ayy it worked!

midnight blaze
#

yes it worked? Why do you ask if it works xd

hazy girder
#

how can i delete one thing from a model in mongodb?
for example:

guild: 262826
channel: 739373
role: 738362

i want delete only role how can i ?

fluid basin
#

$unset

final stone
#

Does anyone have a suggestion for initilizing a keyv database in index.js and then using it in other files without causing an Error: This socket has been ended by the other party

Basically taking this

  const servers = new Keyv(`mysql://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:3306/${process.env.DB_NAME}`)

And using it in other files

Node - Discord.js

#

I would assume it would be module.exports but I need to get this working properly KEKW

fluid basin
#

using it in other files
don't reinitialise the server, but instead pass it around

final stone
#

Yeah, that was a mistake on my end

fluid basin
#
// index.js
const module = require('./module');
const servers = /* code here */;
module(servers);

// module.js
module.exports = (server) => {
  /* some code here */
}```
#

for example

final stone
#

Oh, thanks, that fixes basically all my problems in non-command files, however in command files im using commando, is that around the same idea?

cinder patio
#

You can attach the server to your client

fluid basin
#

add it in the constructor

#

like this

#
module.exports = class DebugVerifyCommand extends Command {
  constructor(client, servers) {
    super(client, /* code */);
    this.servers = servers // or something similar
  }
}
#

then you can invoke it like this

#
new DebugVerifyCommand(client, servers);```
final stone
#

Oh, yeah its morning and im tired I guess lol. Thanks a bunch. bloblul

#

Im gonna go test some changes on it now, might msg back when I get it workin 👍

earnest phoenix
#

@maiden mauve message limits

#

you can't send bigger than 256 characters in titles of embeds

#

1024 limit for descriptions

#

@sudden geyser I already changed it to V12, I have an error that I do not know how to solve is this

#

@sudden geyser I already changed it to V12, I have an error that I do not know how to solve is this
@earnest phoenix message.guild.ban LMFAO dogekek

#

Hmmm

pale vessel
#

looks right

midnight blaze
#

ban guilds

pale vessel
#

what are you lmfaoing

sudden geyser
#

It means .guild does not have a method called ban()

earnest phoenix
#

what are you lmfaoing
@pale vessel he's trying to ban a guild lol

sudden geyser
#

They're probably trying to ban a user.

#

You'd do <GuildMember>.ban I think

earnest phoenix
#

GuildMember.ban

#

What fu-

pale vessel
#

oh

#

wait a minute

#

looks like abuse

final stone
#

KEKW time to ban guilds, also massban bot?

earnest phoenix
final stone
sudden geyser
#

yeah speaking of which

#

why do you want to ban a set of users

final stone
pale vessel
#

and why toString() when it's already a string

earnest phoenix
#

message.GuildMember.ban(id.toString());?

pale vessel
#

not quite

blazing portal
#
earnest phoenix
#

It is a forceban of my personal database

midnight blaze
#

message.guild.member(message.mentions.users.first()).ban

final stone
#

one day people will read the docs waitWhat and what KEKW

maiden mauve
#

@earnest phoenix yeah thanks noticed that ^_^ just had to reformat my embed

midnight blaze
#
if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("Invalid Permissions")
let User = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0])
if (!User) return message.channel.send("Invalid User")
if (User.hasPermission("BAN_MEMBERS")) return message.reply("Invalid Permissions")
let banReason = args.join(" ").slice(22);
if (!banReason) {
  banReason = "None"
}

User.ban({reason: banReason})
blazing portal
#

confusing to name the GuildMember object User when User is something else, but otherwise it should work

#

That code part doesn't account for different name lengths though, if you get the reason from character 22 onwards.

silk chasm
#

.

pale vessel
#

how about mentions.members.first()

earnest phoenix
#

<Message>.mentions.members.first()

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

uhh

#

the fuck

#

_client.GetGuild(id:

#

you aren't closing it

sage bobcat
#

One message removed from a suspended account.

serene cobalt
#

I'm looking to get some prs for hacktober, if anyone has a public python bot repo, and wants some help

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.

errant jetty
#

# Discord Response Bot
Needed: py -version -m pip install discord, Discord App/Bot

import discord
import time
from discord.ext import commands


class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged in as')
        print(self.user.name)
        print(self.user.id)
        print('------')

    async def on_message(self, message):

        if message.author.id == self.user.id:
            return

        if message.content.startswith('command here'):
            await message.channel.send('response here'.format(message))
        elif message.content.startswith('second command here'):
            await message.channel.send('second response here'.format(message))


client = MyClient()
client.run('token here')```
sage bobcat
#

One message removed from a suspended account.

serene cobalt
#

What

errant jetty
#

yes

serene cobalt
#

explain yourself

errant jetty
#

how

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

errant jetty
#

yes

sage bobcat
#

One message removed from a suspended account.

errant jetty
#

dont worry bout it

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

yes

south cove
#

Hey anyone here know how to convert user object to user id. DiscordPy here

sudden geyser
#

.id?

serene cobalt
#

^

south cove
#

Yes I need .Id from tag

#

@south cove to id

errant jetty
#

249016220987293697

south cove
#

.id?
@sudden geyser how to I parse the userid

serene cobalt
#

xd

south cove
#

No I'm working on economy system

sudden geyser
#

So like, you want the ID from mentioning someone or something

serene cobalt
#

Here's the trick though

south cove
#

Mes

#

Yes

serene cobalt
#

check the docs

south cove
#

I did multiple times

serene cobalt
#

returns their id as an int

sudden geyser
south cove
#

If I'm not wrong

sudden geyser
#

So you're trying to get the client user's ID this time

south cove
#

No I wwanr to send tokens

#

For example

#

Send @kits $1

#

So in my SQL db, I have users saved as Id'#

#

Id type

#

So Im struggling with this

serene cobalt
#

in the command you can specify to take the id of the first mentioned user iirc

#

like, in the args

south cove
#

You can do that?

restive night
#

Hi @quartz kindle, may I ask about your library (discord.js-light) via DM?

serene cobalt
#

@south cove pretty sure you can

south cove
#

Do you by any chance know the syntax

serene cobalt
#

lemmie go find it

south cove
#

Aight I'll also look

serene cobalt
#

varName: discord.Member = None

#

try that

south cove
#

@bot.command(name="id") async def id_(ctx, user: discord.User): await ctx.send(user.id)

#

Found this

quartz kindle
#

@restive night sure

serene cobalt
#

then varName.id for their id

south cove
#

Okay I'll try it

#

Thanks man

earnest phoenix
#

what is the "authorization header" in DSL vote webhooks
idk wut headers are i'm not a web developer

cinder patio
#

It's... the authorization header

earnest phoenix
#

what are headers

cinder patio
#

you check if it contains the password you set in the webhook settings

earnest phoenix
#

i can see you linking me an MDN page on headers but that's ok

cinder patio
#

if it does not, then the request is not coming from DBL

earnest phoenix
#

every request has its headers

cinder patio
#

Mainly info about the request

earnest phoenix
#

@earnest phoenix i searched req.headers on express.js docs but there was nothing

#

if it does not, then the request is not coming from DBL
@cinder patio *DSL

cinder patio
#

req.header(headerName);

#

to get a header

earnest phoenix
#

🏝️

#

;;help

#

;help

#

//help

#

/help

#

s!help

#

p!help

#

@coral trellis

coral trellis
earnest phoenix
#
if (request.header("Request-Authorization") != process.env.DSL_WEBHOOK_PASS) return response.send("stop");

is this a good idea (discord text wrap put the return on the next line)

#

it didn't your screen just smol

#

if the header is named like that, sure

#

smh

#

dsl just said it will be sent in th authorization header

#

MDN said authorization header is of request type

#

i'm testing it rn

#

i'd just return a 404 though just in case someone were to try to find the endpoint and exploit/spam the living fuck out of it

#

@earnest phoenix made a few changes and now it allows event he DSL test webhook through
does DSL send the authorization header too in the test webhook?

#

i don't know

#

log the request headers and find out

#

ok

#

@earnest phoenix bruh it was undefined
why you should learn to read MDN

#

@earnest phoenix it works ||kthnxbai||

modest smelt
#

hey can i get some help?

#
@client.event
async def on_guild_join(guild):
    #loads json file to dictionary
    with open("filename.json", "r") as f:
        guildInfo = json.load(f)

    guildInfo[int(guild.id)] = guild.text_channels[0] #sets key to guilds id and value to top textchannel
    
    #writes dictionary to json file
    with open("filename.json", "w") as f:
        json.dump(guildInfo, f)

#allows server members to set channel for welcome messages to send to    
@client.command()
async def welcomeChannel(ctx):
    with open("filename.json", "r") as f:
        guildInfo = json.load(f)

    guildInfo[int(ctx.message.guild.id)] = ctx.message.channel.id #sets channel to send message to as the channel the command was sent to

    with open("filename.json", "w") as f:
        json.dump(guildInfo, f)
    
    await ctx.send(f"I have set the welcome channel!")

@client.event
async def on_member_join(member):
    await member.send(f'Hope you like the server! {member.mention} make sure to check out the rules!')
    embed = discord.Embed(title = "Welcome", description = f"{member.mention} Just Joined \nWelcome to our server :partying_face: \nStay Here and Buy Some Discord Bots! \nYou are the {len(list(member.guild.members))} member!")
    embed.timestamp = datetime.datetime.utcnow()
    embed.set_footer(text = f"{member.guild}", icon_url = f"{member.guild.icon_url}")
    embed.set_author(name = f"{member.name}", icon_url = f"{member.avatar_url}")
    embed.set_thumbnail(url=f"{member.avatar_url}")
    with open("filename.json", "r") as f:
        guildInfo = json.load(f)
    


    channel = guildInfo[str(member.guild.id)]

    await channel.send(embed = embed)
```my code. error: ```  File "actual code.py", line 125, in on_member_join
    await channel.send(embed = embed)
AttributeError: 'int' object has no attribute 'send'```
earnest phoenix
#

BRUH

modest smelt
#

?

earnest phoenix
#

ask shivaco

#

hes PY

modest smelt
#

i will ask him l8er

#

he isn't online

earnest phoenix
#

then no idea

modest smelt
#

is there no PY people here?

graceful drift
modest smelt
#

oh

graceful drift
#

or client.get_channel

modest smelt
#

and set that to channel, right?

graceful drift
#

correct, you're currently defining channel as an integer so I assume that is returning a channel id instead of a channel object

modest smelt
graceful drift
#

yes, that should work

modest smelt
#

ok

final stone
#

It should be a simple fix, however I can't get it working. All I need is to have the keyv database usable in all other files if required. And module.exports seems to not work very well at that. (or im just stupid KEKW )

vernal rivet
#

@final stone it's saying that servers.get is not a function. Which means you are treating a property like a function. Double check your types, and make sure you are passing the correct type through when declaring your variable.

modest smelt
#
    channel = client.get_channel(guildInfo[str(member.guild.id)])
KeyError: '747929495427874836'
```@graceful drift
#

oh w8 crap

graceful drift
#

huh

autumn perch
#

Hello

vernal rivet
#

Hi

graceful drift
autumn perch
#

can you help me

graceful drift
#

Sorry but I'm confused on what you're trying to do, are you trying to send a message to a server using only server id @modest smelt

modest smelt
#

so basicall

#

i am letting the user give me an input of a channel

#

where i will be sending a welcome message

graceful drift
#

ohhh

modest smelt
#

i store the dict as {guild.id:channel.id}

graceful drift
#

ah alright, makes sense

modest smelt
#

yes

autumn perch
#

can you help me please

graceful drift
autumn perch
graceful drift
#

@autumn perch just say your question.

modest smelt
#

@autumn perch be patient

vernal rivet
#

Don't ask to ask, just ask

modest smelt
#

@graceful drift i think i already tried that

graceful drift
#

hm

modest smelt
#

w8

#

do u mean python channel = client.get_channel(guildInfo.get[str(member.guild.id)])?

#

i haven't tried that

graceful drift
#

if it returns a channel id, then it should work