#development

1 messages · Page 1619 of 1

pale vessel
#

specify the radix

#

e.g. 16

cinder patio
#

that's a required parameter?

snow urchin
#

no

#

so idk why its screamin at me 😄

ebon rock
#

How do I create a special page for my robot?

#

Possible tick-reaction code

safe creek
#

tick-reaction?

edgy tapir
#

why even if a member has a nickname the bot says no nickname?

 .addField(":3656_NitroBoost: `-` **Nickname:**", `${target.nickname || "Fara Nickname"}`,inline, true)
cinder patio
#

Show us how you define target

edgy tapir
#
                    let target = message.mentions.users.first() || message.author;

cinder patio
#

because it's a User object

#

users don't have nicknames, only GuildMembers do

#

User is a discord account, GuildMember represents a user in a specific guild

edgy tapir
#

Oh, ok

#

so if i do guild.member.cache.get(args[0]) it should work ?

pale vessel
#

just change mentions.users to mentions.members and message.author to message.member

onyx hare
#

how can i get this to tagg the user without this small problem (Error: <@undefined>) ive tried adding .id after user but get Cannot get id of undefined anyhelp will be helpful ive been stressing over a show warnings command and this tips the triggering of more stress <:>

    const user = message.mentions.members.first()
    if(!user) {
        return message.channel.send("Please Mention The Person You Are **Reminding**")
        }

    message.channel.send(`<@${message.mentions.user}>`);
    message.channel.send(`Follow The Rules, Rules Channel: [#800870206427627541](/guild/264445053596991498/channel/800870206427627541/)`);
pale vessel
#

message.channel.send(user.toString())?

onyx hare
#

i didnt think of that tbh

pale vessel
#

if you .toString() a user, it gives you the mention

onyx hare
#

ty

edgy tapir
#
 const status = {
                      online: "Online",
                      idle: "Idle",
                      dnd: "Do Not Disturb",
                      offline: "Offline"
                  }

.
.
.


.addField(
                ":2713_Microphone: `-` **Status**",
                `${status[target.presence.status]}`,
                inline,
                true
              )

any idea why it says Offline everytime ?

marsh oar
#

plz help me

safe creek
#

read the errors

pale vessel
viral mortar
#

lol

viral mortar
safe creek
#

more text in general CouncilLaugh

onyx hare
#

This is my other stress i dont get it completely (quick.db) but reading the website about ti i kinda know wehat its doing but cant get it to retrieve

let reason = db.get(`warnings_${message.guild.id}_${user.id}_${reason}`)
    
    if(reason === null) reason = 0;
    
    message.channel.send(`${user} Has Been Warned For The Following Reasons\n ${reason} \nCrystal Warning List For ${message.mention.member}!`)

err
ReferenceError: Cannot access 'reason' before initialization ik it means not defined but it looks defined for me or do i need to add an extra line of code

edgy tapir
#
                    let member = message.mentions.users.first() || message.author;

.addField(":wrench: `-` **Roluri**", `${member.roles.filter(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).join(" **|** ") || "Niciun rol"}`)

Cannot read property 'filter' of undefined

lament rock
edgy tapir
#

oh yes

#

Ty

snow urchin
lament rock
#

at the end of the class Logger block, you need a parenthesis method call
()

#

new (class Logger {...})()

silent cloud
#

Heyyo guys

#

My friend have this error and this is him code part

#

I didn't see anything bad in code

pale vessel
#

Unlimited amandathink

silent cloud
#

?

lament rock
#

what is the type of let buffer

#

aka the return type of AlexClient.image.bad

silent cloud
#

It should give that

lament rock
#

Yes but what is it. Is it a string, is it actually a Buffer or what

silent cloud
#

Buffer

pale vessel
#

Try logging it

lament rock
#

Are you sure? Because the error says it isn't a buffer

silent cloud
#

Yea, on him pc it works perfectly

#

But on hosting he have issue

lament rock
#

oh boy. Native dependencies

pale vessel
lament rock
#

oh lol

silent cloud
#

Oh wtf

safe creek
#

wow

silent cloud
#

._.

quartz kindle
#

tell him to read what includes does lol

pale vessel
quartz kindle
#

^

pale vessel
lament rock
#

That seems so easy to fix

#

wtf

silent cloud
#

Ty

safe creek
#

what is discord.js light?

cinder patio
#

discord.js but you can disable caches

safe creek
#

oh ok

onyx hare
#

my messageDelete.js doesnt show deleted messages anymore @_@

gusty ivy
safe creek
#

pog

onyx hare
boreal iron
#

Your catching mentions.members and if found then catching again but this time mentions.users

#

message.mentions.user is of course undefined, the property doesn’t exist

#

catch user = ... mentions.users.first()
and return it’s id if found - user.id

boreal iron
onyx hare
boreal iron
#

Hmm Discord doesn’t let me jump to the answer for whatever reason

cinder patio
#
let reason = db.get(`warnings_${message.guild.id}_${user.id}_${reason}`)

You are using reason before it's fully initialized, same thing as

let l = l + 1;

does that make sense?

onyx hare
#

kinda from what i got breaking down online not defined "reason" so idk whats what

cinder patio
#

...

#
let reason = // Here you start defining the "reason" variable
db.get(`warnings_${message.guild.id}_${user.id}_${reason}`) 
// Here you are trying to use the same variable that's getting initialized (reason) In order to use the variable it must be alrady intialized. 

The error is so straight-forward that I don't know how to explain it in other words

#

You are basically doing this

let a = a + 5

How can a be equal to a + 5 if a hasn't been defined before?

slender thistle
#
let reason = "I exist!";
console.log(reason); // correct
console.log(reason);
let reason = "I exist!"; // incorrect
opal plank
#

and this is why i tell people not to use var in their code mmulu

cinder patio
#

ew

#

hoisting

boreal iron
#

Well that’s not 100% true

let key = mycar.keys();
let mycar = cars.buyed;

won’t return something nice BUT using another method like:

let mycar = random_car.lockpick();
let key = mycar.keys();

does the job for you

/sarcasm

opal plank
#

Im just gonna patiently wait now for someone using stackoverflow or copied code without understanding

boreal iron
umbral zealot
#

