#development

1 messages · Page 491 of 1

quartz kindle
#

never had any problem with it

lusty dew
#

var is obsolete

#

that is what someone told me ;p

quartz kindle
#

its not obsolete

#

you cant use const and let for everything

#

sometimes you need to go through scopes

#

let fails at doing that

#

and const is not always the right choice

lusty dew
#

idk I used to use var and never had problems

#

I was just saying what someone else told me

knotty steeple
lusty dew
#

Lol

quartz kindle
#

yeah well, thats one situation

lusty dew
#

How would I make a userUpdate event?

#

like

#

oldUser.username?

#

wouldn't that give me their old username?

#

or am I just dumb

knotty steeple
#

i dont think thats an event

lusty dew
#

userUpdate is an event

knotty steeple
#

since when

lusty dew
#

@knotty steeple Sense then

#

Lol

knotty steeple
#

@earnest phoenix no

#

const is a constant variable it cant be changed

lusty dew
#

Exactly

knotty steeple
#

deletes message

lusty dew
#

Anyway

#

How do I get the oldUser's username?

mortal rose
#

yo

knotty steeple
#

sup

#

quick tip

quartz kindle
#

the words constant and variable are mutually exclusive

#

lmao

knotty steeple
#

use cogs

mortal rose
#

whats that?

knotty steeple
#

you can have a bunch of commands in 1 python file

#

kinda like categorizing them

mortal rose
#

ok

lusty dew
#

:/

mortal rose
#

mines just a long line of If statements x

knotty steeple
#

yea thats very bad

mortal rose
#

xD*

knotty steeple
#

if you had to reload a command you have to restart the bot

#

if you has cogs you can just reload that cog

mortal rose
#

oh ok

knotty steeple
#

i said has on purpose mmLol

lusty dew
#

-_-

#

Grammar

#

xD

mortal rose
#

do you think you could help with the command im tryna do?

knotty steeple
#

yes

lusty dew
#

SamuraiStacks

mortal rose
#

thank fuck

knotty steeple
#

also

#

is that async

lusty dew
#

Answer me a quick question

knotty steeple
#

pls no use async

lusty dew
#

pleaes

#

please*

knotty steeple
#

yes what

mortal rose
#

i use async

lusty dew
#

do I do oldUser.username to get the person's old username?

knotty steeple
#

idk

lusty dew
#

oof

devout flicker
#

yes

knotty steeple
#

i never used userUpdate

#

i wouldnt know

lusty dew
#

@devout flicker have you used the userUpdate event in js?

devout flicker
#

yes once the property tells it basically

#

newUser = after change
oldUser = before change

harsh musk
#

@mortal rose you're doing everything wrong

#

Delete your bot and start over

west raptor
mortal rose
#

id rather not thnx

lusty dew
#

XD

knotty steeple
#

lmao

devout flicker
#

send git

lusty dew
#

@devout flicker Yea I know what it saids

harsh musk
#

Use rewrite branch of dpy, use the command extension and cogs

lusty dew
#

But I am doing oldUser.username

knotty steeple
#

thats what i suggested

lusty dew
#

and it doesn't do anything

devout flicker
#

ayy

knotty steeple
#
if message.content == '^stab':
        name  = "<@" + message.author.id + ">"
        await client.send_message(message.channel, name + ' stabbed ')
