#development

1 messages · Page 596 of 1

alpine cliff
#

how do i use that

amber fractal
#

He sent the loop

alpine cliff
#

yes

#

but

#

have a error

buoyant wagon
#

whoops i forgot the semicolon

amber fractal
#

you use commas in the for loop

buoyant wagon
#
const prefixes = [prefix1, prefix2];
for (var i = 0; i < prefixes.length; i++) {
    if (message.content.startsWith(prefixes[i]) {//run some code}
}```
alpine cliff
#

ok

#

thanks

#

i will test

#

@buoyant wagon man

#

doesnt work

buoyant wagon
#

return maybe

alpine cliff
#

can i speak in portuguese and u put it in google translator?

buoyant wagon
#

uhh ok

alpine cliff
#

ok

#

então

#

eu tenho uma variavel para prefix

#

e queria

#

tranformar ela

#

pra ela responder a alguns prefixos a mais

#

eu estou tentando

#

colocar o seu codigo

#

dentro do meu

#

mas não esta funcionando

buoyant wagon
#

hmm

alpine cliff
buoyant wagon
#

ohh

alpine cliff
#

these prefixes is only for the tests

#

lol

buoyant wagon
#
const prefixes = [prefix1, prefix2, prefix3];
var x = 0;
for (var i = 0; i < prefixes.length; i++) {
    if (message.content.startsWith(prefixes[i]) {
        x = 1;
    }
}
if (x == 0) return;```
#

that should work

scenic kelp
#

Or you could just do prefix.includes(), no?

buoyant wagon
#

it has to start with the prefix

alpine cliff
#

dont work

buoyant wagon
#

you forgot the }

smoky spire
#

Could use Array.some

buoyant wagon
#

after x = 1;

alpine cliff
#

still doesnt work

buoyant wagon
#

array.some might work

alpine cliff
#

how can i use it

buoyant wagon
#

uhh u should delete that

alpine cliff
#

why?

buoyant wagon
#

...

amber fractal
alpine cliff
#

im joking

#

lol

scenic kelp
#

oh ok nvm

modern sable
scenic kelp
#

nope nothing wrong here

alpine cliff
#

@buoyant wagon what can i do?

#

but my english is not good

#

thats true

buoyant wagon
#
var prefixes = ["","",""];
function checkSW(p) {
      return message.content.startsWith(p);
}
if (!prefixes.some(checkSW)) return;```
alpine cliff
#

@buoyant wagon man

#

i want if !message.content...

#

not message.content

buoyant wagon
#

yeah

#
if (!prefixes.some(checkSW)) return;```
alpine cliff
#

hmmm

#

ok

earnest phoenix
#

hey so having slight issue in d.js
i have

    if(!command.startsWith(prefix)) return;```
in my code, but it doesnt seem to be working 
my prefix is `j!` but the bot responds to `l!` or `i!` too
alpine cliff
#

i will teste

buoyant wagon
#

@earnest phoenix what is command supposed to mean?

earnest phoenix
#

let command = messageArray[0];

alpine cliff
buoyant wagon
#

i think

alpine cliff
#

but doesnt work

#

,-,

buoyant wagon
#

again

#

maybe its something in your other code

alpine cliff
#

what?

#

@buoyant wagon

buoyant wagon
#

the other code

#

the code before and after that

alpine cliff
#

@buoyant wagon do u wanna i give u my index in DM?

buoyant wagon
#

ok

#

it works fine for me

zealous crypt
#

@alpine cliff

alpine cliff
#

da uma lida ae

zealous crypt
#

@alpine cliff oq vc quer perguntar?

alpine cliff
#

olha vei

#

,-,

zealous crypt
#

@alpine cliff fala logo

#

to ocupado

alpine cliff
#

o bot responder a dois prefixos

#

so que ta foda

zealous crypt
#

heeeeeeeeelllllppppp meeeee

#

I need that my bot return the two prefixes

#

anyperson know how make this?

#

@alpine cliff ta bom?

alpine cliff
#

kkkkk

#

eu ja perguntei

#

so que a maneira que eles respondem

#

funfam pra eles

#

e pra mim n ,-,

#

@zealous crypt

zealous crypt
#

@alpine cliff vai no Discord.js

quartz kindle
#

q tradução tosca kkkk (what a bad translation lmao)

glacial sentinel
#

why are webhooks so slow...

opaque eagle
#

[TypeScript] So I have classes for commands that all extend an abstract Command class... how would I add a property to the abstract Command class that gets the name of the childrens' filenames to use for the command name?

alpine cliff
#

@quartz kindle are u br?

earnest phoenix
#

Right

#

I need help

#

I run npm un dblapi.js

#

and it tells me ```npm WARN deprecated snekfetch@3.6.4: use node-fetch instead
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/dblapi.js" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-31T23_59_13_859Z-debug.log```

#

like-- I'm trying to uninstall you, why the fuck you complaining about installation??

alpine cliff
#

@earnest phoenix npm install

#

or

#

you have

amber fractal
#

He's trying to uninstall

alpine cliff
#

to are in the folder of the bot

earnest phoenix
#

Ill make this simple

#

any time i do npm and then something

#

i get that error

#

all the time

#

even when i have hard deleted it off of my system

amber fractal
#

do npm --v

earnest phoenix
#

what has gone wrong here

amber fractal
#

tell me what it says

earnest phoenix
#

5.8.0

amber fractal
#

I'm on 6.9.0

#

You're a bit outdated

earnest phoenix
#

yeah--- I'll update now

#

did npm update

#

still claims i'm on 5.8.0?

amber fractal
#

can you do node --version

earnest phoenix
#

I

#

um

#

i want to die

amber fractal
#

what was it Thonk

earnest phoenix
#

I have spent the past good few hours on this

#

and all i needed to do was npm rebuild.

#

someone shoot me

amber fractal
#

mmLol it do be like that sometimes

#

I hate node-gyp tbh

amber fractal
#

:+1: I gtg

west skiff
#

hey so dumb question how do you send an emoji from another guild?

buoyant wagon
#

get the id of the emoji

#

then js const emojiName = client.emojis.get("emojiid"); message.channel.send(emojiName);

west skiff
#

nvm figured it out

#

I was looking for the actual message to send to discord also I don't use js

bright spear
#

it looks fine to me @west skiff

west skiff
#

It's not looping right for me, it completes the circle then stops immediately and resets

#

It should ease back into being just the dot

bright spear
#

probably just not formatted right

west skiff
#

So does it look like that video for you?

bright spear
#

no

west skiff
#

f

lusty dew
#
client.music.load(`ytsearch:${args.join(' ')}`).then(r => client.music.players.get(message.guild.id).play(r.tracks[0]))
{ playlistInfo: {},
  loadType: 'SEARCH_RESULT',
  tracks:
   [ [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object],
     [Object] ] }
#

How could I check if the number of tracks

#

is 0

#

and if so

#

send a message

burnt moon
#

can someone make a bot that you can mine fake bitcoin (for a server im making) ((i also dont know how to code a bot))

scenic kelp
#

@burnt moon how old are you

burnt moon
#

. . .

#

do i have to say?

scenic kelp
#

No

burnt moon
#

then no thanks

loud salmon
#

@burnt moon pls

bright spear
#

well just know that u need to be 13 to legally use discord

loud salmon
#

did you read the embed?

covert turtleBOT
#

You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you havent searched already... What you can do is talk to Oliy#0330 to get access to #434058442764714002 and find a developer willing to do the job. Be sure you provide enough details like payment options, if you are going to selfhost it or not, how fast you want it done, etc.

buoyant wagon
#

how do you put a text inside an embed that has a link

amber fractal
#

may be the other way around

scenic kelp
#

yeah it's just standard markdown

buoyant wagon
#

ok

#

uhh didn't work

languid vault
#

how do i make my bot ignore other bots

buoyant wagon
#
if (message.author.bot) return;
//Below to make the bot not listen to DMs
if (message.channel.type == "dm") return;```
#

uhh i only know discord.js

languid vault
#

same

#

going for python

#

next

buoyant wagon
#

wait no the link thingy work

#

-bots @languid vault

gilded plankBOT
#
AngerKingz#1246
Bots

@latent spoke

slender thistle
#

@languid vault Still need help or nah?

lusty dew
#

-bots @lusty dew

gilded plankBOT
#
KawaiiPanda#6311
Bots

@molten prairie

buoyant wagon
#

-bots

gilded plankBOT
#
0628ƐɐlɐℲɐlɐN#9305
Bots

@unkempt steppe

coral trellis
#

Please don't use Luca in here

lusty dew
#

Lol

#

Okie

#

Sowwy

inner jewel
#

@lusty dew TRACK_LOADED/SEARCH_RESULT/PLAYLIST_LOADED will never have zero tracks

#

it'd be NO_MATCHES/LOAD_FAILED

lusty dew
#

Yea

#

I already got that lol

#

I am just wondering now

#

how I would check if it would be 0

inner jewel
#

it will never be 0

lusty dew
#

Oh?

#

No Matches will never be 0?

inner jewel
#

it won't have the key

#

so the length can't be zero

#

because it doesn't exist

lusty dew
#

It will just be empty

inner jewel
#

it won't be empty

#

it will be absent

lusty dew
#

Ah okie

inner jewel
#

an empty array and an absent value are different

lusty dew
#

So could I just check if the client.music.load

#

returns No Matches?

#

then if it does I can just send out a message to the channel?

earnest phoenix
#

hello, why isn't the message being sent?

client.on('ready',()=>{
    console.log('work')

    if(new Date().getHours()==8)
    {
        client.channels.get('281113673282486273').send('8 hours') 
    }

})
slender thistle
#

Any errors?

earnest phoenix
#

no

amber fractal
#

Well is hours even 8?

earnest phoenix
#

okay, sorry it works))

earnest phoenix
#

guys how to check the time in an infinite loop? not just once

client.on('ready',()=>{
    console.log('work')
    
    if(new Date().getHours()==9)
    {
        client.channels.get('281113673282486273').send('9 hours') 
    }

})
buoyant wagon
#

uhh

#

setInterval

silent cloud
#

y

solid shale
#

does anyone know how to change the name of a bot

lusty dew
#

Depends

#

Nickname or actuaal name?

#

And what Lib?

spring ember
#

@earnest phoenix npm start and make sure you have a run script in package.json

earnest phoenix
#

Wha

#

How I npm start?

spring ember
#

npm start in the console

#

and make sure you have the start script in package.json

earnest phoenix
#

O.O IDK WHAT I DID

#

I think I do. I used this website to learn it:

spring ember
#

you don't have a package.json

earnest phoenix
spring ember
#

also it's recommended to work in the project folder rather than the home folder

earnest phoenix
#

I made one tho?

#

..huh?

#

I'm sorry can i DM? I feel... Really dumb. XD

spring ember
#

also it's recommended to work in the project folder rather than the home folder

#

no

#

figure it out

earnest phoenix
#

Okie.

#

I'm trying, I just, idk what's going on.

spring ember
#

Maybe get a better tutorial because it's basic stuff

idle basalt
#

start at a lower level... like with basic node/js

earnest phoenix
#

i have node.js

#

will it work?

idle basalt
#

yea thats not what that means

#

no it wont

#

.send() returns a promise

#

use .then or async/await to resolve it into the correct embed

quartz kindle
#

@alpine cliff yes

hot sleet
#

.sentembed ??
I think it's not in d.js library

glacial sentinel
#

Why are webhooks so slow? People aren't gonna bother voting if they get the reward a hour later

#

Please fix this

bright spear
fiery birch
#

yo anyone know cpp?

#

just wondering what it would mean if you declare a var such as, int a = [300][300]

proper ember
#

Anyone up with experience of Lavaplayer and D4j?

spring ember
#

@fiery birch what

fiery birch
#

idk, but i guess i found it

#

its a 2d array

spring ember
#

You mean int a[300][300]?

fiery birch
#

i mean exactly that mmLol

spring ember
#

Yes

earnest phoenix
#

Do bot invites get reset daily?

spring ember
#

It's a 2d array

fiery birch
#

tyty

spring ember
#

@earnest phoenix bot invites?

earnest phoenix
#

I meant votes

spring ember
#

It's half a day

#

12 hours

late hill
#

If you meant the vote counter, it's monthly

#

So yes it did today

earnest phoenix
#

My bot just lost all of its votes?

#

Ah

#

Okay

#

Thanks

spring ember
#

Oh that reset I thought like when you can vote again

earnest phoenix
#

Yeah it was bad wording on my part

earnest phoenix
#

how to get the @everyone role in discord.js cuz in discord.net there's guild.everyonerole but not in discord.js

mossy vine
#
const client = new Discord.Client({ disableEveryone: false})```?
#

dunno if thats correct

#

you can read the docs

earnest phoenix
#

I'll try

#

the solution on sof didnt help :/

inner jewel
#

...

#

do you know js

lusty dew
#

A tiny bit

#

Not a lot

#

I know enough to do a good amount of stuff.

#

Just not this

mint cradle
#

Dear anyone, what am I doing wrong. I tried this 5 times by now, but it just won't update...

#

I'm using Heroku

#

Btw no april joke, I tought it might be because I ran out of dyno hours last month so I tried today (new month with new dyno hours)

lime fiber
#

I wonder to buy a computer/server to host bots in my house. What should I buy?

idle basalt
#

raspberry pi is an inexpensive way to run a small server

late hill
#

Probably because you're missing some of the stuff that's currently on that repo

#

You could force push

idle basalt
#

@earnest phoenix the everyone role can be tagged with <@&guildid>. also, for that error use this:
Run npm i windows-build-tools --production --vs2015 --add-python-to-PATH --global as admin, and restart terminal.
Restarting machine can also be required.

late hill
#

Would most likely fix your issue

earnest phoenix
#

already tried

late hill
#

@mint cradle

#

Try force push

#

Add --force

mint cradle
#

Okay thnx

#

I will

idle basalt
#

already tried what eggplant

#

that exact command?

#

if none of the commands work, go to the node-gyp readme on github and follow the manual installation instructions for windows

proud pivot
#

How can i get the both with names ? (Python)

uservoice = ctx.message.author.voice.voice_channel
botvoice = bot.voice_client_in(server)
slender thistle
#

With names?

proud pivot
#

I need them te be same to make this: if botvoice != uservoice: work

uservoice = ╔• Minecraft Ⅰ
botvoice  = <discord.voice_client.VoiceClient object at 0x0000022ED3C399B0>```
slender thistle
#

Compare .ids

#

Actually, for botvoice, you would need to get Channel from that

proud pivot
#

jas cus the .id whont worke

534010878870290513
Ignoring exception in command play
Traceback (most recent call last):
  File "C:\Users\frick\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Users\frick\Desktop\discord bots\musik\bot 247.py", line 63, in play
    print(botvoice.id)
AttributeError: 'VoiceClient' object has no attribute 'id'
slender thistle
#

Yep, you would need to use .channel on botvoice, which would return Channel

#

And that Channel would have an attribute id

proud pivot
#

Thank you 😃

slender thistle
inner jewel
#

@idle basalt <@&guildid> does not tag everyone

idle basalt
#

i couldve sworn that worked

#

will test

quiet topaz
#

why my bot isnt online?

mossy vine
#

maybe because your code errored?

#

@quiet topaz the token is incorrect

quiet topaz
#

and where is the token?

trail dagger
#

OMFG

quiet topaz
#

@mossy vine

trail dagger
#

if you dont know that you cant make a bot

mossy vine
#

are you new to coding?

quiet topaz
#

yes, at bot coding , at JavaScript not

trail dagger
#

you should read the docs or something or try to lear coding before starting making a bot

mossy vine
#

select your bot application

#

navigate to the "Bot" tab

#

and under token there will be a "copy" button. paste that token into your client.login()

#

be sure to not share this token

#

your token is basically your bots password. if someone knows it, they have full access to your bot

quiet topaz
#

ok

#

thx, i try it now, i say, if i have problems...

trail dagger
#
@commands.command()
  async def kick(self, member: discord.User, *, reason='No Reason'):
    embed = discord.Embed(
      colour = discord.Colour.blue()
    )
    await self.client.kick(member)

    embed.set_author(name='Twite Kick')
    embed.add_field(name="Member", value=member, inline=False)
    embed.add_field(name='Kicked by', value=f'{message.author}', inline=False)
    embed.add_field(name="Reason", value=reason, inline=False)

    await self.client.say(embed=embed)

I tried using ctx.message.author but then the message you have to send gets strange and i just want it to be !kick {member} {reason} but yea that wont work so if anyone have any suggestions come with it (cogs btw)

earnest phoenix
#

first send info then kick

mossy vine
#

sorry, i dont know python

earnest phoenix
#

saying i dont know x is annoying, you're not contributing to anything, if you don't know how to help out just... don't send a message lol

trail dagger
#

i explained

#

what i tried

earnest phoenix
#

try sending the message first

#

then kicking

quiet topaz
#

how do i stop the bot

earnest phoenix
#

it might be because the member is getting deleted from the cache

slender thistle
#

member: discord.User -> self.client.kick(member)

quiet topaz
#

How do i stop my bot?

trail dagger
#

but thats not what i need..

slender thistle
earnest phoenix
#

exit the process...? @quiet topaz

trail dagger
#

i need it to send WHO kicked the member

quiet topaz
#

ok

trail dagger
#

in the kicked by tab

mossy vine
#

@quiet topaz press ctrl+c in the terminal to exit the running node process

quiet topaz
#

ok

slender thistle
#

ctx.message.author is what you need, although I don't get what's wrong when you use that

trail dagger
#

the message i have to send to execute the command gets all strange

#

if i use ctx

earnest phoenix
#

weird as in

trail dagger
#

because i have to have self, ctx, user stuff reason stuff

#

!kick ctx {member} reason stuff

slender thistle
#

No you don't need to enter ctx when uisng the command

#

You'll need pass_context=True in your command decorator if you use ctx

earnest phoenix
trail dagger
#

There we go thank you

earnest phoenix
#

@earnest phoenix lang and lib?

#

Discord.js @cry#2046

#

Master

#

@earnest phoenix

#

so from what i'm seeing createdAt returns a date, you can then use methods on the date e.g .getMonth() to get the month number

#

so yours would be something like .getDate() .getMonth() .getFullYear()

#

however month is returned in a number so you'll have to keep an array of named months somewhere

cold harness
#

what's a good way to create a database for users in python?

merry stirrup
#

pm me cuz I gtg

earnest phoenix
#

opengraph meta tags

merry stirrup
#
<meta property="og:image" content="https://imgur.com/tKkG2N7.png" />
#

I tried that

#

but doesn't work

earnest phoenix
#

you have to fill the rest of properties

merry stirrup
#

wdym?

earnest phoenix
#

you have to fill og:title and og:description so discord can construct an actual embed with content

merry stirrup
#

yea I have that

#

I just showed that

#
<meta property="og:title" content="Dustie Bot" />
<meta property="og:image" content="https://imgur.com/tKkG2N7.png" />
<meta property="og:description" content="The most customizable and user friendly bot that always accepts suggestions!" />
earnest phoenix
#

no, you only have og:image filled

merry stirrup
#

what I have

earnest phoenix
#

ah

merry stirrup
#

and it shows everything

#

except the image

willow marlin
#

JDA: How 2 check if the added reaction to my message is 👍? I can't figure out what I should check

earnest phoenix
#

the event provides a MessageReaction which has a getReactionEmote method @willow marlin

#

@merry stirrup did you try using anything else but imgur

willow marlin
#

yass. But how do I compare both ReactionEmotes?

#

I mean, somehow I must get the ReactionEmote object of :thumbsup:

earnest phoenix
#

just .Equals them...?

#

or compare their getName

#

and no you'll never get unicode emojis in :name: format

#

they'll always be returned in their unicode value e.g \👍

willow marlin
#

I can't find a way how to compare to the unicode value. reactionEmote.equals("👍") doesn't work :/

#

But I can add reactions with message.addReaction("✅").queue();

earnest phoenix
#

equalsing them probably expects instance of another reactionEmote

#

i told you compare their getName()

willow marlin
#

But what will happen if someone is using his custom emoji, named thumbsup?

earnest phoenix
#

it'll be returned in the custom emoji format

#

<:name:id>

willow marlin
#

aaah, that's understandable :D. Thank you 😉

clever wave
#

Whats the problem?

grim aspen
#

using glitch

slate kayak
#
(node:1058) UnhandledPromiseRejectionWarning: TypeError: client.guildsettings.get is not a function

at module.exports (/app/events/message.js:28:43)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:189:7)

(node:1058) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:1058) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
#

anybody that can help me with this error please 😦

junior summit
#

wait does it just say the error

clever wave
#

I'm using Glitch, I tried to enable-pnpm it was like that again

junior summit
#

also we need code

#

to see

#

it legit says TypeError: client.guildsettings.get is not a function

marble needle
#

yea, what are you asking for then if it "legit says <insert error>

clever wave
#

@marble needle

slate kayak
#

its an event file

clever wave
junior summit
#

bruh

#

it legit says

#

it

#

just look it up

clever wave
#

@marble needle Whats the problem?

junior summit
#

on google or somethin

grim aspen
#

the problem is using glitch

junior summit
#

TypeError: client.guildsettings.get is not a function

slate kayak
#

i have tried everything and its still give me that error 😦 @junior summit

junior summit
#

oof

marble needle
slate kayak
#

no matter what i type i get that error thats why i =m asking here for help

marble needle
#

object properties are case sensitive

#

its guidSettings not guidsettings

#

mind researching your issue for like half a second before asking lol

junior summit
#

also make sure

clever wave
#

Rye, can you help me?

junior summit
#

client is not confused with bot

#

idk

#

it might be bot.guildSettings.get or something

#

idk

marble needle
#

if he passes client in his module export you can be fairly sure he called his discord client client and not bot

clever wave
#

@marble needle Can you help me please.?

marble needle
#

just saw that you defined some db table as client.guildsettings, disregard what i said earlier

#

dude if i haven't replied after the 5th mention you won't make me reply after a 6th

#

@slate kayak if your thing crashes on line 28 does the mentioned check work?

clever lagoon
#

can I get some help with the "Discord Server List" ?

grim aspen
#

it's being fixed

earnest phoenix
#

um

#

how fix

slate kayak
#

everything works but i only get that error when i do prefix help @marble needle

earnest phoenix
marble needle
#

does it only crash on <prefix>help (e.g all other commands work) or does every command crash

unreal rampart
#

How would i go around making my bot respond to dms?

marble needle
#

lib?

unreal rampart
#

async

earnest phoenix
#

It straight up refuses to find it

marble needle
#

could check for that and return if the type's private

#

accidentally linked the /latest/ docs but it seems to be the same for async

unreal rampart
#

how would i get that message?

#

that the user sends to the bot

slender thistle
#

DM: message.server is None

unreal rampart
#

how can i implement that?

slender thistle
#

An if with that condition

earnest phoenix
#

reuploading my bot to my VPS for like the 10th time today

#

It works on my PC

#

lets hope it works on the VPS. 🤞

unreal rampart
#

@slender thistle `@commands.command(pass_context=True)
async def rps(self, ctx, member1: discord.Member, member2: discord.Member):
channel = ctx.message.server.channel
await self.bot.send_message(member1, "You have been invited to RPS, choose either 'Rock' 'Paper' or 'Scissors'")
await self.bot.send_message(member2, "You have been invited to RPS, choose either 'Rock' 'Paper' or 'Scissors'")

`

#

i have this

distant minnow
#

Hi

earnest phoenix
#

omfg

#

i uploaded it to the wrong file

#

fml

#

how did i even do that

slender thistle
#

no_pm=True in command decorator @unreal rampart

earnest phoenix
#

Does client refer to client ID?
const dbl = new DBL('Your discordbots.org token', client);

empty owl
#

no

#

it refers to const client = new Discord.Client

#

()\

earnest phoenix
#

Gotcha thanks.

empty owl
#

np

earnest phoenix
#

thanks bb

#

How does one fix this? I am so lost

scenic kelp
#

There's an unhandled Error

#

code?

marble needle
#

implement a listener for "error"

#

you prolly lost connection to the websocket or something

empty owl
#

if (message.member.roles.has(allowedRole.id)) {
console.log('foo')
}else{
console.log('blah')
}

earnest phoenix
#

How does that happen? my vps is always on

empty owl
#

it returns blah when i have a the role

marble needle
#

could also be an issue on discord's side. apart from that, "always on" doesn't mean that there can't/won't be any network issues

earnest phoenix
#

damn

empty owl
#

if (message.member.roles.has(allowedRole.id)) {
console.log('foo')
}else{
console.log('blah')
}
it returns blah when i have a the role

earnest phoenix
#

is there anything I can do to maybe ignore the error so the bot doesn't drop @marble needle

marble needle
#

you don't just ignore errors in programming lol

#

implement a listener for it and you'll get the exact reason for the crash, if it's a network issue you'll just have to reconnect

earnest phoenix
#
            await channel.overwritePermissions(message.author, {
               VIEW_CHANNEL: true
            });
            await channel.overwritePermissions(everyone, {
                VIEW_CHANNEL: false
             });
so this is what I'm trying to do but I can't figure out how to get the @everyone role like that I tried doing this: 
        let everyone = message.guild.roles.find(r => r.id == 562374492316368934);
but it won't work and it would only work on my server.
empty owl
#

try

earnest phoenix
#

lmao I swear I tohught about that but I thought it wouldn't work it just worked

#

tysm

empty owl
#

ok

marble needle
#

why wouldn't it work lol

earnest phoenix
#

idfk I thought that role was setup differently

#

anyways ty

marble needle
#

its a role like any other, except for the fact that its name can't be edited

empty owl
#

oof

#

if (message.member.roles.has(allowedRole.id)) {
console.log('foo')
}else{
console.log('blah')
}
it returns blah when i have a the role
discord.js

marble needle
#

doublecheck if you're even getting the right role

empty owl
#

let allowedRole = message.guild.roles.find(r => r.name == "Plop", "Admin", "Mod");

marble needle
#

is that even valid js

gleaming tulip
#

not that I know of, tho I tested it and it didn't work the way I expected it to. So I'm guessing it is not? correct me if I'm wrong.

restive nest
#

No thats not valid js

mint cradle
#

@late hill that force push didn't work

earnest phoenix
#

😄

mint cradle
#

Dear anyone, what am I doing wrong. I tried this 5 times by now, but it just won't update... I'm using Heroku. Btw no april joke, I tought it might be because I ran out of dyno hours last month so I tried today (new month with new dyno hours)

#

Well and an extra failed build...

pale marsh
#

View the build log

mint cradle
#

Hold on

#

@pale marsh

#

Ah fuck

#

It now needs 3.7

#

Running 3.6.5

#

Forced to rewrite

mint cradle
#

Btw anyone, I fixed it.

#

I putted in file called 'runtime.txt' with the version of Python

#

And I had changed this in the requirement file:
google-auth google-auth-oauthlib google-auth-httplib2
to:

google-auth
google-auth-oauthlib
google-auth-httplib2

And then it just worked! Awesome.

dusk drift
#

Making bots is so confusing

dusky marsh
#

Making a discord bot is not that confusing at all. Most of it has the easiest to follow documentation

hushed berry
#

i mean

#

it depends if you know how to code beforehand lul

dusk drift
hushed berry
#

?

buoyant wagon
#

the detailed description?

earnest phoenix
#

someone know how to do a long interval "send a message every hour"

#

i think its ```setInterval(message => {

  console.log('test')

}, 60 * 60 * 1000)```

#

i'm not sure

idle basalt
#

setInterval(() => message.channel.send('test'), 3600000)

earnest phoenix
#

oh okay because i do 600000 ms

#

and it send message every 10 minutes

idle basalt
#

set the time to whatever you want, but yea setInterval is the best way to do these delayed loops

earnest phoenix
#

Yes i'm doing a auto reboot

#

Every hour

#

And thanks its worked @idle basalt

idle basalt
upbeat maple
#

Hey guys, I hadn't seen this until recently but one of my bots isn't getting an "ONLINE" status. I just tried changing the Discord bot token and it still seems to be doing the same thing

scarlet bane
#

what bot

upbeat maple
#

It's showing "???" instead of "ONLINE".

scarlet bane
#

it needs to be in here for it to be online on the site

#

@grim hamlet

#

your bot is not

#

it was kicked for that reason

upbeat maple
#

It had been for the last couple months...

#

Umm.. I guess I'll add it again?

#

Ah, yeah I had adjusted some of the permissions. I must have missed that.

#

Thanks!

scarlet bane
#

mhm, when you fix the issue you can ping one of the mods and they'll invite it back

upbeat maple
#

I'll add it again. I think all the perms have been sorted out. I just noticed a weird case with a few users with strange permissions

#

appreciate it!

scarlet bane
#

no no no

upbeat maple
#

So the general flow is to alert the mods rather than resubmit?

scarlet bane
#

your bot is fine on the list

#

it got kicked from this server

#

it's still on the list

#

you dont resubmit for kicks

upbeat maple
#

gotcha

scarlet bane
#

you just gotta fix the issue

#

and tell a mod

#

if it was removed from the list

#

then you'd have to resubmit

#

make sense?

upbeat maple
#

Yup. Got it. Let me just triple check that isn't the issue anymore on my test server

scarlet bane
#

mhm

junior summit
#

epic gamer

ashen vector
#

Is it normal to see bots with votes back to 0 on DBL when it was more than 70 yesterday ?

upbeat maple
#

@ashen vector yeah, votes reset at the start of each month

ashen vector
#

Ok I see, thank you.

upbeat maple
#

No prob 😃

lilac geyser
#

uh i submitted a bot to dbl

#

and it was denied

#

i didnt save the long description

#

and i spent so much time for that

#

💢

#

can i recover it...

idle basalt
#

i mean... wrong chat, but why not save it

#

keep your shit under version control with a tool like git and keep a README.md handy

#

they even let you import one

lilac geyser
#

i saved it but it was in a git repo and i accidentally reset the git repo

#

without commiting

#

:|

idle basalt
#

you mean deleted?

lilac geyser
#

yesss

idle basalt
#

oof

lilac geyser
#

:(

idle basalt
#

well important lesson for the future :) keep your code safe

lilac geyser
#

it got overwriten by my other project

#

i dont want to rewrite all the codes...

idle basalt
#

i dont think you can recover it but ask staff

#

maybe they keep a copy somewhere

lilac geyser
#

am i allowed to mention them 🤔

idle basalt
#

i wouldnt

lilac geyser
#

oh

idle basalt
#

just put it in general, theyre likely to see

lilac geyser
#

i did a screenshot though so i think i'll just use that as reference lmao

idle basalt
lilac geyser
#

oh

idle basalt
#

gl

lilac geyser
#

yess

quartz kindle
#

I autosave all my code in google drive

west skiff
#

please say sike

slender thistle
#

ekis

lethal sun
#

Can someone help me with this?
I am trying to get the first user in the list of users who reacted to a message.

Here is my code:

client.on('messageReactionAdd', (reaction, user) => {
        if(reaction.emoji.name === "✅") {
            console.log(reaction.users[0]);
        }
    });```

I am trying to get this user:

'267025484028706816' => User {
id: '267025484028706816',
username: 'Vanished',
discriminator: '1111',
avatar: 'a_547cce2e1af163a30b3c9ce59a849f16',
bot: false,
lastMessageID: '562550225873403914',
lastMessage:
Message {
channel: [TextChannel],
deleted: false,
id: '562550225873403914',
type: 'DEFAULT',
content: 'hmm',
author: [Circular],
member: [GuildMember],
pinned: false,
tts: false,
nonce: '568721003362910208',
system: false,
embeds: [],
attachments: Collection [Map] {},
createdTimestamp: 1554192825526,
editedTimestamp: null,
reactions: [Collection],
mentions: [MessageMentions],
webhookID: null,
hit: null,
_edits: [] } } }