Or someone claiming that they wrote a bot 100% on their own but they're literally using code I wrote 3 years ago.

boreal iron
#

He did probably code the same stuff with the same var names etc.

#

Who knows

cinder patio
#

I've been trying to make an auto-expanding textarea for two hours now đŸ˜©

umbral zealot
opal plank
#

one more 👀

boreal iron
#

auto-expanding by which trigger?

#

Entering text causing a line break?

cinder patio
#

sure

boreal iron
#

Using any framework like jQuery or just JS?

cinder patio
#

no jquery

boreal iron
#

You’re actually listening to each input event and call your function to resize the text area in there?

umbral zealot
#

2 hours...

#
function auto_grow(element) {
    element.style.height = "5px";
    element.style.height = (element.scrollHeight)+"px";
}
<textarea oninput="auto_grow(this)"></textarea>
textarea {
    resize: none;
    overflow: hidden;
    min-height: 50px;
    max-height: 100px;
}
compact valve
#

How to do this

umbral zealot
compact valve
#

No the online thing

umbral zealot
#

There's no longer any way for top.gg to know that bots are online, that part will be deprecated or replaced by something eventually but for now you can't control that.

compact valve
#

How to do server count or vote count

compact valve
umbral zealot
compact valve
#

Ok must l ask them

umbral zealot
#

yes, you can ask how to do those things in #topgg-api , after reading the topic of that channel and looking at the API Docs.

#

they're not that hard.

boreal iron
#

Not being able to do much more on mobile tbh

umbral zealot
#

what

#

I was shaming Feud for not finding the solution on stackoverflow after 5 minutes which is what I did.

boreal iron
cinder patio
#

đŸ˜© I was overthinking it

river panther
#

CAN YOU SEND THE FULL VIDEO?

cinder patio
#

that's the full one afaik

#

I see it on the programming humour sub at least once a week

river panther
#

oh

edgy tapir
#

why ```js
message.guild.owner

earnest phoenix
#

Is it okay when the bot sends a cooldown message every 15 seconds ?

umbral zealot
edgy tapir
#

Oh, ok

earnest phoenix
#

if the user triggers a command it will send the cooldown message just every 5 th time and not every time

pale vessel
edgy tapir
#

Ty

boreal iron
#

just my opinion

crystal wigeon
#

hey umm

#

if (client.shard.ids.includes(0)) { some code }

#

this will execute for all guilds shared between the shards right?

cinder patio
#

The code will execute only on the worker which handles shard

#

zero

crystal wigeon
#

what about the guilds on shard 1

#

it wont work for those guilds?

#

so its something like this

if (client.shard.ids.includes(0)) { if user voted do something from DBL server.listen(port) }

#

also it has "includeS"

#

which should work for both shards

#

?

#

or no?

solemn leaf
#

If you do includes

#

It will run for all the shards if it has a shard id of 0

crystal wigeon
#

yeah, so it should work i suppose

#

but the port will be called twice to listen right?

lyric mountain
#

Because the ids do contain 0

#

So it's basically if (true) {}

crystal wigeon
#

yeah

#

but how does it listen to that port only once?

#

like it should throw a port already in use error

#

right

#

because its spawning for 2 shards

lyric mountain
#

Use shard id not collection

#

if (client.shard.id === 0)

#

Idk if that's the proper way to get shard id, but you get the idea

crystal wigeon
#

sahrd.ids[0] === 0

#

i was using that before

#

but they recommended includes

lyric mountain
#

ids is a collection

crystal wigeon
lyric mountain
#

You don't want to get id of all shards

crystal wigeon
#

for the 0th shard

lyric mountain
#

No

#

All shards will have 0 on [0]

crystal wigeon
earnest phoenix
#

there's a way to get shard id

lyric mountain
#

You want the individual id of the current shard

earnest phoenix
#

.shard.id doesn't exist

lyric mountain
#

I know, that's what I said after my example

earnest phoenix
#

listen to shardReady event and store the ID

#

for some reason, discordjs doesn't store it in User class

lyric mountain
#

Djs is a mess when it comes to shards

earnest phoenix
#

also the pic is from client class not shardingmanager

robust blade
#

ohhh ok

#

then what is

bot.guilds.cache.size
#

?

misty sigil
#

That’s the total amount of servers that your shard is handling

robust blade
#

then ```js
bot.guilds.cache.users

misty sigil
#

that doesn’t exist

robust blade
#

for real?

misty sigil
#

no it doesn’t

wispy holly
#

nitro bots are legal?

misty sigil
#

no

wispy holly
#

ok

#

why ı dont have a role?

robust blade
#

oh i meant

bot.users.cache.size

@misty sigil

misty sigil
#

that’s cached users

#

not all users

robust blade
#

oh

#

i want all users

misty sigil
#

go to the message you replied to then

#

bonk

robust blade
#

hmm ok

lyric mountain
# wispy holly ok

You have no approved bots, nor boosted the server, nor own a lib, nor applied to br, etc etc

#

Also, what are nitro bots?

wispy holly
#

k

misty sigil
#

Nitro generation bots I assume

wispy holly
#

thats makes a nitro gift links

pale vessel
#

Doesn't sound too legit

misty sigil
#

ye no

earnest phoenix
#

such thing is not possible

#

you cannot "generate" them

wispy holly
#

ye

lyric mountain
#

It is, if u want to prank

earnest phoenix
#

you can just spam random characters in hopes one of them is a gift

wispy holly
#

u can just steal someone's nitro gift

lyric mountain
#

No

#

Just no

misty sigil
pale vessel
earnest phoenix
#

like 1 in a million

#

considering you don't get banned

lyric mountain
#

How many chars are in gift link?

wispy holly
#

ant its like %0.001 change

#

ı tested like few thousand

pale vessel
lyric mountain
#

Considering alphanumeric, there are 26 + 26 + 10 options per char

wispy holly
#

lmao

lyric mountain
#

So 62 options per char

old cliff
#
    render(){
        switch(this.props.color){
            case("primary"):{
                return(
                    <button className="btn btn-primary" >{this.props.name}</button>
                );
            }
            case("secondary"):{
                return(
                    <button className="btn btn-secondary" >{this.props.name}</button>
                );
            }
            default:{
                return(
                    <button className="btn" >{this.props.name}</button>
                );
            }
        }
    }