``` this is his code im just posting so i dont have to go in general lmao
mortal rose
#

ok

devout flicker
mortal rose
#

thats as far as i got and my brain exploded

lusty dew
#

@devout flicker No shit

#

I can read

knotty steeple
#

also

#

you can use f strings mmLol

devout flicker
#

then why u asking uwu

lusty dew
#

Cause, I am doing oldUser.username

#

and it isn't working

devout flicker
#

probably because he didnt change the username?

#

thats my thought

lusty dew
#

I am testing it on myself lmfao

devout flicker
mortal rose
#

@knotty steeple whats a fstring?

devout flicker
#

thats the file

harsh musk
#

Formatted string

mortal rose
#

oh ok

lusty dew
#

Ok

mortal rose
#

how would i do cogs

#

ive got like 3 versions of my bot

#

ill just do it on of the otheres

#

others*

knotty steeple
#

you can use f strings or format() a normal string

harsh musk
#

Or use c style string formatting but fstrings are easiest

mortal rose
#

it looks alot more complex

knotty steeple
#

what does?

#

the cogs

mortal rose
#

yea

glacial kestrel
#

what js lib would be best for a mod bot:
d.js, eris, or d.io

knotty steeple
#

jda mmLol

glacial kestrel
#

reee

mortal rose
#

dio? dun dun dunnnnn

knotty steeple
#

but no seriously

glacial kestrel
#

it was me dio

knotty steeple
glacial kestrel
#

idk

knotty steeple
#

its like

#

fucking

#

outdated

glacial kestrel
#

true

knotty steeple
#

af

glacial kestrel
#

fair point

devout flicker
#

java danBad

knotty steeple
#

i'd use eris mmLol

devout flicker
#

I'd use dotnet core

mortal rose
#

im dyinnggg

glacial kestrel
#

was thinking about it, seemed good

harsh musk
#

Everything thats more complex is faster

devout flicker
#

c++

knotty steeple
#

ew

#

c++

#

c# better

mortal rose
#

can someone just tell me how ill add someone elses name so when i say ^sab @modern zenithname it will do @mortal rose stabbed @modern zenithname

devout flicker
#

u mean like

#

@bold sluice kill

knotty steeple
#

you have to get the first mentioned user

devout flicker
lusty dew
#

oof @devout flicker Still not working

mortal rose
#

how would i get that mentioned user?

devout flicker
#

lemme check myself

knotty steeple
#

wouldnt discord.Member work

harsh musk
#

So comes here doesn't accept advice cus "too complex" then wants to get spoon-fed

mortal rose
#

i came here to ask the question i just asked

knotty steeple
#

but we are giving advice

#

which would make boat better ™

harsh musk
#

You cant use a member converter if you arent using the command extension @knotty steeple

mortal rose
#

because thats the only thing i dont know that i need

knotty steeple
#

oh sad

harsh musk
#

You need minimal python knowledge to put apart a string, can't spoon-feed you

glacial kestrel
#

google is your friend

knotty steeple
#

the docs are your friend

mortal rose
#

dude i know how to do everything that im tryna do apart from that one thing

#

thats why i asked

glacial kestrel
harsh musk
#

Yes that one thing requires minimal python knowledge

devout flicker
#

works for me @lusty dew

glacial kestrel
#

substringing/pulling apart strings is basic python

#

if you dont know that and everything else a simple google query will find it

harsh musk
#

Try reading a Python book before coding a discord bot

knotty steeple
#

i didnt even do that

harsh musk
#

Dpy is a huge framework for a noobie python guy

knotty steeple
#

i literally just did a course online

#

on python

harsh musk
#

You learn your preferred way

glacial kestrel
#

also i think i know you from somewhere natsu

#

indeed i do

mortal rose
#

natsu my bot has loads of shit ive got it to play music just fine and this is the only thing i need help with ]

knotty steeple
#

i mean once i tried python

glacial kestrel
#

looking at our friends anneChamp

knotty steeple
#

but i was like fuck it

#

its actually not bad

harsh musk
#

leak 😉

glacial kestrel
#

yep

#

my top languages are probably C++, JS/TS, Python

knotty steeple
#

TS

#

pls

lusty dew
#

TypeScript?

knotty steeple
#

i mean i only really know js and python

#

i can make a website with html and css

lusty dew
#

oof I am trying to learn Java

knotty steeple
#

but would be very bad

glacial kestrel
#

yeh typescript

lusty dew
#
client.on("userUpdate", (oldUser, newUser) => {
    let embed = new Discord.RichEmbed()
    .addField("Old Username:", oldUser.username)
    .addField("New Username:", newUser.username)
    .addField("Time:", new Date().toDateString())
    .setColor("RANDOM")

    modchannel = client.channels.get("492835442354552844")

    modchannel.send(embed)
})
#

This is my code

glacial kestrel
#

that's not java 👀

west raptor
#

ts isnt bad

lusty dew
#

and the oldUser.username isn't working

knotty steeple
#

no one said that @west raptor

lusty dew
#

nor is the newUser.username

glacial kestrel
#

are you sure your event is activating?

devout flicker
west raptor
#

SamuraiStacksToday at 8:23 AM
TS
pls
``` kinda gives the impression you dislike it
lusty dew
#

@glacial kestrel ik it isn't java XD

glacial kestrel
#

well you said learning java so i got confused

lusty dew
#

Lol

#

I said im trying to

#

Anyway

glacial kestrel
#

what lib are you using?

#

d.js?

knotty steeple
#

well your impression is wrong

lusty dew
#

discord.js

devout flicker
#

ts is cewl

#

why no discord.ts

lusty dew
#

lol

knotty steeple
#

you can use discord.js with typescript

#

typescript compiles to js

devout flicker
#

u see that

glacial kestrel
#

actually d.js already has built in TS bindings

#

no need

devout flicker
#

: kappa :

knotty steeple
#

or the other way around

#

uh

#

idk

lusty dew
#

@glacial kestrel I am indeed using d.js

devout flicker
#

latest ?

glacial kestrel
#

where are you putting the event? outside of the other events?

#

one noob mistake is people put a event within a event

lusty dew
#

right before the client.on("ready") event

#

and no it is not inside another event

glacial kestrel
#

is your message event working properly if you have one? if not it might be an issue with placement

lusty dew
#

it is working properly

glacial kestrel
#

hmm, odd

knotty steeple
#

why would there be an issue with placement

#

you can put events anywhere

glacial kestrel
#

for some reason my message event borked when above ready

knotty steeple
#

beside in other events

lusty dew
#

Idk what the problem is

#

lol

knotty steeple
#

maybe go to discord api

#

server

lusty dew
#

I am

#

they didn't really help much..

#

No one really answered me xD

knotty steeple
#

yea

#

sometimes they are no help

#

maybe official d.js server?

lusty dew
#

Tried there too

#

No one answered

#

just started helping someone else

knotty steeple
#

wew

lusty dew
#

yepo

#

lmfao

#

That is why I prefer to ask for help here

glacial kestrel
#

think im gonna go with eris for my mod bot tbh

earnest phoenix
glacial kestrel
#

lmao

earnest phoenix
#

Also 10/10 English

lusty dew
#

Umm don't make fun of them for speaking improper English, never know if that is not their first language

glacial kestrel
#

don't be a sjw

#

this is the internet

earnest phoenix
#

This guy don’t speak any other language I’ve talked to him before @lusty dew

glacial kestrel
#

your bound to be made fun of

lusty dew
#

ooof

#

Ok

#

He just needs help with grammar >~<

glacial kestrel
#

what would be a good name for a mod bot anneThink

earnest phoenix
#

Moddy

glacial kestrel
#

that's generic but i could use it lmao

earnest phoenix
#

Lmao name is clipy @glacial kestrel

glacial kestrel
#

oh god not clippy

earnest phoenix
glacial kestrel
earnest phoenix
#

Next bot: Microsoft clippy

glacial kestrel
#

make it so it randomly shows useless discord tips

earnest phoenix
#

Like make sure to give everyone @everyone perms @glacial kestrel

