#development

1 messages Β· Page 562 of 1

earnest phoenix
#

🀦

#

This is python correct

#

@prime oriole

prime oriole
#

Yea

earnest phoenix
#

You need to rename your script to something else, preferrably not a standard python module.

inner jewel
#

@keen drift just ask the question /shrug

earnest phoenix
#

failed /shrug

inner jewel
#

it's also in the topic don't ask to ask

prime oriole
#

I did, if it detects the file it crashes and when i remove the json file its fine but cant save data

keen drift
#

So uh, how does env passing work in docker and kube

#

Do I need to do anything special in dockerfile

earnest phoenix
#

idk wild

#

maybe someone else knows

#

go to the python discord support server

#

if there is one

inner jewel
#

docker run -e K=V image

keen drift
#

And in kube?

inner jewel
#

Β―_(ツ)_/Β―

keen drift
#

wew

granite tartan
#

i need

#

css code

#

to make them look like balls

#

like

#

shading

#

pls

languid dragon
queen sentinel
languid dragon
granite tartan
#

ty

languid dragon
#
.sphere{
    box-shadow: left_position top_position blur distance colour inset;    
    box-shadow: -5px -5px 5px 5px rgba(0,0,0.0.5) inset;
}
granite tartan
earnest phoenix
#

notepad

#

L

languid dragon
granite tartan
earnest phoenix
#

looks better

#

what is it you're trying to make?

queen sentinel
#

squares

earnest phoenix
#

🀦

#

no

granite tartan
#

balls

#

just wanna make them look like

#

balls

earnest phoenix
granite tartan
queen sentinel
#

wow

#

looks exactly like what you made

#

just send in what you've got

granite tartan
#

😩

languid dragon
#

u tryd

earnest phoenix
#

Wait is this supposed to be like those science things

#

that you slide the balls on the rod

granite tartan
#

ye

earnest phoenix
#

ahh

granite tartan
#

i just cant get them to look like

#

fckn balls

earnest phoenix
#

Someone know a package for transform 1000 to 1K

#

?

#

i make that if(curargent > 999) { curargent = `${curargent / 1000}K` } else { curargent = curargent }

#

So its working but

#

if i have 1234 credits he say 1.234K

keen drift
#

just round

#

?

earnest phoenix
#

@keen drift round?

queen sentinel
#

wot

keen drift
#

round?

#

Do you not know how to round

earnest phoenix
#

No

keen drift
#

do you know what rounding is

earnest phoenix
#

I dont understand what is meaning

#

No idk

keen drift
#

wew first grade all over

earnest phoenix
#

lmfao

#

round a number

#