quartz kindle
#

if you just want the first user, you shouldnt use messageReactionAdd

#

you should use something like message.awaitReactions or message.createReactionCollector

#

since those can be switched on and off

#

messageReactionAdd will run forever and execute on ALL reactions from EVERYONE

potent frost
spring ember
#

?

potent frost
#
<html>
  <style>
    .longdescription .content {
    border-radius: 360%;
    padding: 0px;
    background-color: #0c0c0cab;
    margin-top: 0%;
      color: #0c0c0cab;
  }
  </style>
  <style>
    #bot-details-page {
  background-image: url("https://nebot.us/assets/24.png");
  background-color: #1f2424;
  background-repeat: repeat;
  padding-top: 120px;
  width: 100%;
  position: absolute;
  z-index: 1;
}
  </style>
  <style>
    .bot-description {
    font: 400 14px "Karla", sans-serif;
    color: #ffffff;
    line-height: 1.36;
    margin-top: 10px;
  }
  </style>
  <style>
    #createdby b {
      background-color: #4fb4f9;
    }
  </style>
  <style> 
    #bot-details-page .bot-img {
    display: block;
    width: 260px;
    height: 260px;
    background: transparent;
    box-shadow: none !important;
    animation:float 10s ease-in-out infinite;
    content: url('https://nebot.us/assets/nep.png');
    }
  
  @keyframes float {
      50% {
          transform: translatey(-20px);
      }
  }
    </style>
  <style> 
    #bot-info {
    background-color: #00000029;
    }
  </style>
  <style>
  @keyframes float {
      50% {
          transform: translatey(-20px);
      }
  </style>
  <style>
   p {
      color:#FFF;
  }
  </style>
<body>

<iframe src="https://nebot.us">
  <p>Your browser does not support iframes.</p>
</iframe>

</body>```
quartz kindle
#

you dont need new style tags for every single css rule. also you dont need the html tag nor body tags

#

other than that i dont know what you want lol

bitter sundial
#

he's asking why it doesn't work when it's all in one style tag

spring ember
#

It should work

lethal sun
#

@quartz kindle can I get some examples for the reaction collector?

quartz kindle
lethal sun
#

Thanks.

spring ember
#

@slim heart make a unified cache

#

Like redis

slim heart
#

Hm

#

I mean still unreliable at best so

lethal sun
#

@quartz kindle How do I access the users in that collection?

slim heart
#

@Vanished#1111 explain wym?

#

@lethal sun

spring ember
#

@slim heart it's very reliable

#

If you need data consistency I recommend something like Apache Ignite

lethal sun
#

@slim heart I want to access the users that have reacted an emoji with the ReactionCollector

slim heart
#

Doesn’t that kinda destroy the purpose of sharding

#

@lethal sun with the collected one, inside the collection, by the key of the emoji you want there’s a users collection in that

earnest phoenix
#

do you actually need to have a Developer License (Discord) to be able to have purchase-able in-game items?
will that then allow you to sell things? or are you able to just sell it on on your website without the need for the License

grim aspen
#

this isn't the place to ask that

#

this is discord bot development not discord game development

earnest phoenix
#

im asking in regards to a bot

mossy vine
#

you need the license to publish your game on the discord store

lethal sun
#

No, the license only allows you to publish game onto the Discord store. You can buy games and in app items without it.

mossy vine
#

@earnest phoenix

#

yeah

#

im still waiting for them to allow developers to upload mac and linux builds

lethal sun
#

To make a bot, you dont need the license.

earnest phoenix
#

Understood.

So it wouldn't be required if I were to sell premium items in my economy bot?

lethal sun
#

No.

#

The license is only for the Discord store.

#

Not for bots.

mossy vine
#

no not at all, as you arent selling the items through the discord store, but your own system

earnest phoenix
#

Thankyou :)

lethal sun
#

👍

earnest phoenix
#

The wording and them pushing me to buy it really started confusing me

#

XD

earnest phoenix
#

someone know how to purge message of a user ?

#

get x messages from channel, filter the collection (array) so there are only messages whose author is y, pass that to your lib's method to delete messages

mossy vine
#

im trying to set up a webserver with flask, but i get an exec format error on line 8 (app.run)

from flask import Flask, redirect, render_template, send_from_directory
app = Flask(__name__, static_url_path='/static')

@app.route('/')
def helloWorld():
    return send_from_directory('main.html')

app.run(host='0.0.0.0', port=8080, debug=True)```
#

removing debug=True seems to fix it 🤔

slender thistle
#

Full traceback please

mossy vine
#
  File "server.py", line 8, in <module>
    app.run(host='0.0.0.0', port=8080, debug=True)
  File "/home/cyber28/.local/lib/python2.7/site-packages/flask/app.py", line 943, in run
    run_simple(host, port, self, **options)
  File "/home/cyber28/.local/lib/python2.7/site-packages/werkzeug/serving.py", line 988, in run_simple
    run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
  File "/home/cyber28/.local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 332, in run_with_reloader
    sys.exit(reloader.restart_with_reloader())
  File "/home/cyber28/.local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 176, in restart_with_reloader
    exit_code = subprocess.call(args, env=new_environ, close_fds=False)
  File "/usr/lib/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error```
slender thistle
#

@mossy vine Do you literally just use send_from_directory('main.html')?

mossy vine
#

no im trying to figure things out and that is just the code from that moment

slender thistle
#

Tbh not sure what causes that

#

It works for me just fine

#
from flask import Flask, send_file

app = Flask(__name__, static_url_path='/static')

@app.route('/')
def yeet():
    return send_file('start.bat')

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)