glacial kestrel
earnest phoenix
glacial kestrel
#

that's sad

earnest phoenix
#

yeah

loud salmon
#

Teamviewer good

topaz fjord
#

Windows remote desktop connection should work

earnest phoenix
#

dont work for me

glacial kestrel
loud salmon
#

Using it to connect to a vps? Thats a paddling

topaz fjord
#

Unless it wasn't configured properly on your vps

#

@glacial kestrel what about it

earnest phoenix
#

its worked perviously

glacial kestrel
#

contemplating eris vs d.js for a mod bot

earnest phoenix
#

but recently it just says internal error @topaz fjord

topaz fjord
#

eris gud

glacial kestrel
#

gunna go w/ eris

topaz fjord
#

I'm thinking of making a dart lib

earnest phoenix
#

do you know whats wrong with it?

#

it just says internal error when i try to connect

glacial kestrel
#

is the port for it blocked?

earnest phoenix
#

i would assume not as it worked previousl @glacial kestrel

golden nacelle
#

Does anyone know, why a "DefaultChannel" can be null?

#

Even if the server was just created

earnest phoenix
#
const discord = require('discord.js')
const ownerID = ['274284493043531776', '273504257464991754'];


exports.run = async (client, message, args) => {
if (message.author.id !== ownerID) return message.channel.send("You are not authorized to use this command."); 
message.delete(message.author.id)
 .then(message.channel.content(args[0]));
}

how can i make this work so if i do --say this is a test it responds with this is a test and not just this and ignore the rest after the first word

inner jewel
#

@earnest phoenix Array#join

earnest phoenix
#

Join the args

inner jewel
#

also what are you even trying to do with message.delete(message.author.id)

earnest phoenix
#

args[0] only looks at the first element in the array

#

And yes, what he said.

#

That's incorrect

#

delete the command I assume @inner jewel

inner jewel
#

yes but why the id as argument

earnest phoenix
#

That's now how you use that function

#

idk

#

¯_(ツ)_/¯

#

you could just do message.delete()

#

message.channel.content is not even a function either

#

What documentation are you reading 👀

golden nacelle
#

its david getter

#

xD

earnest phoenix
#

the one that the 3 year old who thinks they know how to code made @earnest phoenix

#

@inner jewel were do i put Array#join

#

what's the point of this getter?

golden nacelle
#

lol

earnest phoenix
#

@earnest phoenix join is an array method

#

Pretty self explanatory

golden nacelle
#

It gives you the content

#

pretty self explanatory

earnest phoenix
#

Also, you're using js if (message.author.id !== ownerID)

#

This will always return true

golden nacelle
#

this will result in error

earnest phoenix
#

couldn't you do !ownerID @earnest phoenix ?

#

No

#

That will always return false

golden nacelle
#

@earnest phoenix !== would never work != or ==

earnest phoenix
#

That's not what I am saying

#

@golden nacelle wrong, it works

golden nacelle
#

@earnest phoenix is it C#?

earnest phoenix
#

I am saying that the statement is incorrect because you're comparing a string to an array

#

it's javascript, pls

golden nacelle
#

Ah my bad i just checked your quote @earnest phoenix

#

The syntax on that quote is 1:1 same in C# except the !==

glacial kestrel
#

Isn't d.js guild.defaultChannel deprecated

west raptor
#

yes

earnest phoenix
#

@golden nacelle im using .js

golden nacelle
#

@earnest phoenix Ok i dont have anything to do with .js sorry

earnest phoenix
#

lol its grand

topaz fjord
#

debatable

earnest phoenix
#
    await delay(5)
    m.delete()```
#

this wont work

#

it dont send the message

#

What is delay()

#
    return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  }```
#

@earnest phoenix

#

Check the channel permissions

#

its in my server it has admin

#

I'm not going to ask why you made this whole function

#

when all you needed was a setTimeout()

#

I even think d.js has a built in timer, hold on

#

Yep, it does

#

why dont it send the message though

#

but like

#

why does have those brackets around embed

#

yeah but how do I only delete the message the bot sent and not the most recent @earnest phoenix

#

dont send

lusty dew
#

I am trying to do this

#

but it isn't working (this is from another bot btw)

rustic axle
#

Assuming js.. <message>.author and <client> should contain the info... You just have to call the data and phrase it

lusty dew
#

yea js

#

I want it to tell me the accounts age

#

I got the created On part down pretty sure

west raptor
#

use moment to format it

rustic axle
#

Yeah message.author should have a timestamp containing the age of the user who sent the message. You have to format it and subtract it to get the age

#

You may be able to find it by mentions if use use the client constructor

signal iron
#

all my bot does is send a link to the song September every 21st of September

#

thats it

earnest phoenix
#

ok

west raptor
#

ok

cyan trellis
#

How would I find out how many servers my bot is in in discord.js?

gilded blaze
#
<Client>.guilds.size```
cyan trellis
#

thank you.

#

@gilded blaze I'm getting an error saying "bot.guilds.size is not a function"

if(cmd === `${prefix}botinfo`){
        let bicon = bot.user.displayAvatarURL
        let botembed = new Discord.RichEmbed()
        let guilds = bot.guilds.size()
        .setDescription("Bot Information")
        .setThumbnail(bicon)
        .setColor("#9900ff")
        .addField("Servers", `in ${guilds} servers!`)
        .addField("Bot Name", `${bot.user.username}`)
        .setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`)
        return message.channel.send(botembed)
    }```
gilded blaze
#

Size is not a function

#

It's a property

cyan trellis
#

How would I make it say how many servers it's in then?

gilded blaze
#

What I typed

bot.guilds.size```
cyan trellis
#

thats what i did

gilded blaze
#