I dont speak english :(

#

like 40

keen drift
#

Rounding a number is when you take a number and "bump it up" or "bump it down" to a nearby and "cleaner" number

earnest phoenix
#

Ahhhh

#

so say you have the number 46

#

rounding will be up to 50

keen drift
#

you can round 1.234k to 1k

earnest phoenix
#

and if a number is at a variable of 5, then your round up

keen drift
#

or just cut off the precision

#

either one

earnest phoenix
#

Math.round?

keen drift
#

yeah

earnest phoenix
#

Ahhhh

#

I'm stupid

idle mountain
#

don't worry we're all stupid

#

@keen drift you know what?

#

you stupid

#

stinking

#

fish

keen drift
idle mountain
#

ill hav e you know

#

i graduated top of my class

hushed berry
#

wow fishy stop ignoring my dms

keen drift
#

smh, I didn't ignore it, just didn't read it yet

daring sage
#

hey guys, i'm new in here, as well, in bot development. I just made a bot in discord.js by node.js, and my bot only stays online when i run the code.

it has any way so i can set the bot online without leaving my code running? because i would need to let my computer on

languid dragon
#

you should get a host

#

hosting it on a VPS is ideal to keep it online 24/7

daring sage
#

do i pay anything?

languid dragon
#

yes

#

a small price of 2.50 if you go to the right hosting service

daring sage
#

got it

languid dragon
#

but that's like $2.50 a month

#

which is pretty ideal

daring sage
#

do you have any indication?

languid dragon
#

for small applications

#

indication?

daring sage
#

yup

languid dragon
#

like do you want a link to a host?

daring sage
#

just a trustable one

languid dragon
#

sure give me a sec

daring sage
#

no need for a link

#

okay

languid dragon
daring sage
#

that's nice

#

thanks for helping Deftones!

languid dragon
daring sage
#

that's perfect!

#

thanks!!

earnest phoenix
#

I wouldn't use that

daring sage
#

oh, okay

#

i'll check all of them!

sick cloud
#

looks sketchy tbh

earnest phoenix
#

I use them

#

So I can say it's legit

sick cloud
#

i've had experience with vultr and they're rather good @daring sage

earnest phoenix
#

πŸ˜„

sick cloud
#

@earnest phoenix silky's website is literally a template

earnest phoenix
#

From their sponsor

sick cloud
daring sage
#

got it, thanks @sick cloud

sick cloud
#

πŸ‘Œ

languid dragon
#

swifti why would you do that though

#

I wouldn't use that

#

you make it sound like vultr and DO are dodgy

#

they're super well known and trusted

sick cloud
#

i tried this

table, thead, tr, th, tbody {
border: none !important;
outline: none !important;
}
``` but had no success there
languid dragon
#

can i have the link

sick cloud
#

to that page?

languid dragon
#

yes

sick cloud
#

it's on another bot list

languid dragon
#

ok well ill go to it but yes

sick cloud
#

alrighty

languid dragon
#
.markdown-body table,
.markdown-body td, 
.markdown-body tr, 
.markdown-body th, 
.markdown-body thead, 
.markdown-body tbody {
    border:none !important;
    outline:none !important;
}   
sick cloud
#

awesome, thanks

wet coral
#

Hey My pc isn’t working and I need help in creating a discord bot

earnest phoenix
#

use glitch

crude portal
#
     reactions:
      Collection [Map] {
        'πŸ˜‚' => [MessageReaction],
        'πŸ™‚' => [MessageReaction],
        'πŸ˜…' => [MessageReaction],
        'πŸ€—' => [Circular],
        '😜' => [MessageReaction],
        'πŸ˜ƒ' => [MessageReaction] },
#

Hey can someone explain to me why one of the emojis is "Circular"?

#

This is in MessageReaction

#

Thanks

pale marsh
#

Quick question

#

Is using a database to keep track of starboard messages overkill? Or should I just keep track of say, last 100 starred messages or something?

amber fractal
#

Well if you want old starboard messages to remain working..

#

I use a db

pale marsh
#

Makes sense

amber fractal
crude portal
#

Thanks! Lol I should've google it myself

amber fractal
blazing star
#

Is there anyway to get the raw data object from the User instance in discord.js master?

blazing stratus
#

!work

#

!rank

#

?help

#

Omg bot spam help me

queen sentinel
#

congratulations

earnest phoenix
#

lol

velvet chasm
#

help me..!
i want logging some one change nickname

clinet.on("guildMemberUpdate", async (oldMember, newMember) => {
  if(oldMember.nickname == undefined){
  var old = oldMember.username
  }else if(oldMember.nickname == null){
  var old = oldMember.username
  }else{
  var old = oldMember.nickname
  }
  
  if(newMember.nickname == undefined){
  var newm = newMember.username
  }else if(newMember.nickname == null){
  var newm = newMember.username
  }else{
  var newm = newMember.nickname
  }
  console.log(old)
  console.log(newm)
    var logs = oldMember.guild.channels.find(c => c.name === 'w봇-λ‹‰λ„€μž„-μ—…λ°μ΄νŠΈ-좔가쀑');
    if (!logs) return
if(old !== newm){
  const cembed = new Discord.RichEmbed()
          .setTitle("μœ μ € μ—…λ°μ΄νŠΈλ¨")
        .setColor("RANDOM")
        .setDescription(`μ „ : **${old}**\nν›„ : **${newm}**`)
        .setTimestamp(new Date());
    logs.send(cembed)
}else{
return
  }
});

i write like it
bot working
but.. bot print oldMember.username or newm = newMember.username
= null or undefined... help me T.T

sick cloud
#

because the event also fires for new nicknames and removed nicknames

#

old or new could be null

astral gyro
#

Yes @sick cloud i'm agree with You

velvet chasm
#

oh..
how can i fix it..?

astral gyro
#

I think in your last if

velvet chasm
#

um... i can't understand..

languid dragon
#

clean your code

#

maybe you'd actually understand it better if it wasn't a crazy mess

velvet chasm
#

oh i got it..
i fix that source

earnest phoenix
#

Well hello there

#

I have a question regarding my bot

amber fractal
#

Ok

#

You should just ask it

earnest phoenix
#

Aight

#

But how do i make the bot respond to a message

#

for example if i write in the chat "reeee" the bot responds "reeeee"

amber fractal
#

Well I dont use python, I suggest you read the docs then

earnest phoenix
#

Yeah i did

#

However it doesnt mention exactly how to solve my situation as far as i can tell

languid dragon
#

that's because ur supposed to use ur brain to put 2 and 2 together

earnest phoenix
#

Ty dad

marble needle
#

you have a message event listener in the library which does something whenever your bot receives a message
said message has content, check if the content is "reeee" and if so reply to it

languid dragon
#
  1. you learn python and you understand the basics of programming
  2. you make a bot and learn the documentation and get provided the basics of how to manipulate the library
  3. you put 2 and 2 together
earnest phoenix
#

Cheers @marble needle

marble needle
#

i suggest you do what @languid dragon told you before attempting to write a bot, especially the first point

earnest phoenix
#

PFF

marble needle
#

woah imagine having to learn about what you want to do before doing it waitwhat

earnest phoenix
#

ikr

languid dragon
#

learning how to actually program and read documentation? NAHH

earnest phoenix
#

hell naw

languid dragon
#

jumping right into the deep end and asking people for help > fuck yeah

earnest phoenix
#

Damn right

marble needle
#

he left lillulmoa probably expected to get working code thrown his way

quartz kindle
#

Lol

#

remember the dude from the other day wanting to code a bot on his phone?

marble needle
#

wait what πŸ‘€

#

seems like i missed that one, sounds wild though lmao

quartz kindle
#

yeah, i told him that is not easy, and that he has to install the environment and dependencies and what not, and send him a guide

#

he sends me a screenshot of the guide and asks "where do i click now?"

marble needle
#

should've told him to set up a dev env on his main rig and remote desktop to do work from his phone mmLol

quartz kindle
#

he doesnt have a pc

marble needle
#

well, that's unfortunate

#

coding on your phone doesn't seem like the most convenient thing either

earnest phoenix
#

I coded my bot on my phone mmLol

slim heart
#
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ninja\Desktop\bot
gyp ERR! node -v v11.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok```
im getting this when im trying to rebuild node-gyp meaning i cant install any of the addons i need
quartz kindle
#

@earnest phoenix coding is one thing, coding AND running/hosting is another

earnest phoenix
#

Ah okay

#

You never said hosting

quartz kindle
#

my bad then lul

#

but yeah he wanted run it on his phone, because he had no computer and no vps

earnest phoenix
#

Ah

#

What language

marble needle
#

may aswell code on paper

quartz kindle
#

js

earnest phoenix
#

Oh

quartz kindle
#

@slim heart did you change/update node?

slim heart
#

yes i just fully updated to 11.

#

but i reinstalled node-gyp

quartz kindle
#

bindings are locked to specific versions

slim heart
#

i dont have a binding file

#

and idk what it is

#

im at the binding.gyp wiki page and i dont get it

#

do i put it in package.json?

quartz kindle
#

no, binding files are for building native code

slim heart
#

so what do

quartz kindle
#

let me check their github

slim heart
ruby dust
#

I think I'm crazy, but I think I saw that thumbnail floating in that embed

slim heart
#
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ninja\Desktop\bot\bck\node_modules\bignum
gyp ERR! node -v v11.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bignum@0.13.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bignum@0.13.0 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\ninja\AppData\Roaming\npm-cache\_logs\2019-01-28T16_38_37_839Z-debug.log```
quartz kindle
#

@slim heart from what i understood, node-gyp is not native and doesnt need to be built

#

just needs to be installed globally

slim heart
#

i did

quartz kindle
#

msbuild failed with exit code: 1

#

isnt that a problem with ms build tools?

slim heart
#

i just installed those too tho

quartz kindle
#

you have python 2.7 right?

slim heart
#

how do i check

quartz kindle
#

python --version

slim heart
#

Python 2.7.15

quartz kindle
#

fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libeay32.lib

#

does bignum require openssl?

slim heart
#

idk

quartz kindle
#
bignum

Arbitrary precision integral arithmetic for Node.js using OpenSSL.```
slim heart
#

alright ill go download that

earnest phoenix
queen trench
#

Nani

quartz kindle
#

just post your question, if its a simple issue, even people who are not very knowledgeable might be able to help

viral spade
#

good day,
i'd be very thankful if you could help me.

i have a certain audio within a Buffer in nodejs.
i can successfully fs.writeFileSync('file.wav',buffer) and play file.wav on my pc.
How can i play that buffer with discordjs' connection.playStream() / playArbitraryInput() / ... ?

When feeding the buffer into the play function(s), i get an error message stating TypeError: this.inputMedia.pipe is not a function I have tried converting the buffer to a stream with ReadableStreamBuffer.put(buffer);. When i feed the stream into the play functions i dont get an error message anymore, but the sound doesnt play. The bots speaking indicator (the circle around the profilepic) is not showing up.
What can i do?

#

(without saving a temporary file on my pc!)

amber fractal
#

Well is this.inputMedia.pipe a function Thonk

viral spade
#

i guess it is on a stream object, not on a buffer object. i dont know

viral spade
#

@inner jewel i need your wisdom real real yasmin please

inner jewel
#

ask in the d.js guild how to play a buffer

sick cloud
#

will something like this work

if (!msg.guild.me.permissions.has('ATTACH_FILES') || !msg.channel.permissions.for(client.user.id).has('ATTACH_FILES')) return send(`I don't have permission to send files to this channel.`);
west mango
#

Anyone know any good AI apis, just a simple api to respond to questions, and return a answer in JSON

sick cloud
#

cleverbot

dreamy breach
#

Someone know how i can restart a jar file on java out of memory error?

#

Like kill it then restart it

earnest phoenix
#

cleverbot

keen drift
#

@Dorian, plenty of options, system service, etc

#

just listen for the exit status

dreamy breach
#

Okay ty πŸ˜ƒ

earnest phoenix
#

how do we get our bot certified

dreamy breach
earnest phoenix
#

thanks

silver lintel
#

can someone tell me, or know any good videos on how to add a soundboard/music to a discord.js bot?

earnest phoenix
#

don't use videos for learning

#

most people use lavalink and whatever lavalink wrapper there is for d.js now

#

google around

sick cloud
#

there's a guide on the discord.js site

#

@eternal nymph stop trying to advertise

#

@loud salmon

loud salmon
#

yardim snipe

#

@gilded plank ban @eternal nymph ads

gilded plankBOT
#

dblMod Banned FortKajπŸ‘‘#5861 (@eternal nymph)

hushed berry
#

@loud salmon what'd he do

loud salmon
#

posted invite links

hushed berry
#

nice

loud salmon
#

like a bitch

hushed berry
#

is yardim a prefix now

keen drift
#

yes

hushed berry
#

hahahahahah

#

thats great

loud salmon
#

yes its my custom prefix

sick cloud
#

back when bo had custom prefixes TsumikiCute

keen drift
#

back when bot had dashboards so they don't need commands

rich quest
#

l!help

#

@skallg

meager lava
#

When I check the logs for my bot, I see that I occasionally get a weird error:
`events.js:188
throw err;
^

Error: Unhandled "error" event. ([object Object])
at Client.emit (events.js:186:19)
at WebSocketConnection.onError (/home/ubuntu/DB/node_modules/discord.js/src/ client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/home/ubuntu/DB/node_modules/discord.js/node_modules/w s/lib/event-target.js:128:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
at _receiver.cleanup (/home/ubuntu/DB/node_modules/discord.js/node_modules/w s/lib/websocket.js:211:14)
at Receiver.cleanup (/home/ubuntu/DB/node_modules/discord.js/node_modules/ws /lib/receiver.js:557:13)
at WebSocket.finalize (/home/ubuntu/DB/node_modules/discord.js/node_modules/ ws/lib/websocket.js:206:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)`
I don't know why this error is happening and if anything is causing it, it's happening in servers I'm not in.

#

It isn't super often, but it makes my bot crash.

amber fractal
#

Well it crashes because its unhandled

meager lava
#

But what triggers the error event?

amber fractal
meager lava
#

I'll do that, but I wish I knew why it happened

amber fractal
#

When it is logged you should have more info

meager lava
#

Ok

orchid arrow
#

Fellas

#

I got an issue

earnest phoenix
#

oml

#

dude

orchid arrow
#

No im fr

earnest phoenix
#

Don't just ask to ask.

#

Provide everything instead of saying you have an issue

orchid arrow
#

Ok

#

And everytime I attempt to upvote.

#

It keeps authorizing as my alt account

#

How do I switchh it to my main?

earnest phoenix
#

🀦

#

You need to log out of the account in the web browser

#

then log in with the correct one

#

Go to "open discord"

orchid arrow
#

What do you think I did?

earnest phoenix
orchid arrow
#

I logged out like 8 times

#

And relogged into my main

earnest phoenix
#

Did you ever log out on the dbl website?

orchid arrow
#

And it keeps doing it.

#

Yes

earnest phoenix
#

Take a picture

orchid arrow
#

Whatever kiddo

earnest phoenix
#

of your dbl page

orchid arrow
#

Nah im leaving

#

Unhelpful.

#

And disrespectful.

earnest phoenix
#

Lmao, what do you think this is? A fucking hotel? Leave me a bad review skid and get outa my bedrooms πŸ‘

amber fractal
#

Nice

lusty dew
#

Lmfao

#

Ok that was funny to read

amber fractal
#

"Whatever kiddo" he must belong to the military

#

mmLol but this is offtopic

#

Imma leave

earnest phoenix
#

haha

lusty dew
#

or he just didn't do any of the things he said he did

#

and he felt embarrassed that he didn't think of it first

slim heart
#

what would be a good monitoring/managing solution for pm2?
Like something where i can host the website and i can restart and view metrics from certain processes etc.
I try like 3 different npm packages but they all have random problems and dont work

rugged terrace
#

@slim heart If you have a the GitHub Student Pack, you can get $50 in credits on DigitalOcean

#

You can also get more credits if u use my referall link πŸ˜‰

lost swallow
#

any ideas on how do i get the current count of a vc where my bot is?

#

i want to add a skip vote function for music

keen drift
#

Cached voice states

lost swallow
#

uhm

#

teach

keen drift
#

You need to reference w/e lib you are using for it

lost swallow
#

im using simple-youtube-api, ytdl-core, and ffmpeg with opusscript

keen drift
#

Reference to your Discord lib

lost swallow
#

d.js

keen drift
#

now reference to w/e place it has voice states

lost swallow
#

?

crisp ledge
#

hey

#

can I ask questions about discordrb here?

marble needle
#

maybe mmLol

crisp ledge
#

hmmm

#

trying now lol

#

so I have this bot

#

that is deployed to heroku

#

written in ruby

#

so it plays music using the gem's play_dca

#

but then its stuttering

#

so i was wondering is it the gem's limitation or heroku or am I doing something wrong

keen drift
#

maybe check usage

#

if heroku has that

twin locust
#

Sorry for the trouble my bot caused few lines of codes got deleted which caused the trouble fixed it now @void mantle

drowsy lily
#

heroku was good until second season, third one sucks

void mantle
#

We will approve it once we have testing it gain @twin locust

twin locust
#

Ok np

drowsy lily
#

like im not an anime fan but heroku is one of the few i tried watching

crisp ledge
#

hmmm

marble needle
twin locust
#

heoku?

crisp ledge
#

haikyu?

twin locust
#

@drowsy lily There is no anime named heroku

void mantle
#

because this is not the channel for this conversation

earnest phoenix
#

if you are doing music free hosting wont cut it

#
const { client } = require('../index.js');

class Info {

  static userInfo(ID) {
    
    return client.guilds.get('495953092743921664').members.get(ID).user;
    
  }

}

module.exports = Info;
#

help me

quartz kindle
#

i dont think you can require client from your index like that

#

require discord and get the client from that

earnest phoenix
#

then how?

#

Can I get a example?

quartz kindle
#

or pass it along with the function

earnest phoenix
#

can you give a example?

#

?

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

const client = new Discord.Client();

class Info {

  static userInfo(ID) {
    
    let guild = client.guilds.get('495953092743921664');
    
    let user =  guild.members.get(ID).user;
    
    return user;
    
  }

}

module.exports = Info;
#

ok

#

?

blazing star
#

uh

#

that’s not how that works

earnest phoenix
#

umm

blazing star
#

you can’t just keep creating client instances

#

you only need one

earnest phoenix
#

then how I get in this

blazing star
#

make a command class

earnest phoenix
#

like

#

example

#

please

blazing star
#

then when loading the command pass the client instance with it

#

so that you can access this.client

earnest phoenix
#

hm

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

class PBL extends Discord.Client {
  constructor (opt) {
    super (opt);
      }
}

module.exports = PBL;
#

now ?

sinful lotus
#

what are you trying to do?

#

if you want to pass client into that class

class Stuff {
    constructor(client) {
        this.client = client
    }

    getUser() {
        this.client.users.get()
    }
}
module.exports = Stuff;
#
// main.js
const SomeStuff = require('path to stuff file');
const client = new Discord.Client();
const stuff = new SomeStuff(client);
stuff.getUser();
#

although if you dont understand classes and how they work, then dont use it yet.

restive halo
#

Hey, new to this stuff and was wondering how people set up allowing your bots prefix to be changed? And any pointers would be much appreciated

sinful lotus
#

use a persistent storage

#

and grab the data there

restive halo
#

Ah thanks

dusky marsh
#

I use sqlite for my storage, it works pretty well if you're new to database stuff, but there are LOTS of options, to choose and learn.

viral spade
#

Hello, i have wav audio data in form of a UInt8Array. How do i have to convert it, so i can feed it into the connection.play() function?

versed cedar
#

if i am using node.js

#

i have the code in but how do i execute it in terminal whats the command?

marble needle
#

node <filename>

versed cedar
#

yeah but thats not working node turns yellow and im not good at this yet its my first time

marble needle
#

define "turns yellow"

versed cedar
#

it turns yellow when i type node but everything else isnt

quartz kindle
#

screenshot?

marble needle
#

inb4 its just his shell syntax highlighting the command

versed cedar
#

but its not working

mossy vine
#

just send a screenshot of your terminal

amber fractal
#

is anything in the file?

marble needle
#

can you take a screenshot of what you are doing

#

gotta have node installed to use it and code in the file you are trying to execute

amber fractal
#

and all the modules you require mmLol

versed cedar
mossy vine
#

πŸ‘

quartz kindle
#

that means the file was executed and then exited

#

meaning your file doesnt have anything in it that keeps it running

mossy vine
#

obviously its an issue with your code then

versed cedar
#

okay so just back track and code it again?

mossy vine
#

youre already a bot developer, how do you not know how to make a bot

versed cedar
#

its easy

quartz kindle
#

show us your file, just remove the token from it

versed cedar
amber fractal
#

client.on('ready')

#

Wait

quartz kindle
#

missing the function

versed cedar
#

hm?

amber fractal
#

Its not a function

quartz kindle
#

client.on("ready", function() {})

#

or client.on("ready", () => {})

mossy vine
#

this is node, you can do the arrow syntax - yes

amber fractal
#

How does that not error anyways

mossy vine
#

but you still need the ,

amber fractal
#

he has an extra }