is there any alternative for this ?

#

in react

lyric mountain
#

I counted 16 chars there

#

So 16^62

#

Ye, big number

#

Oh, wait

pallid quail
# old cliff in react

Switch to assign the class name to a variable, and return the whole thing at the end?

lyric mountain
#

62^16 actually

pale vessel
old cliff
#

ok thanks

earnest phoenix
#

gift snipers are really the only option

#

and even then

wispy holly
#

ı know how to steal bots

earnest phoenix
#

you will be competing with other gift snipers

#

there's probably like 50 running right now in this guild

wispy holly
#

mee6 just have 3 script :/

earnest phoenix
#

you're talking nonsense

#

anyways

wispy holly
#

yea

#

u too

lyric mountain
earnest phoenix
wispy holly
#

ok?

#

ım working on leveling system

earnest phoenix
#

nobody cares

wispy holly
#

ı m not asked to u

earnest phoenix
#

hi not asked to u, i'm dad

pale vessel
#

got em

lyric mountain
#

Texas hold em

earnest phoenix
pale vessel
earnest phoenix
#

yes

#

ik isnt it cool how im lemme think

#

if they are dad

#

ill be the step bro 😉

#

im jk

#

forgive me

#

you guys didnt see anything inapporpriate

pale vessel
#

okay

earnest phoenix
#

i promise

#

can you move please?

#

This is development channel not general

#

yes sorry

spare portal
#

im using a command to get an image, and when i log it to the console it logs the image link fine, but when i set an embed image URL to that link, it comes up as [object undefined]
it might be just a problem with the npm package im using but im not sure

umbral zealot
#

can you show us your code and what it logs exactly?

feral aspen
#

So I'm trying to get to know what command is causing my logs to be filled with Missing Permissions

#
try {
        commandfile.run(message, args)
    } catch (err) {
        console.log(commandfile.name)
    }
pale vessel
#

await it

feral aspen
pale vessel
#

Yes

#

otherwise that catch won't work

feral aspen
#

Ah, await the try catch or where?

pale vessel
#

the run method

#

assuming it's an async function

boreal iron
#

is causing my logs to be filled with Missing Permissions

just console.log the commandfile

feral aspen
#

K

pale vessel
#

or this ^^

#

i do that

spare portal
# umbral zealot can you show us your code and what it logs exactly?
if (msg.content.toLowerCase() === ",,neko") {
    const nekotime = marii_.neko().then((res) => console.log(res));
    const nEmbed = new Discord.MessageEmbed()
      .setColor('#A76DDC')
      .setTitle('neko time ;)')
      .setImage(toString(nekotime));
    msg.channel.send(nEmbed);
}

the error:

(node:5415) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
embed.image.url: Scheme "[object undefined]" is not supported. Scheme must be one of ('http', 'https').
pale vessel
umbral zealot
spare portal
#

alright, thanks

feral aspen
pale vessel
#

log commandfile

feral aspen
#

inside the try or in the cache?

#

Well the error of Missing Permissions came and it didn't tell me what command caused it.

pale vessel
#

commandfile.name is undefined?

umbral zealot
#

ok then log each command being run, before it's run

#

simple

pale vessel
#

Simple fix, just log message.content xd

umbral zealot
#
try {
  console.log(`Running ${commandfile.name}, command by ${message.author.tag}`);
        commandfile.run(message, args)
    } catch (err) {
        console.error(err)
        console.log(commandfile.name)
    }
#

boom

celest bone
#

ok im confused here. Its probably some small thing i missed, or something i am doing completely wrong, but I cant seem to make my bot send the error message. (I have tried else and other else if statements, none work.) urlEnding is defined as let urlEnding = ['.png', '.jpg']

let filter = m => m.author.id === message.author.id
        message.channel.send(`Please Post The Link Now! This expires in 10 seconds!`).then(() => {
          message.channel.awaitMessages(filter, {
              max: 1,
              time: 10000,
              errors: ['time']
            })
            .then(message => {
              message = message.first()
              if (message.content.startsWith('https://') || message.content.endsWith(urlEnding)) {
                db.set(`wBg_${message.guild.id}`, args[0])
                return message.channel.send(`WORKING! Link set to ${args[0]}`)
            } else if (!message.content.startsWith('https://') || !message.content.endsWith(urlEnding)) {
               return message.channel.send(`This link is invalid. Please make sure you have a valid link, that starts with 'https://' and ends with either '.png' or '.jpg'!`)
            }})
        })```

My issue is, it always says its working, even without https or the url endings.
pale vessel
#

endsWith() takes a string, not an array

hoary vine
#

how do i get my bot to stay online 24/7?

royal herald
boreal iron
#

I would use a RegEx match instead of searching the content 2 tumes

umbral zealot
#

also called "A VPS" or "A hosting service"

hoary vine
#

ok

#

also

pale vessel
#

do not use those free panels

hoary vine
#

why cant i get it back online

feral aspen
pale vessel
#

or even a panel in general, get an actual VPS

pale vessel
umbral zealot
hoary vine
#

nothing

#

it just wont go back online

umbral zealot
#

how are you starting it?

hoary vine
#

?

umbral zealot
#

How do you start your bot. boot it. run it. execute it.

celest bone
hoary vine
#

im doing this is the terminal:

PS C:\Users\Lenovo\Desktop\me\New bot> node My_Bot.js```
#

but its not working

umbral zealot
#

Ok so when you run that, what exactly does it do?

pale vessel
#

did you mean &&?

umbral zealot
#

does it go back to the prompt? or does it stay stuck? or what exactly?

celest bone
hoary vine
umbral zealot
#

"nothing" isn't a choice in this

#

what exactly happens when you do node My_Bot.js ?

pale vessel
celest bone
#

oke

feral aspen
#

Ok, issue on my side. It's fixed! 👍

pale vessel
#

Not message.content.endsWith(urlEnding), your new code

hoary vine
pale vessel
#

since that code is wrong

hoary vine
#

now how do i get it back online

umbral zealot
hoary vine
#

ok

#

how do i get it back online

umbral zealot
#

