#development

1 messages Β· Page 391 of 1

terse badger
#

Your story is as inconsistent as it gets

earnest phoenix
#

oh well

terse badger
#

No one can help you then

earnest phoenix
#

just go awae

#

.-.

terse badger
#

No u

#

?

earnest phoenix
#

who

terse badger
#

Im so confused at what your actual problem is

earnest phoenix
#

who asked you

terse badger
#

You?

earnest phoenix
#

converting what to js?

terse badger
#

You asked pretty much everyone

earnest phoenix
#

ecksdee

terse badger
#

@earnest phoenix imajinasion

#

✨

earnest phoenix
#

processing

#

yes imjainasion

terse badger
#

Processing WHAT

trim plinth
#

processing to JS GWfroggerHyperXD

terse badger
#

wheeze

#

Wait

#

@trim plinth i think he said

#

Converting processing to js

trim plinth
earnest phoenix
#

write assembly in your head and convert to js on the fly

terse badger
#

Ill give one tatsu rep to anyone who actually manages to help him substantially

earnest phoenix
#

as i already said

#

i finished

terse badger
#

Well then what in gods name are you asking for help with???

earnest phoenix
#

im not

terse badger
#

You were?

earnest phoenix
#

(tbh i just wanted u to shut up)

terse badger
#

πŸ€” πŸ€” πŸ€” πŸ€”

earnest phoenix
#

and yes, i were

terse badger
#

Well then why did you ask if you managed to figure it out yourself

#

Seems like a waste of everyone's time

trim plinth
#

ok so you went from "I need help" to "JS is easy" to "I am converting processing to JS" to "I don't need your help" Thonk

earnest phoenix
#

lol

#

not anymore

terse badger
earnest phoenix
#

Thonk u r crazy

terse badger
#

Kids got a lot to learn about how to use the magic organ in his head

earnest phoenix
#

adults need to learn the magik of "give the thing they are asking you for, not a motivation"

terse badger
#

Why did you ask for help in the first place?

earnest phoenix
#

and that is actually mean

terse badger
#

Im not convinced you actually did solve your issue

earnest phoenix
#

good for u

terse badger
#

Adults dont need to learn that

earnest phoenix
#

ugh, look

terse badger
#

Kids gotta learn to think for themselves

earnest phoenix
#

#development is just people asking for help and getting laughed at or asking for help and getting no response xd

#

i found a solution to another problem

#

block you

terse badger
#

wheeze

#

Thx for late night entertainment i guess

#

@trim plinth guys more of an extra bad meme than you

#

Relinquish your nickname!

#

He really got me at the "adults need to learn the magik of "give the thing they are asking you for, not a motivation"" part

trim plinth
#

@earnest phoenix its more like people usually get their answers, or they ask a question, get their answer, and then ignore it and call everyone who tried to help them a dumbass and block them

earnest phoenix
#

._.

#

lol

terse badger
#

And a lot of asking for the simplest thing that the first google result will give ya

earnest phoenix
#

im mad cuz he wasted my time giving me the solution i didnt asked for and didnt want actually

#

after all hes not my father

terse badger
#

Its not the solution you wanted, but the solution you needed

trim plinth
#
  1. a. Don’t spoon-feed or attack beginners.
    Everyone starts somewhere and asking questions is smart. Do not attack people for not knowing how to code. Point them to great learning sources and help them with problems.
    However, you shouldn’t just give them finished code because then they only learn to copy more.
terse badger
#

Wonder if im actually blocked or not

trim plinth
#

Don't spoon-feed

#

hmm I wonder why you don't have the straight solution

elder rapids
#

Smh

topaz fjord
#

just realized this was dev not general

trim plinth
#

πŸ‘€

terse badger
#

😬

trim plinth
#

anyways we should probably just end this conversation, as its going nowhere

terse badger
#

Not gonna get anywhere. Personally i hope he looks back in years to come and is like"damn they were right"

elder rapids
#

Hey strum this is what roblox dev help is like 24/7

terse badger
#

Im in physical pain just thinking about it

trim plinth
#

@elder rapids bringing roblox into this GWahreeSure

elder rapids
#

Only did to mention a point

trim plinth
#

fair enough

earnest phoenix
#

var imgArray;
imgArray[0] = new Image();
imgArray[0].src = 'fly.png';

imgArray[1] = new Image();
imgArray[1].src = 'deltafighter.png';

imgArray[2] = new Image();
imgArray[2].src = 'trident.png';

imgArray[3] = new Image();
imgArray[3].src = 'sidefighter.png';

imgArray[4] = new Image();
imgArray[4].src = 'pulsefighter.png';

imgArray[5] = new Image();
imgArray[5].src = 'shadowx1';

imgArray[6] = new Image();
imgArray[6].src = 'Ydefender';
#

else if(message.content== 'fly random ship'){
message.channel.send(imgArray[(Math.floor(Math.random() * 6) + 1)]);
}

#

can u tell me what is wrong in this code please?

trim plinth
#

thats not how you do arrays

#

search it up on google

earnest phoenix
#

i did

#

i looked up for image arrays

trim plinth
earnest phoenix
#

but those look very different

trim plinth
#

read this

earnest phoenix
#

ok

trim plinth
#

and theres no such thing as image arrays, theres just arrays

terse badger
#

Lotta things wrong with that code

earnest phoenix
#

@trim plinth

#

var imgArray = [{files: ["fly.png"]}, {files: ["trident.png"]}]; is this any better?

trim plinth
#

better but still has issues

earnest phoenix
#

which ones?

trim plinth
#

^

#

that might help

earnest phoenix
#

im confused

#

lol, what are the errors

terse badger
#

@trim plinth have fun

earnest phoenix
#

i just dont see them

trim plinth
#

uhh run the code and see the console

#

it'll show the errors

earnest phoenix
#

okay

#

what he posted looks like valid js

#

just not a very good way to do it

trim plinth
#

hmm well the way they did the attachments isn't how to do it

earnest phoenix
#

yeah this is wrong

#

