#development

1 messages · Page 532 of 1

quartz kindle
#

maybe hes trolling him in dms

#

xD

earnest phoenix
#

so i delete maven,

#

and i use gcenter like a lib ?

shadow barn
#

#soon

earnest phoenix
#

How to remove all the reactions of a message? plz

slim heart
#

Lib?

earnest phoenix
#

JS

#

@slim heart

slim heart
#

message.clearReactions()

#

Read the docs before you ask questions please.

earnest phoenix
#

Thanks you

earnest phoenix
#

Hello

#

i have a problem

#

My code work but my bot send a embed message to all the discord who have my embed

#

You understand ?

#

My code :

#
                var embedpoke = new Discord.RichEmbed()
                    .setColor(embedcolor)
                    .addField(`Pokémon trouvé !`, `Bien joué ${sender}, vous avez capturé un **${Pokemon.Noms[FinalRand]}#${FinalRand}** & vous avez Gagné **${pokep}** Points`, false)
                    .setImage(Pokemon.Gifs[FinalRand])
                    .setColor(`${color}`)
                message.channel.send(embedpoke)
                .then(message => {
                    // https://discord.js.org/#/docs/main/stable/class/ReactionEmoji
                    // https://discord.js.org/#/docs/main/stable/class/MessageReaction?scrollTo=emoji
                    var TonEmoji = client.emojis.find("name", "Rappel")
                    message.react(TonEmoji)
                    client.on('messageReactionAdd', (reaction, user) => {
                        if (reaction.emoji === TonEmoji && user.id !== client.user.id) {
                            if (user.id !== sender.id) return
                            message.channel.send(':Rappel: **__Un rappel a été lancé, dans 15 minutes vous serez mentionné ici !__** :Rappel:')
                            message.clearReactions()
                            setTimeout(() => {
                                message.channel.send(`**__Rappel pour :__** ${sender} :Rappel:`)
                            }, 900000);
                        }
                    })
                })```
#

anyone know how to get emoji id's, i cant get it :/

#

Respond me plz

#

ctrl shift I -> Network -> Send an Emoji & you will see the ID of the Emoji in the inspect element side (sorry for my english) @earnest phoenix

#

ok

slim heart
#

Lol I’m bout to take a reading test I could answer both of ur question sksksks

earnest phoenix
#

@earnest phoenix i cant see 😦

#

gunteronline l

#

Are you in the "Network" section ?

#

yes emojis at there but i cant find it so i cant get id 😫

#

hm, you see "message" when you send emoji

#

nope

#

Can you take a screen ?

#

🤠

#

thats not i

#

t

#

hmm, strange

#

😭 JUST TELL ME HOW TO GET EMOJİ GRR

#

Sorry :c

#

but why you need emoji id ?

#

İ NEED TO ADD İT TO MY BOT

#

oh ok

#

Hello
i have a problem
My code work but my bot send a embed message to all the discord who have my embed
You understand ?
My code :

                var embedpoke = new Discord.RichEmbed()
                    .setColor(embedcolor)
                    .addField(`Pokémon trouvé !`, `Bien joué ${sender}, vous avez capturé un **${Pokemon.Noms[FinalRand]}#${FinalRand}** & vous avez Gagné **${pokep}** Points`, false)
                    .setImage(Pokemon.Gifs[FinalRand])
                    .setColor(`${color}`)
                message.channel.send(embedpoke)
                .then(message => {
                    // https://discord.js.org/#/docs/main/stable/class/ReactionEmoji
                    // https://discord.js.org/#/docs/main/stable/class/MessageReaction?scrollTo=emoji
                    var TonEmoji = client.emojis.find("name", "Rappel")
                    message.react(TonEmoji)
                    client.on('messageReactionAdd', (reaction, user) => {
                        if (reaction.emoji === TonEmoji && user.id !== client.user.id) {
                            if (user.id !== sender.id) return
                            message.channel.send(':Rappel: **__Un rappel a été lancé, dans 15 minutes vous serez mentionné ici !__** :Rappel:')
                            message.clearReactions()
                            setTimeout(() => {
                                message.channel.send(`**__Rappel pour :__** ${sender} :Rappel:`)
                            }, 900000);
                        }
                    })
                })```
#

😭

#

SOMEONE TELL ME HOW TO GET EMOJİ İD

#

WHY İTS SO HARD DİSCORD, DİDNT YOU THİNK DEVS CAN NEED TO ADD İT TO BOTS 😡

#

wow

#

i found it with eval command haHAA

#

Xd

little silo
#

@earnest phoenix j'ai eu le même problème, je vais essayer de retrouver mon code 😉

earnest phoenix
#

Merci tu peux décale en PV ?

little silo
#

oui

earnest phoenix
#

@tight heath ?

#

Can you help me plz

tight heath
#

with?

earnest phoenix
#

You can moove private ?

tight heath
#

I can but I don't really want to

earnest phoenix
#

Plz

shadow barn
#

@earnest phoenix or you can just right click the emoji in chat and click copy link, the id will be in the link.

#

Much easier

#

like this

#

The ID 469565491397001223

west raptor
#

oh I thought that was eggsy

#

LMAO

#

I was so confused

earnest phoenix
#

wow i am really idiot 😦

shadow barn
#

it's alot easier to do that

#

than inspecting element and shit

west raptor
#

or

earnest phoenix
#

@west raptor i got permission to have his gif

west raptor
#

you can do

#

:mmLol-1:

#

fuck

#

phone suck

earnest phoenix
#

ok guys dont shitpost here or mute is coming seriously

west raptor
#

\<emoji>

#

thats a easier way

shadow barn
earnest phoenix
#

@west raptor hey can you teach me how to do it

mild quarry
#

In discord.py, I have a command that requires arguments from the user ( >[command] [args]) and if the args the user gives is a custom emote, the command doesn't execute and nothing happens. How can I get it to take a custom emote as an argument from the user?

visual zenith
tight heath
#

@visual zenith you define the function inside of the constructor

#

define it outside

visual zenith
#

i just tried that and it didnt work

#

@tight heath

tight heath
#

please define it that way and show me the error.

visual zenith
#

@tight heath

tight heath
#

I mean you can entirely remove the constructor if it's empty

#

can I get app/AntiRaid.js lines 320 - 330

visual zenith
#

ok

tight heath
#

where is spamfilter required?

#

because you'd need to do

#

const { spamfilter, linkfilter, mentionfilter } = require('path/to/Protection.js')

earnest phoenix
#

From a design standpoint, passing message and message.client to a function is kind of pointless

#

All discord.js classes have a client

tight heath
#

from a design standpoint

#

this is the most messy code I've ever seen

balmy parrot
#

Hello everyone, I'm creating a bot for Discord, but when I put ** $ {client.users.size} ** on client.user.setActivity it does not work, does anyone know why...

rocky mesa
#

no space

#

its ${client.users.size}

#

dont put a space between the $ and {

#

@balmy parrot

balmy parrot
rocky mesa
#

hmm

tight heath
#

use

#

``

#

not

#

""

quartz kindle
#

${} doesnt work without template literals

tight heath
#

backtics indicate a template string

balmy parrot
#

But the other works ...

tight heath
#

no it doesn't

balmy parrot
quartz kindle
#
"em "+client.guilds.size+" servidores" // normal string
'em '+client.guilds.size+' servidores' // normal string
`em ${client.guilds.size} servidores` // template literal```
rocky mesa
#