Getting a bot online should be running node My_Bot.js again

pale vessel
umbral zealot
#

to get a bot online based on a node library, you do node thebotfile.js and it goes online.

#

that's it

#

Now to keep it online requires a hosting service and more configurations, but to get it online to begin with, that's enough.

celest bone
#

Idk

hoary vine
#

help me

celest bone
#

ill figure it out, thanks for the help

umbral zealot
#

ok so do that again

hoary vine
#

in visual studio code

umbral zealot
#

I thought we were passed this

#

I ask questions but you don't answer, I can't help you if oyu can't answer these questions

short valley
#

Im trying to set up a command handler for my bot but I keep getting this error when I run the code Uncaught Error: ENOENT: no such file or directory, scandir './commands', this is the code

umbral zealot
#

Ok so next I asked, "what happens when you do that", @hoary vine

#

you never answered

hoary vine
#

it does nothing

earnest phoenix
#

Hey

umbral zealot
#

again, I said, "nothing" isn't correct, I need to know precisely, exactly, in details, exactly what happens

mellow kelp
umbral zealot
#

does it go to the next line? does it stop? does it output anything?

celest bone
hoary vine
umbral zealot
#

show us your My_Bot.js file (just without the token in it please)

hoary vine
#

oh my god

#

how did it get deleted

#

theres no login line

umbral zealot
umbral zealot
hoary vine
#

ok got it back online thx for the help

boreal iron
#

easy solution for this

earnest phoenix
#

@quartz kindle sorry for the ping but since you are the dev of djs-light .I have a question.Does djs-light have modified built-in ratelimit or is the standard like djs?

boreal iron
#

...readdirSync(__dirname.replace(/\\/g, "/") + "/commands")

#

@hoary vine

umbral zealot
hoary vine
#

what

boreal iron
#

woops

hoary vine
#

lol

boreal iron
#

yeah I see

umbral zealot
#

Also that solution isn't a solution at all until we know where that package.json file is

#

and also how they start the bot I guess

boreal iron
#

the path is the current path of your index.js being started in node or however it's been called

#

I'm coding with NPP, means it's not creating a "project" etc. with package files etc.

#

assuming he isn't doing as well

umbral zealot
#

"npp"? you mean notepad++?

quartz kindle
boreal iron
#

that's the short term, yeah

umbral zealot
#

Ok well you don't "create a project" with npp, you edit files with it.

#

a node project should always start with an npm init command in your project root

pale vessel
#

he meant something like a workspace in VSC

umbral zealot
#

if it doesn't, you're doing development wrong.

boreal iron
#

depends on how you're developing your environment

#

missing words always... oof

umbral zealot
#

No it doesn't. not really. Package.json is how node.js determines your dependencies and their versions and how you install them. So unless you're using no dependencies at all, it's required.

#

Now, we can discuss and bicker about what's a good way to run nodejs but it's a bit pointless since this guy didn't even bother answering my question and we're just talking between each other and not really helping 😛

boreal iron
#

well true

short valley
hexed flower
#

STFU EVERYBODY

boreal iron
#

just for you#

misty sigil
#

discord.js tho

earnest phoenix
#

My name is Hentai girl 69

short valley
#

I probaly messed up something in the beginning of the code

#

Wait

#

I don't think I choose node when making a new folder

lyric mountain
#

You don't choose node

#

If you're using npm there's 100% chance you are using a node project

short valley
#

Ok

#

I did download node.js

lyric mountain
#

Did u init it?

short valley
#

Whats that

lyric mountain
#

npm init

short valley
#

Don't think so

lyric mountain
#

So you have no project at all

#

Unless you cloned another project

short valley
#

The bot used to work fine

lyric mountain
#

If u didn't init it, it couldn't work at all

#

It's like trying to build a skyscraper without first floor

tulip ledge
#
        let dataEmbed = new Discord.MessageEmbed()
        .setTitle(this.title ? this.title : "Tournament")
        .addField(`Ended`, `**Type** âȘŒ \`${this.type == "slayerXP" ? "Slayer XP" : "Catacombs XP"}\`\n**Ended** âȘŒ ${moment(this.endAt).format("LLLL")}\n${(this.hostedBy ? this.messages.hostedBy.replace('{user}', this.hostedBy) : '')}`)
        .addField(`Prizes`, this.prize)
        .addField(`Top 10`, "`Gathering data...`")
        .setColor("#FFFFF1")
        .setFooter("This tournament has already ended.")
        (await this.channel.messages.fetch(this.messageID)).edit(dataEmbed);
 TypeError: (intermediate value).setTitle(...).addField(...).addField(...).addField(...).setColor(...).setFooter(...) is not a function
0|Bot          |     at /root/MM/util/Tournament.js:217:9

How do I fix?

short valley
#

On line 2 it says "'config' is declared but its value is never read"

dusky sundial
#

That's just saying that you created a variable but you never read it anywhere in your code, pretty sure

boreal iron
#

@earnest phoenix u're still on?

earnest phoenix
#

possibly

boreal iron
#

you may or may not remember this

umbral zealot
# marble juniper fs comes with nodejs

Yes I'm fully aware of FS being a core node feature but it doesn't change that its path is relative to the root of the working directory which is usually where the package.json is located.

boreal iron
#

got some time now to test and investigate it but can't get forward without some help

umbral zealot
# short valley

not sure exactly how you're starting this, but to get this working correctly, you need to go to the terminal tab, go cd bot and then npm init --y, then npm i discord.js and then node index.js. That should make the whole thing functional for now

marble juniper
#

I had that too

pale vessel
#

you can use shorthand flags with --?

marble juniper
#

where I would make fs read ./events

#

but I would do require('../events')

umbral zealot
marble juniper
#

its kinda weird

umbral zealot
#

It's not even "weird". It's exactly how nodejs works.

marble juniper
#

ig

wispy holly
#

ım trying make a weather command but it doesnt working help me plis

#

pls*

umbral zealot
#

fs is relative to the working directory, and require() is relative to the current file, and that's how node documents it too.

umbral zealot
wispy holly
#

ok

marble juniper
#

you have to show us errors if any

#

and the code associated with it

#

otherwise we can't help

quiet topaz
#

how can I escape user input for mysql queries in java

