#development

1 messages · Page 494 of 1

limpid cosmos
#
	if(message.content === prefix + "avat"){
		
	let args = message.content.split(" ")
let member = message.mentions.members.first() || message.guild.members.get(args[0]) || message.author; 

let embed = new Discord.RichEmbed() 	
.setTitle(member.tag + '\' avatar') 	
.setImage(member.avatarURL); 

 message.channel.send({embed})


}
})
    ``` a!avat give me my avatar but it don't work for mentioned users or args
earnest phoenix
#

which

#

is the best for sound quality pre size

sinful lotus
#

30mb flac 👌

earnest phoenix
#

flac is prety cool but im 90% sure what he has right there is an audio conversion site so either way

#

whatever the source audio is

#

i may be wrong

#

wav is better than flac. but for size flac is cool

#

wav is better then flac?

#

TIL

#

i thought the whole idea for flac is well

#

its flawless

#

no loss

#

yeah wav is indeed better

#

wav is normaly larger too

#

neat

bitter sundial
#

WAV is equal to FLAC in sound quality

#

FLAC is compressed but still lossless

#

so I would say using FLAC is better

rustic axle
#

^

#

But if you want to share the audio file with users or upload it somewhere mp3 is the best to go... But otherwise use FLAC for just general encoding/deciding purposes

earnest phoenix
#

mp3 quality sucks though

#

it’s compressed and it sucks

limpid cosmos
#

Anybody know how to do action when a user make a reaction ?

earnest phoenix
#

listen to reaction events

limpid cosmos
#

How ? @earnest phoenix

earnest phoenix
#

what lib

limpid cosmos
#

Js

earnest phoenix
#

what lib

limpid cosmos
#

JavaScipt

#

Script

#

so discord.js

earnest phoenix
limpid cosmos
#

Thanks

earnest phoenix
#

help

#

me

#

rn

#

how do i make my website avaliable for everyone to see

#

aaaaand that is?

#

wamp

#

confi file

#

googles wamp

#

ouch

abstract crystal
#

@earnest phoenix what's your hosting environment?

#

windows version, network setup, open ports etc

earnest phoenix
#

wampserver

abstract crystal
#

if you have a VPS you just set Listen 80 or Listen 443 if you have ssl cert

#

wampserver only tells me that you use windows

earnest phoenix
#

i do have a wps

#

so wait wamp wouldnt work on vps?

#

windows server?

abstract crystal
#

wamp stands for windows, apache, mysql and php, but you probably know this; apache works on windows, you just need to open the right ports (80, 443) and set Listen property to appropriate ports

earnest phoenix
#

what if i wanted to host it on a vps?

abstract crystal
#

what do you have as a vps, which os?

earnest phoenix
#

my vps is windows server 2016

abstract crystal
#

yes wamp should work

#

but if you can't access the webserver, you probably don't have the ports open in the firewall

earnest phoenix
#

ah alright

#

but

#

how do i make my website open for everyone?

abstract crystal
#

that's what i'm trying to tell you

#

open the ports

earnest phoenix
#

but

#

on the vps

abstract crystal
#

YES

earnest phoenix
#

i dont think i would be able

#

to

abstract crystal
#

windows firewall

earnest phoenix
#

oh

abstract crystal
#

you shouldn't host websites on windows, unless they use asp.net

earnest phoenix
#

but linux is hard

sand roost
#

xd

#

linux is ez

earnest phoenix
#

im meme

#

wait i can host a website using asp.net?

sand roost
#

oof

earnest phoenix
abstract crystal
earnest phoenix
#

jesus

sand roost
earnest phoenix
#

ooo

#

nvm

#

can i host website with angular? 4Head

sand roost
#

yes @earnest phoenix

earnest phoenix
jagged plume
#

can i host a website on discord

mossy vine
#

can i host a website on a website

sand roost
#

yes

#

implement a php script that opens a new webserver

mossy vine
#

itwasajoke

sand roost
#

ikr

earnest phoenix
#

i tried opening from the fire wall

#

and i check it says its clode

#

closed

#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaa. i am sooooooooooo pissssssed rn

abstract crystal
#

xd

#

Windows™

earnest phoenix
sand roost
#

owo

abstract crystal
#

opening all ports is a really bad idea

#

just a tip

earnest phoenix
#

dbl: making crackable rdps since 2018

abstract crystal
#

^

earnest phoenix
#

i have open only port 80

#

why do flipin is it blocked

#

do uaactually have the server running and listening on that port

#

umm that pic is from my

#

vps

abstract crystal
#

shows ip

earnest phoenix
#

and wamp isnt running on it

#

iooooh

#

omg

#

aaaaaaa

#

can i just freakin

#

do port 8080

#

which is https i believe

abstract crystal
#

https is 443

earnest phoenix
#

well

abstract crystal
#

8080 is http-alt

earnest phoenix
#

can i use 443

#

then

abstract crystal
#

yes

earnest phoenix
#

what do i put there, sorry because i'm new to this stuff

#

not to the port part

#

but yea

#

do i do [::0]:443

#

?

abstract crystal
#

do you have a ssl cert?

earnest phoenix
#

no

abstract crystal
#

well then you can't use https

earnest phoenix
#

well

#

what can i use instead of https

#

then

abstract crystal
#

http

earnest phoenix
#

which is port 80?

abstract crystal
#

indeed

earnest phoenix
#

which is blocked

#

by my pc and router

abstract crystal
#

are you using a vps or your computer

earnest phoenix
#

i'm testing it on a computer

#

but it will run on a vps

zealous veldt
#

ngl I read that as gru 99 for a second

abstract crystal
#

xd

#

then use port 8080 on your pc

#

but if you don't want ppl to enter port in the browser you'll have to use port 80

earnest phoenix
#

how do make bot status dnd in d.js mmLol

abstract crystal
earnest phoenix
#

i tried using port 8080

#

gave me this

#

oh

#

i needed to type in the port

#

nvm

#

but

#

wamp only allows my pc to view the website

#

thats the whole reason i was asking

sand roost
#

@earnest phoenix 192 is a local ip

#

you dont need to blur it

earnest phoenix
#

oh

quartz kindle
#

my vps has port 80 blocked for non-root users and running node as root says node is not installed/found

#

i tried running sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000

#

but the rule doesnt work or show up in the iptables list

#

im running express on port 3000 which works, but i want to run on http since i have a domain hooked up via dns

#

any ideas?

karmic parcel
#

how did you install node?

quartz kindle
#

via nvm

#

nvm install x.x.x

#

i've read that running node as root is a bad idea, and its best to use port forwarding/redirection

earnest phoenix
#

@quartz kindle best bet is to use a reverse proxy

#

Something like nginx will do fine

wide ruin
#

in discord.js, i dont get how you use js message.reactions()

#

i want to check if it has ⬅

#

i dont get the docs

muted fable
#

message.reactions() deprecated?

smoky spire
#

For one, reactions is a property not a method

wide ruin
#

what would i use instead?

smoky spire
#

It's not deprecated

ruby dust
#

I'm starting to think that he's just adding () to pretty much everything sigh

smoky spire
#

Yep

earnest phoenix
#

() = function

wide ruin
#

well i thought it would be like message.reactions('⬅')

#

ok

earnest phoenix
#

Did you not read the docs before asking?

wide ruin
#

i did

earnest phoenix
#

Oh wait, you did
weshouldchill

smoky spire
#

message.reactions is a collection of MessageReactions which have an emoji property

earnest phoenix
#

Then you read them wrong

wide ruin
#

Collection<Snowflake, MessageReaction>

#

so is it message.reactions<something>

smoky spire
#

no

#

Do you know what a collection is?

wide ruin
#

no

smoky spire
wide ruin
#

message.MessageReaction.emoji.left_arrow

#

?

smoky spire
wide ruin
#

it doesnt have snowflake or MessageReaction

earnest phoenix
#

Forget what I said

#

U didn't read the docs

wide ruin
#

i did

earnest phoenix
#

No you didn't

wide ruin
#

i did

earnest phoenix
#

If you did, then you wouldn't be saying message.MessageReaction.emoji.left_arrow

#

So I know you didn't

ruby dust
#

I think he needs to read js docs than discord.js tbh

wide ruin
#

well that was for what you said iTexlo

#

and i dont get Collection<Snowflake, MessageReaction>

earnest phoenix
#

I didn't tell you to use that, though

smoky spire
#

It's a Collection of MessageReactions keyed by their ids

wide ruin
#

that was from docs

#

so how do i use it?

smoky spire
#

I sent the link to all the collection methods, use your brain and eyes to find one that works

wide ruin
#

which method?

#

the bot will add the reactions, and check if the user reacted with it

smoky spire
#

Are you waiting for the user to react before doing something?

wide ruin
#

when they react it edits the message

#

the clears reactions, and adds ➡

#

then changes if they react again

smoky spire
ruby dust
#

in my opinion, that will be too hard for you while you have so few knowledge of js

ruby dust
#

How do I round to 2 decimals in python is something I found on google, but is there a simplified version? or can someone please explain me the way it has to be done?

solid cliff
#

round(number, 2) bearCop1

ruby dust
#

wait really?

#

that easy?

solid cliff
#

hahayes

ruby dust
#

wow... ok

#

all other examples I found are super overcomplicated then

#

yeah thanks, that's what I wanted

cosmic swallow
#

can someone help me with html ?

quartz kindle
#

what do you need?

cosmic swallow
#

I somehow cant add an image on my color background

#

like when I get the color , the image goes away , and when I have the image the color goes away

earnest phoenix
#

googles image api is actually incredibly entertaining to play with

earnest phoenix
#

How dafuq i start learn codding ??(like feurst things i need to d)

frank dust
#

wot

cosmic swallow
#

what

west raptor
#
earnest phoenix
#

adding image recognition to bot for keks

#

its going well

#

but for complex things it starts to freak out

#

:/

#

response time from googles servers is also really shitty

slate kayak
#

hello i have a question can somebody tell me thats using .py please

earnest phoenix
#

How could I get my bot to find a chat from a guild that’s provided that the bot has create invite perms in

night imp
#

uh you could loop through each channel in the server

#

and then check perms

#

But that is hella API heavy so not good for big bots

#

I would just make it be the current channel and if not display an error

#

@earnest phoenix

earnest phoenix
#

How would I do that just server.defaultChannel? Or something else idk

#

@night imp

#

wait

west raptor
#

defaultChannel for guilds is decepercated

earnest phoenix
#

decepercated

west raptor
#

just loop through the channels

#

i cant spell

#

shut

night imp
#

@

#

@earnest phoenix You would want to use forEach on server.channels

earnest phoenix
#

Okay

west raptor
vernal rivet
#

I mean what you could do is search for the more common chats, such as general, lounge, etc. That's if you want to do that

slate kayak
#

is there a way for me to convert a discord.js file to .py ?

west raptor
#

um... no?

#

i mean

earnest phoenix
vernal rivet
#

I don't know if theres something that would convert it for you, you might have to do it yourself

slate kayak
#

mmm ok so basically i need to recode the bots as i have 4 running 😦 @west raptor

#

and the vps server required the bots to be on .py 😢

earnest phoenix
#

Weird

vernal rivet
#

Well the thing is the libraries aren't the same, so even if you find something to convert it, it wouldnt do much for you since the libraries are different

earnest phoenix
#

Why would a VPs require that

#

What vps do you have? @slate kayak

slate kayak
#

OVH ubuntu 16.04 @earnest phoenix

earnest phoenix
#

k

#

If you have js and you need py try find another VPs

#

¯_(ツ)_/¯

vernal rivet
#

Yes

earnest phoenix
#

I run my bots on a VPs

#

Both js

slate kayak
#

i did try pm2 for it and doesnt work 😦 but yeah will just have to recode it then

earnest phoenix
#

Why recode then

#

Onfg

#

REEEEEEE

vernal rivet
#

Or you can find another vps

earnest phoenix
#

why recode them

#

That’s just a waste of time

#

@slate kayak use google cloud

vernal rivet
#

Yes, if you did it right once, then why change it if it works

earnest phoenix
#

Yeah

slate kayak
#

nope google cloud is too expensive but i have the time to do it 😦 so will just have to redu it

earnest phoenix
#

you get free credits if you link your credit/debit card

vernal rivet
#

Then find a friend that would host your bot for you

earnest phoenix
#

I got £200 free when I did mine

#

¯_(ツ)_/¯

#

Just a suggestion but it’s probably the better choice to use google cloud instead of recoding your whole bot

#

I hate coding with permissions

vernal rivet
#

The great thing about programming is that you learn to problem solve and use it in programming, or in real life and learn to do it better and cheaper. Start using those skills @slate kayak

earnest phoenix
#

how would use a string variable on JSON syntax

#

ie

#
let foobar = "uwu"

let json = {
  uwu : "hastebin no"
}

json.foobar
inner jewel
#

json[foobar]

earnest phoenix
#

thanks

inner jewel
#

also known as out of memory

rustic axle
#

Yeah I know

#

I did something

#

That was bad

#

And it

#

Yeah

#

I get those every other day so honestly its nothing

inner jewel
#

it's not "nothing"

#

that's bad

#

really bad

heady zinc
#

that's actually extremely bad

#

getting OOM with javascript frequently means you're doing something wrong, and you're doing it really wrong

zealous veldt
#

Yeah

split juniper
#

I have a question for hosting. I wanna move onto a paid form of hosting rather than using the free tier in heroku (need more memory). Could anyone recommend good services that accept PayPal payments? I'm thinking about signing up for digital ocean but I genuinely do not know what to do. My bot runs on node.js btw

sick cloud
#

literally any cheap VPS provider will do

#

a lot of people like galaxygate, I myself use both DO and OVH

#

OVH is great but so far has slow support

split juniper
#

I'm really liking DO's plans tbh

#

They look perfect

#

will check out OVH and galaxygate

#

I checked out galaxygate and everything looks good

earnest phoenix
#

how do you create a role and in the options specify the permissions, such as SEND_MESSAGES: false

split juniper
#

but I'm confused about the hostname part @sick cloud

#

Do I have to register a domain for this?

ruby dust
#

Cloud -> VPS

smoky spire
#

@earnest phoenix what lib

earnest phoenix
#

How can I get guild's avatar?

sick cloud
#

@earnest phoenix what lang and lib

#

@earnest phoenix guilds usually have an iconURL or icon property

earnest phoenix
#

d.js

#

sorry

#

oh right

sick cloud
#

@earnest phoenix look at the docs

earnest phoenix
#

i have

#

and the right code will be guild.iconURL?

sick cloud
#

stable has Guild#createRole

earnest phoenix
#

im using master

sick cloud
#

master has roles#create

earnest phoenix
#

its not that

sick cloud
#

ok

earnest phoenix
#

its setting perms

#

like

sick cloud
#

so use roles.create

earnest phoenix
#

speak: false

sick cloud
#

and add perms to it

earnest phoenix
#

how

#

to

#

disable

#

like

sick cloud
#

add

earnest phoenix
#

permissions: ["SEND_MESSAGES off"]

sick cloud
#

permissions

#

to

#

the

#

code

#

and stop being a lazy idiot, the code is right there

earnest phoenix
#

??

sick cloud
#

read how to do it

#

rule 7b.

earnest phoenix
sick cloud
#

check that out too

#

i've told you what to look at, so go look

earnest phoenix
#

wait is it deny: []

sick cloud
#

bc im not spoonfeeding

#

yes

earnest phoenix
#

i

#

c

smoky spire
#
sick cloud
#

createRole doesn't exist in master

earnest phoenix
#

yes i know what he means

sick cloud
#

its Guild#RoleCollection .create

earnest phoenix
#

it accepts permissions: [] but that is allowing

smoky spire
#

Yes

earnest phoenix
#

i know its .create

#

i want to deny them

smoky spire
#

Don't put it in there then

earnest phoenix
#

wont it be default then?

#

or do i just put READ_MESSAGES

west raptor
#

:|

smoky spire
#

Roles either have permissions or don't, neutral doesn't come into play until permission overwrites

earnest phoenix
#

ic

#

thanks

#

How do I exactly get a guild's avatar? with guild.iconURL?

sick cloud
#

why isn't this accepting that colour

#

@earnest phoenix look at your libs docs

earnest phoenix
#

can't find it

sick cloud
#

check out the functions for guild

earnest phoenix
#

already did

sick cloud
#

setIcon might exist

#

are you on djs @earnest phoenix?

west raptor
#

what version you on texusak

earnest phoenix
#

yeah

#

found it

west raptor
#

oof ight

earnest phoenix
#

I'm trying to create an event

#

and it's still giving me this shit error

#

of undefined

#

.-.

west raptor
#

what's the code and error?

earnest phoenix
#

guild.iconURL

sick cloud
#

guild is undefined

west raptor
#

^

sick cloud
#

and are you on master

earnest phoenix
#

already defined it

sick cloud
#

if so, iconURL needs a ()

#

well

#

guild is undefined

west raptor
#

what event

earnest phoenix
#

channelCreate

#

lmao

west raptor
#

yea

#

guild isnt defined

sick cloud
#

channel.guild.iconURL()

west raptor
#

^

zealous veldt
#

channel.guild

earnest phoenix
#

oki

knotty steeple
#

same @zealous veldt

sick cloud
#
<Client>.on('channelCreate', channel => {
    channel.guild
    // => Guild object

    channel.guild.iconURL()
    // => string, containing what you want
});
earnest phoenix
#

lmao

#

I need the guild icon in an embed

#

like .setAuthor

sick cloud
#

i'm trying to make sure it isn't leaking or anything, never owned a bot this big

topaz fjord
#

depends on what it does

sick cloud
#

it just does api stuff, and runs a constant setInterval every 30 seconds

topaz fjord
#

seems a bit high

sick cloud
#

hm

#

is there a way to reduce it?

zealous veldt
#

yes CTRL+C lul

sick cloud
#

moose pls

zealous veldt
#

I mean it's the best possible solution

west raptor
#

im guessing a swear filter?

slim heart
#

yes

#

so instead of having two files is there a way to get the keys as its own array and then actually use the keys and get the array from those keys bla

earnest phoenix
#

🤔

slim heart
#

So im currently using an array[key] type thing in a json file, i'm curious if there's a way that instead of having a seperate file with an array with the list of all the keys if theres a way to grab all the keys along with it so it's all compacted to the same file

so like for example
byp.json

"ass": ["yada"]
}```
and
swears.json
```{
"var": ["ass", "yada"]
}```