Sending request to http://127.0.0.1:5000/ works fine Thonkang

#

Oh, wait

#

python2.7

mossy vine
#

i dont even know what version of python im using

slender thistle
#

Try using python3 when running the script

mossy vine
#

vscode says im using python 3.7.1 but flask is installed in a python2.7 folder

#

running with python3 says that flask is not installed

slender thistle
#

You installed it through wrong environment variable

#

Install it on pip3

#

pip seems to be Python 2.7 for you

mossy vine
#

running with python3 still gives the same error

slender thistle
#

Literally the same one or something changed?

mossy vine
#

it changed to
Exec format error: thepathofthepythonfile

viral spade
#

good day. how do people usually create proper frontpages for bots on dbl? what is the best (looks/labor) way of getting some simple design (but not just text)? It should also be able to use that same design for any other bots index sites. I have experience in wordpress, css, bootstrap. any recommendations?

slender thistle
#

You can use CSS in long description thonkku

viral spade
#

okey so all designs are custom css, and i guess most people take templates from somewhere to achieve this?

mossy vine
#

doubt

#

if you already have experience why use a template

viral spade
#

because i dont want to tinker on css code to be honest

slender thistle
#

Cyber, what's string of file path you have?

mossy vine
#

?

#

you mean this?
OSError: [Errno 8] Exec format error: '/media/cyber28/Maxtor/Coding/python/cyber28.xyz/server.py'