message.channel.send(imgArray[(Math.floor(Math.random() * 6) + 1)]);

#

but otherwise it works

#

just really long array initialization

trim plinth
#

I just do times the length of the array GWnanamiLaceShrug

#

no +1

earnest phoenix
#

lol

#

is just messing around

#

it doesnt show errors @trim plinth

#

it just doesent work

trim plinth
#

then you should wrap your code in try and catch to find the error

earnest phoenix
#

what is that?

trim plinth
earnest phoenix
#

since i dont know how to use that

#

i quit that command

trim plinth
#

ok

earnest phoenix
#

bye bye arrays

errant bone
#

Anyone have any ideas on JUnit testing with JDA?

trim plinth
#

you're going to need them some time in the future so its not ideal to avoid them GWcentralPikaLUL

earnest phoenix
#

ik

#

ill try to figure it out with tryal and error

#

a know coding languages base

#

so it shouldnt be that hard

trim plinth
#

it will be hard

earnest phoenix
#

(10 hours later deskflip)

topaz fjord
#

you could always try to learn js

#

Β―_(ツ)_/Β―

earnest phoenix
#

OwO he must have an 8ball command but doesnt understand arrays 𝙸 𝚜𝚎𝚎 𝚞 πšŒπš˜πš™πš’/πš™πšŠπšœπšπšŠ-πš’πš—πš πŸ‘€

#

dont need an array for that though

#

random number 1-8 and then a lot of ifelse

topaz fjord
#

but

#

bad

fresh shuttle
#

I need help with this

#

SyntaxError: Unexpected end of JSON input

topaz fjord
#

check your json file

#

syntax might be wrong

fresh shuttle
#

This is all I have in my json...

#

{}

frail harness
#

why are you using json as datastorage lmao

#

use sqlite

#

or nedb

#

or something other than json

gilded thunder
#

Without quotes it won't load.

earnest phoenix
#

how do I make a command for both people with a specific role and me (if I don't have role)?

gilded thunder
#

Language?

earnest phoenix
#

discord.js

gilded thunder
#

Can't help, sorry.

earnest phoenix
#

kewl

#

I have fixed roles and me but not both

low owl
#

Ahm, how do you check if people have a specific role?

#

Basically just post a bit of your code @earnest phoenix

earnest phoenix
#

its eg

#

eh

#

member.roles.some(stuff)

#

kinda

low owl
#

πŸ™„

#

Anyway just use multiple conditions in your if statement..

earnest phoenix
#

@earnest phoenix wat do u mean?

low owl
#

Can't be arsed to help him if he posts so little details lol

gilded thunder
#

What about my thing πŸ˜‰

low owl
#

@gilded thunder is there any exception? Can you break in debug and look at the value of your expression?

gilded thunder
#

Ok, gimme a sec.

#

Just working on my personal butler bot.'

#
  File "bot.py", line 70                                    
    embed.add_field(name="Guilds", value=len(bot.servers)), 
inline=True)                                                
                                                            
           ^                                                
SyntaxError: invalid syntax```
terse badger
#

Youve got one too many closing brackets...

low owl
#

Ah, good catch. Didn't even see that.

gilded thunder
#

Aha, let me try remove one and see.

#

AHA!

#

Thank you @terse badger

terse badger
#

Cmon man, it said syntax error :p

#

Should be the first thing you look at ;)

gilded thunder
#

Well I didn't.

#

Working on too much.

terse badger
#

Now you know πŸ‘

gilded thunder
#

I sure do.

#

Thanks blobthumbsup

terse badger
#

Npnp

opaque zinc
#

Hey! Any idea how to get info that user has been joined voice channel? Discord Py

earnest phoenix
#

cant u check the docs?

#

lets take over the world

opaque zinc
floral stone
#

the client doesn't have attribute member

#

you are basically fetching the user wrong

#

should be

#

async def on_voice_state_update(member, before, after):

#

and remove client.

#

@opaque zinc

opaque zinc
#

Seemd something strange - no?

earnest phoenix
#

in discord.js how do you make it so it’s maps out the real user count and bots count in a guild

#

use the filter action

#

uuuh

#

Hey

#

Ive got a question

#

So i have my bot running

quiet bobcat
#

ok?

earnest phoenix
#

But thats only while i have node opened

#

How do i make it to run for example when i turn off my PC?

quiet bobcat
#

To host it 24/7 you'd either need a vps or use a website eg glitch or heruko

earnest phoenix
#

What is a vps?

#

An alternative server?

gusty topaz
#

Virtual Private Server

earnest phoenix
#

Okay

gusty topaz
#

they are paid services

#

which give you access to a server

earnest phoenix
#

:c

gusty topaz
#

Here is a list:
https://www.ovh.com/ - Cheap servers, not very fast network, quite decent reliability
https://www.scaleway.com/ - Cheap servers, decent network, decent reliability
https://bakeryhosting.us/ - Cheap servers, no bandwidth limits, small company, decent reliability
https://www.vultr.com/ - Expensive, very good servers, excellent reliability
https://www.digitalocean.com/ - Expensive, extremely fast network, excellent reliability
https://vpsdime.com/ - Cheap, never have had experience with it
https://cloud.google.com/ - Expensive, scaleable, hosted by google, has free trial,
https://aws.amazon.com/ - Expensive, scaleable, hosted by amazon, has free trial
https://azure.microsoft.com/en-us/ - Expensive, scaleable, hosted by microsoft

earnest phoenix
#

Ok

opaque zinc
#

contabo also good

earnest phoenix
#

And whats heruko?

quiet bobcat
#

It's kinda like glitch

#

if you know what that is

earnest phoenix
#

.-.

#

Ok

quiet bobcat
#

google it

earnest phoenix
#

Okay

#

And will that help me?

#

How do u guys host your bots?

opaque zinc
#

I host on my own server

earnest phoenix
#

Wow

#

I wont ask you for it because its your server ' ^ '

quiet bobcat
#

I host on a vps

earnest phoenix
#

Okay

#

How much a month?

quiet bobcat
#

Depends on which one you choose

earnest phoenix
#

Ok

gusty topaz
#

look on the sites I linked

earnest phoenix
#

I did

gusty topaz
#

for a small bot the cheapest server should be fitting

#

around 5 bucks

earnest phoenix
#

Lol, im not thinking to pay

#

I dont have cyber muns

#

Only papers and coins

static oasis
#

What's best to put in my bot's desc? (the html preview)

earnest phoenix
#

Ummmm

#

Is cool bot.

#

Idk really

floral stone
#

Can you get other users information beside the users logged in with oauth2?

earnest phoenix
#

Idk

gusty topaz
#

you can make an authenticated request to /api/v6/user/:id

#

iirc

earnest phoenix
#

I am the last one who knows about online stuff

floral stone
#
    print("whatever")
    print(member.voice.joined")```