You did bot.guilds.size()

cyan trellis
#

but it gave me an error saying "bot.guilds.size.setDescription is not a valid argument"

#

bot.guilds.size.setDescription is not a function

signal iron
#

wait i have to code?

#

SCREW THAT CRAP

gilded blaze
#

That is cause you are using that method on the size

#

Not on an Embed object

cyan trellis
#

I don't understand q.q

gilded blaze
#

Move the guilds above your let embed

cyan trellis
#

ok

#

How do I do a welcome message image in discord.js?

golden nacelle
#

How can a defaultChannel be null?

slender thistle
#

Discord removed those

golden nacelle
#

i created a fresh new discord server and in the debugger it tells me that DefaultChannel is null

slender thistle
#

that's how

golden nacelle
#

fuck

#

😦

slender thistle
#

They removed those a while ago already :v

golden nacelle
#

Thats why its working on my old discord main server

#

and on the new one not

#

😦

cyan trellis
#

hey shivaco, how do I do a welcome image?

slender thistle
#

Canvas! Probably...

#

I am not a js coder so eh

topaz fjord
#

they removed defaultChannel after they added the ability to delete the general channel

#

@golden nacelle

slender thistle
#

You'd just need a library that's able to work with images

topaz fjord
#

for js you can use canvas or jimp

golden nacelle
#

@topaz fjord Thanks man now i need to try out how i can send a message to all 😄

topaz fjord
#

are you trying to send a welcome message?

golden nacelle
#

No i subscribe to the "Ready" event with the Discord.Net library in C# it just should tell when Bot is back up online

#

But the Ready Event doesnt have arguments

topaz fjord
#

you can try filtering through all the channels to find one that you have perms in

golden nacelle
#

im struggling along time with that shit lol

#
foreach (var x in _client.Guilds)
 {
           if (x.DefaultChannel != null)
           {
                        x.DefaultChannel.SendMessageAsync($"🔋 I've been                  updated and i am back online.\nCheck updatelogs here: {PasteBin}");
            }
}

^ this is what i currently had, but now i just got told by you defaultchannel hjas been deleted

inner jewel
#

this will get you banned from discord

topaz fjord
#

most libs have deprecated it

golden nacelle
#

is it called "GroupChannels"?

topaz fjord
#

also what natan said

inner jewel
#

and you'll get ratelimited as hell

cyan trellis
#

can someone tell me how to do the welcome image to people please?

golden nacelle
#

Ok i didnt know that i just got told and it doesnt even work 😃

#

Are the normal channels called GroupChannels?

glacial kestrel
#

d.js deprecated default channel yes, think eris did as well js wise, idk about other libs

#

uh i think groupchannels are group dms

#

atleast thats what it sounds like

golden nacelle
#

ok

glacial kestrel
#

also i know your name means 666 in hex lol

#

👀

golden nacelle
#

Nice lol your the 2nd one who told me that and got this name 1year xD

earnest phoenix
#

oh hey

#

i know your name

#

means 666

#

not because he just said

#

so make that 3 people

golden nacelle
#

ok

glacial kestrel
#

do you even know hexadecimal

golden nacelle
#

Yep

glacial kestrel
#

i also know that 29a used to be a group that created viruses back when MS-DOS was around anneCool

earnest phoenix
golden nacelle
#

py kappa

cyan trellis
#

if you know discord.js please dm me, I need help.

glacial kestrel
#

will throw dm

earnest phoenix
#

@cyan trellis me

#

I know discord.js

#

Too easy

#

@cyan trellis dm me

topaz fjord
#

d.js is the easiest lib

glacial kestrel
#

there's disco which was made by b1nzy, it's another python lib but idk how good it is compared to d.py

ruby dust
glacial kestrel
earnest phoenix
#

But I know at least two libraries

#

discord.js and discord.js-commando

glacial kestrel
#

smh never heard of eris

#

commando is ass

earnest phoenix
#

Commando is not ass

#

Is fun tbh

ruby dust
#

people nowadays are still talking about what is best? sigh

glacial kestrel
#

p sure most js devs here don't like commando 👀

earnest phoenix
#

I don't think so

glacial kestrel
#

it's best to make your own module/command framework tbh

earnest phoenix
#

Gonna to study eris

glacial kestrel
#

do that, eris is lovely

earnest phoenix
#

Ok.

#

Then I'm gonna make my own library

earnest phoenix
#

sorry

#
  member.createDM().then(function (channel) {
  return channel.send(1)(`Welcome to server unknown`)
}).catch(console.error)```
#

would this work?

bright spear
#

d.js?

ruby dust
#

...why are you welcoming a member when they leave the server Thonk

earnest phoenix
#

yea

#

right

#

XD

bright spear
#

you dont need createDM

earnest phoenix
#

oh

bright spear
#
client.on("guildMemberRemove", member => {
  member.send(`Welcome to server unknown`)
}).catch(console.error)```
earnest phoenix
#

oh

ruby dust
#

lets already ask a mod to kick hos bot for default welcome dm messages

earnest phoenix
#

how would i make the message get send after an amount of time

bright spear
#

use settimeout

earnest phoenix
#

sweet thanks

bright spear
#

@light magnet you need to host your bot on a server, not on your computer

ruby dust
#

keep the program running

rustic axle
#

A server

#

an actual server

#

not discord servers

earnest phoenix
#

@light magnet vps

bright spear
#

either pay for a server/vps or use a free host like glitch or heroku

earnest phoenix
#

@light magnet i will give you a vps right now

#

for the cheapest price

#

you buy one

#

you pay me i give you one

ruby dust
#

you are talking to someone that doesn't know much about how technology works, and is using google translate, be easy on them