how is it zero if its in a server

tight heath
#

^

balmy parrot
#

Strange, it is in this server and in development, and continues with 0 ...

rocky mesa
#

because it doesnt work

balmy parrot
#

This template works, but something happens and gets 0.

rocky mesa
#

also its not in this server

balmy parrot
#

The bot is on the server and on the development server, but still it still generates 0, why?

quartz kindle
#

are you trying to use it before the ready event?

balmy parrot
#

yes

quartz kindle
#

thats the problem

#

the user list is not populated yet before the ready event

balmy parrot
quartz kindle
#

exactly

#

you need to move activities_list inside the ready event

earnest phoenix
#

Put the array in the ready event

balmy parrot
#

?

earnest phoenix
#

I'll say it again

#

Put the array inside of the ready event callback

quartz kindle
#

client.on("ready", () => {
activities_list = [blablabla]
})

earnest phoenix
#

No

#

You need to declare it

balmy parrot
earnest phoenix
#

Lol. What's so hard about moving your code

quartz kindle
#

move the entire activities_list part

#

to inside the ready event

balmy parrot
#

oh

quartz kindle
#

.>

balmy parrot
#

Well, now it shows 3

fair sage
#

@earnest phoenix Tu es français je vais t'expliquer ?

earnest phoenix
#

Oui

#

Viens PV

fair sage
#

Ok*

quartz kindle
#

@balmy parrot show your code again

balmy parrot
quartz kindle
#

looks correct

#

how many guilds?

balmy parrot
#

2

#

Here and the development guild

quartz kindle
#

its not here yet

#

if it was here, your name would be green

visual zenith
#

@tight heath

var {
    spamfilter,
    linkfilter,
    mentionfilter
} = require('./protection.js')
#

i already defined it

#

but it still shows the error

balmy parrot
#

kkkkkkkkkkkkkkkkkk

#

tu é br tbm

#

KKKKKKKKKKKKKKKKkk

quartz kindle
#

yes, but english only here

balmy parrot
#

fds

#

shudhusadshuasdhu

#

mas n entendi

#

tipo, o bot tá em 2 guilds

#

mas n tem 3 users utilizando o bot

quartz kindle
#

it only found 3 online users

#

offline users dont count

visual zenith
#

yep*

quartz kindle
#

and this guild doesnt count, because your bot is not accepted yet

visual zenith
#

true

balmy parrot
#

ham hamm

serene sun
ruby talon
#

@earnest phoenix If you put a backslash before the emoji you can receive the emoji id fully.

Emoji: GrandCat
Emoji ID: :GrandCat:

#

Oh lol

#

Did they change that or wut

#

:thinking:

serene sun
#

oof

ruby talon
#

Wuttt

#

/🤔

#

Nop

#

It wzs backslash

#