viral spade
#

is this modesta responsible for the whole design of your site?

mossy vine
#

yes. modestacss made by alexflipnote. i really love it, tho people may judge you as more and more people start to use it as a basic template

viral spade
#

and can you use frameworks like that / can you include css files in the long desc of the dbl bot frontpage?

mossy vine
#

of course

slender thistle
#

Tbh I can't reproduce this. Can you show me the full script and how you run it?

viral spade
#

ok nice thanks

mossy vine
#

i sent the full script earlier

slender thistle
#

Ah

mossy vine
#

i run it with just python server.py or python3 server.py, producing the same traceback that also includes the file path

slender thistle
#

What's the full traceback when using python3?

mossy vine
#
  File "server.py", line 8, in <module>
    app.run(host='0.0.0.0', port=8080, debug=True)
  File "/home/cyber28/.local/lib/python3.6/site-packages/flask/app.py", line 943, in run
    run_simple(host, port, self, **options)
  File "/home/cyber28/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 988, in run_simple
    run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
  File "/home/cyber28/.local/lib/python3.6/site-packages/werkzeug/_reloader.py", line 332, in run_with_reloader
    sys.exit(reloader.restart_with_reloader())
  File "/home/cyber28/.local/lib/python3.6/site-packages/werkzeug/_reloader.py", line 176, in restart_with_reloader
    exit_code = subprocess.call(args, env=new_environ, close_fds=False)
  File "/usr/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/media/cyber28/Maxtor/Coding/python/cyber28.xyz/server.py'```