umbral zealot
wispy holly
#

`const Discord = require('discord.js');

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

if (!args[0]) {
    const embed = new Discord.RichEmbed()
        .setDescription("Bir ßehir yaz!")
        .setColor("RANDOM")
    message.channel.send({embed})
    return
}

const konum = args.join(" ")
message.channel.send("", {
    files: [
        `http://wttr.in/${konum}_0tqp_lang=tr.png`
    ]
})

};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['hava', 'hava-durumu', 'havabilgisi', 'hava-bilgisi', 'weather', 'weatherforecast'],
permLevel: 0
}

exports.help = {
name: 'havadurumu',
description: 'Yazılan konumun hava durumu bilgisini gösterir.',
usage: 'havadurumu [konum]'
}`

lyric mountain
quiet topaz
#

i think

wispy holly
#

its keep charshing

quiet topaz
#

like that a user cant do a sql injection

wispy holly
#

my visual studio code

lyric mountain
#

There's a reason concatting in sql is also called "unsafe" and "prone to injection"

#

Use params

umbral zealot
#

it's a website with html

wispy holly
#

thats an api

#

wait let me show

pale vessel
#

@wispy holly .png at the front, not in the query parameter http://wttr.in/.png?konum&0tqp_lang=tr

vital bronze
#

how to make custom bot status?

quiet topaz
quiet topaz
umbral zealot
#

well it's not mine so I don't really care tbh.

vital bronze
quiet topaz
#

you do Client.user.setActivity i think

vital bronze
#

ok

quiet topaz
wispy holly
#

Working but that gives error in terminal

umbral zealot
wispy holly
umbral zealot
#

```js
your code
```

#

Also what error do you get?

wispy holly
#

node:12345

#

DEP0018

pale vessel
#

good job you managed to hide the actual error

umbral zealot
#

yep

pale vessel
#

scroll up

wispy holly
#

(This is turkish bot for my cousins)

#

iphone is not a city...

quiet topaz
#

just post the error or we cant help you

wispy holly
#

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

quiet topaz
#

like your main code

wispy holly
#

oh k

#

OMG I FOUND WHATS WRONG

umbral zealot
#

I'm guessing if you look at your events/ready.js file you'll find you forgot a c in const

quiet topaz
#

btw i didnt knew what file was his

#

but i was thinking that

umbral zealot
#

pretty obvious while reading the error actually.

wispy holly
#

oh THX

umbral zealot
#

well that needs a bit of fixin' sharkyay

quiet topaz
#

I think you cant have semicolon in a var name?

umbral zealot
#

No, you definitely can't.

#

And onst is not a keyword either.

quiet topaz
umbral zealot
#

Yeah I think they got it.

wispy holly
#

İm not dumb

#

i fixed

#

and ı need help ı cant make my bot's status like this

umbral zealot
wispy holly
#

oh thx

hoary vine
#

how do i get my discord bot on top.gg

wispy holly
#

hmm

wispy holly
umbral zealot
umbral zealot
wispy holly
#

ok

hoary vine
# umbral zealot https://top.gg/newbot

ik but it says: An error has occurred while validating your input:
Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.

umbral zealot
#

I think that's pretty clear

#

Which part of this confuses you?

hoary vine
#

Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.

umbral zealot
#

Ok but which part of this english sentence do you not understand?

hoary vine
#

this part

#

Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.

umbral zealot
#

Here let me simplify it: write more words

hoary vine
#

ok

wispy holly
hoary vine
#

how much

#

words

earnest phoenix
#

hı

lyric mountain
#

Tldr: write enough to describe ur bot

safe creek
#
    @has_permissions(ban_members=True)
    @commands.command()
    async def unban(self, ctx, *, member):
        banned_user = await ctx.guild.bans()
        member = member.strip("<@!>")

        for ban_entry in banned_user:
            user = ban_entry.user

            if (user.name, user.descriminator) == (member):
                await ctx.guild.unban(user)
                embed = discord.Embed(title=f"{user.mention}unbanned by {ctx.author.id}", descriptiom=f"{user.mention} was unbanned by {ctx.author.id}"),
                await ctx.send(embed=embed)
                return``` will this also unban users via mention as this unbans via id not sure about mentions tho
earnest phoenix
#

try it

#

and see

safe creek
#

mmmk

hoary vine
#

what the- i added a roll command i dont want it to do it like that-

#

script:

client.on('message', message => {


  if (message.content === '!roll') {

    var rollNumber = Math.random() * 6 + 1

    message.channel.send('You rolled a ' + rollNumber)

  }
});```
safe creek
#

so make it to where it doesnt say the rest

quiet topaz
#

what language

hoary vine
hoary vine
quiet topaz
#

Math.floor() i think

boreal iron
#

@earnest phoenix nvm, got it working now

hoary vine
#

oh yea oops

quiet topaz
#

or Math.round()

earnest phoenix
boreal iron
#

ah np, just needed to figure out how to work with buffers for UDP sockets @earnest phoenix

quiet topaz
#

your have a f outside string

boreal iron
#

but it's actually not even complicated lmao

hoary vine
#

how do i fix it lol

#

its still doing it

#

but

#

its sending 3 messages at once

safe creek
#

you should know it belongs there if you have

quiet topaz
#

oh that is python? no i never really used python

safe creek
#

when you do the three quote thingys to make it an embed

quiet topaz
#

btw you wrote descriptiom

safe creek
#

you can do py, js etc and each language has its own color code

#

oh thanks

restive furnace
quiet topaz
#

but why is it f"{user.mention} was unbanned by {ctx.author.id}")? i mean doesnt the f at the beginning must be in the string?

earnest phoenix
#

no

dusky sundial
#

f string in python, look it up

earnest phoenix
quiet topaz
#

oh i never used python so it looked weird to me

hoary vine
#

OH MY GOD

#

WHY DOES THE COMMANDS KEEP REPEATING LOL

umbral zealot
#

probably because you coded it wrong

hoary vine
#

idk how

umbral zealot
hoary vine
#
const Discord = require('discord.js');
const client = new Discord.Client();

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

  client.user.setActivity("Rhetty Chapter 6 saturday March 6th, 2PM")
   
  
});

// Game link command

client.on('message', message => {
  // If the message is "ping"
  if (message.content === '!game') {
    // Send "pong" to the same channel
    message.channel.send('https://roblox.com/games/5808867844/Rhett-y-Alpha-Chapter-5th?refPageId=f8dedd66-83bc-4999-9f41-c5673e2413a0');
    
  }
});

client.on('message', message => {
  // If the message is "ping"
  if (message.content === '!ping') {
    // Send "pong" to the same channel
    message.channel.send('pong!');
    
  }
});```
misty sigil
#