so instead of having two files is there a way to get the keys as its own array and then actually use the keys and get the array from those keys bla
earnest phoenix
#

is it so you can log what bad word they were trying to say?

#

i dont understand the purpose of the arrays and such

#

i guess you could just pop the entire thing into an array and just pop a .includes fro messages

slim heart
#

So basically its a byp.json (bypass) and a swears.json, so it first checks if the message matches the swears.var and if it does then it uses the swears.var it matches as a key to byp and tests if it matches any of those

#

i tried loggin like just byp, and it doesnt seem to have what i needed

#

i need two seperate arrays

#

whithout the containing array

earnest phoenix
#

ok then in that case get the message, run a foreach on the json file and check every array if they .include

#

?

#
let blah = //json object

blah.forEach(obj => {
    if(obj.includes(/*WORD*/){
        //if they said a baddie
    }
})
#

ye?

#

would check every array in the json file for the word

slim heart
#

yeah thats what i already have set up

earnest phoenix
#

im not really sure what your trying to accomplish in that case xF

slim heart
#

but it finds the containing array, not the actually keys

#

we'll use ass as an example because its not as bad

earnest phoenix
#

ok

#

assume

slim heart
#

so inside ass, so what i do to check is byp['ass'].forEach( if matches bla

earnest phoenix
#

so once you match it and its in the array you want to know what 'category' its in?

slim heart
#

no i already got that

#

but what happens first to see which key to use

#

is it used swears.var

#

which is a COMPLETELY seperate file

#

which means i have to update both to add a word

earnest phoenix
#

whats the diffrence between the files?

slim heart
#

one contains the bare words, and the other contains the arrays with the bypasses

earnest phoenix
#

why not consolidate it?/

slim heart
#

so this is swears.var

tardy ingot
#

😂

slim heart
#

it contains all those words

earnest phoenix
#

ok so it contains the keys

slim heart
#

yes

#

exactly

earnest phoenix
#

and right now it just searches for values

#

in the arrays

#

yes?

slim heart
#

yup

earnest phoenix
#

and you wnt to also check for keys?

slim heart
#

so i want to not need swears.var and be able to get the words that swears.var has, from byp.json where they're keys

earnest phoenix
#

ok

#

so i know a for in would return the keys

#

or

#

🤔

#

lemme draft somethin upp

slim heart
#

could i do something like this?

{
"words":[
"ass": {"ignore":["wass", ""]}
]
}```
earnest phoenix
#

no pont

#

you can keep your current format

slim heart
#

oh oki

earnest phoenix
#

maybe index notation 🤔

#
let obj = //json object

Object.keys(obj).forEach(key => {
    //key = keys string
    //obj[key] = array
})

#

i think that should work just find

#

try that out

#

and check the word they say against key and obj[key].includes

#

@slim heart report back to me if that worked

slim heart
#

Yup :DDD

#

it worked

#

thanks so much

earnest phoenix
#

np

slim heart
#

i was just adding it to everything cuz everything was crashing when i deleted the file but yeah

#

thanks so muuuch

earnest phoenix
#

npnp

wicked summit
#

Hey

earnest phoenix
#

hi

wicked summit
#

Do you know what events if we change avatar ?

earnest phoenix
#

what library

wicked summit
#

Discord.js

earnest phoenix
wicked summit
#

are that ?

earnest phoenix
#

?

#

thats a client event

#

client.on('guildMemberUpdate', (old, new) =>{})

wicked summit
#

Yeah but how its work ?

earnest phoenix
#

the first var in the callback is the old member, second is new member

wicked summit
#
  }else if (oldMember.user.displayAvatarURL !== newMember.user.displayAvatarURL){
            editEmbed.setImage(new Discord.Attachment(await updateAvatar))
             editEmbed.setFooter("Avatar Updated",oldMember.user.displayAvatarURL)
            editEmbed.setColor("RANDOM")
       ```
#

I want make it like that

earnest phoenix
#

not gunna spoonfeed ya but heres the jist

#
client.on('guildMemberUpdate', (old, notOld) =>{
    old.avatarURL //this is the old avatarurl
    notOld.avatarURL //this is the new avatarurl
})```
#

i have faith you can figure that out

wicked summit
#

oj

#

Ok

#

And the request for Canvas ?

#

Like await get(oldMember.avatarURL) ? This wrong or true ?

earnest phoenix
#

what

#

you dont ned to request anything

#

it passes the objects

wicked summit
#

i want make it in canvas

earnest phoenix
#

in the callback

#

oh you mean to make an image?

wicked summit
#

Yeah

earnest phoenix
#

do you know how js canvases work?

wicked summit
#

need buffer

#

Not an url ?

earnest phoenix
#

im assuming ur using nodecanvas

wicked summit
#

Im using canvas-constructor

earnest phoenix
#

mm

#

ok

wicked summit
#
        const oldAvatar = (await get(oldMember.user.avatarURL)).body;
earnest phoenix
#

im not sure how that library works specficially but

#

normal canvas you can create a buffer with the fs lib

wicked summit
#

uhh im not using an paid hosting

#

And not using pc too for coding

earnest phoenix
#

wha..

wicked summit
#

Im using glitch for hosting

#

I want make it like that

earnest phoenix
#

k

wicked summit
#

How that things work ?

earnest phoenix
#

what

#

what lang are you using

wicked summit
#

Djs

shy verge
#

learn canvas omegalul

wicked summit
#

idk the events thing work

#

I know the canvas

#
  else if (oldMember.avatarURL !== newMember.avatarURL){
            editEmbed.setImage(new Discord.Attachment(await updateAvatar))
             editEmbed.setFooter("Avatar Updated",oldMember.user.displayAvatarURL)          editEmbed.setColor("RANDOM")
#

Are thats rigth ?

shy verge
earnest phoenix
#

thats not even canvas

shy verge
#

i haven't used d.js in months

wicked summit
#

the canvas im make it an function

#
 const oldAvatar = (await get(oldMember.user.avatarURL)).body;
        const newAvatar = (await get(newMember.user.avatarURL)).body;
            var hasiln = oldMember.user.username.length > 7 ? oldMember.user.username.substring(0, 7) + ".." : oldMember.user.username;
  
  async function updateAvatar () {
  return new Canvas(460,260)
  .setColor('#1d1d1d')
.addRect(0, 0, 450, 260)
.addImage(oldAvatar, 0,0, 225, 225)
.addImage(newAvatar, 225, 0, 225, 225)
.setTextFont('24px Impact')
.setColor('white')
.addText(`${hasiln} updated his avatar!`, 40, 250)
}
earnest phoenix
#

looks good

wicked summit
#

but it'snt work

earnest phoenix
#

whats the error

wicked summit
#

no error

#

Maybe wrong events

#

I will try to client.on('userUpdate'

earnest phoenix
#

is that even a event tho

wicked summit
#

Maybe

earnest phoenix
#

it is

#

use User Update

wicked summit
#

Still not work

earnest phoenix
#

ok

#

do you know what about it is not working

wicked summit
#

Idk

#

Im never create an events like userUpdate

earnest phoenix
#

ok

#

so why is there a Discord.Attachment inside the editEmbed.setImage()

wicked summit
#

Like when you send canvas maybe its need Attachment

earnest phoenix
#

no

#

just remove the Discord.Attachment function

wicked summit
#

Ok lemme try

earnest phoenix
#

just keep the await updateAvatar

wicked summit
#

Oke

#

Not working to

earnest phoenix
#

ok

#

just send the entire code for the event

wicked summit
#

Wait i will make it short

earnest phoenix
#

or

#

use

wicked summit
#

Im using events handler

earnest phoenix
#

ok

#

so

#

whats the welcome stuff for

wicked summit
#

The channel

#

@earnest phoenix can you fix it?

earnest phoenix
#

ok

#

so how is the welcome stuff for the channel again

wicked summit
#

you just can ignore it

earnest phoenix
#

but like

#

you said it was for sending it ti the channel

wicked summit
#

That stuff is same like the other events

#

And the other events is work perfectly

earnest phoenix
#

so

#

have you checked if the values were 0 or undefined

wicked summit
#

Value is Different in other server

#

Idk for that

earnest phoenix
#

hmm

wicked summit
#

My channel is per server settings

earnest phoenix
#

ok but likr

#

is it 0 tho

wicked summit
#

If im enable the event

#

That will change to 1

earnest phoenix
#

ok

#

if you say so

wicked summit
#

Or maybe the code in event is wrong

late harbor
#

how to debug this one?

#

@coral trellis

coral trellis
#

Don’t ping for support

#

Mods are here to moderate

late harbor
#

smh ok

coral trellis
#

Yes deleting it will make it better zerotwolaugh

late harbor
#

lol

languid dragon
#

Why

coral trellis
#

He pinged for help

#

He pinged mods

#

Too bad they don’t have warns here just mute,ban n kick

earnest phoenix
#

I need help (d.js)

#
client.on('messageUpdate', (oldMessage, newMessage) => {
  let embed = new Discord.RichEmbed()
  .addField("Edited Message", "Original:\n" + oldMessage.content + "\nNew Message:\n" + newMessage.content + "")
  client.channels.get(jsonfile.readFileSync("data/moderation.json")[oldMessage.guild.id]).send(embed)
});
#

whoops

#

it spams

#

idk why

#

ignore the fact im using jsonfile

#

imma switch to enmaps in the final build

#

can I help

#

lol

#

invite me to a server that you own with the bot in it

#

k

cosmic swallow
#

ok , so I have a problem , each time I have the bg color on the page , the image goes away , and when the image is on the page , the color goes away (html)

earnest phoenix
cosmic swallow
#

eh ye , but none of the stuff works what I find lol

frigid juniper
#

Hey, did someone know how to get reaction of user when they add one to a message in python.
I tried this but it prints directly the class of reaction :

emo = discord.utils.get(client.get_all_emojis(), name='time')
            await client.add_reaction(ctx.message, emo)
            res = await client.wait_for_reaction(emoji=emo, message=ctx.message)
            print(res)```
#

I tried other things but idk why it doesn't await

earnest phoenix
#

Can somebody tell me how can I make a command using python? The method I used didn’t work anymore

ruby dust
#

what did you use

earnest phoenix
#

@client.command

#

ok I was actually here to ask how can I make a bot say something

knotty steeple
#

command()

earnest phoenix
#

client.say don’t work now for me

granite tartan
#

I was pinged here

ruby dust
#

it also depends what version of discord.py you are using

knotty steeple
#

rewrite or async

#

i will always say

#

use rewrite over async

spice coral
#

can I make the bot tag the prefix with an eval command?

#

sry if that is an stupid question

west raptor
#

regex

spice coral
#

?

exotic timber
#

how do you make the bot show #servers on the dbl web page?

#

mine has said N/A all day

west raptor
#

@exotic timber

exotic timber
#

thanks

#

is my bot's token the string of numbers at the end of my bot's url?

west raptor
#

no

exotic timber
#

i can't find this my bots page

vast ember
#

does anyone know how to keep an JS bot online 24/7 without keeping the pc on?

exotic timber
#

raspberry pi or vps

west raptor
#

Vps is probably better, since you are not using electricity with a vps

#

But it's up to you

exotic timber
#

yeah and a pi costs as much as like 2 years on basic w scaleway anyway

west raptor
#

Also

exotic timber
#

dream do you know how i find my token?

west raptor
#

Wait beb

#

Brb

exotic timber
#

k

west raptor
#

Ok sorry personal issues

#

So I'm on mobile so I'm trying to remember

#

Let me get on PC rq

exotic timber
#

thanks man

west raptor
#

@exotic timber

earnest phoenix
#

...

west raptor
earnest phoenix
#

?

#

oh shit

#

serverqueuet

west raptor
#

hahayes

earnest phoenix
#

wut

#

same problem

#

wtf

#

LOOK WTF

west raptor
#

u didnt change anything

#

:/

earnest phoenix
#

wait

west raptor
#

the q isnt a capital

#

:|

earnest phoenix
#

🤦

#

serverqueue and serverQueue it's not same

#

orr..

west raptor
#

:|

#

line 58

earnest phoenix
#

and serverQueue it's message.guild 😃

#

matter?

west raptor
#

serverQueue isnt defined in the function

#

define it

#
    const serverQueue = queue.get(guild.id);```
#

literally change one letter

earnest phoenix
#

ok

west raptor
#

line 58 btw

earnest phoenix
#

ik

#

ReferenceError: message is not defined
🤦

#

i can put ```js
function play(guild, song , MESSAGE)

#

@west raptor

#

?

west raptor
#

heh

#

wait

earnest phoenix
west raptor
#

because

earnest phoenix
#

but then it's the same thing with the serverqueue

west raptor
#

what

earnest phoenix
#
    const serverqueue = queue.get(guild.id);
    var serverQueuef = queue.get(guild.id);
#

....

#

i can delete the serverQueuef?

west raptor
#

ok so

#

look

#
function play(guild, song) {
    const serverQueue = queue.get(guild.id);

    if(!song){
        serverQueue.voiceChannel.leave();
        queue.delete(guild.id);
        return;
    }


    const dispatcher = serverqueue.connection.playStream(ytdl(song.url))
        .on('end', () => {
            console.log('A song was ended.')
            serverQueue.song.shift();
            play(guild, serverQueue.song[0]);
        }).on('error', error => console.error(error));
    dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);
}``` why did you out a f at the end
#

im confused about that

earnest phoenix
#

where

#

?

west raptor
#

:|

earnest phoenix
#
function play(guild, song) {
    const serverqueue = queue.get(guild.id);

    if(!song){
        serverqueue.voiceChannel.leave();
        queue.delete(guild.id);
        return;
    }


    const dispatcher = serverqueue.connection.playStream(ytdl(song.url))
        .on('end', () => {
            console.log('A song was ended.')
            serverqueue.song.shift();
            play(guild, serverqueue.song[0]);
        }).on('error', error => console.error(error));
    dispatcher.setVolumeLogarithmic(serverqueue.volume / 5);
}
west raptor
earnest phoenix
#

it's ok now?

west raptor
#

yes ok now

#

message isnt defined in the function

#

and there is no need to

earnest phoenix
#

The green line appears

#

but it is not heard

#

@west raptor

west raptor
#

what

earnest phoenix
#

wait

#

Thank you @west raptor

#

I kiss your ass

#

😝

#

😄

west raptor
#

:/

spice coral
#

So i stopped working with Discord Bot maker and startet working with js (visual studio)
now my question.
i made a config.json with the prefix in it and token etc.
how do i get the Bot tag as a prefix too?

#

thats my config

#

tag me pls if u answer

west raptor
#

5k files not staged

#

same

rustic axle
#

node_modules amiright

jagged basalt
#

can anyone help me with heroku?

shy verge
#

solution: don't use heroku

earnest phoenix
#

deleted

flat citrus
#

ఋ Triple fesses !

woeful gorge
#

emm, how to upload files from computer to bot?

west raptor
#

wut

woeful gorge
#

?

lean minnow
#

hey...does anyone know how can I draw a image over a image (using Jimp)

woeful gorge
#

nope

#

How to upload files from computer to bot?

lean minnow
#

That makes no logic...

#

Bot is on your computer

woeful gorge
#

what?

#

how turn on it

cobalt pier
#

hey

woeful gorge
#

?

lean minnow
#

Like you cant upload files to your bot

woeful gorge
#

Sorry, I'm new at it]

#

How to turn on this bot?

lusty dew
#

¯_(ツ)_/¯

cobalt pier
#

im have some trouble with some code

lean minnow
#

coding lang?

west raptor
#

u have to make it

lusty dew
#

Lol

west raptor
#

what a shooker

lean minnow
#

hey...does anyone know how can I draw a image over a image (using Jimp)

lusty dew
#

:O

#

No

knotty steeple
#

@lean minnow use canvas GWqlabsMmLol

lusty dew
#

^

lean minnow
#

?

woeful gorge
#

How to turn on this bot?

knotty steeple
#

jimp is slow

#

run the code

lusty dew
#

Canvas is na npm package

lean minnow
#

ok...

lusty dew
#

@woeful gorge What is the coding lang?

woeful gorge
#

bot.js

lusty dew
#

So

#

javascript

knotty steeple
#

node bot.js

woeful gorge
#

i did it in program Discord Bot Maker

knotty steeple
#

oh bloblul

lusty dew
#

Ew

lean minnow
#

🤦

woeful gorge
#

And i wan't to always active bot

lusty dew
#

That program is trash

knotty steeple
#

learn to code and dont use discord bot maker

lean minnow
#

you coud have asked in their server

knotty steeple
#

you just wasted $10 tbh

lusty dew
#

Or he could learn Javascript

west raptor
#

ask for refund

lean minnow
#

5$*

cobalt pier
#

hey should i use pycharm

lusty dew
#

10$

lean minnow
#

I payed 5$

lusty dew
#

It is 10

lean minnow
#

ok

knotty steeple
#

just use visual studio code @cobalt pier

cobalt pier
#

ok thx

knotty steeple
#

free and not laggy mmLol

lusty dew
#

Same with you @woeful gorge

#

Use VScode

#

and learn JS

knotty steeple
#

well any jetbrains ide is slow on my laptop

woeful gorge
#

OK ok]

#

Can I turn this bot on and can it be always active?

west raptor
#

jetbrains is alright

#

depends what you want to do

woeful gorge
#

Without this program

#

Without Discord Bot Maker

lusty dew
#

Never used Discord Bot Maker

#

Lol

woeful gorge
#

How to turn on this bot?

#

I've got files

west raptor
#

heh

lean minnow
#

@woeful gorge you need to pay for a VPS

lusty dew
#

No you don't

knotty steeple
#
lusty dew
#

@lean minnow You don't

lean minnow
#

you do

lusty dew
#

Not

knotty steeple
#

its not needed

#

you can host on your computer if you wanted to mmLol

lusty dew
#

You can host on your Computer

#

Just will run it hot

woeful gorge
#

@lusty dew So how turn on for always active this bot

#

I want to always active

lusty dew
#

I use pm2

woeful gorge
#

?

#

But I want active bot when I have turned off PC

lusty dew
#

oof

knotty steeple
#

not possible

lean minnow
#

RENT A VPS

lusty dew
#

Use VPS then

west raptor
#

vps

#

hahayes

woeful gorge
#

Ehh ok

lean minnow
#

-_-

lusty dew
#

@lean minnow Shhhh the kids are sleeping and it is past your bed time

knotty steeple
#
  1. windows key + r
  2. type in cmd
  3. cd to your directory
  4. node bot.js
lusty dew
#

or just

woeful gorge
#

So for what is this website?

lusty dew
#

CTRL + SHIFT + Right Click in the bot folder

#

and pick Command prompt

#

then do node bot.js

knotty steeple
#

it will show powershell

woeful gorge
#

ok but For what is this website?

lusty dew
#

Not for me

#

;3

knotty steeple
#

list your bot

woeful gorge
#

Ehh

#

okey

lusty dew
#

I use a thing called a friend who has a linux server and let's me use it

west raptor
#

what a shocker woah ok im being mean good bye

lusty dew
#

oof

#

Hello Dream

#

XD

lean minnow
#

I cant intall canvas

lusty dew
#

npm i canvas@next

lean minnow
#

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.12 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.12 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alexc\AppData\Roaming\npm-cache_logs\2018-09-29T17_41_00_482Z-debug.log

lusty dew
#

Did you do

#

npm i canvas@next?

lean minnow
#

yes

#

the error I get

lusty dew
#

Ok

west raptor
#

build tools

#

are needed

lusty dew
#

Ys

#

Yes

lean minnow
#

??

west raptor
#

wait

knotty steeple
#

and cairo

lean minnow
#

Sorry I am a newbie

#

😃

#

I still wait...

earnest phoenix
#

What

lusty dew
#

You need build tools and cario

lean minnow
#

where do I get cario from?

#

@lusty dew

lusty dew
#

¯_(ツ)_/¯

#

I just read the docs

cobalt pier
#

hey is it possible to make a discord bot in python

lean minnow
#

yes

knotty steeple
#

yes

cobalt pier
#

ok

lusty dew
#

yes

#

lol

lean minnow
knotty steeple
#

rewrite docs mmLol

#

async is shit

lusty dew
#

oof

#

ll

#

XD

#

I grabbed the wrong docs

#

lol

knotty steeple
#

i already posted the docs but ok

earnest phoenix
#

how can i put 2 prefixes?
or more

thick imp
#

.

abstract crystal
#

@earnest phoenix try starting with:
what's your library?
which version?
which language?

cobalt pier
#

FINNALY I DID IT

earnest phoenix
#

Where should I even start with an AI chat bot?

#

I have fairly extensive knowledge of NodeJS.

abstract crystal
#

if you are looking into any deep or machine learning you should look in python

#

primarily tensorflow

earnest phoenix
#

@earnest phoenix you can use a cleverbot API

#

@earnest phoenix I am looking for a "free" API or to make it myself.

#

Okay

#

There are some good free ones out there

#

I may use Wit

#

As for making it yourself, good luck...

#

Heh. Cant be to hard!

#

😄

#

I'm sure basic phrases are easy

#

Mhm.

#

But you don't want a chat bot just for basic phrases

#

I do not intend to.

#

It is quite simple, the bot just needs to extract keywords.

abstract crystal
#

your best bet would be making a model with tones of lines and responses then training it with tensorflow

woeful gorge
#

hi, what program do you prefeer to easy make bots?

abstract crystal
#

discord bot maker

#

you can get it in steam store

#

(i don't prefer it, but it's easy)

#

the other way is to learn a programming language

bright spear
#

do the other way

placid flax
#

i find it ironic that donatebot does not support discord webhooks

bright spear
#

dbl doesnt either

west raptor
#

hi so im working on a sudo command 'cause im bored and when trying to set a member property it return this error: js TypeError: Cannot set property member of [object Object] which has only a getter
also here's code

        if (!this.client.commands.get(command)) return msg.channel.send('Not really a valid command...')
        msg.author = user.user
        msg.member = msg.guild.member(user);
        msg.content = `${msg.guild.settings.prefix}${command} ${args}`
        this.client.commands.get(command).run(msg)```
#

setting the .author property works fine, im not sure why setting .member property returns that

#

ive tried everything

#

my head hurts because i dont understand this error crylaugh

restive silo
#

you can't assign member cause its a getter

#

so its readonly

west raptor
#

oh

restive silo
#

also are you using master?

west raptor
#

yea

restive silo
#

on master its a getter what gets from cache

#

you dont need that

#

it will always be up to date

west raptor
#

The issue I have now is that running commands that require member property doesn't work

#

And I don't get any errors

#

so that's kinda an issue :/

restive silo
#

wdym "doesn't work"

#

you can fetch member to be sure its there