Does it still work for channels?
[#general](/guild/264445053596991498/channel/264445053596991498/)

#

Yep

#

Thonkr

#

Y did they change that reee

smoky spire
#

They didn't change anything

serene sun
#

@quartz kindle I GOT IT TO WORK!!

balmy parrot
#

Hi everyone, I was doing a help command in categories, where you select a reaction and the bot edits the message, showing the commands and among others, but when I execute the command, edit directly, what do I do?

west raptor
#

@ruby talon I think its broke on mobile

#

I can do it fine

ruby talon
#

Oh lol

#

Rip mobile

#

@balmy parrot you will have to say what language you're using xP

balmy parrot
#

js

ruby talon
#

Say that with your message next time xP

#

But I'm python so can't help ya.

balmy parrot
#

.-.

bright spear
#

@balmy parrot could you explain what specifically you need?

balmy parrot
#

Hi everyone, I was doinh a help command in categories, where you select a reaction and the bot edits the message, showing the commands and among others, but when I execute the command, edit directly, what do I do?
Code (Js/Javascript):
http://prntscr.com/lr8u95

Lightshot

Captured with Lightshot

#

Reads that you understand ❤

west raptor
#

Tony made a tutorial kinda thing on this a while ago

balmy parrot
#

Oh, thanks ❤

west raptor
#

Np

balmy parrot
#

This way it's a little more complicated, better not even try. oliy

lusty dew
#

@west raptor How do you make a restart command

#

😂

west raptor
#

shrug

lusty dew
#

Im joking by the way but Maria needs to know and I'm a bit busy

primal egret
#

Just stop process and restart it with a script

lusty dew
#

Yea

earnest phoenix
#

and...

#

this script is........

west raptor
#

use like

#

pm2

lusty dew
#

I think you can use the . destroy function right? @primal egret

west raptor
#

or something

lusty dew
#

.destroy*

primal egret
#

This only destroy discord connection

#

If you want to restart the code

lusty dew
#

Ah ok

primal egret
#

Stop the process

lusty dew
#

Ok

#

Yes that makes sense olol

primal egret
#

😂

lusty dew
#

I haven't looked too much into the discord.js docs

#

Lol

primal egret
#

I made it with my bot @low cloak

lusty dew
#

Oo

#

I'ma dm the bot

#

;3

primal egret
#

😂

lusty dew
#

I'ma ask for it's number

#

It hates me

#

It's as if I'm blocked

primal egret
#

😂

lusty dew
#

😂

#

It said I couldn't dm it

primal egret
#

Lul

lusty dew
#

:((

#

I just want a girlfriend

primal egret
#

Sad

lusty dew
#

Or a boyfriend

primal egret
#

Oh

earnest phoenix
#

:v

lusty dew
#

I'm joking btw

primal egret
#

😂

lusty dew
#

@earnest phoenix It's not hard

earnest phoenix
#

anyone have the restart script?

#

:u

lusty dew
#

Make it yourself? :V

primal egret
#

Just make a while

lusty dew
#

You don't learn by taking

earnest phoenix
#

yea

#

i know but only the basic

#

my bot can run music

#

and i used my own code

lusty dew
#

Learn whatever language your doing?

primal egret
#

While true

#

😂

lusty dew
#

I barely know Js but I know a bit

#

I can make a bot that turns on

#

:p

primal egret
#

:p 😂

lusty dew
#

Oh and it turns off

#

I'm pro

primal egret
#

@gilded plank bots @lusty dew

gilded plankBOT
#
Nightmare Ali#0674
Bots

@molten prairie

lusty dew
#

;)

primal egret
#

:C

lusty dew
#

The bot is Yukari

primal egret
#

Is not here

lusty dew
#

It's here I think

primal egret
#

No, I only see the ID

lusty dew
#

Oh no....it's not

#

WTH happened to my bot

#

Lol

#

Maybe because the embeds are huge

primal egret
#

My bot left a days ago

#

😂

lusty dew
#

Lol

#

My bot emebeds are huge

#

Embeds*

#

It's a ToS bot

#

For discord

#

😂

primal egret
lusty dew
#

Isn't that batch?

primal egret
#

Yeah 😂

lusty dew
#

Lol

earnest phoenix
#

ok

primal egret
#

For bot starting

#

I use it

lusty dew
#

I know how to make batch viruses

#

;)

primal egret
#

OH that ilegal boy

lusty dew
#

No

#

That's only if I release them

primal egret
#

Yea yea

serene sun
#

hello. i just finished a bot running on linux on gcp. i am also using putty. after i close the putty cmd my bot turns off around 2 minutes after? why is this?

balmy parrot
primal egret
#

Because you stop the process when you close putty

serene sun
#

how can i have it continue running?

quartz kindle
#

use pm2

primal egret
#

I think if you make a screen you can close putty without stopping bot process

#

Or pm2

serene sun
#

whats that?

keen drift
quartz kindle
#

process manager 2

keen drift
#

or systemctl

primal egret
#

😂

keen drift
#

or a lot of things

quartz kindle
#

if that's what pm2 actually stands for

#

lmao

keen drift
#

tmux also w0rks

serene sun
#

can someone walk me through how to use that

quartz kindle
#

they have a website

keen drift
#

they have a doc

knotty steeple
#

nodemon

quartz kindle
#

basically you have many options

#

i used tmux and pm2 so far

#

i like pm2 better

serene sun
#

so i have to install it then just do pm2 start app.js

quartz kindle
#

yup

serene sun
primal egret
#

mp2

quartz kindle
#

mp2

#

lmao

primal egret
#

😂

serene sun
#

LOL

lusty dew
#

@quartz kindle Hi

serene sun
#

my b

lusty dew
#

It's pm2 right?

quartz kindle
#

yup

primal egret
#

Yes

lusty dew
#

Okie

serene sun
#

hahah im start bloblul

#

okee dokie, well, lets hope this works

#

but its me so it probably wont

primal egret
#

Will work

#

:v

serene sun
#

so after pm2 start app.js, i can close cmd?

quartz kindle
#

well, you managed to get everything else working so far

#

so you'll be able to get this too

serene sun
#

@primal egret ask tim, everything doesnt work with me lol

quartz kindle
#

yes you can close

primal egret
#

@serene sun oh

serene sun
#

now time to wait a few minutes

quartz kindle
#

when you open the connection again you can do pm2 ls to list running processes

#

and pm2 monit to get live information about them

serene sun
#

oh perfect

quartz kindle
#

pm2 log to see past logs and errors

#

and pm2 will auto restart your bot in case of crash

#

and if you launch it with pm2 start file.js --watch it will auto restart on code change

#

so you dont need to restart it when you add changes

primal egret
#

I will switch to pm2 lol

#

😂

serene sun
#

wait so do i do node . , then type pm2 start app.js

quartz kindle
#

when i started using pm2 i was like "why didnt i use this before lmao"

primal egret
#

😂

quartz kindle
#

no, pm2 replaces the node command

#

they manage the node command for you

serene sun
#

ohhhhh

primal egret
#

It sounds veryyy god

#

Good

serene sun
#

so do i have to replace it or it detects it

quartz kindle
#

yes it is god

primal egret
#

😂

quartz kindle
#

literally just run pm2 start filename instead of node filename

serene sun
#

alrighty

lusty dew
#

Oooo

#

Mmmm

#

Gggg

#

I'm so bored

quartz kindle
#

it also saves the process by name (without .js)

#

so you can do pm2 restart name and pm2 stop name

serene sun
#

wow.

#

it is finally done.

#

i cant thank you guys enough

#

truly

primal egret
#

😃

#

Thanks to Tim 😂

serene sun
#

tim literally carried me through this project

#

i feel bad for wasting close to like 4 hours of his time lol

primal egret
#

@gilded plank bots @quartz kindle

gilded plankBOT
#
Tim#2373
Bots <:dblCertified:392249976639455232>

@oak sentinel dblCertified

serene sun
#

the GOAT himself ^^

vast lantern
#

Why dosnt the /votes api also give you the unix time when the user voted :3

serene sun
#

hmmm

#

testing it rn and when i need it to join the call, countdown, then leave it just instantly joins and instantly leaves. it worked before the pm2 stuff as well

quartz kindle
#

check pm2 log

serene sun
#

should i do pm2 monit

quartz kindle
#

yeah, but monit doesnt show past logs, only current ones

#

it starts logging them from the moment you use it

#

did you manage to install the lzma thing? i believe lzma is a dependency for the audio stuff

serene sun
#

yup

#

i think atleast

#

lol

#

i just did npm rebuild and the bot started to work

#

then i had to download ffmpeg

quartz kindle
#

nice

serene sun
#

i get this

keen drift
#

Prob want to do pm2 save

#

And pm2 startup

serene sun
#

okee

#

hmm still does the same thing

#

no error though

keen drift
#

Those are to ensure the process comes back up after system reboot

serene sun
#

should i try to restart the pm?

vast lantern
#

Hey can someone tell me how the Icarus bot got a custom background on the discordbots page? or is that something only the webadmins can do?

knotty steeple
#

whats a custom background

#

its called css

#

learn it

vast lantern
#

thats what i mean

knotty steeple
#

its called css
learn it

#

lmao

vast lantern
#

they actualy allow you to use css lol

#

didnt know that

#

kk thx

balmy parrot
#

How to imp .Spaceflight News API?

serene sun
#

@quartz kindle hey, i got these errors when checking pm2 log

#

@primal egret ^^ also if you can help.

quartz kindle
#

looks like an internal error, not sure whats causing it

#

you can try adding this to your code

#
client.on('error', function(e){
    console.log(e.error,new Date());
});```
sick cloud
#

anyone know any node modules that can turn things like 14000 into 14k or such?

knotty steeple
#

look for the amount of 0s

#

do it urself mmLol

quartz kindle
#

^

sick cloud
#

thanks

serene sun
#

i was doing research and found that this error has to do with a connection to the internet...

#

odd huh

#

should i try a different program?

#

the bot works fine when im not using pm2 @quartz kindle

tawdry kite
#

reee

#
  if(!kickeduser) return message.channel.send('Specify who the offender is.')
  if(message.kickeduser.hasPermission('KICK_MEMBERS')) return message.channel.send('This student cannot be expelled due to their high status in school.')```
#

Howcome it says hasPermission cannot be read

quartz kindle
#

user doesnt have hasPermission

#

only member does

#

and idk @serene sun never happened to me... it shouldnt be an issue with pm2 tho

serene sun
#

damn 😦

quartz kindle
#

does it happen consistently every time it joins voice?

serene sun
#

yup

#

should i try restarting it?

#

pm2 restart

quartz kindle
#

well it restarts on crash anyway

#

did you try adding the on.error?

serene sun
#

yeah

#

nothing pops up in cmd though

quartz kindle
#

not in pm2 log ?

serene sun
#

nope

#

except for the error

#

and connections

quartz kindle
#

try adding the on("error") to your voice connection

#

it should be something like js voiceChannel.join() .then(connection => { connection.on("error", e => console.log(e)) });

gilded blaze
#

You could just do js connection.on("error", console.log)

quartz kindle
#

oh, nice

#

didnt know that

serene sun
#

let startgame = function(guild,channel1,channel2) { channel2.join().then(connection => { const dispatcher = connection.playFile('bot/sound/321go.mp3'); dispatcher.on('end', () => { channel2.leave(); const embed2 = new RichEmbed() .setColor(0xff0000) .addField("Waiting for server 3 digit codes...","Please enter them in here. They are located on top of your screen on left side in game, last 3 digits is the code.",false) channel1.send(embed2) scrims[guild.id].codes = true; scrims[guild.id].codedata = {} scrims[guild.id].message = false; }); }) }

#

oof i tried to be cool like you guys

#

but is that where i should throw in the error

sick cloud
#

have you heard of codeblocks

quartz kindle
#

if thats the only place you use voice connections, then yeah, add it right after you declare connection

serene sun
#

i dont think that is the only place

quartz kindle
#

well, if you remove all your voice features and it works, then you could try remaking them

#

idk about problems with pm2, since my bot doesnt use voice

#

maybe someone else who uses voice and pm2 can help

serene sun
#

yeah

#

i find it odd how it works just fine outside of pm2

knotty steeple
#

i have it installed tho

west raptor
#

uh

#

what

#

os u on

knotty steeple
#

windows

west raptor
#

i had problems installing it on windows also

#

i never fixed it

serene sun
#

i think i got the bot working with tmux

uneven rover
#

i got this error from a server with 2FA enabled
unhandledRejection: DiscordAPIError: Two factor is required for this operation

bright spear
#

so either enable 2fa or tell them to disable the requirement

uneven rover
#

i did that, I had no choice

earnest phoenix
#

This is about python not discord bots why does it make me run my .py files in a cmd prompt

west raptor
#

because

earnest phoenix
#

@earnest phoenix where else are you going to run them

#

whenever i am able to double click an app it will run it.

#

what

#

a python file

#

yes but

#

you can't run a .py file by double clicking it

oak imp
#

Dumb question for y'all...

I'm working on a new bot, and stupid Clyde keeps telling me the bot has explicit image filtering on; in the user account that owns it, content filtering is turned off.

Is there a way to make the explicit filter off, via code? If not, is there a way to disable it entirely?

JavaScript (like everything I make and list here)
Discord.js (like everything else I make and list here lolz)

civic crypt
#

@oak imp Nobody can help unless you provide language and library

#

Just sayin 🤷

sick cloud
#

@civic crypt did you read

#

right under ur nose

civic crypt
#

@sick cloud they just edited it btw

earnest phoenix
#

@oak imp can you provide an image thanks

oak imp
#

@earnest phoenix of what? clyde rejecting images?

earnest phoenix
#

yes

ruby dust
#

I'm pretty sure bot accounts have explicit filter enabled in dms anyway, it's not something you can change

oak imp
#

Alright, welp, I'll have to figure out a wrokaround

ruby dust
#

It's surprising that you are even allowed to attach a file in bot dms, just my opinion

oak imp
#

Agreed; basically we're creating (and almost done) a replacement service since tumblr is removing adult content. Given the nature of such a service, you can see how explicit content is like the vast majority of what we're handling lolz... I think I'll just need to create a command that uses an NSFW-marked channel, instead of DMs

quartz kindle
#

well, the fact that discord itself has optional content filtering is proof that its allowed

#

otherwise they wouldnt bother implementing it if its gonna be banned anyway

ruby dust
#

That's for receiving content, bot accounts have that enabled by default

quartz kindle
#

you mean a user sending an image to a bot?

ruby dust
#

Yes

quartz kindle
#

oh thats stupid lmao

#

well, bots can still extract it from the message

#

could use it to upload files for example

ruby dust
#

Well I can see the point in discord doing it, for example to prevent people from using bot dms to use as an alternative for NSFW marked channels, or post something that is explicitly against TOS

earnest phoenix
#

i have a problem with

dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});