oh no

#

just use one message listener

earnest phoenix
#

my favourite kind of pasta is the one prepared with ctrl and a tiny pinch of c and v

hoary vine
#

how do i fix

#
client.on('message', message => {
  // If the message is "ping"
  if (message.content === '!ping') {
    // Send "pong" to the same channel
    message.channel.send('pong!');

    if (message.content === '!game') {
      // Send "pong" to the same channel
      message.channel.send('https://roblox.com/games/5808867844/Rhett-y-Alpha-Chapter-5th?refPageId=f8dedd66-83bc-4999-9f41-c5673e2413a0');
      
    }
    
  }
});```
misty sigil
#

yea ikr

earnest phoenix
#

learn js

hoary vine
#

just tell how to fix

misty sigil
#

and now an if statement in an entirely unrelated one that literally cannot fire

misty sigil
#

that’s how you fix

earnest phoenix
hoary vine
misty sigil
#

LEARN JS

hoary vine
#

NO

misty sigil
#

THATS HOW YOU FIX IT

earnest phoenix
#

if you pay us, sure

misty sigil
#

pay me ÂŁ30 to fix your script

#

30 quid

earnest phoenix
#

our labor is not free

misty sigil
#

into my paypal

hoary vine
misty sigil
#

well

umbral zealot
earnest phoenix
#

sucks to be you i guess

misty sigil
#

learn js

dusky sundial
#

People aren't here to spoonfeed you, that's why they're telling you to learn the language before making a bot

umbral zealot
#

we will not spoonfeed you solutions.

hoary vine
#

only with robux

misty sigil
#

learn js

umbral zealot
#

Learn javascript first, then make a bot.

hoary vine
earnest phoenix
#

how old are you, @hoary vine

umbral zealot
#

No, clearly, you didn't, sorry.

misty sigil
#

sorry love but it’s obvious you haven’t

earnest phoenix
#

Anyone how can i create rythm?

hoary vine
#

but if i didnt i wouldnt know how to write that script

misty sigil
#

fuck me

earnest phoenix
dusky harness
#

I'm typing the Embed Message command, but it doesn't work. It doesn't give an error. Why can you help me?

dusky sundial
umbral zealot
misty sigil
#

provide context

umbral zealot
misty sigil
#

learn js

umbral zealot
#

that's the help you get.

misty sigil
#

I need some fuckin beer

hoary vine
misty sigil
#

NO YOU DIDNT

quiet topaz
misty sigil
#

YOURE JUST BLINDLY COPYPASTING CODE

dusky sundial
#

No need to argue, peeps

umbral zealot
earnest phoenix
#

How I can do a thing like:

const res = await verynicefunction('a link.gif');
console.log(res);
# CONSOLE:

# {
#  fps: 48,
#  images: [
#      <Buffer>,
#      <Buffer>,
#      <Buffer>,
#      <Buffer>,
#      .......
#  ]
#}

Thonkang

misty sigil
#

they screamed at us

dusky harness
earnest phoenix
#

don't drop to their ooga-booga level

#

they're clearly an underage child

umbral zealot
#

Doesn't matter, you should try to stay calm. if it pisses you off to see them sream, you can easily just go read some other channel or server to cool down ^_^

misty sigil
#

i’m calm

earnest phoenix
#

they just have to admit it before getting banned

misty sigil
umbral zealot
# dusky harness

Looks good to me, are you sure you're sending precisely the correct message? Did you also make sure to save and restart your bot after writing this?

dusky harness
#

yes

earnest phoenix
#

messageEmbed

misty sigil
#

it might be messageEmbed

earnest phoenix
#

the class is MessageEmbed

misty sigil
#

we just don’t know

umbral zealot
#

True, we don't know how messageEmbed was defined.

earnest phoenix
#

i honestly doubt they imported it with the as operator đŸ€·â€â™‚ïž

#

or redeclared it

dusky harness
#

what should I do

umbral zealot
quiet topaz
#

whats the error

misty sigil
#

give us some more code

earnest phoenix
#

also

#

you're lacking the new operator

#

(if you're using the class)

dusky harness
misty sigil
#

ah

umbral zealot
#

well messageEmbed and MessageEmbed are not the same thing

#

javascript is case sensitive

misty sigil
#

it’s MessageEmbed, not messageEmbed

#

and MessageEmbed is a class so it’d be new MessageEmbed

dusky harness
#

ok i'll fix it

umbral zealot
#

The new keyword is actually optional...

misty sigil
#

wait it is?

earnest phoenix
umbral zealot
#

yeah. eslint will scream at you, but it it's optional

misty sigil
#

last time I tried it I was screamed at by node

#

iirc

#

it’s been a while since I’ve tried so I might as well try it again now

lyric mountain
#

New being optional?

#

Js is weird

earnest phoenix
dusky harness
#

C:\Users\Hp\Desktop\bot\efe.js:33
const kanal = MessageEmbed()
^

TypeError: Class constructor MessageEmbed cannot be invoked without 'new'

misty sigil
#

Yea I was thinking that

dusky harness
#

gave this error

earnest phoenix
lyric mountain
#

Yeah, new is definitely required for constructors

misty sigil
#

yea I thought that

lyric mountain
#

Else it's a static access

sudden geyser
#

New is required for class constructors, but can also be used with functions

#

but i don't touch that

umbral zealot
#

alright well, I might be wrong actually, seems that yes it's old archaic function-based stuff that doesn't need new

#

nevermidn

lyric mountain
#

That'd be static builders

#

Aka factories

misty sigil
#

ah so it’s old stuff that doesn’t require new

river panther
#

how do i do it like, the bot will get as many avatars as the user will mention

lyric mountain
#

You're limited to 10 tho

river panther
#

yes, so how do i do that

lyric mountain
#

Loop over mentions

misty sigil
#

run a loop through your arguments / mentions

lyric mountain
#

Adding file to message

dusky harness
river panther
#

umm, can you explain this a bit more?

#

how loop?

umbral zealot
river panther
#

repeat..until or if

earnest phoenix
river panther
#

or while

misty sigil
#

you can use a for loop

lyric mountain
#

And if ain't a loop

misty sigil
#

for .... in mentions

river panther
#

oh yes, its in pseudocode

dusky harness
lyric mountain
#

You're not doing pseudocode rlly now tho

#

Use either for or while

river panther
#

next*

umbral zealot
lyric mountain
#

Since it'll be a bounded loop, use for

river panther
#

oh, ok

#

for loop

#

hmm, ok ok

#

let me try

earnest phoenix
# misty sigil for .... in mentions
for (let user of message.mentions.users.array()) {
  ...
}
``` ![stonks](https://cdn.discordapp.com/emojis/813470003596230707.webp?size=128 "stonks")
lyric mountain
#

No

earnest phoenix
#

No?

lyric mountain
#

It has a limit of 10 files

#

You can't loop solely over the array

#

You need a counter too

earnest phoenix
#

oh Thinkeng

old cliff
#

Just map that array

lyric mountain
#

...still have limit issue

earnest phoenix
#

why manipulate it in the first place

#

you're just adding complexitiy for no reason

#

a map is iterable

lyric mountain
#
let arr = message.mentions.users.array();
for (let i = 0; i < 10 && i < arr.size(); i++) {
	...
} 
warm junco
#

anyone else been having problems with youtube-dl lately? music was working fine with my bot but now im getting this error for some songs:
DownloadError: ERROR: No video formats found

#

wait no

#

wrong copy paste

dusky harness
crimson vapor
#

what the fuck

river panther
#

yes

#

it wrong

lyric mountain
#

No

river panther
#

;-;

lyric mountain
#

It's not guaranteed to have 10 mentions

crimson vapor
#

or what?

#

you are looping through an array

#

shit discord

#

can't send messages

lyric mountain
#

That avatar array makes no sense at all

river panther
#

oh yes, i realised

lyric mountain
#

And you don't need to define loop iterator outside of loop

sudden geyser
#

why are you using const for c anyway

crimson vapor
#

wait you can't reassign a const

#

use let

river panther
#

as a counter

#

ok

crimson vapor
#

for(let i = 0; i < 10; i++) {}

#

standard

old cliff
#

Just map through mentions... and get their avatars

lyric mountain
river panther
#

but the message can also have 2 mentions and 10

#

or maybe 6

old cliff
#

Reduce array to 10

#

Simple

crimson vapor
#

array.length = 10

#

ezpz

old cliff
#

If array len > 10 len = 10

#

Simple logic

#

And map through that array

#

Ezpz

#

Also why make a mass pfp command ?

boreal iron
#

@earnest phoenix may you got an idea

    getBattlEyeBan(be_guid)
    {
        if(!be_guid || be_guid.length != 32) return null;
        
        const socket = dgram.createSocket("udp4");
        const buffer = Buffer.from("..6.." + be_guid, "ascii");
        
        socket.on("message", (message) =>
        {
            const result = message.toString().slice(4);
            
            if(result) //return getBattlEyeBan()
        });
        
        socket.send(buffer, xxxx, "1.2.3.4", (error) =>
        {
            if(error) socket.close();
        });
    }

calling getBattlEyeBan() will open the UDP socket listener
returning on if(result) would of course only return socket.on()

that would cause my called function to return undefined

I'm struggeling a little bit how to return the function 2nd degree

river panther
#

it will send a gif of all the pfps

earnest phoenix
old cliff
#

Also if you just want the code we won't give

river panther
#

nah, i am not a copy paster

old cliff
#

Nice 👌

earnest phoenix
#
getBattlEyeBan(...)
{
  return new Promise((resolve, reject) => {
      socket.on(..., () => {
          const result = ...
          if(result) resolve();
      })
  });
}

@boreal iron

old cliff
#

Simple

boreal iron
#

thank you

earnest phoenix
#

wrong channel

soft bluff
#

what channel should i do it in

earnest phoenix
#

đŸ€·â€â™‚ïž

#

find the bot's support server

soft bluff
#

k

safe creek
#

that console print tho lmfao

river panther
safe creek
#

send me the plain text pls xd

wraith haven
#

Before I go into the docs n stuff - is it possible to have a !vote command that allows users to vote?

lyric mountain
#

Yes

safe creek
#

yes

wraith haven
#

okee, thank you

#

Does the top.gg python library have native support for it?

safe creek
#

thats called an embed with an embeded link attached to an bit of text

#

thats how people are gonna vote with that command

#

the only infact

wraith haven
#

ah oke - so like the link goes to my bots top.gg page?

#

or the /vote version of it

edgy tapir
#

which is the best database to use for heroku hosting? ( i don't want to buy a host until my bot is finished)

wraith haven
#

heroku = bad

If you somehow find a way to edit files uploaded to your heroku app - when the bot restarts all of the data will be reset to the initial upload

#

not talking about the monthly uptime limit - the lack of support - etc

quiet topaz
misty sigil
#

they provide a few free postgres rows or something

edgy tapir
#

i heard that it kinda works with json files but it update the file after restart

wraith haven
#

I would recommend repl.it over heroku

#

any day

edgy tapir
quiet topaz
#

you couldd host it on a raspberry pi

wraith haven
#

I does that

#

its pretty good - accept for my lavalink server which kills it 😆

dusky sundial
#

There are some pretty cheap VPSs in pinned messages as well

quiet topaz
misty sigil
#

saving data in json file

#

ew

edgy tapir
#

and i don't really want to pay because there are better hosts for that money xd

misty sigil
#

use atlas?

#

you can use atlas on a rpi?

quiet topaz
#

normally a server costs a few € per month like thats not much

edgy tapir
#

and the rasberry pi are not that common in romania 😩

misty sigil
#

i pay ÂŁ6.60/month for mine but you can get way cheaper

edgy tapir
dusky sundial
safe creek
wraith haven
#

Where da heck do I get a topgg token

pale vessel
#

go to your bot edit page and select "Webhooks"

wraith haven
#

Thank you

#

ah appreciate you

pale vessel
#

yeah, that should not be there

edgy tapir
pale vessel
#

or at least change "Webhooks" to "API Access" or something

quiet topaz
#

why cant you let your pc on?

edgy tapir
#

because the taxes are huge in my country ☠

#

and because my laptop will probably blow up xD

quiet topaz
#

in germany we pay lot for power too

edgy tapir
#

yes but germany is a rich country xD, you have big sallary, our minimum sallary is like 500euros

#

so yeah

quiet topaz
#

and a rich country doesnt mean that all people are rich

edgy tapir
#

no but in my country 60% of people are dyslexic =))