earnest phoenix
#

or we could make a deal

knotty steeple
#
return channel.send(1)(`Welcome to server unknown`)
#

the fuck is this

topaz fjord
#

what in the fuck

knotty steeple
#

so in my eval command for my python bot i need return for literally everything how do i make it not like that

#

not actually everything but you get what i mean

topaz fjord
#

wut

ruby dust
#

repeating your question doesn't help it explain it to us

#

you need to elaborate

topaz fjord
#

set a bot status?

knotty steeple
#

yea i think

#

what library

junior hornet
#

Hi I have a question about discord does anyone know how to change what calls google or a game I’m playing

knotty steeple
#

change what calls google?

#

wat

slender thistle
#

Custom Playing status?

junior hornet
#

Like if I’m on google people see that I’m useing google how do I rename google

#

No

earnest phoenix
#

i have a report

#

i need to report rn

topaz fjord
#

what language/library are you using

slender thistle
#

That's not a language

knotty steeple
#

lmao

topaz fjord
#

thats a text editor

junior hornet
#

Victor they mean like html or c++

#

I think

slender thistle
#

kek

topaz fjord
#

still not a coding language

slender thistle
#

Programming language

knotty steeple
#

what ur using to make the bot

earnest phoenix
#

yeah

#

this is the issue

#

guys

#

thing for a second

#

this person

topaz fjord
#

if you explain your issue we could actually help

earnest phoenix
#

is using a clone other wise he would know what programing lanugauge he used

slender thistle
#

@junior hornet Btw, if you are on PC:
This wheel next to your username#discriminator -> Games -> Add it! and choose whatever application

earnest phoenix
#

look at this

#

i was making a deal with this person

#

he seems really young

junior hornet
#

Shivaco thx

knotty steeple
#

@junior hornet ^

earnest phoenix
#

can

#

a memeber do embeds?

#

like a user

ruby dust
#

no

earnest phoenix
#

ah then i found a dm advertiser bot

#

cause it was embed

ruby dust
#

the only embeds users can do if they send a link that can be embeded

earnest phoenix
#

yeah, well there was no link

#

so

ruby dust
#

you can also tell who is a bot and who is not cause bots have BOT tag in their name

earnest phoenix
#

no

#

i mean like

#

selfbotting

ruby dust
#

show

earnest phoenix
#

the gost server sends is a link

ruby dust
#

yeah... I don't see any links that would create such embed

#

report it to mods

earnest phoenix
#

this person isnt here thank god

ruby dust
#

give id

earnest phoenix
#

i think i will not report him

#

492779852500566018

ruby dust
#

that id looks like a brand new discord user

#

created yesterday, so they are most likelly aware that they are breaking tos so this is their alt account

junior hornet
#

thx for the help

earnest phoenix
#

yes

#

it was created a day ago

#

setTimeout(function(){client.channels.find('id', '435814918651117579').setName("♡An"); }, 3000);

#

is this current for this purpose

bright spear
#

why do you need to set the channel name to that every 3 seconds

#

that can be seen as api abuse

cyan trellis
#

@knotty steeple ur computer laggy af

knotty steeple
#

ok?

cyan trellis
#

lol

knotty steeple
#

@inner jewel hi this person randomly pinged me tell him ur not allowed to do that kthx

inner jewel
#

@cyan trellis no random pings

#

it's even in the topic

cyan trellis
#

ohk

lusty dew
#

Can you embed videos?

ruby dust
#

p sure you can't, unless you post a link to the video and let your message embed it

lusty dew
#

ok

lusty dew
#

How do I get the bot's avatar?

ruby dust
#

it's own avatar?

lusty dew
#

Ye

knotty steeple
#

get avatar from bot user

ruby dust
#

your bot is also treated as a user object, depending on the lib you are using you need to get the client user itself

lusty dew
#

What I am doing only giving me the URL

ruby dust
#

yes

#

url is what gives you

knotty steeple
#

what are you doing

lusty dew
#

I don't want the url though :/

knotty steeple
#

well what do you want

#

you cant get the image itself

lusty dew
#

I want it like that

ruby dust
#

you can download the image from the url, I guess

lusty dew
#

Ok

west raptor
#

bot have the property user

#

user has the property avatarURL

#

use it

lusty dew
#

How would I use setTimeout to delay something?

night imp
#

setTimeout(function(){
whattodo
}, timeinms)

#

ex

#

setTimeout(function(){
console.log("hey");
}, 3000)

#

This logs "hey" after 3 seconds

knotty steeple
#
setTimeout(() => {
    console.log("gey");
}, 3000)```
lusty dew
#

Ah ok

knotty steeple
lusty dew
#

    message.channel.send(`${client.user.tag} is going offline`)
    setTimeout(() => {
        client.destroy
    }, 3000)
    
}
#

Would this work?

knotty steeple
#

destroy is a function

lusty dew
#

Ik

#

I forgot to ad the ()

#

lol

#

Anyway

#

Would it work?

knotty steeple
#

test it out

lusty dew
#

Tyty

#

It worked

#

at first I had the thing as

#
setTimeout(() => {client.destroy()}, 3000)
#

Not sure if that would have worked

#

I think so

#

Oh yea that would work

lusty dew
#
RangeError: Maximum call stack size exceeded
    at rand (C:\Users\User\node_modules\unique-random\index.js:4:22)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
    at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
#

Can anyone help me and tell me why I am getting this?

lusty dew
#

I don't understand it o.O

earnest phoenix
#

how would i do a setTimeout for member.createDM

topaz fjord
#

log url

lusty dew
#

I did

#

@topaz fjord it works perfectly fine right now :/

slate kayak
topaz fjord
#

the connection to the thing timed out

signal saffron
#

You must vote to use the command from discord bots how can I do it

lusty dew
#
snekfetch.get(`https://discordbots.org/api/bots/YOURBOTID/check?userId=${message.author.id}`)
  .set("Authorization", config.dblToken)
  .then(response => {
    var check = response.body.voted;
    if(check == 1) {
     <PUT COMMAND HERE>    
} else {
    return message.reply("Upvote first!")
}
})

