#development

1 messages · Page 1001 of 1

quartz kindle
#

@earnest phoenix you will soon

earnest phoenix
#

i still dont get why quick.db didn't save my stuff

quartz kindle
#

anyway, your problem is that you're resetting your own database every time your bot restarts

earnest phoenix
#

oh

#

so do i set all the keys at once then i remove the code?

quartz kindle
#

that would be one way of doing it yes

earnest phoenix
#

and i should probably add .gitignore i dont want user IDs to be in my backup repo

#

and no one uses glitch

#

also can you tell me how i can detect if a user's ID is in "userBalance" and if it isn't then it does db.set("userBalance", { <userid> : 300 //starter money});. And i don't wanna overwrite everyone elses balances

#

@quartz kindle p i n g

quartz kindle
#

you cant set it in titles or field titles

#

use it in description

earnest phoenix
#

oof

#

also tim can you help me with another problem

#

i just wanna check if a user's ID is in "userBalance.<id here>" and if it isn't then i add another variable (or whatever you call it) with the starter muny 500

#

@quartz kindle p i n g

#

sorry man

quartz kindle
#

either add the user id to the key, or add it as a field

earnest phoenix
#

how do i check if its there

quartz kindle
#

most people do something like db.set("balance_USERIDHERE",value)

earnest phoenix
#

how do i check if its there in the first place

#

wait i gotcha

quartz kindle
#

try getting it

earnest phoenix
#

try {}

#

catch {add it here}

quartz kindle
#

also i believe there is a .has method

earnest phoenix
#

ok

#

i added my own ID

worn niche
#
if (command === 'profile') {
 
    var user = message.mentions.users.first() || message.author
 
    var output = await dl.Fetch(user.id)
    if (msg.content === "profile") {
      const profileEmbed = new Discord.MessageEmbed()
    .setColor('#0099ff')
    .setTitle(`Welcome ${user.tag} |:bell:|`)
    .setAuthor('LevelHouse™️ |👨|')
    .setDescription('Welcome to LevelHouse™️! Here you are able to check your LVL and XP! Have fun :)')
    .addFields(
      { name: 'Level |:black_joker:|', value: `Your level is ${output.level}`},
      { name: '\u200B', value: '\u200B' },
      { name: 'XP |:black_joker:|', value: `Your XP is ${output.xp}`},
    )
    .addField('News |:newspaper:|', 'Soon b2.0.0.0 :)', true)
    .setTimestamp()
    .setFooter('Next |↪️|: 𝗰𝟮?𝗱𝗮𝗶𝗹𝘆');
  
   message.channel.send(profileEmbed);
    
  }
    
   
}

Error is: "msg is not defined". What can I do?

opal plank
#

Define msh

#

Msg*

quartz kindle
#

you're using message, not msg

worn niche
#

oh wait that's wrong code

sudden geyser
#
`if (msg.content === "profile") {`
opal plank
#

Msg = message

#

Mobipe typing is such a hassle

#

Ffs

quartz kindle
#

mobipe

worn niche
#

still same

opal plank
#

Shouldn't be doing support on mobile

worn niche
#

after changing to msg

opal plank
#

Shits hard to type

earnest phoenix
#

How's Possible to like slice off the elements of an array by the amount you want so all of them are seperated by the amount you want... For example
i have an array that has 150 elements and i want them to be seperated by 50 elements each..
How can i do that?
Is it possible to like run a loop on it?

sudden geyser
#

mobile bad desktop good

quartz kindle
#

i didnt tell you to change to msg

#

i said you're using message

#

so you have to use message everywhere

earnest phoenix
#

how to use try{} catch{}

opal plank
#

or define msg

worn niche
#

oh

quartz kindle
#

unless you change everything to msg

opal plank
#

let msg = message

quartz kindle
#

why would you do that lol

#

thats redundant

opal plank
#

No reason

#

Thats just plain as lazy

#

Bad code but saves typing time dependung on how long ur code is

worn niche
#

I'm just stupid 😂

quartz kindle
#

@earnest phoenix you mean create 3 arrays of 50 elements each?

#

i believe discord.js collections have a method for that

opal plank
earnest phoenix
#

why is it telling me catch {} <= unexpected token {

opal plank
#

catch()

#

not catch {}

earnest phoenix
#

oh

opal plank
#

check docs

#

i sent you above

#

the {} is what you do with your catch

quartz kindle
#

catch {} is valid in node.js 13+

prime cliff
#

Fun fact catch { } works in C# but in js you have to specify an exception

worn niche
#
(message.content === "profile")

Error was bcoz of me, I forgot to add "c2?" before "profile" XD
Now everything working, but thanks for help :)
(code is looking like that:

(message.content === "c2?profile")

)

opal plank
#

is it actually?

#

i know try works with that syntax, but i was always told yo do catch() {}

quartz kindle
#

its a recent change

earnest phoenix
#

i did try{} and the try works but after that catch() guves error

opal plank
#

hmm my bad

#

wasnt aware of that

earnest phoenix
#

How do you make it look like this?
I tried removing the value but it just show undefined
{ name: "All Commands", value: "All Commands" },
@earnest phoenix I fixed it by setting the name to “ ‍ “

#

No i mean like for example
let someArray = [<150> elements here];
I want to like join 50 elements and then get the other 50 elements and join them one by one...
Example

let someArray = [
  'f', 's', 'j', 'f', 's', 'i', 'g', 'i', 't', 's', 'k', 'g',
  's', 'k', 'g', 'd', 'k', 'h', 'x', 'k', 'g', 'z', 'i', 'g',
  'd', 'i', 'g', 'x', 'o', 'g', 'x', 'o', 'g', 'z', 'l', 'g',
  'x', 'l', 'g', 'd', 'l', 'h', 'd', 'o', 'y', 'd', 'p', 'h',
  'd', 'p', 'h', 'd', 'p', 'h', 'd', 'p', 'h', 'd', 'p', 'h',
  'd', 'p', 'y', 'd', 'l', 'y', 'd', 'k', 'y', 'd', 'k', 'y',
  'd', 'l', 'y', 'x', 'p', 'u', 'd', 'p', 'u', 'f', 'p', 'y',
  'd', 'l', 'j', 'c', 'i', 't', 'd', 'l', 'y', 's', ' ', 'i',
  's', ' ', 'o', 'y',
  ... 43 more items
];
someArray.slice(0, 50) + "\n" +  someArray.slice(50) + "\n" + someArray.slice(100);``` @quartz kindle
#

Run a loop on that kind of a thing to seperate all of them by 50 elements and like join Something between them

#

what's worser than not being able to fix catch{} which is supposed to fix errors

#

and botht he brackets dont work

opal plank
#

would be much better to tell you whats wrong if you provided the code

earnest phoenix
#
try {
        message.channel.send("You have "+db.get("userBalance_${message.author.id}.balance"));
        } catch {
          db.set("userBalance_${message.author.id}",{balance : 500});
        }
opal plank
#

what error is it outputting?

earnest phoenix
#

Also use ` insteas of "

#

in both catch() and catch{} it is giving an error unexpected identifier ( or {

#

by ( or { i meant in both cases it gives different error

#

You're literally providing options on setting something on a db object

quartz kindle
#

@earnest phoenix if the length is known, you can do what you did there lol. but if the length is unknown, you can use a loop with array.splice(0,50)

#

so that on each loop, the first 50 items will be removed from the main array

#

so you dont need to constantly update the indexes

earnest phoenix
#

@opal plank

#

Oh i thought of splice to work

#

Lemme try

#

@opal plank it is giving unexpected identifier ( in catch() and unexpected identifier {} in catch{}

#

@earnest phoenix
<db>.set(<object>, <Something to set>)

#

bro its not about db

#

Not <db>.set(<object>, { <Something to set> })

#

It's because of it

#

what

quartz kindle
#

@earnest phoenix as i said, try {} catch {} is only available in node 13+. you're using node 8

opal plank
#

@earnest phoenix theres no syntax error in that snippet , try ```js
try {
message.channel.send("You have "+db.get("userBalance_${message.author.id}.balance"));
} catch(() => db.set("userBalance_${message.author.id}",{balance : 500});)

    ```
quartz kindle
#

in older node versions you have to use try {} catch() {}

#
try {
  bla
} catch() {
  bla
}
earnest phoenix
#

oh

vernal vapor
#

Wanted to ask is this host good for hosting a bot aiming to reach over 1000 servers. Or should I go for more reputable hosts. If for more reputable paid hosts may I gain suggestions

quartz kindle
#

you can get better

vernal vapor
#

Any suggestions 👀

earnest phoenix
#

@quartz kindle still giving errors in try{} catch() {}

#

fixed it

#

@vernal vapor check out Google cloud

#

needed to put err in catch()

#

the service that doesnt jhave captcha

#

but goddamn credit card verifictaion

vernal vapor
#

O aight I'll give that a look

quartz kindle
#

google and amazon both offer free for 1 year trials

earnest phoenix
#

^

quartz kindle
#

google has a permanent free tier as well, but they charge for bandwidth usage

#

im using galaxygate at the moment, which has roughly the same specs as you showed above, but for 3 USD a month

#

for european hosting, i heard good things about hetzner and contabo

warm marsh
#

Contabo is pretty good.

earnest phoenix
quartz kindle
#

nope

earnest phoenix
#

FR0taCry

modest maple
#

what are you trying todo @earnest phoenix

lusty quest
#

for Europe Hetzner and Digitalocean is really good. Amazon AWS and Google also works

delicate shore
#
if(command === "patreon"){
    const pat = new Discord.MessageEmbed
    .setColor("#7289DA")
     .setAuthor(bot.user.tag, bot.user.displayAvatarURL())
      .setDescription("Become a Patreon To Unlock Exclusie perks")
    .addFied("Before Becoming Patreon Join Here" , "Link")
    .addField("Become A Patreon" , "Link")
    .setFooter("Pls Support lol")
    msg.channel.send(pat);
  };```
#

What is error here?

#

like

#

it's not working

cinder patio
#

You are not calling the constructor

delicate shore
#

oh wait

#

Embed ()

#

right?

cinder patio
#

yes

delicate shore
#

ok

#

thanks

modest maple
#

🧠

misty sigil
#

How do I get guild owner name

earnest phoenix
#

@quartz kindle so i tried but i don't know how to actually run a correct loop on that... How can i do it?

#

i'm trying to get my bot to work and play music in different servers at once, using SQL, but it's not Renaming the Song what it needs too and i keep getting an Error saying ```py
Song#672743264675168257(Testing Grounds).mp3: No such file or directory

then i changed it a bit and now it's giving me a this error: 
```py
Song#672743264675168257(Testing Grounds).mp3: No such file or directory
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/player.py", line 611, in _call_after
    self.after(error)
  File "OwO.py", line 2236, in <lambda>
    voice.play(discord.FFmpegPCMAudio(f"{name_song[0]}({name_server[0]}).mp3"), after=lambda e: check_queue())
  File "OwO.py", line 2157, in check_queue
    length = len(os.listdir(Queue_Main))
FileNotFoundError: [Errno 2] No such file or directory: '/Users/con/Desktop/Yandere copy/Queues/Queue#672743264675168257'

@modest maple

opal plank
#

@misty sigil guild has a property that can be accessed for that

misty sigil
#

docs?

earnest phoenix
#

@misty sigil Guild.Owner

modest maple
#

@earnest phoenix No such file in that directory

earnest phoenix
#

it's putting it into the Main Directory, but not into the Queue folder, and i cant seem to understand why.

long yew
#

ok so

earnest phoenix
#

@misty sigil if it's cached
<Guild>.owner.username if not

<Guild>.members.fetch(<Guild>.ownerID).then(o => o.user.username)```
quartz kindle
long yew
earnest phoenix
#

Oh i see...

long yew
earnest phoenix
#

Lemme try

long yew
#

someone help

quartz kindle
#

what is spawns.json

long yew
#

a file

quartz kindle
#

what are its contents

long yew
#

that logs the pokemon that spawn

#

it is empty

#

{}

#

them

quartz kindle
#

then thats why

#

.push is only available for arrays

#

an array is [] not {}

long yew
#

ohhhhhhhhhhh

#

ok thanks

#

know the problem for that aswell?

earnest phoenix
#

@quartz kindle trying that loop instantly crashes the bot lol, the bot runs out of memory

#

@long yew client.channels.cache.get()

deft condor
pure lion
#

like
if(command === "MemberCount") {

}
@delicate shore firstly, delete your code and start over with a handler

earnest phoenix
#

@deft condor version?

pure lion
#

@deft condor code

deft condor
#

12.x

delicate shore
#

I have it

#

@pure lion

pure lion
#

That's not a handler

deft condor
#

if (message.content === ${prefix}avatar) {
const avatarEmbed = new Discord.MessageEmbed()
.setColor("#000000")
.setTitle("Avatar")
.setAuthor(
${message.author.tag},
${message.author.displayAvatarURL()}
)
.setImage(${message.author.displayAvatarURL()});

message.channel.send(avatarEmbed);

}

pure lion
#

Just advice for the future

earnest phoenix
#

@deft condor you don't need to have template literals for one single thing like that

pure lion
#

^^^^^

earnest phoenix
#

you can just do message.author.tag or the others without template literals if you aren't gonna use those inside an actual string

pure lion
#

Change the image settings, you don't need full res

#

Or webp

#

Because it's bad

long yew
cinder patio
#

Channel is not cached or id is invalid

long yew
#

so what would need changing?

cinder patio
#

you could fetch the channel instead of getting it from the cache

#

and console.log pConfig.spawnChannel to make sure it's an ID

#

\https://discord.js.org/#/docs/main/stable/class/ChannelManager?scrollTo=fetch

restive furnace
#

@long yew please.. but channelCache#send

dense patio
#

how do i get the total guild count from all shards and set it as the status

cinder patio
#

It's in the example

dense patio
#

yeah but how do i set it as the presence

cinder patio
#

search "set presence" in the docs

#

first result

long yew
#

@restive furnace wdym

dense patio
#

i know how to set a presence, i just don't know how to combine them

cinder patio
#

In the broadcastEval example, results is an array of the returned values of every shard, using reduce with the parameters in the same example will give you the total count. Then do client.user.setPresence({ activity: { name: THE REDUCED VALUE HERE })

dense patio
#

is there any way i can take the value from .then() and add it to an external value to put in the presence

placid iron
#

can i assume that if bot.get_user(id) returns None then that account is deleted. or is it just not viewable by the bot

subtle holly
#

Some JS here

/**
* Create custom fields map
* @type {Map<string, () => string }
*/
this.customFields = new Map();

I am trying to JSDOC the typing of a map for VSCode
This works but I basically want the function in the type there to be asynchronous

tight plinth
#

Make it async lol

subtle holly
#

Does not work

#

async () => string
VSCode then gives me type "any"

pale vessel
#

try adding @async?

subtle holly
#

I don;t see how to do that on an @type though

dusky marsh
#

Just return Promise<string>

subtle holly
#

Oh

#

I see

plucky harness
#

guys any suggestions for postgresql database hosting? i need one with more concurrent connections

cinder patio
#

@dense patio put the code that sets the status inside the then

dusky marsh
#

Buy a vps to put your database on

plucky harness
#

can u suggest me any guide fos r vps

dense patio
#

i tried and it didn't work

cinder patio
#

@subtle holly You are missing a >

dusky marsh
#

Check the pins

long yew
cinder patio
#

It should work so you did something wrong

subtle holly
#

Ah yeah

cinder patio
#

Already answered zSam

long yew
#

idk what to do though

cinder patio
#

if pointing to a method you could use to resolve the issue is not enough then I don't know what is

long yew
#

how do i cache channel?

cinder patio
#

by fetching it

earnest phoenix
#

im here i need help

pale vessel
#

and?

earnest phoenix
#

my image isnt going in embed

#
let embed = new Discord.MessageEmbed()
    .attachFiles(canvas.toBuffer(), 'profile_card_${name}.png')
    .setImage(`attachment://profile_card_${name}.png`);
message.channel.send(embed)
``` my code
#

Guys, how can i get the badges links?

#

Is there a way ?

pale vessel
#

you find them

earnest phoenix
#

help

#

i sent code

#

bruh

#

help

cinder patio
#

Look closely

pale vessel
#

' '

pure saddle
#

i have same issue with derku

pale vessel
#

please read

#

the syntax highlighting even gave you a clue

earnest phoenix
#

guys i still dont know how to make embed messages on c#

#

i need help with making embed messages doe

pale vessel
#

read docs on your library

#

what library are you using?

earnest phoenix
#

im using dsharp

#

to code it

earnest phoenix
#

thx

livid rivet
#

is there a way (python) to grab the custom status of a user? i have tried to do so but failed... and the documentation doesn't say anything about it

pale vessel
#

and the documentation doesn't say anything about it
you sure about that

earnest phoenix
#

about python when i try to get my bot online on python i get errors that arent even on my code and i dont understand

#

why i use c#

earnest phoenix
#

is it only for me or why when i try to get my bot online on python a bunch of errors pop up that arent even on my code

pale vessel
#

just you probably

earnest phoenix
#

why doe

#

im unlucky wtf

lofty lagoon
#

I have the problem of MaxListenersExceededWarning I fixed the think but my bot wont answer to my cmd

misty sigil
#

Code

pale vessel
#

who knows, on message event for every command?

lofty lagoon
#

my code is good there is no error

misty sigil
#

show us the code.

lofty lagoon
#

it's worked before the error

#

k

#

wait

earnest phoenix
#

yea for me the code on python is fine but there are other errors i dont understand

#

maybe my interpreter or something i dont know

lofty lagoon
#

the code

earnest phoenix
#

i have the code already

#

let me see though

pure lion
#

who knows, on message event for every command?
@pale vessel JAJAJAJAJAJAJAJAJAJJAJAJAJAJJA

#

@lofty lagoon bro you have a get command files script why aren't you using it

lofty lagoon
#

?

pure lion
#

To the fullest

lofty lagoon
#

@lofty lagoon bro you have a get command files script why aren't you using it
@pure lion I already use the script for the cmd

#

I have 3 file I use with the get command file

#

To the fullest
@pure lion the fullest?

#

hmmm

#

idk how and why but my bot work again

#

and I didnt change anything in the code

pure lion
#

:/

lofty lagoon
#

before my bot just say no and do nothing but now it's say yes ._.

restive willow
#

looking to implement sharding using discord.py, need i jsut change my Bot instance to AutoShardedBot?

#

i feel like im missing something

earnest phoenix
#

So i made a function that makes an string to turn into a chunked string by the provided amount and what to join between the strings... Is this good?

if(!joinWith){
return "There was nothing provided to join between the strings";
}
if(!JoinSpot){
return "There was no join position between the strings provided";
}
if(isNaN(JoinSpot)){
return "Join position is not a number";
}

let arrayOfElements = [];
for(e of this.split("")){
arrayOfElements.push(e);
}

let arrayOfSpliced = [];
while(arrayOfElements.length > parseInt(JoinSpot)){
arrayOfSpliced.push(arrayOfElements.splice(0, parseInt(JoinSpot)));
}

let arrayOfJoined = [];
let CounterOfIndex = 0;
for(a of arrayOfSpliced){
arrayOfJoined.push(arrayOfSpliced[CounterOfIndex++].join(""));
}
return arrayOfJoined.join(joinWith.toString()) + this.slice(arrayOfJoined.join("").length);
}```
cinder patio
#

I think it can be simplified

plucky harness
#

whats the worst a team member can do to the bot? they can only change tokens right?

lusty quest
#

steal your rented hardware and ghost you

#

or add stuff to the bot that is against the TOS to get you banned and in certain cases even fined

plucky harness
#

what does that mean?

#

oh

earnest phoenix
#

@cinder patio how tho

plucky harness
#

can he steal the code?

amber fractal
#

@earnest phoenix so what does it actually do like an input output example

lusty quest
#

if he get access

earnest phoenix
#

Lemme show you

lusty quest
#
  async function chunk(arr, len) {

                let chunks = [],
                    i = 0,
                    x = arr.length;
              
                while (i < x) {
                  chunks.push(arr.slice(i, i += len));
                }
              
                return chunks;
              }
             
              // Optionally, you can do the following to avoid cluttering the global namespace:
              Array.chunk = chunk;
```i use this for chunking down large arrays into groups of 10
#

you just pass the array and the wanted chunksize to it

earnest phoenix
#

@lusty quest
"77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777".JoinBy("\n", 15)
=>

777777777777777
777777777777777
777777777777777
777777777777777
777777777777777
777777777777777
777777777777777
77777777777777777777777777777```
lusty quest
#

split it into indidual numbers and push them as a single number into an array. then just chunk it into the wanted size

earnest phoenix
#

Hmm not a bad thing to do Actually

lusty quest
#

there is probably a more efficent way but idk rn

cinder patio
#
function joinBy(string, separateAt, joinChar) {
    let result = "";
    const length =  string.length;
    for (let i=0; i < length; i++) {
       if (i % separateAt === 0) result += joinChar;
       result += string[i];
    } 
    return result;
 }

Here's how I would do it

lusty quest
#

i guess i use my function bcs i call an API that returns sometimes 2k keys in a array

#

so i can have it in handy smaller chunks to display them in Embeds

cinder patio
earnest phoenix
#

That looks good actually

cinder patio
#

It's probably the fastest too

lusty quest
#

i get fancy arrays with arrays inside so i can access something like array[10][5]. better than trying to limit it to 10 arrays per page with a counter

#

yea but his function is probably faster

sacred wraith
#

Can you change the bot discriminator?

cinder patio
#

no

earnest phoenix
#

How can i learn to a user join position?

summer torrent
#

sort members by join date

pale vessel
#

fetch all members, sort by join timestamp

earnest phoenix
#

Yapabilsem neden sorayım

summer torrent
#

then find member's index

ripe stream
cinder patio
#

It's not rainbow though?

ripe stream
#

Looks like that to me?

cinder patio
#

you'd do that by using CSS

#

not for me

ripe stream
#

Maybe not rainbow but constantly changing color

cinder patio
solemn latch
#

dont bots constantly get denied for having css like that

spare mirage
#

what is a good thing to add to a bot?

torn ravine
#

@solemn latch yea because those can cause seizures

pure lion
#

hey, i have code for a music bot but it kiiiiiiiiiiiiiiiiinnnnnnnnnnnnda sucks ass

#

can i have help building one from scratch?

#

I'll link a hastebin

spare mirage
#

youtube exists 👍

pure lion
#

youtube exists 👍
hahahahahahahahahahahahahahahahahahahaha

spare mirage
#

:P

restive willow
#

looking to implement sharding using discord.py, need i jsut change my Bot instance to AutoShardedBot?
@restive willow

viral iris
#
              .setAuthor("Some text", client.user.avatarURL())

Cannot read property 'avatarURL' of null

#

idk what's wrong

toxic forum
#

null is nothing, you are trying to get an avatar url on a user that does not exist

earnest phoenix
#

@viral iris try displayAvatarURL ()

viral iris
#

@viral iris try displayAvatarURL ()
@earnest phoenix the same

earnest phoenix
#

:/

solemn latch
#

it would still be the same

#

is this in a command?

toxic forum
#

I have no idea why your user is null though

solemn latch
#

message.client.user

viral iris
#

is this in a command?
@solemn latch file

#

command handler

solemn latch
#

try message.client.user.displayAvatarURL()

pure lion
#

hey, i have code for a music bot but it kiiiiiiiiiiiiiiiiinnnnnnnnnnnnda sucks ass
Pspsppspsps

solemn latch
#

or whatever your message is called

pure lion
#

*loud crying*

viral iris
#

@solemn latch yea worked thx

solemn latch
#

Client doesn't exist if you don't pass it on, messages always have .client tho

toxic forum
#

@pure lion writing a music bot is a good exercise, we can answer questions. but you still need to write it somehow 🙂

pure lion
#

Alright true

#

But I'm not sure where to start

#

AHAHAHHAHAHAHAHAHAHAHAH

finite bough
#

start with deciding

#

if u wonna use ytdl-core

#

or

#

lavalink

toxic forum
#

do the big 🤔

pure lion
#

I'm using ytdl-core

finite bough
#

are u using glitch?

pure lion
#

Nope

finite bough
#

good

toxic forum
#

what's glitch? js library or something?

pure lion
#

Also using @discordjs/opus

finite bough
#

a type of code running service

pure lion
#

Because opusscript trash

#

For discord

toxic forum
#

a type of code running service
ah alright, i understand

finite bough
#

I mean opusscript is when discordjs/opus doesnt work

spare mirage
#

ive been trying not to ask this discord will this ping command work?

pure lion
#

Oh god that's

#

Um

spare mirage
#

I really need a command holder

#

lol

pure lion
#

Yea

#

You do.

#

Okay do you know basic js?@spare mirage

finite bough
#

@spare mirage try it and see

spare mirage
#

@pure lion the basics of the basics

#

lmao

pure lion
#

Ehhh

#

Ok

#

Apparently not

#

Because

#

Else if should have curly brackets

#

e.g

finite bough
#

wait what

spare mirage
#

no

#

..

pure lion
#

E

finite bough
#

from when was that a rule in js

pure lion
#

Idk I've never used it without

toxic forum
#

curlies are optional, itll use the next statement for the if block

pure lion
#

if (your code is bad) {
return ('ujajaajajja')
} else if (code is good) {
return ('good')
}

#

curlies are optional, itll use the next statement for the if block
The more you know...

toxic forum
#

I find it more readable with, but you dont need em

pure lion
#

Ye same

#

I've never done it the other way-

finite bough
#

yes

spare mirage
finite bough
#

but it should work

toxic forum
#

you need some scoping lessons ma boi

dull blade
#

Error: Cannot find module '../util/UserFlags' can someone explain ......

earnest phoenix
#

Read the error

pure lion
#

@spare mirage read the error

opaque hawk
#

@spare mirage that isn’t how elseifs work

pure lion
#

It is apparently

finite bough
#

@spare mirage the code will work

opaque hawk
#

Hmm

finite bough
#

the code above the code would not

spare mirage
#

wait what!??!

pure lion
#

the code above the code would not
Cryptic

#

I'll brb

opaque hawk
#

Either it doesn’t work like that or it is bad formatting

finite bough
#

the code u sent is correct

toxic forum
#

@spare mirage you see the word message in bot.on. that creates the message that you use. but it only exists inbetween the { }

finite bough
#

but u see

spare mirage
#

uhh

#

I see

finite bough
#

var ping = bla bka

#

that's outside the scope

opaque hawk
#

who uses var anymore

finite bough
#

before message has been given a value or defined

#

I use var

opaque hawk
#

It’s outdated as of ES5

spare mirage
#

@opaque hawk bruh Im boutta use const lmao

#

I never change my vars

opaque hawk
#

I use const and let

toxic forum
#

who uses var anymore
@opaque hawk a beginner who doesnt know better?

spare mirage
#

^ ||me||

opaque hawk
#

...fair point

finite bough
#

i use var too

#

var let and cost have their features

#

const*

spare mirage
#

const is a var u cant change right?

finite bough
#

yes

#

kinda correct

opaque hawk
#

I think that const amd let are better, var isn’t as good in ES5 and 6

toxic forum
#

you can only assign (const val = 12) once

spare mirage
#

how do I fix my stuffs xD

toxic forum
#

the = is assignment

finite bough
#

remove var ping = ... above bot.on( bla bla

opaque hawk
#

== is checking if it equals that, after type juggling

spare mirage
#

ok

finite bough
#

and pls learn the basics

opaque hawk
#

And === checks if they are the same without type juggling

#

Simply put

spare mirage
#

Im trying @finite bough

#

im just dumb lmao

finite bough
#

its alright

#

dbl welcomes new programmers

toxic forum
#

im just dumb lmao
everybody thinks that in the beginning, if you keep at it you'll get there eventually 🙂

spare mirage
#

still not fixed :/

toxic forum
#

same error? did you save?

spare mirage
#

yes

finite bough
#

show the new error pls

spare mirage
#

everybody thinks that in the beginning, if you keep at it you'll get there eventually 🙂
@toxic forum I mean I can understand the code but I cant come up with it

#

¯_(ツ)_/¯

toxic forum
#

well you need to understand what you have before you can think about how to use it

#

the "how to use it" part is a bit harder though

pale vessel
#

why did you define the ping and decide to not use it

finite bough
#

I mean that's not the problem tho

pale vessel
#

YEP still

dull blade
#

how to download this module or so '../util/UserFlags'

earnest phoenix
#

double the allocation means the program runs faster sunglassesvery3dcool

#

/s dont do that kids

pale vessel
#

i see

toxic forum
#

double the allocation means the program runs faster :sunglassesvery3dcool:
X to doubt

dull blade
finite bough
#

X

#

I mean

#

it depends

#

in that case

pale vessel
#

why

#

are you

finite bough
#

it wouldnt make it run faster

pale vessel
#

speaking

#

like this?

dull blade
finite bough
#

bad habit

spare mirage
#

wait ill put it into an hastebin thats easier to see

earnest phoenix
#

more allocation is never faster

#

people always try to cut down on the amount they allocate

finite bough
#

yea

spare mirage
finite bough
#

thats why i said depends

toxic forum
#

thats why i said depends
very much depends, think about how slow a bot would be if it wouldn't cache users. it would have to fetch them from the API. which is very slow compared to reading them from memory when working with them

earnest phoenix
#

all of that caching design is probably going to get abandoned with huge api changes in october

#

stateless design and all

spare mirage
#

wait what

#

why?

earnest phoenix
#

YESSS
mY BOTTT

#

MYYY BOTTTTT

#

YESS

#

FINALLY

#

stop being annoying

spare mirage
#

spam

earnest phoenix
#

:((

#

@spare mirage i dont know, ask discord

toxic forum
#

FINALLY
gj

earnest phoenix
#

probably to cut down on resource usage

finite bough
#

@earnest phoenix pls go to general

earnest phoenix
#

im sorry

#

tldr the api and libs are switching to stateless design

toxic forum
#

stateless design and all
you are talking about intents or changes in discord.js?

earnest phoenix
#

intents

toxic forum
#

might not have to change much for library users then

earnest phoenix
#

they'll change the payloads so the data you get is what you can work with without doing any extra requests

#

iirc

toxic forum
#

you were probably sending everyone in a panic there XD

earnest phoenix
#

i love how people here are afraid of design changes in libs

#

because they have little to no experience with the language and they only know how to do x in a certain way

spare mirage
#

sendMessage isnt a function right?

toxic forum
#

what error do you get?

spare mirage
#

message.channel.sendMessage("Your ping is " + ${Date.now() - message.createdTimestamp} + " ms");

#

TypeError: message.channel.sendMessage is not a function

toxic forum
#

that's your code, not the error message. but nevermind

earnest phoenix
#

so i set up d.js

#

just send

#

what are the essentials for doing anything with it

spare mirage
#

yes thats what i though

#

lemme try

toxic forum
#

@earnest phoenix how much do you know about programming in javascript? or any other language?

pure lion
#

mostly js because thats what youd be coding in

earnest phoenix
#

@toxic forum thank you for your cooperation

#

i will now take the actions needed to meet those requirements

#

thank you

toxic forum
#

mostly js because thats what youd be coding in
@pure lion just asking if he has any experience anywhere

spare mirage
#

Works! Thanks for the help!

finite bough
#

sendMessage is no longer a function in 12v i think

pure lion
#

ye its not

spare mirage
#

why?

#

why would they delete it

#

makes 0 sense

pure lion
#

because message.channel is useful

spare mirage
#

ok ok ur right

#

How do I make the message it sends an embed?

pure lion
#

docs

spare mirage
#

:/

toxic forum
#

thank you
@earnest phoenix if you haven't done any programming in javascript, then you probably need to setup an editor aswell. Visual Studio Code is a good recommendation due to the help it gives when writing javascript.

spare mirage
#

How does a man not forget the docs lmaoo

pale vessel
#

please read docs otherwise you're never learning

misty sigil
#

the docs

#

i like

#

very utilitary

spare mirage
#

I red it twice today

finite bough
#

time to go woosh

spare mirage
#

still dont know anything

#

REEEEEEEEE I hate when people send that link

misty sigil
#

why

#

its useful

spare mirage
#

My whole browser history is full of that

pure lion
#

ok listen, order of importance:
docs > stack > discord > youtube

earnest phoenix
#

@toxic forum i know about visual studio code, but i use sublime text because to me its just very simple

spare mirage
#

and I cant remember it

#

whats stack

pure lion
#

stackoverflow

spare mirage
#

I only get py stuff there

toxic forum
#

@toxic forum i know about visual studio code, but i use sublime text because to me its just very simple
that's fine, everyone has a preference 🙂

pale vessel
#

ayy i use notepad++

pure lion
#

i-

#

:o

finite bough
#

ay i use simple notepad

misty sigil
#

i use vsc

#

cuz i like it

pure lion
#

why do you torture yourselves

pale vessel
#

npp just works for me

misty sigil
#

and it makes my code colourful

earnest phoenix
#

i use google docs

pure lion
#

uses word

toxic forum
#

why do you torture yourselves
@pure lion ever heard of vim?

finite bough
#

i also use discord code block

misty sigil
#

wait

#

google docs

pure lion
#

@pure lion ever heard of vim?
@toxic forum nope :D

pale vessel
#

what feature do you even need in vsc that isn't in npp

misty sigil
#

the new github

earnest phoenix
#

yes

pure lion
#

what feature do you even need in vsc that isn't in npp
sexy ui

misty sigil
#

@pale vessel discord rp

#

and more

pure lion
#

dark mode

finite bough
pale vessel
#

damn i don't need any of those, lucky me

misty sigil
#

dont forget darkmode

pure lion
#

madlad

#

madlad

#

madlad

pale vessel
#

bruh

pure lion
#

ok but

#

who uses python idle

toxic forum
pure lion
#

raise your hand and you will be spared

pale vessel
#

nano gang

pure lion
toxic forum
#

yeah that's a lot easier to use than vim

pale vessel
#

but some people just prefer vim

#

just preferences ig

toxic forum
#

it has very quick shortcuts, so if you know how it works then you can get around very fast

pure lion
#

any useful npm packages i can use for music (other than ff/opus/ytdl)

#

oh cool everyone went

#

nice

toxic forum
#

still here

pure lion
#

can you recommend me stuff

stable nimbus
#

I'm finally starting on my command handler, but I need help. How do I have my bot look for a certain line of text within the commands folder? Like a text file with footer info?

toxic forum
#

...buut im not a javascript developer, i use c# primarily

pure lion
#

b a l l s

#

again, meaning to learn

toxic forum
#

again, meaning to learn
maybe take a look around on npm? maybe use tags to do some searching?

pure lion
#

I'm finally starting on my command handler, but I need help. How do I have my bot look for a certain line of text within the commands folder? Like a text file with footer info?
w-

#

if you want footer info use a json

stable nimbus
#

Okay.

pure lion
#

what info do you mean to get for the footer tho?

opal plank
#

Set footer on module exports

spare mirage
#

@stable nimbus I bet there are good tutorials out there

pure lion
#

I'm finally starting on my command handler, but I need help. How do I have my bot look for a certain line of text within the commands folder? Like a text file with footer info?
@stable nimbus i take it back, i believe you can map the footer

stable nimbus
#

Human interaction is nice sometimes. I think I figured it out with dice's reference, I'll see what happens.

opal plank
#

Footer = require('. /footer.json')

#

On the exporterd commands

pure lion
#
module.exports = {
    name: "poll",
    description: 'makes the message into a poll',
    footer: 'footer'
}

like this?

opal plank
#

That works too

pure lion
#

meh

#

im gonna go fail at making a music bot

opal plank
#

If u ever change the footer you need to change every single one

pure lion
#

again

opal plank
#

Hence why probably setting a var or a json it'd be good

toxic forum
#

im gonna go fail at making a music bot
have fun! get back here when you have questions 🙂

pure lion
#

have fun! get back here when you have questions 🙂
thanks :))))))))))))))))))))))))))))))))