mossy vine
#

or client.on("ready", () => {})

versed cedar
#

so do that?

mossy vine
#

yes

#

and write your code in the {}

versed cedar
#

okay thx

pastel edge
#

hi guys. This is my first ever bot build, building one to play sound effects on command. Any tips/advise?

quartz kindle
#

have you tried doing simpler (text only) commands first?

mossy vine
#

learn how to code before jumping into bots

restive bough
#

@versed cedar you need to add an callback function

#

like this

#
   client.on('ready',  function() {
      // your code
   })
#

or with ES6 syntax

#
   client.on('ready',  () => {
      // your code
   })
#

and you don't need to learn how to code before jumping into bots

amber fractal
restive bough
#

i think it's the best way to learn coding

#

by doing fun stuff like making discord bots

amber fractal
#

You should know how to make an if statement imo

restive bough
#

yeah

#

well

#

that shouldnt be that hard

marble needle
#

lul, gotta learn the basics before applying the 'learning by doing' concept to some degree

idle mountain
#

I started learning by making a bot

#

knew nothing previous to making one

#

definitely not the best way to learn, but it sure as heck works

amber fractal
#

until you come into a dev channel asking for help with something simple

restive bough
#

so?

idle mountain
#

are you saying that there shouldn't be any simple questions? thonkku