its do error TypeError: Cannot read property 'on' of undefined

lament meteor
#

should be very clear

earnest phoenix
#

yes

#

the only time you're accessing the property 'on' of something is when you're doing dbl.webhook.on

#

so dbl.webhook is undefined

spring ember
#

Not exactly bot development but the api for it. I need a plug-in for hapi for server side session storage, I didn't manage to find any. Also why is hapi caching so complex?

shadow dust
#

Is there a way in HTML / JS to ask a user where he would like to save a file

spring ember
#

@shadow dust it's the default download

shadow dust
#

Mmh true

shadow dust
#
        <div class="col-12 text-center">
            Are you sure that you want to remove "<div class="selected-file-name">UNKNOWN_FILE</div>" ?
        </div>
.selected-file-name {
  display: inline;
  font-weight: bold;
}
let sfilename = "lol";
let filenamedivs    = document.getElementsByClassName("selected-file-name");
for(let div in filenamedivs)
    div.textContent = sfilename;

With that following code my div's text never gets changed so I dont get what im doing wrong

misty rune
#

consider changing innerHTML instead of textContent

#

textContent would work for <p> <span> and such

#

but not sure for div

quartz kindle
#

just fire up the console and test it live

misty rune
#

textContent actually work for me

shadow dust
#

well