earnest phoenix
#

Guys so I'm trying to add logging to my bot and it's working but I have 1 issue from what I understand to make the embed show the current time u need to keep setTimeStamp empty ( .setTimestamp(); ) but it seems to crash my bot "rich embed fields may not be empty".

idle basalt
#

show code

earnest phoenix
idle basalt
#

looks valid to me /shrug

mossy vine
#

if you remove .setTimestamp() do you still get the error?

idle basalt
#

it said fields cant be empty but both messages should have content

earnest phoenix
#

ow yeah I actually do still get the error

idle basalt
#

log the messages

#

they should both have content but thats weird

slender thistle
#

I don't understand how you manage to get OSError. I literally can't reproduce it in any damn way lol

mossy vine
#

it only happens if debug is set to true in app.run()

slender thistle
#

I have it set to True and it still works

mossy vine
#

¯_(ツ)_/¯

dull bobcat
#

Any1 need help?

quiet topaz
#

how can I do a variable where are the members of a dc server?

dull bobcat
#

@earnest phoenix either the content of newMessage or oldMessage is false

quiet topaz
#

and how i write them in to a message

dull bobcat
#

Dude, basic JS ^

#

Learn JS

earnest phoenix
#

@earnest phoenix "rich embed fields may not be empty" its bc a variable is not define