stable nimbus
#

I did that, footer = require('./footer.json')

#

And returned with objects.

pure lion
#

do you have a file named footer.json now?

stable nimbus
#

Its reading the file successfully, so thats a start, I just need it to read the data and put it in there.

toxic forum
#

in the file or the let footer?

pure lion
#

example of the json:

{
  "command name": [
  "footer"
],
  "command name": [
  "footer"
] etc etc etc
}
stable nimbus
#

module.exports = {
    name: 'ping',
    description: 'Ping!',
    execute(message, args) {
        const embed = new MessageEmbed()
        .setTitle('Ping!')
        .setDescription('This is a ping command')
        .setColor('#ffd700')
        .setFooter(copyright);
        message.channel.send('Hey ' + `<@${message.author.id}>` + '!',embed);
    },```
The code
```{
    "copyright": "[!]  News: /news  |  © Fuzzy Wilson 2020"
}```
And the file.
#

const copyright is my reference point, and the file is in .json

pure lion
#

i guess you could do that too

spare mirage
#
    if (message.content.startsWith(PREFIX + "ping")) {
    
        var ping = Date.now() - message.createdTimestamp + " ms";
        message.channel.send("Your ping is `" + `${Date.now() - message.createdTimestamp}` + " ms`");``` 
how do i make ``` ("Your ping is `" + `${Date.now() - message.createdTimestamp}` + " ms`"); ``` an embed? do I make the embed in bot.on or above it?
stable nimbus
#

Yeah but it returns nothing.

pure lion
#

@spare mirage
Read
the
docs

#

Yeah but it returns nothing.
copyright[0]?

stable nimbus
#

No, it returns

[object] [Object]

#

Doesn't put it in.

pure lion
#

what are you getting?

toxic forum
#

@stable nimbus @spare mirage
you can color code your discord code snippets by adding the file ending (like .js) to your first "```"

like this
```js
```

makes it easier to read

pure lion
#

yeah do

.setFooter(copyright[0])
#

@stable nimbus

stable nimbus
pure lion
#

yeah do

.setFooter(copyright[0])

.

stable nimbus
#

OH! Thats how you do that! Thank you.

pure lion
#

youre welcome

#

:)