gusty topaz
#

@earnest phoenix if you dont know, simpy dont answer

floral stone
#

@gusty topaz docs?

earnest phoenix
#

Okay

floral stone
#

@opaque zinc

#

look above

earnest phoenix
#

Im gonna look up a free vps

opaque zinc
#

Python doesnt read more than 2 arguments, so i found some solution @floral stone

@client.event
async def on_voice_state_update(before, after):
    print(after.name + ' joined ' + str(after.voice_channel))
floral stone
#

Wait, are you using async or rewrite?

opaque zinc
#

async

floral stone
#

My bad

#

@gusty topaz where's api v6 docs!?

opaque zinc
#

Now i need to guess how to get if user disconnected from voice channel

gusty topaz
#

you replace @me with the id

#

although you need to be authenticated with a bot token

#

and that endpoint has very harsh ratelimits

floral stone
#

How harsh!?

gusty topaz
#

1 request per second

heady zinc
#

it's not that harsh considering you shouldn't need to use it frequently ZoomEyes

floral stone
#

per second isn't harsh

#

It's for viewing users profile

gusty topaz
#

compared to other dapi endpoints

#

it is harsh

floral stone
#

I mean, no one is going calling the api every half second

floral stone
#

Do i need to send any other headers besides {"authorization":"token"}

toxic oracle
#

U never know with some of these Devs lol

floral stone
#

nvm, got it

earnest phoenix
#

i cant upload my shit to github

#

rip bot project

topaz fjord
#

you dont need too

#

the github option in the form is optional @earnest phoenix

hushed oyster
#

what postgresql data type should i use for ids

topaz fjord
#

if there is bigint try that else try string

low owl
#

It has BIGINT

earnest phoenix
#

.help

quiet bobcat
tepid laurel
#

@hushed oyster integer I thought

hushed oyster
#

integer is too small

#

i used bigint

tepid laurel
#

Oh

terse badger
#

Shouldnt IDs be strings?

#

Youre not really gonna perform arithmetic on them id assume

spring ember
#

Bigint

#

Trust me I use pg

earnest phoenix
#

boi

spring ember
#

Waddap boi

solemn obsidian
#

It CAN be, but the correct way is to have bigint

spring ember
#

Strings is less optimal because it takes more space

#

Are

cinder junco
#

Tru

spring ember
#

1 char takes 7 bits or 8

#

while bigints are 64 bita

cinder junco
#

HoW aBoUt U sToR iDs As FlOaTs

prime cliff
spring ember
prime cliff
#

Its not shitpost its the dbl website nerd

#

🀦

terse badger
#

The entire server is a shitpost

solemn obsidian
spring ember
#

So it's either general or shitpost

prime cliff
#

Yea ik i thought i was in general lul

upper ember
#

reee

little garnet
#

One message removed from a suspended account.

upper ember
#

hi

earnest phoenix
#

how would my bot react to its own message (discord.js)

#

this doesnt work

msg.channel.send("**Voting**")
    .then(function (message){
      sleep.msleep(1500)
      msg.react("πŸ‘")
      msg.react("πŸ‘Ž")
    })
uncut slate
#

you're creating the message variable in that .then function

#

use it

earnest phoenix
#

wow thanks lmao

uncut slate
#

np

earnest phoenix
#

I dont see how they are compatible

#

How can I make a command which makes a message and then adds 2 emojis, and after some time it random picks 1 user and says their name in the channel? (discord.js) Β―_(ツ)_/Β―

opaque zinc
#

Hello! How can i make a function similar to this: While user connected in channel +1 every second. And when disconnected - stop counting
p.s python.
I have tried many methods but theY didnt work

terse badger
#

@earnest phoenix break the problem down into small steps, solve the steps one by one

#

Dont think of the problem as a whole

terse badger
#

Whats the difference between d.py async and rewrite

earnest phoenix
#

create a bot ofr me

trim plinth
#

no

spring ember
#

Dynamic programming

faint scarab
#

Hi!, I Need Some Purge or Afk Code. Anyone Have The Code?

#

for discord.js

floral stone
#

<style>.alert {display: none !important}</style>

#

@hushed oyster put that on your bot page to hide the aler tor advertising

wraith cape
#

Can someone help me fixing this thing: Everytime i enter node . to start my bot it says the following:
Error: Cannot find module 'C:\Users\Kucni'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3 And yea C:\Users\Kucni isnt a module? IM CONFUSED

#

And by the way im a begginer so..

spring ember
#

What are your imports?

little garnet
#

One message removed from a suspended account.

spring ember
#

Language?

little garnet
#

One message removed from a suspended account.

spring ember
#

Library?

wraith cape
#

Im using discord.js

spring ember
#

Not u

#

@ay what are your imports

earnest phoenix
#

@everyone create me a bot who s name is Fon-Bot And he does fun moderation nsfw and level

#

sait yes here

trim plinth
#

no

spring ember
#

Wtf

#

First don't tag everyone second wtf

trim plinth
#

it was a good try

#

but it failed

spring ember
#

Go learn to make a bot yourself

#

You can add a bot who does that though

earnest phoenix
#

JS

I want the bot to reply if the bot is tagged.

wraith cape
#