#

and the bot cant add it in .addField

idle basalt
#

santana, he might not be using js

earnest phoenix
#

yes but it sends it

#

and then

#

crashes

dull bobcat
#

No, because newMessage or oldMessage is false @earnest phoenix

earnest phoenix
#

after sending the embed

dull bobcat
#

And the second param of an field can't be a boolean

earnest phoenix
#

does it send the embed successfully

#

ye

dapper glade
#

Is there a way to make it so if someone clicks the vote button on the dbl website a message gets sent to a channel saying: (user) has just upvoted Cryptonox! My Bot is running on Discord.js

idle basalt
#

do you have that event inside something else

earnest phoenix
#

@dull bobcat you dont know what youre talking about, youre not contributing

#

no

dull bobcat
#

Wdym @earnest phoenix

shrewd lintel
#

@dapper glade Webhook exists

earnest phoenix
dapper glade
#

Mk

earnest phoenix
#

im so confused rn it happens with every embed I try to send

shrewd lintel
#

Does api support webhook?

dull bobcat
#

I told you your problem @earnest phoenix

idle basalt
#

if the embed sends, thats not the problem

earnest phoenix
#

ok wiat

#

its the event I think

#

did I forget anything?

#

cuz it doesnt crash when its commented

idle basalt
#

looks fine