#

it doesnt work with innerHTML either and the variable isnt an empty string or null

misty rune
#

yup i tried out

#

textContent should work

#

your code is ok

shadow dust
#

this is so weird 😟

misty rune
#

is your div well displayed ?

#

is the " well escaped ?

quartz kindle
#

regardless, div is not supposed to be used inline

#

better use span

shadow dust
#

i was using span, it was for testing purposes

#

:/

#

" is in the html part so it shouldnt need escaping right?

misty rune
#

did you tried to run your javascript in the console ?

shadow dust
#

yep

misty rune
#

did it work ?

shadow dust
#

actually let me try that out again

quartz kindle
#

run it in parts

misty rune
quartz kindle
#

and see where it breaks

#

^ like that

shadow dust
#

it stays UNKNOWN_FILE which means it havent been changed

#

😢

misty rune
#

can you run document.getElementsByClassName("selected-file-name")[0].textContent = "lol"; and look for the first ?

shadow dust
#

sure

quartz kindle
#

just do document.getElementsByClassName(selected-file-name)

#

to see if it even finds it

misty rune
#

i tried the for my self and it didn't do anything

#

it seems

quartz kindle
#

and if it finds the correct thing

shadow dust
#

document.getElementsByClassName("selected-file-name").length
1

#

it finds it

#

and @misty rune thing worked

quartz kindle
#

try with for or forEach instead of for in

shadow dust
#

oh wait!

#

thats the issue

#

its of in javascript

#

im stupid

#

Yes! that was the issue

keen drift
#

for of would work as well

#

for in for key iterations

shadow dust
#

Im so used to lua that I just used in by habit

misty rune
#

i don't know enough js

#

but what is the difference between the two ?

shadow dust
#

in seems to be keys

misty rune
#

i always though that in and of would do the same

shadow dust
#

and of values

keen drift
#

you can deconstruct it

misty rune
#

ow

#

it iterates over test method

keen drift
#

but yeah it's key

misty rune
#

yeah ok i understand know

#

the more you know : D

quartz kindle
#

oh yeah, i forgot for in gets the key even in arrays

#

i forget that arrays are basically objects with indexes as keys lol

misty rune
#

is a good screenshot to help explain to other

keen drift
#

you can also deconstruct to obtain key in for of

#

for (let [k, v] of stack)

misty rune
#

Good to know

earnest phoenix
#
.setTitle('[View Profile](https://web.roblox.com/users/' + rblx[rId].userId + '/profile)')