I hatte when vs isnt responding

earnest phoenix
#

@wraith cape cd <the_bot_folder>

wraith cape
#

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

earnest phoenix
#

Wdym?

wraith cape
#

nuuuuuuuuuuuuuuuuuuuuu

spring ember
#

Try to catch events @earnest phoenix

#

@wraith cape lol

wraith cape
#

I was making a folder and the js.txt thingy and then....Look........VS DOSENT REPOSND

#

Its back

trim plinth
#

it isn't js.txt GWnanaREEEEEEEEEE

wraith cape
#

Im a beginner i never made a bot well i tried but i failed

idle mountain
#

@earnest phoenix People aren't going to make you a bot. There are plenty of moderation, NSFW, and level bots on DBL.

trim plinth
#

its so simple, bot.js not js.txt

spring ember
#

Vs code I guess

wraith cape
#

so make a folder then the file inside of it?

trim plinth
#

yes

wraith cape
#

oh tanks

spring ember
#

I use jetbrains for EVERYTHING

trim plinth
#

jetbrains makes my computer angery

spring ember
#

Lol

#

It does

wraith cape
#

Brains

#

oK I MADE THE FILE NOW DO I NEED TO DO SOMETHING

#

Its not ready isnt it?

trim plinth
#

show your code now

spring ember
#

Dude learn js

#

Send code

#

Hastebin pls

trim plinth
#

u saw nothing

wraith cape
#

Confused.............

spring ember
#

@trim plinth that's what I thought lol

#

@wraith cape send code

trim plinth
wraith cape
#

The code in vs?

trim plinth
#

yes

wraith cape
#

oky

trim plinth
#

send a screenshot

spring ember
#

Through hastebin

trim plinth
#

ew no

spring ember
#

Yes

wraith cape
#

No

trim plinth
#

you still haven't set the file extension correctly GWfroggyFacepalm

wraith cape
#

how do i do it

spring ember
#

Have a prefix pls

trim plinth
#

what is your file's name right now

spring ember
#

For the sake of humanity

wraith cape
#

Untiteld-1

#

xD

trim plinth
#

oh my fucking god

spring ember
#

Also use .startswith

trim plinth
#

have you actually listened to us like at all

wraith cape
#

I NEVER MADE A BOT AND IM CONFUSED RIGHT NOW

trim plinth
#

learn JS first

#

before you throw yourself into making a bot

wraith cape
#

JUST TELL ME WHAT DO I DO

#

IM DONE

#

BYE

trim plinth
#

ok what to do

#

learn JS

edgy needle
#

does anyone know how do i make my bot send a message every 1min without any input

#

Language : Javascript

heady zinc
#

See the setInterval() method

edgy needle
#

ok

earnest phoenix
#

XD

waxen mango
#

can anyone help me add music to my bot pls?

#

its js

earnest phoenix
#

pls spoonfeed me

#

i dont know image editting

#

can someone send me a code of an image editing bot?

trim plinth
#

no

earnest phoenix
quiet bobcat
#

Rule 7b doesn't let us

spring ember
#

Stop

#

I will call a mod

earnest phoenix
#

.-.

#

k

#

i asked for help without spoonfeed

trim plinth
#

if we gave you help for that it would be spoonfeed

earnest phoenix
#

i recived an answer like "figure it out by ursel"

#

"can someone send me a code of an image editing bot?" this would be spoon-feeding which we're not allowed to do

#

well

#

i mean before πŸ˜„

#

it was all like "here u have a thing that may help u"

#

i dont understand that thing

#

"what is wrong?"

trim plinth
earnest phoenix
#

"figure out by urself"

trim plinth
#

last time I checked when you asked for help and it wasn't asking for spoonfeeding we tried to help you and you didn't listen

earnest phoenix
#

well

#

anyway, bye

trim plinth
#

cya

earnest phoenix
#

no cya

#

im leaving server LOL

trim plinth
#

ok

#

cya

earnest phoenix
#

bye πŸ˜„

#

pls meme

south solstice
#

I was trying to follow the moderation guide provided by Discordbot site and for some reason the code isn't working anymore for me atleast

topaz fjord
#

paste code and error

south solstice
#

Will in abit, uploading an updated version of my bot to my server rn, afterward

earnest phoenix
#

ok im back

#