earnest phoenix
#

😕

#

what syntax do you use

#

wdym?

#

Discord.RichEmbed are green

dull bobcat
#

Bro, color doesn't matter ^

#

Its just a theme

earnest phoenix
#

ik

#

i'm just asking

dull bobcat
#

Different text editors have different colors

earnest phoenix
#

default visual studio code

dull bobcat
#

Okay, but he's like confused

mossy vine
#

its commented out thats why its green

dull bobcat
#

No ^

mossy vine
#

in default vsc theme comments are dark green

dull bobcat
mossy vine
#

oh that

dull bobcat
#

Yeah that 😂

mossy vine
#

because its a class and in vsc default theme those are light green

#

wait i didnt even read context

#

ok imma just leave to avoid losing more braincells

earnest phoenix
#

syntax =/= colorcoding

#

ow shit I think I fixed it

#

yep

shrewd lintel
#

WHAT

#

That doesn't makes any sense

mossy vine
#

no it doesnt

#

can you send your full code now?

shrewd lintel
#

If its the same, it shouldn't even fire the event at the first place

mossy vine
#

yeah

shrewd lintel
#

Also, i see a bug there

slender thistle
#

Embed loaded = content stays the same

earnest phoenix
#

yes

#

whenever embeds from links appear its counted as a message updated event

quiet topaz
#

why my bot crashes ?I want to make a @golden gull bot, and it should tag someone random... client.on('message', message => {
// If the message is "@golden gull"
if (message.content === '@golden gull') {
var user = 1;
var userrandom = guild.memberCount;
message.channel.send('test');
}
});

earnest phoenix
#

where do you define guild

mossy vine
#

you appearently dont

#

you would need message.guild.memberCount

#

also you tagged some rando xd

quiet topaz
#

xD

earnest phoenix
#

also keep the code in codeblocks to prevent mentions

#

hastebin for longer code

gleaming tulip
#

and memberCount won't provide you a random user

quiet topaz
#

yes, it isnt ready yet, but it chashes if i want tofine the variable user

mossy vine
#

because guild isnt defined

#

you need message.guild

quiet topaz
#

wait, i think i know how

gleaming tulip
#

Cyber told you how, multiple times in fact

mossy vine
#

y o u n e e d message.guild

quiet topaz
#

how, i dont understant where i should write message.guild

gleaming tulip
#

...

dull bobcat
#

Just

#

Learn

#

JavaScript

gleaming tulip
#

would be a good way to start from

earnest phoenix
mossy vine
#

@earnest phoenix side question, did you make that website?

earnest phoenix
#

yes

mossy vine
#

i love it

earnest phoenix
#

5 minute mess

grim aspen
#

please learn javascript before you ask us for help

gleaming tulip
#

I'm keeping that url

quiet topaz
#

yeah, but i want to know, how i know how much members are on a server

gleaming tulip
#

thanks a ton

mossy vine
#

i literally told you

#

3 times

grim aspen
#

oml

gleaming tulip
#

you need a guild object

#

and you can use the memberCount property on it

#

figure it out

mossy vine
#

or read the goddamn docs

dull bobcat
#

@quiet topaz Go learn JS, don't come back until you know the basics (at least). You're not only wasting your time on shit, but our too. Now, bye!

gleaming tulip
#

not a method, property

quiet topaz
#

ok, i go and learn xd

loud salmon
#

please be nice to beginners

dull bobcat
#

Bro, scroll up ^

loud salmon
#

no need to tell them to leave the chat

#

yes i know

earnest phoenix
#

using the users collection would rather be more accurate than memberCount

loud salmon
#

i saw

quiet topaz
#

😑

dull bobcat
#

Okay than

loud salmon
#

please direct them to actual guides instead of just telling them to learn the language

dull bobcat
#

@quiet topaz Please stay with us here, we are going to help you waste our time! ❤

loud salmon
#

go learn js helps no one

#

here are some js guides helps

earnest phoenix
#

its called self dependency and learning to do research

loud salmon
#

facepalm satana please

gleaming tulip
#

unless you have fetched every user from the guild, using the users collection won't give an accurate member count

earnest phoenix
#

correct

#

however

gleaming tulip
#

saying as Guild.members.size as an example

earnest phoenix
#

they want to return a random user

gleaming tulip
#

well

#

then yeah you'd have to use a users collection

idle basalt
#

this chat man

quiet topaz
#

i think i am never be a good dev...

#

its sad...

idle basalt
#

well if you get frustrated easily prob not