Is there a typo in this code? Because it wont appear to be clickable and show all the words I type instead.

west raptor
#

sir

#

may I ask

#

are you under 13

#

@earnest phoenix ?

#

@earnest phoenix Also markdown doesn't work in titles iirc

earnest phoenix
#

No I am not because due to the Discord ToS. Why are you asking that tho?

west raptor
earnest phoenix
#

How so?

#

I am adding a Roblox verification feature to my bot.

#

how it changed the background and color of letters where the bot appears on the discord bots page

#

@earnest phoenix Use CSS

#

ok thanks 😄

earnest phoenix
#

you’re welcome

sick cloud
#

@earnest phoenix use .setURL

#

titles cant have masked links in them

#

but you can combine title and url

earnest phoenix
#

a

slate kayak
#

hello anybody knows some free country radio stations that i can use for my bot please

night imp
#

Wdym?

#

Like for playing music?

slate kayak
#

yes but only country

night imp
#

Idk how you would stream through that but sadly no

slate kayak
#

hmm ok 😦

late hill
#

But does an URL as title work on mobile

mossy vine
#

iirc it does

late hill
#

owo

#

U can't use emojis in titles and field names and stuff on mobile

#

sad

amber junco
#

There is no module.js file

tight heath
#

node index.js

amber junco
#

Yes?

tight heath
#

yes write that

amber junco
#

I have a file called index.js

tight heath
#

not node index

amber junco
#

So type node index.js not node index

tight heath
#

tickNo node index
tickYes node index.js

amber junco
#

ok

#

lol

tight heath
#

is there a way I can make it more clear

amber junco
#

C:\Users\hi\Desktop\TC Helper>node index.js
module.js:550
throw err;
^

Error: Cannot find module 'C:\Users\hi\Desktop\TC Helper\index.js'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3

#

The error I got when saying node index.js

tight heath
#

okay

amber junco
#

I do not get the error

tight heath
#

dir /s | findstr /v "\node_modules" > dir.txt

amber junco
#

^^

#

Whats that?

tight heath
#

run it

#

it'll create a file called dir.txt

#

send it and I can help you

amber junco
#

ok

#

Send all the text there?

tight heath
#

just send the file

amber junco
#

^^

#

File

tight heath
#

okay and

#

dir /s > dir2.txt

#

and that file

amber junco
#

Ok

tight heath
#

this looks suspiciously like DBM

amber junco
#

Whart that?

tight heath
#

nvm

amber junco
tight heath
#

well so what I'm asking myself is

#

are you following some kind of guide?

#

because you have no file that actually contains the code to load the commands in /commands or the events in /events

#

and no node_modules like discord.js installed

amber junco
#

I copy pasted the core code form my other bot

#

I do

#

Have discord.js installed

tight heath
#

not in that folder though

amber junco
#

In TC helper?

#

yes

#

I do

tight heath
#

no

amber junco
#

wth

#

Lemme to it again

tight heath
#

you literally sent me a directory listing; there is none lmao

#

dir.txt is the names of your directories

#

there's no discord.js there

amber junco
#

Oh

#

I ran npm i install discord.js

#

And it didnt install full

tight heath
#

npm i discord.js

#

not i install

amber junco
#

Yes

#

That

#

Sorry

#

I meant npm i discord.js

tight heath
#

if you did npm i install discord.js it probably crashed at trying to install a module called "install"

#

lmao

amber junco
#

lol

#

I ran npm i discord.js It did not install the js fully

tight heath
#

oh

#

sad

amber junco
#

ikr

tight heath
#

but what about the file loading your commands and stuff?

amber junco
#

Yes

#

npm i discord.js installed some random stuff

tight heath
#

the folder on the left is unrelated btw

#

side project

amber junco
#

Mine is index.js too

tight heath
#

no

#

there is no index.js

#

in the folder

#

of TC Helper

amber junco
#

npm i discord.js installed some random stuff

tight heath
#

yes it did so what

#

this is my command loader

#

btw

#

not very elegant but it works

#

I didn't bother rewriting my 7 month old loader since my framework (aurora) has an inbuilt one

amber junco
#
const Discord = require("discord.js");
const client = new Discord.Client({disableEveryone: true});
const fs = require("fs");
client.commands = new Discord.Collection();
const config = require("./config.json");
const client = new Discord.Client();

//Error Event (To not trigger errors that will end your process, you must handle this event)
client.on('error', console.error);

fs.readdir("./events/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(file => {
      let eventFunction = require(`./events/${file}`);
      console.log(`Event Loaded: ${file}`);
      let eventName = file.split(".")[0];
      client.on(eventName, (...args) => eventFunction.run(client, ...args));
    });
  });


fs.readdir("./commands/", (err, files) => {

    if(err) console.log(err);

    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0){
      return console.log(`No commands available.`);
    }

    jsfile.forEach((f,) => {
      let props = require(`./commands/${f}`);
      console.log(`Command Loaded: ${f}`);
      client.commands.set(props.help.name, props);
    });
});

client.login(config.token);

This is my index.js

tight heath
#

it's not there though apparently

amber junco
#

So what do I add?

tight heath
#

that file

#

as index.js

#

because this is your directory content

#

did you forget to save it or something?

amber junco
#

I saved it

#

idk

#

Maybe my file is cursed

icy gate
#

it is

amber junco
#

probably

ruby dust
#

is there a way to "test" if a discord webhook url is valid or not without sending a message?

bright spear
#

not afaik

#

might be able to fetch info through the api

#

oh you can

ruby dust
#

my idea was to send a bad request, assuming I'll get a 400 instead of 403 or something

tight heath
#

depends in which order it checks

ruby dust
#

and while that api idea is good, I need to be able to check by only having the entire webhook url and not just it's token