var kebbls=imgArray.get[Math.floor(Math.random()];

#

so i got this array

#

and it says there is an error

#

its supposed to give a string

#

so can u please tell what is wrong?

topaz fjord
#

you get an element of an array by doing imgArray[Math.floor(Math.random()];

#

not .get

earnest phoenix
#

okay thanks

#

and last question

#

how do i make it to get

#

the random string from the lenght of the array?

topaz fjord
#

wut

earnest phoenix
#

i mean random between 0 and imgArray's lenght

#

@topaz fjord hello?

#

var ex= " Hello I Exist";

#

alert (ex);

#

TnT

#

left alone

trim plinth
#

learn JSβ„’

earnest phoenix
#

hey

#

please tell me T-T

#

is no spoonfeeding

#

@trim plinth

#

is yes spoonfeeding

prime cliff
#

i see forkfeeding

earnest phoenix
#

why

#

im asking why it says error

#

and no, teaching sintax is no spoonfeeding

#

and no, learn nodeβ„’

#

var eat=arrae[Math.floor(Math.random()]; it puts error at the semicolon ;n;

#

oh no nvm

#

your missing ) after ()

#

i missed a parenthesis

#

we figured out at same time :3

#

thanks

#

all that just for a parenthesis

#

yup

#

and som sintaxis XD

#

im sorry

#

syntax?

#

yus

#

that thing πŸ˜„

snow talon
#

@gilded plank owner @snow talon

gilded plankBOT
#

That bot wasn't found

gilded thunder
#

Would this work for only allowing a command to be ran on a specific server?

    if ctx.message.author.server.id == '429426403088400406':
quasi marsh
#

you can shorten it to ctx.message.server i think

#

or maybe even ctx.server

#

but that would work methinks

gilded thunder
#

Alright, I'll try that.

#

Alright, now it just sends my else: error message on all servers.

#
@bot.command(pass_context=True)
async def nsfwrole(ctx):
    if ctx.message.server == '429426403088400406':
        role = discord.utils.get(member.server.roles, name='nsfw')
        await bot.add_roles(member, role)
        embed = discord.Embed(title="Role applied!",  description="NSFW role added.", color=0x146aeb)
        await bot.say(embed=embed)
    else:
        embed = discord.Embed(title="You aren't in </CodeHangout>, this command won't work.", color=0x146aeb)
        await bot.say(embed=embed)
frail harness
gilded thunder
#

Thanks!

frail harness
#

np

grizzled isle
#

Requesting Help
Language: javascript
Libraries: discord.js
Code:

const client = new Discord.Client()
try {
  process.on('unhandledRejection', error => client.guilds.get('366705297013735425').channels.get('426385063471480832').send({embed: {
        title: "Event Error Has Occured: guildMemberRemove",
        fields: [{
          name: "Error Name",
          value: error.name
        }, {
          name: "Error Message",
          value: error.message
        }, {
          name: "Stack Error",
          value: error.stack
        }]
      }}));
} catch (error) {
  console.log(error)
}```
**What it's supposed to do:** Supposed to catch any Unhandled Promise Rejections and send it to a channel where I can access it when I am on the go
**Problem:** It keeps on saying 

process.on('unhandledRejection', error => client.channels.get('426385063471480832').send({embed: {
^
TypeError: Cannot read property 'send' of undefined

Any help will be appreciated
trim plinth
#

you would rather get a channel by name than id

grizzled isle
#

I thought its impossible for any channel id to be the same? Besides, I am getting the guild first, then the channel.

gilded blaze
#

Is it worth it to switch from Discord.js to Eris?

trim plinth
#

yes

elder rapids
#

very

gilded blaze
#

GWcfcThonk maybe I should switch

trim plinth
#

you probably should

#

if you plan on having a big bot

low rivet
trim plinth
gilded thunder
#

@low rivet agreed

earnest phoenix
#

that works for meh

#

what's the smoothest way to have a bot?

trim plinth
#

no smooth way, everyway makes you angery

earnest phoenix
#

I mean

#

like minecraft has better fps when like c+ or something then when java

trim plinth
#

hmm

#

asking for best lang and library combo?

earnest phoenix
#

nothing

#

oh

#

mk

#

There is no better

trim plinth
#

yeah

earnest phoenix
#

aw

#

there might be shit lib's but there is no better lib or language

trim plinth
#

if you're using JS just use Eris kthx

earnest phoenix
#

no u

#

depends for woot xD

trim plinth
earnest phoenix
#

by playing music

trim plinth
earnest phoenix
#

it stopped working like

#

it spam leave-join the voicechannel xD

trim plinth
#

hmm

earnest phoenix
#

but now I use JS btw xd

#

its ez

#

takes me only a day to figure something out

#

xd

trim plinth
#

gl

earnest phoenix
#

ew

#

I tried using youtube tutorials and other stuff from google searching but none has worked to use ytdl thingy on L

#

on discord.js

small solar
#

How do you turn off your bot from eval (discord.js)?
process.exit() just reboots it.

gusty topaz
#

process.exit reboots it because probably you run it in a program that automatically restarts the program

#

you'd have to pm2 stop it (if you use pm2)

small solar
#

i am using pm2

gusty topaz
#

exactly

#

pm2 restarts your bot

#

do you run anything else in pm2 or just the bot?

small solar
#

But I can't access the console right now and can't use pm2 delete

gusty topaz
#

you can run console commands

small solar
#

Just the bot

gusty topaz
#

require('child_process').execSync(PUT THE COMMAND HERE IN QUOTES).toString('utf-8')

#

will run the command

#

and return its output

small solar
#

Alright, thanks

gusty topaz
#

yw

small solar
#

πŸ˜„

gilded thunder
#

Can I just put #general in the get_channel("channel here") bit?

#
# on server join
@bot.event
async discord.on_server_join(server):
    channel = server.get_channel("#general")
    fmt = 'Hi, I'm Arc!'
    await bot.send_message(fmt.format(server))

Doesn't seem to work.

#

async is invalid syntax.

spring ember
#

Yeah you defined the signature of the function wrong

#

Wtf is discord. In the name wdym?

gilded thunder
#

Do I remove that?

spring ember
#

Remove the discord

#

.

gilded thunder
spring ember
#

The function annotation knows how to handle the name

#

Async def

#

You forgot the def

gilded thunder
#

Yep, loads now.

spring ember
#

Also don't send a message on server join

#

It's not allowed here on dbl

gilded thunder
#

But it's already on the server.

spring ember
#

So remove it

gilded thunder
#

This is for when the bot is invited to a server.

spring ember
#

Yes

#

It's not allowed

gilded thunder
#

Whatever then.

#

Other servers can suffer.

#

By not having the Muted role for the mute command and a quick start.

#

How can I make a reaction based menu then, for a manual setup?

spring ember
#

I think there is an extension for that otherwise make it yourself

#

And it's against the ToS here so if you won't remove it the mods will simply kick your bot

gilded thunder
#

Yeah whatever, I removed it now, you need to run a command with administrator permissions to do what the join thing would of done.

spring ember
#

I actually made a reaction menu, I will send it maybe when I get home

#

You can remind me then

austere barn
#

pls can someone tell me how to make an canvas (for a cool welcome message)

#

like this ^

spring ember
#

Photoshop?

austere barn
#

yeah thats photoshop

#

CC 2018

spring ember
#

Or are you asking how to code the avatar

austere barn
#

how to code that

#

vut that ur profile picture of course

spring ember
#

Use transparent and add layers on that

austere barn
#

...

floral stone
#

@gilded thunder I don't see nothing wrong with an on server join

austere barn
#

im not a pro-developer

floral stone
#

It's not against the rules

austere barn
#

im just a beginner

spring ember
#

@floral stone message on server join is not allowed

austere barn
#

and i want a bot that sends this when someone joines

floral stone
#

@spring ember quote it

spring ember
#

It's when the bot is added

#

It sends a message

floral stone
#

But the bot is already on here

#

And it's not against the rules

spring ember
#

It is look at the bot is kicked

austere barn
#

i maken a bot

#

and i want that he sends this messages

floral stone
#

on server join doesn't fit that description

austere barn
#

a canvas

spring ember
#

What language @austere barn

floral stone
#

@gilded thunder you don't need to remove it

spring ember
#

I think he does

#

Let's ask a mod

floral stone
spring ember
#

I'm afraid to tag a mod so you go for it

floral stone
#

join message is members join

austere barn
#

what do u mean bro?

floral stone
#

Saying this user joins this server

austere barn
#

@spring ember what do u mean bro?

#

where im from?

spring ember
#

@austere barn what language do you use

#

To develop

austere barn
#

uhh?

#

its just discord.js

floral stone
#

What coding language

#

so Javascript

austere barn
#

yup

#

yh i think

spring ember
#

Oh not my expertise

austere barn
#

Im created a bot and i want that he is going to say in the server chat

#

that

#

like the bot sarah

floral stone
#

I think they used pillow for python unless there is some sort of image generator package.

austere barn
#

but then my bot

floral stone
#

Do you want to send an image or just an on_join text

austere barn
#

uhh

#

that background and the message on it "Welcome"

#

with hes name

#

and hes profile picture

#

u know

floral stone
#

Look into that, I don't usually use Javascript.

spring ember
#

Very specific

austere barn
#

its for a discord bot right?

spring ember
#

Veeery specific

#

@austere barn I don't think so

#

General JavaScript

austere barn
#

owh

#

i want it for a discord bot

spring ember
#

You can send an image file though

floral stone
#

It's possible to generate images on Javascript

spring ember
#

Just create one

austere barn
#

its called canvas

floral stone
#

use the on_join member event

gilded thunder
#

I made it manual now, dw

spring ember
#

Learn JavaScript first

austere barn
#

uh

floral stone
#

@gilded thunder manual?

austere barn
#

i don't want to create website /html/css or a app

#

i just want to make a discord bot

gilded thunder
#

You run config and it does want I wanted it to do.

spring ember
#

It kind of ruins the idea isn't it @gilded thunder

gilded thunder
#

WELL I DON'T WANT IT REMOVED.

floral stone
#

Dondish, this user wants to generate images with canvas for people who join.

spring ember
#

I know

#

He doesn't know js

floral stone
#

It won't get removed from the server, dude.

#

He's a beginner

#

as stated

gilded thunder
#

It's fine, manual looks better anyway.

floral stone
#

Manual how that

gilded thunder
#

The embed I made looks good.

spring ember
#

Great

gilded thunder
#
# config command
@bot.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def config(ctx):
    author = ctx.message.author
    await client.create_role(author.server, name="Muted", permissions=)
    embed=discord.Embed(title="Configuration for Arc.", description="Due to Discord Bot List not allowing events to be ran when the bot is invited to a server, you now need manual setup for mute and other features.", color=0x0080ff)
    embed.set_thumbnail(url="https://joshek.xyz/arc/Arc.png")
    embed.set_footer(text="Configuration will be automatic for ease of use, all I'm doing is making a Muted role.")
    await bot.say(embed=embed)
#

Just need to calculate role permissions

floral stone
#

You can do it on join

gilded thunder
#

Which I know how.

floral stone
#

Dondish didn't know what he was talking about.

gilded thunder
floral stone
#

Join messages refer to member join message

#

On_server_join ain't really going to be a problemm

#

plus, you can make an if statement checking server ids.

gilded thunder
#

This is when the bot joins a server, it says some stuff and makes the muted role.

floral stone
#

plus, you can make an if statement checking server ids.

#
if server.id == "dbots id":
    return```
#

therefore, it won't add the role on_join

austere barn
#

@floral stone u know the welcomer bot?

gilded thunder
#

But it's already on the server.

floral stone
#

plus your bot most likely don't have permission to do it so you'll be fine

#

exactly

#

you will be fine

gilded thunder
#

Alright.

floral stone
#

@austere barn I'm aware of it, I generate my own images myself.

gilded thunder
#

Thanks for understanding what I was talking about πŸ˜›

floral stone
#

No problem! Enjoy botting

austere barn
#

@floral stone do u know the code of welcomer?

spring ember
#

Yeah I kind of was wrong

#

You are not allowed to dm on join

#

Sorry for that

austere barn
#

Advertising?

floral stone
#

@austere barn I use python to generate my images.

austere barn
#

yes but do u know how to make a bot like Welkomer or Python?

gilded thunder
#

@spring ember All good mate.

austere barn
#

a canvas

floral stone
#

python is a coding language different from Javascript and there's a package called pillow.

spring ember
#

@gilded thunder πŸ‘Œ

spring ember
#

Oh pillow

#

What a wonderful lib

floral stone
#

Indeed

spring ember
#

But now I moved to Java

#

And I don't know what to do

floral stone
#

Why though

austere barn
#

i don't want to learn it

worthy storm
#

don't then

spring ember
#

Your problem then

floral stone
#

^

austere barn
#

Problem?

#

I don't want to learn hell javascipt

spring ember
#

Welcome to coding, you learn or you don't

austere barn
#

holl javascript?

floral stone
#

If you can't learn it then what's the point of explaining it to you or helping you.

worthy storm
#
  • You want to do something
  • You have two options: do it or don't do it.
  • The former requires you to do extra work.
  • You don't want to do extra work to solve your problem.
  • This is your problem.
spring ember
#

Listen, you need to learn yourself we won't spoon-feed you

austere barn
#

What wtf

floral stone
#

^^

austere barn
#

I want to learn how to make a welcome message with pictures

worthy storm
#

Do it then

austere barn
#

not holl javascript

floral stone
#

Holl?

worthy storm
#

What languages do you know

earnest phoenix
#

how do you use two tables in sqlite node

worthy storm
#

You don't because it's sqlite

austere barn
#

whole

floral stone
#

whole?

spring ember
#

Sqlite is a file for each table

austere barn
#

yes whole

floral stone
#

What is whole

austere barn
#

"holl" it was auto correction

worthy storm
#

What languages do you know

spring ember
#

What is life?

worthy storm
#

meaningless

floral stone
#

What languages do you know

#

coding languages

spring ember
#

Holl cannot be autocorrected because it's meaningless

austere barn
#

so im lying?

floral stone
#

@austere barn What coding languages do you know? We are trying to help you but you guys are getting off topic.

austere barn
#

idk? im just making a discord bot

spring ember
#

Omg

worthy storm
#

Nice, what a waste of everyone's time. I truly hope you never reach your goal. I hope you realize that you've failed because of your lack of competency for research and instead depend on others. I hope that because of this, you give up and stop bugging others with your mind numbingly boring quest to not do any work.

spring ember
#

It became idiotic

worthy storm
#

πŸ‘‹

spring ember
#

Oh wow

#

Nice work

austere barn
#

@worthy storm waste of ur time? U didn't help u didn't say something to me so wtf

spring ember
#

Waste of all of us times

#

Our

austere barn
#

lel

floral stone
#

You can't just make a discord bot, you need to learn how to code first. Otherwise, we ain't going to help you and you are wasting our time. You can learn to code at http://sololearn.com

#

Anyways, I'm done for now

austere barn
#

oke

floral stone
#

Take a python3 course if you want to do an image thingn

austere barn
#

.....

#

u can just make a discord bot so wtf lol

tropic ridge
#

What are the pros and cons of using SQL database instead of JSON files with Discord.js?

floral stone
#

@tropic ridge less space, easier storage.

low owl
#

Basically what are the benefits of using a database

#

you can easily research that πŸ˜›

spring ember
#

@tropic ridge way easier at any way

#

Better complexity and easier to maintain

#

Complexity for get/set I mean

tropic ridge
#

So, I guess I can trash everything where I've used json files

gilded thunder
#

Would this work alright?

# on join config
@bot.event
async def on_server_join(server)
    author = ctx.message.author
    await bot.create_role(author.server, name="Muted", permissions=65536)
    embed=discord.Embed(title="Hi, I'm Arc.", description="I am a simple Moderation and Fun bot written by Joshek#1337.  I hope you find me helpful for your server!", color=0x0080ff)
    embed.set_author(name="My commands.", url="https://joshek.xyz/arc/commands",, icon_url="https://joshek.xyz/arc/Arc.png")
    embed.set_thumbnail(url="https://joshek.xyz/arc/Arc.png")
    embed.set_footer(text="A muted role will be made for the mute command.")
    await bot.say(embed=embed)
#

Still need to do the exception for this server.

floral stone
#

@tropic ridge You need to understand the language that makes up the api before able to make a bot. Otherwise, your attempt is useless.

spring ember
#

@tropic ridge use json for final cobstants

#

Constants

tropic ridge
#

Aight, thanks

earnest phoenix
#

How do you search a person via name in discord.js?

floral stone
#

@gilded thunder ctx is not defined for author variable

uncut slate
earnest phoenix
#

ok ty

gilded thunder
#

@floral stone ty

floral stone
#

np

gilded thunder
#
root@Joshek:~/Arc# python3 bot.py
  File "bot.py", line 64
    async def on_server_join(server)
                                   ^
SyntaxError: invalid syntax
root@Joshek:~/Arc# ```
ruby dust
#

you forgot :

gilded thunder
#

AHAHAHAHAHAHAH

lament rapids
#

Need :

gilded thunder
#

I'm actually an idiot.

lament rapids
#

Jajajaja

gilded thunder
#

How do I forget this stuff.

ruby dust
#

it happens

gilded thunder
#

Now to test it.

lament rapids
#

Okay, try and if you have any other fault, let us know.

gilded thunder
#
t.py", line 289, in _resolve_destination                    
    raise InvalidArgument(fmt.format(destination))          
discord.errors.InvalidArgument: Destination must be Channel,
 PrivateChannel, User, or Object. Received NoneType         ```
lament rapids
#

Send the complete error.

floral stone
#

do send_message(channel, msg)

spring ember
#

Dude read the error before you send

#

If you read the exception you'll understand what the problem is

floral stone
#

Apparently the channel or Destination is None

gilded thunder
#

I just had await bot.say(embed=embed)

#

Copied straight from the embed generator.

floral stone
#

await bot.send_message(channel, embed=embed)

#

You will need to define the channel though

gilded thunder
#

so ctx.channel =='channel': ?

#

wait no

floral stone
#

are you using rewrite or async

gilded thunder
#

async

floral stone
#

hold up

spring ember
#

channel is a class not a string

#

But maybe it is comparable

floral stone
#

Try sending it to the users through dm. There is no default channel to send too.

spring ember
#

channel is TextChannel or MessageChannel depends on the ctx

gilded thunder
#

await send_message(user, embed=embed)?

floral stone
#

yeah

spring ember
#

bot.send...

#

Or ctx.reply which is awesome

gilded thunder
#

@spring ember await ctx.reply(user, embed=embed) ?

spring ember
#

User is not needed

#

Read the docs please

#

Also it is bot.send_message

gilded thunder
#

Yeah. I clearly need to learn more.

spring ember
#

Therefore the exception

#

You do

worthy storm
#

@gilded thunder yeah you do

#

join the d.py support server mate

#

you're already in dapi

hardy moon
#

How to make my bot online ?

restive totem
#

wdym?

earnest phoenix
#

by terminal for most libs

#

?

spring ember
#

run the code

little garnet
#

One message removed from a suspended account.

topaz fjord
#

@hardy moon u code it

sand roost
#

How did you check if a specific person has a permission

topaz fjord
#

What lib

sand roost
#

d.js

topaz fjord
#

message.member.hasPermission()

#

@sand roost

sand roost
#

thx

topaz fjord
#

if you want for a user you can do message.guild.members().hasPermission()

dusty sandal
#

anyone, for discord.js, how would i make my bot assign a role to a person and remove all their other roles when i type in a command?

#

i figuered out how to do kick and ban but not assign roles

#

for example here is my kick command that i want to turn into the command description provided above

#

const { Command } = require('discord-akairo');

class KickCommand extends Command {
constructor() {
super('kick', {
aliases: ['kick'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}

exec(message, args) {
    if (!args.member) {
        return message.channel.send('**MEMBER NOT FOUND**');    
    }
    
    return args.member.kick().then(() => {
        return message.channel.send(`**${args.member} was kicked!**`);
    }).catch(error => {
        message.channel.send(`\`I couldn't kick that person because I do not have enough permissions to kick them!\``);
    });
}

}