#

so our school is worse

lyric mountain
#

In my country 99% of people are dumb af

#

So our school is even worse

edgy tapir
#

xD

#

where are u from ?

earnest phoenix
#

sounds like America to me

gilded swallow
pale vessel
gilded swallow
#

how come i have the bot developer role and some people don't is it auto assigning it if i have a bot on top.gg ?

edgy tapir
#

u get the role

gilded swallow
#

yes thats the question

#

thanks for confirming

edgy tapir
#

np

lyric mountain
#

The country of the chloroquine-addicted president and contradicting laws

quartz kindle
#

And his army of negative iq zombies

earnest phoenix
#

anyone here familiar with eris.js

crimson vapor
#

whats your issue?

earnest phoenix
#

im new to e.js

crimson vapor
#

wdym a member list

#

like guild members?

earnest phoenix
#

what would js await message.guild.members.fetch()

#

i have js await client.guilds.get(message.guildID).fetchMembers({limit: client.guilds.get(message.guildID).memberCount})) but i get an empty array

pale vessel
crimson vapor
earnest phoenix
#

i get an empty array

crimson vapor
#

oh fuck

#

I was slow

#

all of this is optional

#

try it without the limit

#

and make sure you have guilds member intent

earnest phoenix
#

||its a userbot||

#