bright spear
#

just make a get request instead of a post request

#

looks like the url structure is the same

ruby dust
#

can you give me a direct link to that webhook part from the discord portal?

bright spear
ruby dust
#

thanks

bright spear
#

yw

earnest phoenix
#

`Could not find node >=8.0.0, using 10

/opt/watcher/app-types/node/start.sh: line 49: null: command not found` glitch commando

bright spear
#

First one: your format for the node version is wrong but looks like its handling it

#

Second: command not gonna found is probably something with commando so ask in the commando channel in the djs server

earnest phoenix
#

Hey, im asking this because i have seen other bots do this, any way to set up vote rewards? like how can i use it

#

so when i vote for my bot on dbl, it gives a reward to the user. like lets you access a command

mossy vine
earnest phoenix
#

Thanks

swift light
#

Can anyone help me fork a bot over to Heroku to get it on my server?. Not how to do this right
Or if the bot can even be hosted on heroku

near lintel
#

@amber junco You defined client twice

sick cloud
#

@near lintel show where

#

i only see once

modern otter
#

Does anyone know how to set up giveaway bot or any bot in particular

sick cloud
#

go to their support server

modern otter
#

Can you send me the server in a pm

sick cloud
topaz fjord
#

@restive silo yes

#

I think

#

I moved to dev since it's dev related

restive silo
#

oh ok

topaz fjord
#

I connected to the ws

restive silo
#

use that as url

topaz fjord
#

whats the ws for

#

👀

restive silo
#

you dont need ws

topaz fjord
#

oh

restive silo
topaz fjord
#

I can use that with LL?

restive silo
#

yea

topaz fjord
#

👀 how

#

do I just gib it that link

restive silo
#

yes

topaz fjord
#

oh

#

kool

restive silo
#

like you do with youtube or soundcloud urls

topaz fjord
#

time to attract the weebs

restive silo
#

mmlol

sick cloud
#

i used the WS

#

bc you get info and heartbeating is sick

high lava
#

Is there any specific reason why my bot's status keeps disappearing after a few days?

twin granite
#

I think it's a bug in the api

#

Something like that

#

#BlameDiscord

high lava
#

Yeah. It's getting annoying

bright spear
#

I just make it update on an interval

ruby dust
#

@high lava discord cache is fucking up from time to time, you know, typical discord...

ruby dust
#

in discord.py does on_shard_ready only starts working if I'll actually start using more than 1 shard?

amber junco
#

in .py
How do you make a command like:
!run.
Bot replies
Hello

lethal tangle
#

how do I get the discord bot list webhook server pass and port?

amber junco
jagged birch
#

Google it grape

grave mist
#
dbl.on('vote', vote => {
  console.log(`User with ID ${vote.user.id} just voted!`);
});
#

Does this work

#

I tried it and it didn't work and didn't send any errors

shadow barn
#

I'm using await fetch with node-fetch but because i'm using it my bot won't start, what could be the issue?

sick cloud
#

what errors

shadow barn
#

There's no errors, the bot just refuses to start when i include await in the code

#
const mentioned = message.mentions.users.first();
        // Add sentences to the responses in the embed title.
        var sentences = [
            `${message.author} embraces ${mentioned} close to them.`,
            `${message.author} holds ${mentioned} tightly.`,
            `${message.author} gives ${mentioned} a big hug~`,
            `${message.author} grabs onto ${mentioned} and hugs them.`,
            `${message.author} opens their arms to ${mentioned} to give a big huggie~`
          ];

          var random = sentences[Math.floor(Math.random()*sentences.length)];

        if (!message.mentions.users.size) {
            return message.channel.send('Tag a member to hug them.');
        }

        if (message.author === mentioned) {
            return message.channel.send(`${message.author} hugs themselves... You'll be alright 💕`);
        }
        if (mentioned === client.user) {
            return message.channel.send('Awww, *huggieeeeez*');
        }

        const url = await fetch('https://nekos.life/api/v2/img/hug')
            .then(response => response.json())
            .then(body => body.url);
            let embed = new MessageEmbed()
            .setColor('#363942')
            .setDescription(`${random}`)
            .setImage(url)
            message.channel.send(embed);
sick cloud
#

is it an async function

shadow barn
#

When i remove await it starts

sick cloud
#

you cant use await without making your function async

shadow barn
#

Worked now

#

thanks

earnest phoenix
#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
``` How would I use this, I don't understand?
sick cloud
#

read the docs

earnest phoenix
#

it's limited on detail

sick cloud
#

then make sense of it, its pretty obvious how to use it

earnest phoenix
sick cloud
#

okay?

earnest phoenix
#

how can i make bot write to file?

#

using fs, i tried but doesnt work

mossy vine
#

use fs

earnest phoenix
#

i tried

#

i just need an example

sick cloud
mossy vine
#
const data = new Uint8Array(Buffer.from('Hello Node.js'));
fs.writeFile('message.txt', data, (err) => {
  if (err) throw err;
  console.log('The file has been saved!');
});```
earnest phoenix
#

this was my code

#

tho is 'Hello Node.js' module or you nammed it

#

or my main file

mossy vine
#

its basically a string

#

why do you have a closing thingy there tho

#

why do you close after TextToWrite

earnest phoenix
#

idk :d

mossy vine
#

remove that

#

the )

earnest phoenix
#

oh by mistake

#

your code works tho

mossy vine
#

its not my code

#

fs docs

earnest phoenix
#

i should probably read it xd

mossy vine
#

its complicated and you dont need 99% of it

ruby dust
#

does anyone have an idea why on_shard_ready on discord.py does not do anything at all, even if I'm running 2 shards on the AutoShardedBot object? I've already asked in at least 4 servers, including dapi and discord.py, but no one gave me a proper answer for over several hours now

earnest phoenix
#