module.exports = KickCommand;

#

if anyone can help me with this just ping me

spring ember
#

oi blyat

#

large code

trim plinth
#

put it in a code block kthx

spring ember
#

without ``````

dusty sandal
#

ok let me change that

unreal thistle
#

wth

#

i left thi server

#

lol

uncut slate
unreal thistle
#

yea nb

dusty sandal
#

const { Command } = require('discord-akairo');

class KickCommand extends Command {
constructor() {
super('kick', {
aliases: ['kick'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}

exec(message, args) {
    if (!args.member) {
        return message.channel.send("**MEMBER NOT FOUND**");    
    }
    
    return args.member.kick().then(() => {
        return message.channel.send("**${args.member} was kicked!**");
    }).catch(error => {
        message.channel.send("`I couldn't kick that person because I do not have enough permissions to kick them!`");
    });
}

}

module.exports = KickCommand;

trim plinth
#

angery

dusty sandal
#

basically i want to turn this kick command into a command that assigns a role to a person while removing all their other roles

trim plinth
#

why are you using the kick command as a boilerplate for a role command Thonk

dusty sandal
#

i dont know to to formulate a role command so i'm forming it off of a kick command

trim plinth
#

you'd rather make one from scratch

dusty sandal
#

thats what i need help with

#

im using discord.js with discord akairo

drowsy silo
#

Guys

#

how to be bot developer?

#

😐

trim plinth
#

make a bpt

drowsy silo
#

I just joined

dusty sandal
#

by making a bot

drowsy silo
#

Ok

trim plinth
#

don't clone one

drowsy silo
#

Im bad in programation

#

I studing

#

😐

#

Oh

#

O_O

trim plinth
#

ok what is the programming language you are "studing" in

dusty sandal
#

@drowsy silo i had a friend help me code @light lava

trim plinth
#

@drowsy silo

drowsy silo
#

Portuguese estudando

#

?

#

Yes?

trim plinth
#

programming language.

#

not language

drowsy silo
#

Ok

#

Your bot have clear chat command?

#

?

#

I need

trim plinth
#

yes

dusty sandal
#

no

#

mine can't

trim plinth
#

my bot does have a clear chat command

dusty sandal
#

what's your bot @trim plinth

trim plinth
#

Chihiro

drowsy silo
#

What's the name?

trim plinth
#

@drowsy silo Chihiro

dusty sandal
#

@neon crater

drowsy silo
#

thx

dusty sandal
#

@trim plinth can you help me with the command i described earlier?

#

sorry for ping

drowsy silo
#

what command

trim plinth
#

purge command

drowsy silo
#

i use for clear

#

what command i use for clear my chat

#

?

trim plinth
#

purge

#

thats the command

drowsy silo
#

!purge?

trim plinth
#

chi!purge

#

chi! is it's prefix

dusty sandal
#

thats what his bot does

drowsy silo
#

Ok

#

?

#

Please specify an amount to purge.

#

what i make?

trim plinth
#

yes

#

you enter a number that you'd like to purge

drowsy silo
#

Oh

trim plinth
#

it has to be under 100

dusty sandal
#

any way

#

@trim plinth can you help me make a command that assigns a role to a person while removing all their other roles

trim plinth
#

sorry, I can't really help you out there

dusty sandal
#

ok

drowsy silo
#

Oh

#

Ok

frail harness
#

Lol why

drowsy silo
#

Thank you the best bot

frail harness
#

Other bots can do that

dusty sandal
#

so you know how this "return args.member.kick "kicks a person

frail harness
#

What

drowsy silo
#

Da what's your bot?

#

@dusty sandal

trim plinth
#

chihiro is not the best bot lmao

dusty sandal
#

mine's @light lava

drowsy silo
#

is for my chat

#

Is full of messages

#

LOL

dusty sandal
#

boyobot cant mass delete messages

#

so you know how this "return args.member.kick "kicks a person? what do i replace the "kick" with to assign a role

#

anyone know

frail harness
#

it doesn't lol

#

returning something doesn't do anything..?

dusty sandal
#

hold on

solid cliff
#

Docs Thonk

dusty sandal
#

const { Command } = require('discord-akairo');

class KickCommand extends Command {
constructor() {
super('kick', {
aliases: ['kick'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}

exec(message, args) {
    if (!args.member) {
        return message.channel.send("**MEMBER NOT FOUND**");    
    }
    
    return args.member.kick().then(() => {
        return message.channel.send("**${args.member} was kicked!**");
    }).catch(error => {
        message.channel.send("`I couldn't kick that person because I do not have enough permissions to kick them!`");
    });
}

}

module.exports = KickCommand;

@frail harness this whole code kicks a person

drowsy silo
#

@ripe blade Please help me what programation Sis i use Lua script or Java?

frail harness
#

Oh shit Java lmao

#

Something Ik nothing about

dusty sandal
#

js

#

damn

frail harness
#

What

dusty sandal
#

nm

drowsy silo
#

😐

frail harness
#

Oh JS

dusty sandal
#

wait you know js?

frail harness
#

Something I also don't know about

#

Nope

dusty sandal
#

oh ok

#

sorry lol

solid cliff
#

🀷