stable nimbus
#

js const embed = new MessageEmbed()

#

oof.

pure lion
#

make a new line after ```js```

toxic forum
#

you need the js on the same line as the first ```. and you need a newline after it

stable nimbus
#

Oh

earnest phoenix
#
hi
```
stable nimbus
#
const embed = new MessageEmbed()```
#

Yay! Thank you.

opal plank
#

Its annoying that mobile doesnt have highlighs

#

Fuck consistency

toxic forum
#

you can do it with json (and more!) too

stable nimbus
#

Thanks mate, now I learned two things today!

pure lion
#

a lot more

stable nimbus
#

Okay so the response does change, it changes to undefined

pure lion
#

hmm

#

copyright.copyright[0]

opal plank
#

What exactly are your obj?

#

Paste here

pure lion
#

^

stable nimbus
opal plank
#

The copyright

#

Not the response

stable nimbus
#

Ah

#
{
    "copyright": "[!]  News: /news  |  © Fuzzy Wilson 2020"
}```
#

Thats my copyright

opal plank
#

Just copyright then

#

Or

#

Object.values()[0]

stable nimbus
#

Yeah but it returns with [object Object]

toxic forum
#

it should become a property. so assuming let footer = require("../X.json") it should be footer.copyright

stable nimbus
#

I have it marked as a const