Not sure if this still works, but this is how I did mine @signal saffron

#

It worked for me

#

I hope it works for you

knotty steeple
#

did you have to spoonfeed him

west raptor
#

Just use the api?

lusty dew
#

@knotty steeple No I didn't but eh, I am tired of explaining things :/

west raptor
#

You did

knotty steeple
#

well dont say anything

lusty dew
#

Sorry :/

#

Can't even help someone

signal saffron
#

Hopefully I'll try it soon

lusty dew
#

Ok

slate kayak
#

@lusty dew what kind of bots do you make and with what program ?

#

sorry for the ping

lusty dew
#

It all good, I don't mind it

#

Also I use Discord.js and VSCode

#

And as for what kidn of bots I make that is any really

#

I mostly experiment

earnest phoenix
#

how could i make this work

.setFooter(`${client.config.botname}`)

where would it grab the client.config.botname from?

#

No idea

#

You can't just expect it to work like that

#

If client.config is undefined

knotty steeple
#

since when is config is a uh

#

what do i call this

#

class

#

i guess

#

idk

earnest phoenix
#

i need to make it so i dont have to change my footer for every single one every update, because i would have to change like 50 every time then

quartz kindle
#

its not, but he can set it himself

#

you can do something like client.config = config

#

where config is your variable that contains what you want

#

you have to build it yourself

#

or create a new object

knotty steeple
#

yea i know but

quartz kindle
#

like js client.config = {"botname":"yourbotnamehere","somethingelse":"etc"}

knotty steeple
#

did he do that

lusty dew
#

How do I turn an ID into a username?

topaz fjord
#

d.js?

gilded blaze
#

You could try fetching a user by the cache or using fetchUser if they aren't cached

topaz fjord
west raptor
#

What

gilded blaze
#

Oh it fetches cache automatically

west raptor
#

Oh

topaz fjord
#

.fetchUser is fully removed from master

#

if you have the id you can try

lusty dew
#

Yes discord.js

#

Also it is two ID's

gilded blaze
topaz fjord
#

message.guild.members.get('id')

lusty dew
#

I am not using master

topaz fjord
#

and that returns type GuildMember

rustic axle
#

Dev?

lusty dew
#

Dev?

#
"bot_devs": [
        "330528293843632130", 
        "479603748382179329"
    ]
#

It is in my config file

#

config.json

gilded blaze
topaz fjord
#

oh wait im stupid i cant read

lusty dew
#

so wait do

#

client.guild.fetchUser(config.bot_devs, true)

#

?

#

That

topaz fjord
#

client.fetchUser('id')

lusty dew
#

Ah ok

topaz fjord
#

you cant pass an array into it

lusty dew
#

:/

#

So how am I to get both ID's then?

knotty steeple
#

loop

topaz fjord
#

forEach or for loop

lusty dew
#

Ok

#

It just puts

#

[object Promise]

#

in the embed

earnest phoenix
#

Pls

#

Resolve the promise

topaz fjord
#

.then or async/await

lusty dew
#

ty

#

I just did

await bot.fetchUser(id)

lusty dew
#

Sigh I hate errors that make no sense

#
  .addField("Developers:", await bot.fetchUser("479603748382179329"))
                             ^^^^^

SyntaxError: missing ) after argument list
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at jsfile.forEach (g:\Bot\index.js:18:21)
#

It says it is missing ), but there is a )

topaz fjord
#

show code

lusty dew
#

Code^

vernal rivet
#

That's because your missing a ) in your code

lusty dew
#

No I am not

#

:/

#

I have already checked

#
    message.channel.send(embed)
  });
}
#

the });

#

in that

#

is supposed to close off the fucntion

vernal rivet
#

What's your editor you use?

earnest phoenix
#

How about you resolve the user outside of the embed field

lusty dew
#
.addField("Developers:", await bot.fetchUser("479603748382179329"))

but instead it is trying close it off there

earnest phoenix
#

Try (await bot.fetchUser(...)), Or refer to what I said above

lusty dew
#

Ok

#

Wait how do I resolve the user outside the embed field?

vernal rivet
#

Or take out the "" in the fetchuser?

topaz fjord
#

you cant take out the in fetchUser

lusty dew
#

Sigh

vernal rivet
#

Then resolve it outside the .fetchuser like itexlo said

lusty dew
#

I did

#
.addField("Developers:", await bot.fetchUser("479603748382179329"), true)
vernal rivet
#

Ok

lusty dew
#

Still no

#

:/

#

Still wants me to close off the function that is already closed

topaz fjord
#

try (await bot.fetchUser('id'))

lusty dew
#

I did that

#

Oh waiy

#

wait*

vernal rivet
#

Does anyone know category fetchuser falls under in discord.js doc?

lusty dew
#

I forgot one of them

#

let me do it to that one too

earnest phoenix
#
(node:13296) UnhandledPromiseRejectionWarning: ReferenceError: roles is not defined

code is:

 message.member.roles.map(roles => '!== @everyone', `\`${roles.name}\``).join(' ')
west raptor
#

ok so like

#

that !== is wrong

earnest phoenix
#

@earnest phoenix it's undefined

#

Can you see

#

im new to coding, i dont know how i would define it

vernal rivet
#

You didn't define roles

earnest phoenix
#

But you wrote it BlurpleEyes