marble needle
#

not saying it doesn't work, but it's not as fun if you end up running into issues all the time that could've easily been avoided by looking into the basics

amber fractal
#

Asking a question every error you run into isnt how I believe you should learn. Yes, questions are good, but you should know how to debug and find errors in your code by yourself aswell.

restive bough
#

he knows how to do it know

bright spear
#

@earnest phoenix can you not send that in every channel... It's spam

#

`

#

It's above tab

#

And below escape

#

iOS or Android

#

Hold β€˜ and swipe to the left most one

#

No

dusky marsh
#

Lmao

dusky marsh
#

There you go

pastel edge
#

Can anyone help me work out what I'm doing wrong?

mossy vine
pastel edge
#

That's what I'm sure about. I'm really new to coding.

quartz kindle
pastel edge
#

OK, what should I use instead? In case it's not already obvious, I've been working with a tutorial! lol

quartz kindle
#

use a different tutorial

mossy vine
#

discord.js is very beginner friendly

#

and is the most used library

quartz kindle
#
pastel edge
#

Amending to discord.js gives the same error

quartz kindle
#

your package.json seems to be broken

mossy vine
#

oh its an issue with your package.json

quartz kindle
#

make sure you're using neutral double quotes, not typographic quotes

#

ie: this " " not this β€œ ”

pastel edge
smoky spire
#

Yep those are the wrong "

pastel edge
#

This is the current script

#

ah, ok. let me try chaning

#

brilliant, thank you

#

It's thrown up some warnings though. Do any of them require immediate attention?

quartz kindle
#

nope, those are all safe to ignore

pastel edge
#

Thanks all

#

Suspect I'll be back shortly for more help! xD

pastel edge
#

As predicted, I'm back! lol. What did I do wrong here?

earnest phoenix
#

Looking at the earlier screenshot it looks like you installed discord.js

pastel edge
#

but why would that affect the command?

#

i'm not asking it to find .io...

amber fractal
#

because you're trying to require a module you dont have

earnest phoenix
#

So you probably have something like const Discord = require("discord.io");

pastel edge
#

what command do i need instead?

amber fractal
#

Its not a command

#

just somewhere you do ...require("discord.io")

pastel edge
#

Rephrasing then, what do I need instead of node bot.js?

earnest phoenix
#

node bot.js is fine

#

In your actual code, you have it requiring discord.io

pastel edge
#

but that's what's caused the above...

earnest phoenix
#

It's the inside code that caused it

#

not actually running it

amber fractal
#

because node bot.js runs the bot.js file

pastel edge
#

ah rats

earnest phoenix
#

If you're using discord.io code you should probably change it

amber fractal
#

just find that require("discord.io")

earnest phoenix
mossy vine
pastel edge
#

...right... let's try again! lol

#

Geronimo!! Brilliant, thanks for now all!

#

Can't bring the bot online... now what have I broken?

marble needle
#

so what library are you using now instead of discord.io

pastel edge
#

discord.js

marble needle
#

they have a working implementation as simple as it gets on their homepage

pastel edge
#

I'm using node bot.js, but it's not responding...

marble needle
#

define "Not responding"

pastel edge
#

still not coming online

#

Hang on... Is this the problem?

#

is it because I haven't 'named' the bot, and therefore the command is wrong?

marble needle
#

you're not even connecting

#

you're missing <client>.login(<token>); at the end of your file

#

where <client> is "bot" in your case and <token> is a string of your bot's token

pastel edge
#

so put that on line 40?

marble needle
#

yea

pastel edge
#

Ah wait

#

my bad

marble needle
#

oh boy..<x> are placeholders

#

you're not supposed to include the <>

pastel edge
#

I did say I'm new! lol. hang on

#

What would I need for token?]

marble needle
#

your bot's token

pastel edge
#

the long one i've got in the auth file?

marble needle
#

did you create an application via discord's developer panel

#

yea

#

you access that with auth.token or whatever you called the key in your json object

pastel edge
#

OK, changed those, but my CMD prompt seems to be having a problem with the token. should it have "" on it?

marble needle
#

yes

#

your token is a string

pastel edge
#

I'm learning slowly! lol

marble needle
#

or wait, you're not supposed to put "" around auth.token

#

what problem is it having

#

it needs to have "" around it in your json file

pastel edge
#

yeah it does in the json

#

i added "" to the token in the js, CMD is just rerunning now

marble needle
#

is it still erroring out

pastel edge
#

it seems to have frozen part way through

marble needle
#

you could use console.log(); for starters to have readable console output that isn't an object lmao

#

that being said, there doesn't seem to be anything wrong with that

#

your client did what it was supposed to do on the ready event

pastel edge
#

yep, bot online now! πŸ˜„

#

so I just leave the CMD screen open now, and leave it alone to keep it running, yeah?

marble needle
#

yes

mossy vine
marble needle
#

the shell is essentially your bot, if your close the shell your bot will go offline

pastel edge
#

Right... so the good news is the bot now functions.

#

Bad news is that it's not working as I would like it to.

mossy vine
#

that would be message.content.substring

#

message is an object containing a shit ton of stuff

#

message.content is the actual text that the user sends

pastel edge
#

In theory, I should type DD/Ping! and get Pong! back

#

so what should line 23 be? if (message.content.substring(0, 1) == 'DD/') {?

mossy vine
#

exactly

#

actually lemme check docs real quick

#

i dont know why you would use .substring tho

#

message.content is enough

marble needle
#

what do you want to achieve with substring

restive halo
#

Got a bit of a stupid issue.
Built in a help command that's meant to return a list of all commands if you just use help with no command afterwards. But it's not recognising the blank. Works if I use it for commands though

pastel edge
#

yours is easier to resolve than mine i suspect, nuclear! lol

restive halo
#

Probably lol. The reason my bot broke earlier was because I missed a space bar

pastel edge
#

I'm still learning how to build bots and code... as you've seen it's a slow process! xD

restive halo
#

Fixed it by replacing '' with null smh
Good luck fixing your thing though!

marble needle
#

@pastel edge to figure out whether or not your message starts with your prefix you can take a different and probably better approach, look into String.prototype.split() on mdn

#

nvm i meant .split()

pastel edge
#

which line?

marble needle
#

the one where you're trying to figure out your prefix

pastel edge
#

I though my prefix was DD/ ?

marble needle
#

if you split message.content with a whitespace you get an array of words in the message, array[0] should be the command, now you can split the command with "" (without anything) and set a limit of your prefix length. That will split your command into two array elements, index 0 which should be your prefix and index 1 which should be the command

pastel edge
#

I assume I need to be looking at the following line:

#
  • if (message.content(0, 1) == 'DD/') {*
#

Am I right so far?

marble needle
#
var msg_arr = message.content.split(" "); //Split message into array
var cmd = msg_arr[0]; //First element is your command
var cmd_arr = cmd.split("", <yourprefix>.length); //splits your command into two elements, [0] should be the alleged prefix
pastel edge
#

Like i say, i'm a real rookie with coding, hence all the stupid sounding questions

marble needle
#

everyone started at some point its alright

pastel edge
#

so does that mean that line 23 is ok, it's 24 and 25 i need to be looking at?

marble needle
#

yes you need to be looking at what you highlighted

#

given what i sent earlier (the codeblock) you can check if(cmd_arr[0] === "DD/"){ ... }, the command you want to process would effectively be cmd_arr[1]

pastel edge
#

so in theory, if i remove 24 and 25, and replace them with the var coding you gave me, would that fix it?

hidden ginkgo
#

Assuming you want to ensure a space between the prefix and command

pastel edge
#

at the moment, what i'm hoping to get from the bot is as follows:

#

Me: DD/Ping!"

#

Bot: Pong!

valid frigate
#

i would suggest making the prefix lowercase

pastel edge
#

The DD/?

valid frigate
#

yeah

#

make it dd/

pastel edge
#

ok. out of interest, any particular reason?

valid frigate
#

some people don't capitalize sentences and if it's case sensitive, the bot won't read it

#

also generally good practice

#

but your choice

pastel edge
#

is there any way to program the bot not to be case sensitive on the prefix?

hidden ginkgo
#

Is there no js function for "ignore case"

valid frigate
#

it's not by default 😀

pastel edge
#

fair. thanks for the input

valid frigate
#

okay

marble needle
#
<client>.on("message", (message) => {
    var msg_arr = message.content.split(" "); //Split message into array
    var cmd = msg_arr[0]; //First element is your command
    var cmd_arr = cmd.split("", <yourprefix>.length); //splits your command into two elements, [0] should be the alleged prefix
    
    if(cmd_arr[0] === "DD/"){ //If command starts with your prefix...
        //do cmd stuff
    }
}

this should do the job without the substring memery

pastel edge
#

Rye, do I use that in place of lines 24&5?

#

Or is that in addition to what I already have?

marble needle
#

wait a second what are you passing as params in the message listener lol

pastel edge
#

That's line 20, yeah

marble needle
#

djs passes a single message object

#

you'll have to get the user, the user's id and whatnot from the message object itself

pastel edge
#

so does that mean that message should just be ' ' ?

marble needle
#

that means you remove every parameter you are passing in the event listener other than message

#

on line 20 everything you threw into the brackets except for message doesn't belong there, you can call it however you want it will always represent the message your bot received but the on.message listener only passes one thing

pastel edge
#

so does line 20 just need to be bot.on { then?

#

or bot.on ('message') {?

marble needle
#

bot.on('message', function(message){. . .});

#

or with arrow notation bot.on('message', (message) => {});

#

both essentially the same thing

pastel edge
#

line 20 amended, is now:

#

bot.on('message', function(message){. . .}); {

#

HOWEVER

#

I now can't bring the bot online

#

back to sqaure one! lol.

marble needle
#

placeholders

#

. . . isnt valid js syntax

#

or valid syntax in any programming language lol

pastel edge
#

rookie mistake much! lol

vernal rivet
#

?

marble needle
#

{ . . . } is used to replace actual function content you put into the function body

#

the . . . to be more specific

vernal rivet
#

What's up?

pastel edge
#

so line 20 is now bot.on('message', function(message)); {

marble needle
#

the semicolon doesn't belong there

vernal rivet
#

Why do you need a function method for messages?

#

It's async

pastel edge
#

semicolon gone

vernal rivet
#

bot.on("message", async (message) =>{ }

marble needle
#

you don't specifically need the async keyword for it to work

pastel edge
#

from line 20 is now:

vernal rivet
#

Function only creates a function if I am not mistaken

#

Did you look at the discord.js docs?

marble needle
vernal rivet
#

You don't need it, but it's not a bad idea to include so you know that it's an asynchronous function

pastel edge
#

You're talking to a rookie here... small words please! lol

marble needle
#

i suggest you get yourself a code editor that clearly highlights syntax errors

vernal rivet
#
marble needle
#

easier to work with that and spot minor mistakes

earnest phoenix
#

wym notepad++ best IDE

vernal rivet
#

Never use notepad++

pastel edge
#

using notepad++

marble needle
#

i'd rather write code on paper

vernal rivet
#

Use vsc

earnest phoenix
#

failing to understand sarcasm

vernal rivet
#

Visual studio code

quartz kindle
#

notepad++ isnt bad

earnest phoenix
#

^

#

it just isn't made for coding

#

it's... a notepad

valid frigate
#

a notepad with advanced features

vernal rivet
#

It's not, but for a rookie, don't use it unless you want to suffer

pastel edge
#

ok. let's go back to the beginning

marble needle
#

thats line 20 for you

pastel edge
#

bingo, bot back online

#

still erroring though

marble needle
#

message.content returns a string

pastel edge
#

what do i need to change on line 23?

vernal rivet
#

Also you don't need to do bot.message.channel.send just do message.channel.send

marble needle
#

it's not a function thus cannot be passed parameters

pastel edge
#

ok, so what is it, and what do i need to do instead?

#

panda, which line, please?

vernal rivet
#

Where are you learning to make a discord bot Delta?

marble needle
#

here it seems

pastel edge
#

hehe, was using an online tutorial, but judging by what i've been told here, it looks like it's very out of date

earnest phoenix
marble needle
#

since you were trying to use discord.io earlier you're probably trying to use discord.io elements in discord.js

vernal rivet
#

Go on the you Tubes and look up source code discord bot tutorial, and follow his guide

marble needle
#

there

pastel edge
#

good name! lol

marble needle
#

ok-ish explanations on how to do discord bots in js using djs

restive bough
#

use the docs

vernal rivet
#

Docs, and the you Tubes are your best friends here

restive bough
#

if your familiar with javascript

marble needle
#

the docs won't help you all that much if you dont know basic syntax

earnest phoenix
#

do not use youtube tutorials for learning, reasons stated above

marble needle
#

i mean they will but to a limited extent

earnest phoenix
#

if someone suggests you to use youtube tutorials over something else, they most likely did that too and their bot is probably very shitty

vernal rivet
#

We'll use yt tutorials for learning how to make the shell of your bot, and for someone that is new that would be very useful to use

earnest phoenix
#

you're completly ignoring the fact that you need to know a language to make anything in it, e.g a bot

pastel edge
#

so where it says client.on, i need to type bot.on etc, correct?

vernal rivet
#

Client.on is bot.on

pastel edge
#

so one and the same?

restive bough
#

how did you name your variable?

marble needle
#

he named it bot

#

so you'll have to use "bot" wherever the docs or tutorials mention "client"

restive bough
#

yup

vernal rivet
#

You would know that you pay attention to that you have var bot = Discord.Client();

restive bough
#

use const

#

for constant variables

vernal rivet
#

Yes do that, const will be a lot better to use than var

amber fractal
#

doesnt really change much except throw an error when you attempt to change it

pastel edge
#

so everywhere i have var needs to be ammended to const?

amber fractal
#

just good to define constants as const tho

restive bough
#

no

amber fractal
restive bough
#

only use constant if your not going to change the value

amber fractal
#

Only things that wont change

restive bough
#

of that variable

amber fractal
#

normally your modules wont change

vernal rivet
#

And use the let keyword and the const keyword to define variables

#

If you don't know when to use which one, take the codeacmady Js course

amber fractal
#

I use var 😒

restive bough
#

no lol

#

don't use codecademy

vernal rivet
#

You can use var, but let and const will be more handy to use than just using var, but there are times that var is best to use

amber fractal
#

iirc var and let just changes the scope

pastel edge
#

brilliant. so now that we're back to the start, that still doesn't resolve the fact that my existing code seems to have crashed...

amber fractal
#

where it can be used

vernal rivet
#

I would tell you this Delta, rewrite your code

marble needle
#

message.content is not a function, it returns a string

restive bough
#

you already said that

marble needle
#

you cannot slam brackets onto everything

pastel edge
#

right

#

i've rewritten the code

vernal rivet
#

What he means is message.content is not a method, or function(both are valid) this means it doesn't take in any parameters, so I would change that to message.contenr.startsWith("<string>");

pastel edge
#

Now looks like this

amber fractal
#

Have you considered vsc?

pastel edge
#

Good news. sending the command no longer sends the bot offline

marble needle
#

the 'ready' event doesn't pass any parameter, what's "evt" doing in the callback

pastel edge
#

bad news; it's not returning the expected response

vernal rivet
#

Yes

#

Do ping

inner jewel
#

you never log in

restive bough
#

bruh

marble needle
#

he probably just removed that because of his token on the screenshot

vernal rivet
#

Oh did not see that there

amber fractal
#

^

restive bough
#

he removed the token

marble needle
#

he was logged in before

pastel edge
#

i removed the token to post the printscreen

#

it's still in the script

restive bough
#

you should make an config.json

#

with your token

#

and prefix

marble needle
#

he does

#

its called "auth"

restive bough
#

ah

marble needle
#

hes just not using it for whatever reason

vernal rivet
#

Delta send me a server invite link in dms, will try to see what's wrong

pastel edge
#

Rye, should i have auth being referred to in the bot script then?

marble needle
#

if your json config looks like this (for example)

{
"token" : "hue"
}```