#

Not a let

#

Should change that shouldn't I

toxic forum
#

should not make a difference in this example 🙂, choose what you want

pure lion
#

copyright.copyright[0]
@pure lion

#

@stable nimbus

stable nimbus
#

Reads the first bracket!

#

Progress with dice

spare mirage
stable nimbus
#

Let me try the other.

toxic forum
#

AH

spare mirage
#

or how do I fix the command lmoa

toxic forum
#

it gives back { @stable nimbus ?

pure lion
#

Reads the first bracket!
shit

stable nimbus
#

Gives back [

pure lion
#

did you stringify the json at any point?

opal plank
#

@spare mirage message is undefined, put that after the bot.on

stable nimbus
#

No my json has stayed the same.

toxic forum
#

you can use JSON.Parse(require(...)) to make it an object

pure lion
#

thats what that does?

#

i only used it for readfilesync

spare mirage
#

@opal plank do I put everything + the embed after boton

opal plank
#

@spare mirage message only exists after its emitted

spare mirage
#

oh ye ur right

opal plank
#

therefore it needs to be put afetr its being initialized

stable nimbus
#

json.parse is not a function

cinder patio
#

require automatically parses the JSON

opal plank
#

JSON

#

not json

pure lion
#

nosj

stable nimbus
#

I know thats whats in there.

terse yarrow
#

Koya hgif

stable nimbus
#

Errored out saying its not a function.

pure lion
#

who wants nitro classic?

#

dm me

opal plank
#

who doesnt want free nitro?

#

¯_(ツ)_/¯

toxic forum
#
{
    "copyright": "[!]  News: /news  |  © Fuzzy Wilson 2020"
}```

@stable nimbus is this exactly your file? or is it wrapped in "" or ''?

pure lion
#

i have a spare gift uwu

opal plank
#

dont post it in servers, autoclaimers is an issue

stable nimbus
#

Thats exactly whats in my Json

opal plank
#

pick somoene you deem is worthy

pure lion
#

hmmmmmmmmmmmmmmmmm

toxic forum
#

i have a spare gift uwu
@pure lion do i need to scan a code :sceptical:

pure lion
#

no

spare mirage
#

will this work?

bot.on('message', message=>{
    const embedping = new Discord.MessageEmbed()
    .setColor('#0099ff')
    .setTitle('Ping :banana:')
    .setAuthor('Banana')
    .setDescription('Pong!')
    .addField('ur dinner today', 'bananas', true)
    .addField("Your ping is `" + `${Date.now() - message.createdTimestamp}` + " ms`")
    .setTimestamp()
    .setFooter('Justii :3')
    if (message.content.startsWith(PREFIX + "ping")) {
    
        var ping = Date.now() - message.createdTimestamp + " ms";
        message.channel.send(embedping);
    
      }```
opal plank
#

my bot should be able to read here, this example

pure lion
#

first to dm gets it ;)

opal plank
#

n.eval let footer = {
"copyright": "[!] News: /news | © Fuzzy Wilson 2020"
};
console.log(footer) // @stable nimbus

#

now if i do footer.copyright

#

n.eval let footer = {
"copyright": "[!] News: /news | © Fuzzy Wilson 2020"
};
console.log(footer.copyright) // @stable nimbus

clever garnet
#

i want it so when i send a spefific message it gives everyone in the guild a certain role how do i like do that

im using discord.js

pure lion
#

like

#

!role all <role>?

clever garnet
#

no

#

actually

#

yeah

#

but like i dont want to type the role

#

it just is in the code

pure lion
#

is it for one specific sv?

#

!ping

clever garnet
#

ye

cinder patio
#

Loop through each member in the guild and give them the role. Keep in mind that if there are a lot of people in the server this may be considered API spam

clever garnet
#

and how do i do that

wet dove
#

!role

clever garnet
#

?

pure lion
#

w3schools does something on loops

opaque verge
#

Does anyone know a safe way to calculate math expressions? I tried numexpr evaluate but a friend used it to get my token.

pure lion
#

Does anyone know a safe way to calculate math expressions? I tried numexpr evaluate but a friend used it to get my token.
lang?

cinder patio
#
opaque verge
#

@pure lion Python

pure lion
#

ehhhh

cinder patio
#

you could parse them yourself

opaque verge
#

:/

cinder patio
#

would be a fun challenge

pure lion
#

ah what a fun challenge

#

b y t e s

opaque verge
#

D:

pure lion
#

ive never used py, sorry

clever garnet
#

@cinder patio what even is a foreach

opal plank
#

.....

pure lion
#

:exhale:

#

what even is a foreach
@clever garnet for each (every single one) do <thing>

opal plank
toxic forum
#

googlefeud what even is a foreach
@clever garnet did you do any other programming before starting on your bot?

pure lion
#

for each member of guild, add role

clever garnet
cinder patio
#

then learn javascript

clever garnet
#

bruh

pure lion
#

^

#

is the only way

clever garnet
#

do you not think ive tried looking for it

pure lion
#

i barely know js but at least im confident

#

:D

stable nimbus
#

Do you have any visual programming experience or software development experience? If not we don't recommend just diving right into this, taking lessons is the best thing you can do for yourself mate.

pure lion
#

well i learnt js through making bo-

#

:D

#

okay fr now im gonna make the music bot

toxic forum
#

:D
"One small step for js users, but a giant leap for Dice"

pure lion
#

which :D did you reply to

#

?

pale vessel
#

it's a quote

toxic forum
#

that one yeah

pure lion
#

oh ye

#

:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

#

i learnt js in like a week because i was bored

clever garnet
#

8-------D

#

long smile face

pure lion
#

totally not thin pp

clever garnet
#

oh i just realised

#

xd

stable nimbus
#

@opal plank I used your method, and it works just the way I need it to, thank you very much.

opal plank
#

np

pure lion
#

how do i get the message content after args[0]

finite bough
#

@pure lion args.slice(1).join(' ')

earnest phoenix
pure lion
#

@earnest phoenix how new are you to this?

earnest phoenix
#

Let's say from scratch

pure lion
#

start elsewhere

#

for your own sake

earnest phoenix
#

is it really that difficult ?

pure lion
#

yes

#

what language do you wish to peruse?

earnest phoenix
#

don't know I been coding with python only

wooden ember
#

well you can make a bot with python so that is a start

pure lion
#

okay, go and check out the discord.py docs and set up a basic bot (i cant help you there, sorry)

earnest phoenix
#

aight I'll take a look

wooden ember
#

there are aload of things on google to get you started

earnest phoenix
#

tbh I was pretty sure that there is a website who is selling these things

#

to save time and start with business

wooden ember
#

probably is

pure saddle
#

i have a canvas issue

honest perch
#

and what is that issue

earnest phoenix
#

been searching day and night couldn't find a single thing about it. most communities I am in are using it

pure saddle
#

text

dull blade
#

Error: Cannot find module '../util/UserFlags'
need help please ? userflags is in node_modules and still its not found explanation pls !???

pure saddle
#

u see

honest perch
#

what about the text

#

i dont see

#

ones in a different language?

pure saddle
#

space

honest perch
#

@earnest phoenix you could always try fiverr

pure saddle
#

space

honest perch
#

not sure then, never used canva. Im guessing you have to move the location of the text

dull blade
pure saddle
#

i try

pure lion
#

@pure saddle what do you want to do?

pure saddle
#

status

#

with no space

#

its not problem at dnd

#

but at online have spaces

honest perch
#

then change the location of the text

pure saddle
#

i make it

honest perch
#

then change the location of the text

pure saddle
#

🤦‍♂️

viral iris
#
.setDescription(`**${json.data.messages[parseInt(num)].body}**`)
``` `message.channel.send(...).setDescription is not a function`
__im using (command handler)__
#

what's wrong ?

pure saddle
#

u can send all code

pure lion
#

include discord.js in the command file

surreal field
#

does anyone know if discord.py's asyncio module's event loop is being ran in only one thread or multiple?

#

i'm working with a shared object in an asynchronous function and my solution was to just not await any functions while i own the object's state

viral iris
#
.setDescription(`**${json.data.messages[parseInt(num)].body}**`)
``` `message.channel.send(...).setDescription is not a function`
__im using (command handler)__

can any1 help please

pure lion
#

@viral iris

viral iris
#

yes

pure lion
#

Send all of the code

pure saddle
#

yes

viral iris
#
const Discord = require("discord.js");
const request = require("request");
module.exports = {
name:"news",
run:(message, args) => {
request(
      {
        json: true,
        url: "https://fortnite-api.com/v2/news/stw"
      },
      (err, res, json) => {
        if (err) {
          message.reply("somting wrong!");
        } else {
          var num = Math.floor(Math.random() * (+3 - +1)) + +1;
          message.channel.send(
            new Discord.MessageEmbed()
              .setColor("#0099ff")
              .setAuthor(json.data.messages[parseInt(num)].title, message.client.user.displayAvatarURL())
              )
              .setDescription(`**${json.data.messages[parseInt(num)].body}**`)
              .setImage(json.data.messages[parseInt(num)].image)
              .setFooter("the official bot for lazy leaks server")
          
        }
      }
    );
  }
  }

#

@pure saddle @pure lion

pure lion
#

Why is there a random )