inner jewel
#

@lusty dew what node version?

topaz fjord
#

oh hai natan

inner jewel
#

you're probably outdated

earnest phoenix
#

@earnest phoenix just tell me how to define it....

vernal rivet
#

@earnest phoenix did you learn any js?

inner jewel
#

since it doesn't recognize the await syntax

earnest phoenix
#

I kinda don't want to teach you basic JS man..

lusty dew
#

v8.11.2

topaz fjord
#

@inner jewel usually it would say unexpected identifier

#

if your outdated

earnest phoenix
#

@vernal rivet nr

lusty dew
#

@topaz fjord It did just a second ago

earnest phoenix
#

@earnest phoenix c'mon man

#

You'll never learn this way

inner jewel
#

async function ... would give unexpected identifier

earnest phoenix
#

fine, this is last time i ask, if you help

#

You have to learn to problem solve

vernal rivet
#

I highly suggest you go and learn js. Go to codecamdy and take the Js tutorial

lusty dew
#
.addField("Bot Owner:", (await bot.fetchUser("330528293843632130")), true)
                                   ^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at jsfile.forEach (g:\Bot\index.js:18:21)
earnest phoenix
#

Looks at the code

inner jewel
#

try updating node to latest

#

10.11 or something like that

lusty dew
#

Ok

earnest phoenix
#

8.11.1 supports es7

earnest phoenix
#

This can't be an issue with async await support at this level

lusty dew
#

How do I update Node?

#

DO I have to reinstall it?

#

Do*

earnest phoenix
#

@earnest phoenix would this be it then

const roles = message.guild.roles;
vernal rivet
#

Did you test it @earnest phoenix

earnest phoenix
#

I mean, this doesn't help you with the code you showed me

#

now message isnt defined in that code, uugh

vernal rivet
#

Go learn js before you continue working @earnest phoenix. I suggest going to codecadamy and take the js course

earnest phoenix
#

im doing that

vernal rivet
#

Ok

earnest phoenix
#

welp, fixed the roles being undefined

#

but now name is undefined

#

why doesnt the lazy way work for names and does for roles

#

ffs

vernal rivet
#

Look at discord.js documentation

earnest phoenix
#
message.member.roles.filter(r => r.name !== '@everyone').map(roles =>`${roles.name}`).join(' ')

did this, gave no error, but also gave no response

#

Correct

#

There is no "response" code there

#

so?

message.channel.send(message.member.roles.filter(r => r.name !== '@everyone').map(roles =>`${roles.name}`).join(' ')
)

would that work

#

ayy, it worked

#

Doesn't it feel good when you figure things out yourself?

#

yes

#

fuuuck

#

how do i make it be in bold when it responds

vernal rivet
#

2* in front and the end of it

earnest phoenix
#

so?

message.channel.send(message.member.roles.filter(r => r.name !== '@everyone').map(roles =>`\*\*${roles.name}\*\*`).join(' ')
)
west raptor
#

no

earnest phoenix
#

actually, ye

#

it worked

#

...

west raptor
#

wha

#

ok

earnest phoenix
#

but, how do i make a comma between each role?

west raptor
#

no need for the back slash

#

but

#

ok

#

.join() is your friend

#

use it

#

(ie. .join(', '))

vernal rivet
#

Yes it works \ but you didn't need to add them. It works fine with out \

west raptor
#

^

earnest phoenix
#

why wont this work

const discord = require('discord.js')
const ownerID = '274284493043531776';

exports.run = async (client, message, args) => {
    if (message.author.id !== ownerID) return message.channel.send("You are not authorized to use this command."); 
client.user.setStatus('invisible')
  .then(message.channel.send("Online Status Has Been Set To: ``invisible``"))
  .then(console.log)
  .catch(console.error);

}

it sets the status to idle instead of that, and does the same for dnd command

earnest phoenix
#

nvm

#

ignore that

#

anyone know much about sharding

quartz kindle
#

dont worry about it until your bot reaches 2k servers

earnest phoenix
#

meh, id rather have it now, anyways i already have it set up, i just need to know how i can use it in my bot stats command

west raptor
#

if you shard now you are going to end up using more resources than you need

#

dont yet

earnest phoenix
west raptor
#

wow

earnest phoenix
#

😂

west raptor
#

also cant you just do or no

#

i dont know html

earnest phoenix
#

No

#

href makes that blue clickable text on websites

#

It says google but it leads to bing

#

lol

west raptor
#

mhm

#

i know

earnest phoenix
#

but am i evil for doing that

quartz kindle
#

not as evil as doing yahoo or yandex

#

lmao

earnest phoenix
#

uwu

west raptor
#

now thats just plain mean

knotty steeple
#

of all the ones

#

you say

#

how dare you

west raptor
#

but like

#

bing gets bulli

#

we should support bing

knotty steeple
#

google >>

west raptor
#

google > bing > yahoo >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

earnest phoenix
#

bing

#

rip furryboye on bfd

knotty steeple
#

meh i dont care

west raptor
#

what did they do

knotty steeple
#

2 pings for no fucking reason

earnest phoenix
#

bfd got a strict no leaving the server policy for some reason

west raptor
#

tf

#

thats bs

earnest phoenix
#

if you

knotty steeple
#

actually this isnt the right topic for this channel

#

lets switch

earnest phoenix
#

to where

knotty steeple
#

ye

earnest phoenix
#

kk

#

done

lusty dew
#

How would I do a coin system?

#

I want to use sqlite but idk how to make the table for it

deep inlet
sick cloud
#

js not JS iirc

earnest phoenix
#

the hecc are you doing