guys how can i play c# system.IO stream object directly to discord

#

do i need some additional software like ffmpeg or what

#

?

mossy vine
#

most likely

earnest phoenix
#

fmmpeg is for converting a mp3 file to stream

#

but i dont need that

#

i already have the stream

inner jewel
#

you need to convert it to opus

#

2 channels, 48kHz

earnest phoenix
#

i need to convert it to opus ?

#

how can i manage that

#

?

inner jewel
#

wasiest way might be ffmpeg

earnest phoenix
#

but how can i give ffmpeg info about the stream object

#

is there a way

#

?

#

so wait i dont get it if opus is an audio format what is pcm

#

?

inner jewel
#

another audio format

earnest phoenix
#

but i use a method called createpcmstream

#

why would i need to convert it to opus

inner jewel
#

because discord requires audio to be sent as opus

earnest phoenix
#

then why its named pcmstream

#

wtf

inner jewel
#

¯_(ツ)_/¯

earnest phoenix
#

wtf

#

im so confues

inner jewel
#

check the docs of your lib

earnest phoenix
#

i wasted 3 4 days on that porblem

#

it says Creates a new outgoing stream accepting PCM (raw) data.

#

and the stream is pcm too

#

help

rustic obsidian
#

r!help

earnest phoenix
#

omg

#

my pfp

earnest phoenix
#

I'm confused

void mantle
zenith moss
#

@earnest phoenix it’s how it is catched I think

static thunder
#

Hello,
I would need a person who takes care of checking the bots for the meters on the site of discordbots and, who speaks French please. Thank you.

earnest phoenix
#

who can help me i have aproblem with pcm stream

#

basically i have a stream object that is pcm and 16000 hz and i want to play it on discord voice channel which requires 48000 ,but it does not play why?

jaunty pike
#

heh

vernal rivet
#

?

#

@earnest phoenix did you check for errors?

earnest phoenix
#

it gives no errors

#

it just does not play

vernal rivet
#

Are you using yt API?

earnest phoenix
#

maybe its because of the frequency?

#

yt?

vernal rivet
#

Youtube

earnest phoenix
#

no

#

i just have a stream object

vernal rivet
#

Do you have fs?

earnest phoenix
#

fs?

vernal rivet
#

Not fs, I mean ffmpeg

earnest phoenix
#

yes

#

why woyld i need it

#

i do not convert anything

midnight widget
#

ffmpeg is also for playing music

earnest phoenix
#

yes i know

vernal rivet
#

It is

earnest phoenix
#

i want to play it in discord

#

i do not need ffmpeg

#

i have a audio source i just use copytoasync method

#

but it does not work

#

im not sure why

vernal rivet
#

It allows it to convert the stream to a readable object, I believe that's what the purpose was

earnest phoenix
#

yes

#

it converts mp3 to stream

#

then you pass it to discord

vernal rivet
#

What's your play command look like?

earnest phoenix
#

no it plays on join

#

its not really important

#

the problem is that it does not pkay

#

play

vernal rivet
#

Yes I know what does it look like?

graceful warren
#

Who can help me with a coding problem please?

earnest phoenix
#

?

graceful warren
#

because I'm starter

earnest phoenix
#

ok

loud salmon
#

@graceful warren dont ask to ask

vernal rivet
#

Please be more specific bou

loud salmon
#

just ask the question ^_^

graceful warren
#

So when I run node bot.js I get an error

earnest phoenix
vernal rivet
#

What is the error?

graceful warren
#

at function.module etc etc

#

Error: Cannot find module 'C:\Users\User\bot.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:776:12)
at executeUserCode (internal/bootstrap/node.js:342:17)
at startExecution (internal/bootstrap/node.js:276:5)
at startup (internal/bootstrap/node.js:227:5)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

loud salmon
earnest phoenix
#

easy

graceful warren
#

ty

earnest phoenix
#

👀

graceful warren
#

and I should find here?

vernal rivet
#

You need to change \ to /

midnight widget
#

@graceful warren You're in the wrong directory, you have to change it to where your project is

#

or what korean said mmLol

graceful warren
#

How? like my folder is on the dekstop

#

with the 2 .json and the .js

midnight widget
#

you switch folders with ls

graceful warren
#

in cmd?

#

Like I followed a tutorial

midnight widget
#

yes, ls and then the directory you want. ../ is to go one folder back

graceful warren
#

I followed a tutorial dude and that's the single problem

#

And I need this to can make the bot on

midnight widget
#

Are you using Windows 10?

vernal rivet
#

In your file change the file pathway, so it is C:/User/User/bot.js

graceful warren
#

yes

midnight widget
#

What library?

graceful warren
#

a friend told me some things are missing

midnight widget
#

What coding language are you using?

graceful warren
#

the .js I think

#

It's first time when I'm coding

#

I just followed a tutorial how to make a discord bot

#

And everything is working but not this

midnight widget
#

Where the empty space to the right is

#

sorry

graceful warren
#

me is like this

midnight widget
#

yes click the part I highlighted

#

This

graceful warren
#

yes? and then?

#

C:\Users\User\Desktop\MyBot

midnight widget
#

then delete everything and type cmd

graceful warren
#

yes

#

oohhhhhhhhhh

midnight widget
#

Now try starting it

graceful warren
#

wait wait wait

#

if it is working you're a god

midnight widget
honest pebble
#

Why all bots go shutdown?

graceful warren
#

it's blocking here? umm?

midnight widget
#

no it's downloading modules

#

it's fine

#

let it sit for a while

graceful warren
#

ohhh okk

#

huh pc is very slow

#

it's still blocking, is this normal?

midnight widget
#

How fast is your internet

graceful warren
#

download or up?

midnight widget
#

down

graceful warren
#

96.08

#

MB

midnight widget
#

hm shouldn't take too long

graceful warren
#

hmm