viral iris
#

message.channel.send(

          )
#

for it

pure lion
#

Oh

#

Move it further down

viral iris
#

let me try

#

worked

#

@pure lion how can i make 3 codes with same command -news

#

cuz it's not working

#

only 1 code works

pure lion
#

Wdym

#

Show code

viral iris
#

it's 3 codes

#

same code only api link change

pure lion
#

Why do you wanna do that

viral iris
#

for do 3 news with 1 command

#

br ,stw and creative

pure lion
#

Oh

#

Make the command get all those 3 things???

viral iris
#

yes

#

how?

#

i think ```js
}
{else

#

is it wrong ?

pure lion
#

Wdym

#

Go and learn js please

viral iris
#

u don't understand

pure lion
#

No u

viral iris
#

i have 3 codes
i idid it the same command news only 1 respond
and i'm using (command handler)

pure lion
#

You need 1 code

#

Only

long yew
#

lol

#

anyway

#

can anyone help me?

pure lion
#

try guild

#

.channels

long yew
#

ok thanks

#

got that

smoky spire
#

ur on djs v12?

long yew
#

yeah

#

but some of my code is outdated

#

cause i made parts of it a while ago

#

so i'm updating some of it

#

@smoky spire u know what needs changing?

smoky spire
#

client.channels.cache.get(...)

solemn latch
#

didnt i give you the page with all the updates?

long yew
#

yeah i read through it all and found nothing about this

#

:c

earnest phoenix
#

how to check if there is no member in voice chat with ytdl - core? My bot is playing music for like an hour without stopping

long yew
smoky spire
#

pConfig.spawnChannel isn't a valid id then

solemn latch
#

channels now needing cache was in the first section

long yew
#

....

viral iris
#

How to merge 2 codes in 1?

long yew
#

pConfig.spawnChannel isn't a valid id then
@smoky spire is mine valid? if not idk what to change it to

smoky spire
#

channelIDtospawnpokemonin is not an id

long yew
#

lol

#

idk what to change it to in json

#

?

solemn latch
#

are you trying to get the channel named channelIDtospawnpokemonin

#

because that string looks like a placeholder

#

for a channel ID

earnest phoenix
#

How can i create roles in v12? I tried everything but not working its creating by name "new role" <:(

stark kiln
pure lion
#

@earnest phoenix on the docs you will find the role manager

earnest phoenix
#

@pure lion where?

stark kiln
#

serach

#

search*

pure lion
#

^

#

It's simple to understand, have fun

warm badger
#

Stack overflow is the answer to starvation

earnest phoenix
#

......

stark kiln
#

idk why my bot is erroring like that

#

:/

earnest phoenix
#

Search

warm badger
#

Debug

#

@stark kiln consider proving a hastebin with the code you need help with next time.

stark kiln
#

dont say i have to

solemn latch
#

we cant read the whole line

#

so its pretty impossible to help

warm badger
#

👉👈 are you trying to flex with broken code

slim heart
#

in nginx how can i make it so that it tries to proxy_pass first and if said proxy returns a 404 itll go on and try a directory?

shy turret
#

How does eris.js sharding work?

#

I'm reading..

pure lion
#

hey, i'm using the yt-search npm and im having some issues with it.

(node:15300) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'url' of undefined

line affected:

        const videoURL = videos.url

more context:

      search(searchTerm, async function (err, r) {
        const videosAAAA = r.videos
        const videos = videosAAAA[0]
        const videoURL = videos.url
}

:(

#

it works fine with single word terms, but not terms with multiple words

#

nvm i fixed it :DDDDDDDDDDD

surreal field
#

does anyone know if discord.py's asyncio module's event loop is being ran in only one thread or multiple?
i'm working with a shared object in an asynchronous function and my solution was to just not await any functions while i own the object's state, should I be using mutexes just in case?

final gate
#

How do I show the number of servers that the bot is in

scarlet dragon
#

@final gate Playing or commands?

final gate
#

My friend is on your site, not bot @scarlet dragon

scarlet dragon
#

@final gate Huh wait

final gate
quartz kindle
long yew
#

ok so

final gate
#

ok how @quartz kindle

quartz kindle
#

check the tools menu

#

and pick your language

#

otherwise go to resources -> bots if you prefer manually sending a POST request

long yew
solemn latch
#

channelIDtospawnpokemonin looks like a placeholder

#

for an ID

quartz kindle
#

did you literally write that?

final gate
#

Give me the code, don't give me an explanation@quartz kindle

quartz kindle
#

@final gate no

solemn latch
long yew
#

:/

earnest phoenix
#

hi guys discord.js is giving me the incorrect guild count on bot.shard.fetchClientValues('guilds.cache.size').then(totals => {

long yew
#

@quartz kindle what can i change channelIDtospawnpokemonin to?

solemn latch
#

an id

quartz kindle
#

the channel id lol

long yew
#

what id?

quartz kindle
#

it literally says