deep inlet
#
'Oh, really?'```
#

(Capital JS used there, btw)

sick cloud
#

yeah

#

but

#

discord doesnt use github md

#

it uses its own flavour iirc

deep inlet
earnest phoenix
#

so uh

#

what language

deep inlet
#

I fixed it

earnest phoenix
#

oh ok

deep inlet
#

I realized the closer has to be on the next line

#

md btw

earnest phoenix
#

oh ok

deep inlet
#

Hey, I'm trying to make an overflow preventive recursive function, but it's not working out

  function wait (result, stack = 0, preventStack = false) {
    console.log(stack, preventStack)
    if (preventStack) {
      stack--
      return
    }
    if (stack === 1 && preventStack) preventStack = false
    if (stack === 20) preventStack = true
    stack++
    if (!result) wait(result, stack, preventStack)
  }```
Could someone help me out?
earnest phoenix
#

i dont see anythign wrong with that

#

so after 20 times it stops?

deep inlet
#

After 21

#

I think the problem is that once it returns, it continues after the last line of the function

earnest phoenix
#

ohk

deep inlet
#

Which just ends the function altogether

#

How do I prevent that?

earnest phoenix
#

well just return if stack === 20

#

lol

deep inlet
#

o maybe...

#
  function wait (result, stack = 0) {
    console.log(stack)
    if (stack === 1) {
      stack--
      return
    }
    stack++
    if (!result) wait(result, stack)
  }```
#

Hm

#

Doesn't seem to have worked

#

(Also, yes, I realize I did === 1)

earnest phoenix
#

why stack-- before retuning

#

and where is result comign from

deep inlet
#

Don't worry about result

earnest phoenix
#

is this some synchronous wait DansGame

deep inlet
#

Not important

#

HELP ME

earnest phoenix
#

explain what ur trying to do

deep inlet
#

Sigh I'm making a promise breaker

module.exports = (input, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => {
  let result
  input(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9).then(res => {
    result = {
      success: true,
      value: res
    }
    console.log(result)
  }).catch(err => {
    result = {
      success: false,
      value: err
    }
  })
  function wait (result, stack = 0) {
    console.log(stack)
    if (stack) {
      stack--
      return
    }
    stack++
    if (!result) wait(result, stack)
  }
  wait(result)
  return result
}
earnest phoenix
#

ur making a scuffed sync wait

#

why not just return what u get from the promise

#

tryign to wait like that is a bad idea, lemme explain why:

#
setTimeout(() => {
    console.log('Hello, world!')
}, 1000)
while(true) {
    //waiting
}
// Hello world will never log to console
deep inlet
#

Which is why I'm not using while

#

Either way, I can't return what I get from the promise because then I'm still returning a promise

#

Like, you mean like this?

async function test() {
  return 'test'
}

function bar() {
  return test().then(() => 1)
}
console.log(bar())```
earnest phoenix
#

i mean, wher eur doing console.log(bar())

#

u can always just do .then anc console.log inside it

deep inlet
#

Dude

earnest phoenix
#

but most likely you can do whatever you are doing inside an async function

deep inlet
#

My point isn't just to console log

#

My point is to return the value of a promise synchronously

earnest phoenix
#

u want to use the value of the promise afterwards?

deep inlet
#

Ye

earnest phoenix
#

ok so you do this

#

i mean i was just typing alot but

#

there no wai to get the 'test' from that without a .then or awaiting it

deep inlet
#

Which is why

#

I need help with this recursive func

earnest phoenix
#

why dont you jsut do whatever ur trying to do in the .then??

#

ur trying to like break space time here

deep inlet
#

Lmao

#

And I shall

#

As soon as I figure out this function

earnest phoenix
#

what are you actually trying to do

deep inlet
#

...

#

?
???

earnest phoenix
#

ur literally tryign to do something pointless

#

to get the return value from async function

#

u use .then or await it

#

what are you trying to do that stops you from doing either of those things

royal yacht
#

Any tips on how to add a radius on images using canvas?

signal saffron
#
.setColor(3447003)
.setTimestamp()
.setDescription('')
.setImage(resim)
return message.channel.sendEmbed(ataturk);
} else {
return message.channel.send(":no_entry_sign: **Hata**, bu komutu kullanmak için **12 saat aralıkla** `https://discordbots.org/bot/489816093955719177/vote` sitesinden botu oylamanız gerekmektedir. Onaylanması **1-4** dakikayı bulabilir, lütfen bekleyin.")
}
})}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'gif',
description: 'gif',
usage: 'gif'
}; (64)``` Error: `'} expected.'` (64,3)
frozen bough
#

is there a way to let my bot using emoji's?
i have custom emoji's, but for some reason are they not showing up as emoji, but as text.
like this: :Female: turns into: :Female: en not as an emoji.

timid vapor
#

well...

real ocean
#

You need to send it as <:name:id>

timid vapor
#

yep

#

same as i wanted to say

timid vapor
#

and to get emoji do \:emoji:

frozen bough
#

i do...

#

but seems not working.

#

it turns into : :Female: and not as an emoji.

solid cliff
#

is the bot in the same server where the emoji is

frozen bough
#

yes. 😉

amber fable
#

oh

#

hacked egolu's WTF

frozen bough
#

?

#

it seems a problem with the command.

slender thistle
earnest phoenix
#

What?

fresh kernel
#

Search for FFMPEG online

#

It's an installable

spice coral
#

can somebody help me with heroku bot hosting?

#

but I dont have the work process type

#

I know that I should add "Procfile" but where do I get it and how do I install it?

earnest phoenix
spice coral
#

?

slender thistle
#

Procfile is literally just a name of file without any extension

slate kayak
slender thistle
#

Add a function Map.

earnest phoenix
#

thats not a function hes making new instance of class celled Map