you access your token with auth.token
vernal rivet
#

Its not that mates

marble needle
#

if you use "auth.token" in the login method you don't have to modify your code to take screenshots

vernal rivet
#

He forgot to include the prefix

marble needle
#

i had that feeling but meh

pastel edge
#

right, so correcting those

#
  1. How do i add the prefix?
#
  1. what do i add on the login line?
#

to refer back to auth

marble needle
#

bot.login(auth.whateveryourtokenkeyiscalledinyourjsonfile);

amber fractal
#

it only checks if the message starts with ping, its not checking for a prefix anyways wym

vernal rivet
#

Yee

pastel edge
#

so bot.login(auth.auth); ?

marble needle
vernal rivet
#

You can do that if you want to

amber fractal
#

whatever your token is defined as in your json file

pastel edge
#

Thanks so much for your time and help, Rye

marble needle
#

πŸ‘Œ glhf

vernal rivet
#

So do auth.token

pastel edge
#

bot.login(auth.token); ?

vernal rivet
#

Yup

pastel edge
#

brilliant

vernal rivet
#

Yee

pastel edge
#

right. which line do i need to edit to put a prefix on it?

#

is that line 23?

sick cloud
#

set a variable in your config

vernal rivet
#

under your bot.on("message"..... Put let prefix = "dd/";

sick cloud
#

no

#

that means your setting a variable every message

vernal rivet
#

Tony you don't need to have it in config

sick cloud
#

a config contains information you don't change

#

prefixes go in there

amber fractal
#

I do it in the message event because they can customize it

vernal rivet
#

It doesn't matter where it is, as long it's defined in your file it works

quartz kindle
#

you can set prefixes in a global variable/object at the beginning of the file

pastel edge
#

the aim for this bot is that it plays soundbites on command

vernal rivet
#

Tim knows all

sick cloud
#

yeah but static content in the file is dumb

vernal rivet
#

It's not dumb

pastel edge
#

essentially any command needs to have dd/ first ideally

sick cloud
#

my average config now:

{
    "token": "token",
    "invite": "https://discordapp.com/oauth2/authorize/?permissions=0&scope=bot&client_id=id",
    "prefixes": ["...", "<@id> ", "<@!id> "],
    "botLists": {
    ...
    }
}
vernal rivet
#

So in your message.content.startsWith(); do prefix + "ping"

pastel edge
#

so if (message.content.startsWith(dd/+ "ping")) { ?

sick cloud
#

no

vernal rivet
#

Put your let prefix = "dd/"; on line 22

#

message.content.startsWith(prefix + "ping"); just like that

pastel edge
#

still not picking up

marble needle
#

i think at this point you're better off checking the website i linked earlier and rewriting your entire bot without the stuff that deprecated tutorial taught you

#

there's gotta be some initiative from your side aswell, we can't sit here for hours on end repeating ourselves 3 times a minute

slim heart
#

Is there an error

marble needle
#

if you were to read line 20 you'd figure out what the error is without any console output

#

*23 actually

slim heart
#

Mmm yea

vernal rivet
#

He might have not restarted his bot in his cmd

late hill
#

bruh.mp3

pastel edge
#

can't bring the damn bot back online now! grr

#

i'm back at square one! 😒

sick cloud
#

because you arent doing what we've told you to do

pastel edge
#

i've been trying to follow advise... have rewriten bot as suggested

#

trying to launch now

#

bingo

marble needle
#

rewriting != changing one line of code

pastel edge
#

right. simplified bot now online

marble needle
#

and you're still not using your config file like you should

signal prairie
#

Well... For the command I use a Command Handler so the commands are files in a folder called commands

pastel edge
#

you referring to the login bit, Rye?

marble needle
#

yes

pastel edge
#

i tried it, but couldn't bring the bot online with it

#

just to confirm, it should be bot.login("token"), yes?

signal prairie
#

Did you type bot.login(config.token);?

marble needle
#

bot.login(auth.token); in your case

pastel edge
#

ok, thank you

#

so what do i need to do to configure it to require a prefix? i can't figure that out...

#

currently lines 17-22 are as follows:

#

bot.on("message", (message) => {
let prefix = "dd/";
if (message.content.startsWith('prefix' + "ping"); {
message.channel.send("pong!");
}
});

signal prairie
#

let prefix = "<prefix>"; or let prefix = auth.prefix; above the command

pastel edge
#

now i'm getting an error brining the bot online

#

do i just need to take out the ; that it's pointing to?

sick cloud
#

yes

pastel edge
#

still failing

mossy vine
#

Please

#

Learn javascript

#

Before making a bot with it

#

All of these issues can be solved if you know what youre doing

#

There are some great guides pinned

glossy sphinx
#

A

#

A

#

A

void mantle
#

@glossy sphinx Pls dont sam random bs

pastel edge
#

right... bot online sans prefix commands

glossy sphinx
#

Ok

#

Cool

#

Pourquoi tu m'a parler en en

pastel edge
#

ok... i'm off to try and figure out how to add a prefix command that doesn't crash the bot. thanks all for your time, support and patience thus far; i'll try not to bug you any more tonight!

versed cedar
#

i need help making commands in node.js

signal prairie
#

Want to use command handler Master?

#

Or without with?

earnest phoenix
#

hey what can i do to make my bot repeat a message twice , 2 different messages?

sick cloud
#

send
send

amber fractal
#

Well if its 2 different messages its not a repeat and that above

analog arrow
#

hey guys how do you assign bots so they can only say their commands in chosen channels?

lusty dew
#

Any JS devs wanna collab with me? This bot is very important to me and I would appreciate the help :>

#

Dm me if so

versed cedar
#

@signal prairie whats a command handler?

earnest phoenix
#

Anyone wanna try out my bot and give feedback

versed cedar
#

i will

earnest phoenix
#

I dm u

versed cedar
#

k

thick trellis
#

Can u guys help me get my bot online pls!!πŸ™ πŸ™ πŸ™

frosty gate
#

What do you need

#

@thick trellis

thick trellis
#

My bot is offline!!

frosty gate
#

Ok..?

#

Again

#

What do you need

thick trellis
#

I need to get my bot online!

frosty gate
#

Ok....

#

What stage are you in.. experience wise

#

do you have a library your using?

thick trellis
#

I'm totally new!

frosty gate
#

ahh ok

#

So

#

What, if any, languages are you familiar with?

thick trellis
#

English and Hindi

frosty gate
#

...

thick trellis
#

what?

#

this is my bot

slim heart
#

programming language

#

you cant just tell a bot to login and go online you have to program your bot to do whatever it does

#

woU leaked token

#

@thick trellis delete that image

#

also why are you running a bot on your phone πŸ‘€

thick trellis
#

@slim heart Can't i make a bot on mobile??

languid dragon
#

no

thick trellis
#

Ok there is literally no way of creating a bot on mobile??

slim heart
#

we just said

#

you can

#

but its better if you dont

#

β„’

cobalt dune
#

Hey so I want to use a command to edit messages and embeds. So say i sent my rules in an embed but instead of resending it, to edit it. I cant find any videos how to do this and im not so good at reading docs and learning so anyone know of any vids or anything?

amber fractal
#

save the message sent as a variable

#

refer to it later

#

let m = await message.channel.send("stuff") await m.edit("not stuff")

upper tundra
pale marsh
#

Maybe there's a build() method or something. Check its documentation

frosty gate
#

@

#

Oops

sick cloud
#

can embeds take an svg as an image?

modest sorrel
#

no

amber fractal
#

How to async eval pls

prime cliff
#

@upper tundra like Kef said you need to close the embedbuilder with a .Build()

sick cloud
#

okay

upper tundra
#

Okay

#

The foxbot documentation is in version 1.0.2

sick cloud
#

and whats wrong

upper tundra
#

Yea the .Build() fixed the error, thanks πŸ˜ƒ

crude portal
#

Hey does anyone know what Discord.Message in Discord JS gives?

bright spear
#

huh

mossy vine
crude portal
#

So it's the same as msg in client.on("message", msg => ...)?

#

But it's defined out of the message event

sick cloud
#

where's this apparent Discord.Message

crude portal
#

It's the same as Discord.Client() but it's Discord.Message

bright spear
#

no..

#

Message is just the message object