#

be patient and start with the basics

quiet topaz
#

yeah, i know better batch script vbscript

idle basalt
#

and dont get discouraged by guys on discord servers that just say "learn js"

quiet topaz
#

yeah, i know better batch script vbscript

#

how to work with vbscript and batch

idle basalt
#

thats a start 👌

earnest phoenix
#

ngl, doing discord bots to get into programming is a brilliant idea. dbots are simple and multipurpose bots get you into figuring out APIs and stuff

#

although you aren't gonna get many servers, your aim shud be to learn not expand

idle basalt
#

eh not really. youre learning a lib more than youre learning the language

quiet topaz
#

yes, but its hard...

#

js isnt so much

#

i think for today i do somethink different

earnest phoenix
#

hm fair

quiet topaz
#

i am to frustrated for js

slender thistle
#

Learning the language basics and basic scripts is better than doing using high-level libraries without knowing basics of language

idle basalt
#

especially since you can get a decent bot going by watching tuts and using boilerplates without actually understanding how anything works

#

discord bots are cool and all but its not an ideal place to start

quiet topaz
#

yes, but i dont know what i should program with batch or vbs

earnest phoenix
#

ive never used vbs, but i doubt you'll get anywhere with batch

quiet topaz
#

i think batch is easyier than vbs, sry for my bad english...

earnest phoenix
#

np ur english is fine. Up to you tbh. My batch experience was bad, partially due to notepad being my editor and an inability to understand batch properly

quiet topaz
#

i am playing roblox know... bb

earnest phoenix
#

i want to do a leaderboard in json and i do one but, its just say the top user and not a top 10

#

someone know how to do a top 10 ?

#

@earnest phoenix that makes no sense... you at least need to give an example of your JSON data and a bit of code showing what you have

#

dont use json as a database

proud pivot
#

How can I get an name out of an voice channel id (in Python)

earnest phoenix
#

@earnest phoenix I dont like database

#

@earnest phoenix json is fine

idle basalt
#

no its not

#

if youre writing to json youre very prone to corruption

#

its not a database and if you could use json instead of a database, none of them would exist

earnest phoenix
#

@proud pivot use the docs... dont expect us to spoonfeed

#

json

#

is not fine

idle basalt
#

json is only for reading static data

earnest phoenix
#

@idle basalt using json doesn't necessarily mean writing to a file tho... you could store it in RAM and update file data before stopping the program

#

it's a file with strictly typed syntax, it's size will grow in a dramatic way very quickly, and due to the nature of being a file you can't do async operations like editing/reading it from two different places at the same time

#

true but the OP isn't asking if json is bad

idle basalt
#

were preventing problems before they start

marble needle
#

nothing wrong with educating people about bad practises and suggesting a better solution

#

its up to them to decide whether or not they'd like to change their project, if the file corrupts upon read/write it'll be on him :>

obtuse vortex
#

Hi, I was wondering if anyone could help with the loops in JS. This is my code.

 var br = ["x", "x", "x"];

    for (var i = 0; i < 3; i++){
    
    const filter = m => m.author.id === message.author.id;
    message.reply("Insert var. Will expire in 10 seconds...").then(r => r.delete(10000));
    message.channel.awaitMessages(filter, {
        max: 1,
        time: 10000
    }).then(collected => {

        if (collected.first().content === "cancel") {
            return message.reply("Canceled!");
        }
        
        br[i] = collected.first().content;
        

    })
    
    }
#

I'm trying to make the user write something in the array br. If I do it without the For loop, it works once, but I want to keep collecting the output of the users... This or a while loop is the only thing I could come up with, and it doesn't seem to be working.

earnest phoenix
#

do you want to collect the first three messages?

obtuse vortex
#

Yes

earnest phoenix
#

you'll probably be better off changing the max to 3

#

max: 1 => max: 3

obtuse vortex
#

Damn I didnt notice that

#

I'll try it now

#

Hmm the program doesn't wait for me though, he just runs the loop For three times, without waiting for an answer or at least the 10 seconds.

earnest phoenix
#

uhh no, remove the loop

obtuse vortex
#

Okey, I see, I dont need the loop anymore

#

And how do I tell the array br to store the data? Since I dont have the var 'i' anymore?

#
        br[1] = collected.second().content;
        br[2] = collected.third().content ```
#

Like this?

earnest phoenix
#

yes

#

or

#

br = collected.map(msg => msg.content)

obtuse vortex
#

hmm collected.second and .third aren't functions apparently, so it doesn't work

earnest phoenix
#

oh yeah sorry

#

you'd have to do collected.array()[1] etc

obtuse vortex
#

I'm checking the .map in the Discord Guide, thank you

earnest phoenix
#

or i think my way shud work too

#

ye

obtuse vortex
#

Thanks for the help, at least I'm not bugging my mind with the loop anymore xD👍

upbeat maple
#

@inner jewel @loud salmon my bot was kicked from Discord Bot List for a permissions issue where it was responding over DMs to enable "send messages". Everything should be sorted out now. Can I get it un-kicked or should I reapply?
https://discordbots.org/bot/487298106849886224

#

Sorry for distracting, guys 😃

loud salmon
#

dont reapply

#

ill reinvite it

upbeat maple
#

Awesome. thanks!

green swan
#

@earnest phoenix, Use https://enmap.evie.codes

earnest phoenix
#

What is this

#

didn't evie stop?

green swan
#

nope

#

She's working on Josh now. Almost v5

#

@earnest phoenix, It's a db

#

with points system

#

per-server settings

#

and has an example top10 command

peak musk
#

u

green swan
#

?

junior summit
#

When I use my music bot it has a static sound when it plays bass or somethhing, the vps runs at around 100mbps download is the internet the issue?

unique nimbus
#

it also depends on where the discord server region/your speed also

#

also ping

junior summit
#

so it is wifi?

earnest phoenix
#

which lib are you using

junior summit
#

discord.js

#

aka node

#

it was good before when i had a vps with gigabit internet but then when it hit like 100mbps and i switched vps it sucks

#

so is the internet the issue?

unique nimbus
#

have you tried lowing your volume

#

or bots

junior summit
#

yep

#

both

#

different headphones

#

its the bass

#

wen it plays bass it makes static

#

noises

earnest phoenix
#

try playing a local file maybe? see if it happens then

#

if its fine then, then its internet, but if not, its something else

junior summit
#

how do i play a local file

earnest phoenix
#

idk how to do that

junior summit
#

like a local file on my computer

#

of course it will work

#

i use spotify to play the same song

#

it works without static

earnest phoenix
#

maybe just internet then

junior summit
#

of the server

high lava
#

Connection.playFile()

earnest phoenix
#

yeah or server

junior summit
#

cuz my

#

internet is a dub

high lava
junior summit
#

k

#

it works

#

perfectly

#

but before when i look up the exact music it has static

#

it plays music perfectly