dont ban me pls

misty sigil
#

what

#

what the fuck man

earnest phoenix
#

im not doing anything nefarious

crimson vapor
#

I mean like

#

don't

misty sigil
#

atmods smh stinky userbot

earnest phoenix
#

i was gonna use it to take down a scam server by dming everyone that its a scam

misty sigil
#

wtf man

#

no

crimson vapor
#

well 1. selfbot

#
  1. api abuse
gilded swallow
#

self bots are against discord tos

lyric mountain
gilded swallow
#

cease it immediately

earnest phoenix
crimson vapor
#

how right or wrong what you are doing is doesnt matter if you break rules to do it

earnest phoenix
#

im not asking for help with userbot

#

i just want to know how to fetch member list

lyric mountain
#

Also, you can't take down scam servers

#

Not alone

earnest phoenix
lyric mountain
#

No

earnest phoenix
lyric mountain
#

That's a useless crusade

dusky oar
#

xD

earnest phoenix
#

now time to clear my browsing history being thats a temp alt i didnt even "claim"

#

there its gone

crimson vapor
#

why do you need to clear your browsing history???

earnest phoenix
#

even tho i can make another

gilded swallow
#

this guy sounds like a typical 12 year old wanna be hacker

crimson vapor
#

clearing your browsing history does jack shit

earnest phoenix
#

¯_(ツ)_/¯

misty sigil
#

thats removing a cookie

#

bro

crimson vapor
#

bruh

gilded swallow
crimson vapor
#

LOL

crimson vapor
#

isnt there a keybind to reload your cookies

#

or at least cache

lyric mountain
#

No

#

Cache yes

earnest phoenix
gilded swallow
#

f12 empty cache and hard reloead unggoymerchant

tulip ledge
#

Is there a way I can make for example _TEst_ not be diagonal? Since name.replace("_", "\_") still makes it diagonal

misty sigil
#

use regex

crimson vapor
#

"string".replace(/_/g, '\_')

tulip ledge
#

I sitll want the _ tho

#

Like u can do _Test_

slender wagon
#

@round cove the underaged kid is in with another acc

misty sigil
tulip ledge
safe creek
#

isnt that py?

misty sigil
tulip ledge
#

đŸ€Š

#

LOL

misty sigil
#

it doesn't show italics there

#

so

sterile lantern
#

why do my slash commands look like this?

tulip ledge
#

Still makes it diagonal

crimson vapor
#

huh

tulip ledge
#

output works but discord still makes it diagonal

pale vessel
#

\\

#

maybe

sterile lantern
misty sigil
#

yea its \\

sterile lantern
#

"User used the /command"

tulip ledge
#

Yup that works ty

sterile lantern
#

anyone know why slash command appears like that?

crimson vapor
#

oh

#

that makes sense

sterile lantern
#

when i removed the thingy that shows the user used command

#

it doesnt show

#

otherwise it shows like that

#

weird

sinful atlas
#

How to make bot support Server

sterile lantern
#

you make a discord server

#

and add support channels to it...?

sinful atlas
#

How

sterile lantern
#

search up how to make discord servers

#
How-To Geek

Discord is a quickly growing text and voice chat application, aimed at gamers in particular. Its sleek and simple design makes it an excellent alternative to older apps like Teamspeak and Skype. Discord has taken a lot of inspiration from Teamspeak’s extensive customization and management options but has buried some of those options within the i...

sinful atlas
#

I know how to make Server

sterile lantern
#

So add a channel by clicking +

sinful atlas
#

Bot bot support Server how to make

sterile lantern
#

Then set it up how you iwsh

#

wish*

safe creek
#

bro this kid

#

is just

#

my god

sterile lantern
#

A bot support server is literally just a server....

safe creek
sterile lantern
#

There's no special case for "bot support" servers

#

Just make a regular server and name it your bot support server

safe creek
#

im disappointed

sinful atlas
#

I put my server link in bot Server of top.gg add bots

#

But invalid

#

@safe creek

#

@reef ferry

#

I put my server link in bot Server of top.gg add bots

#

But invalid

safe creek
#

bro we dont care

#

the site isnt working

#

the devs are fixing it

#

please just read support pins