#development

1 messages ยท Page 951 of 1

small prairie
#

Yes during that case i want it to send in a new message

#

i have that coded in catch

pale vessel
#

are you editing or sending

small prairie
#

eiditng

#

editing

#

if over 2000

pale vessel
#

how would split work

small prairie
#

then a new message is send

summer torrent
#

edit(content, {split:true})

pale vessel
#

isn't split option for send only

#

oh

#

how can it send the message in between

summer torrent
#

try this

small prairie
#

Wont that split it middle of a message?

summer torrent
#

no

small prairie
#

i mean likle

pale vessel
#

split just sends a new message

small prairie
#

Hey how are

#

you

#

like this right?

#

how

#

h

pale vessel
#

yeah

small prairie
#

ow

summer torrent
#

only if 2000+

clever tree
#

so. I found the problem i have. When im using ytdl "url" --print url it throws an error. Status code: 429. That means too many requests and i think my bot got softbanned. How could I fix this ?

pale vessel
#

but if it's an edit

summer torrent
#

I am using this option for eval

pale vessel
#

how is that going to work

small prairie
#

Cant do it then

summer torrent
pale vessel
#

:^)

small prairie
#

I just want the error to come to catch nothing else

pale vessel
#

use .catch

small prairie
#

something like throw error can work?

pale vessel
#

it works

#

or you can just add await

#

before mg

#

it'll catch it

small prairie
#

Just await and it will go to catch?

pale vessel
#

yeah

small prairie
#

Ah awesome then thanks

#

yeah my bad

#

im on it

summer torrent
#

@clever tree is this youtube Thonk

small prairie
#

Thanks its working

pale vessel
#

ah nice

clever tree
#

@summer torrent The error is from yt yeas

#

ytdl

pale vessel
#

429 is rate limited

clever tree
#

yes. So i got a softban for my bot. But how could i fix this ? Restart router or change ip ?

pale vessel
#

maybe a proxy

modest maple
#

orrrr

#

deal with your soft ban and fix your fuck up

small prairie
#

thanks a lot Flaze and NMW

pale vessel
#

all good

summer torrent
fallow steppe
#

So I added this to code: if (!message.member.hasPermission(["MANAGE_GUILD"]) || !message.author.id == "518738198982295564") return;Does that mean it must either be someone with the permission or it ignores perms if the message author has this id ( which is me ) and executes command?

pale vessel
#

it needs to have both

#

you need &&

#

it means that if it's the owner or a person that have permissions, it will execute the command

earnest phoenix
#

if (!message.member.hasPermission(["MANAGE_GUILD"]) && !message.author.id == "518738198982295564") return;

#

@fallow steppe

summer torrent
#

๐Ÿ™„

earnest phoenix
#

:/

pale vessel
fallow steppe
#

Ah

clever tree
#

@summer torrent Yeah. A proxy. But i use the bot on my desktop pc... I have to look around. But why doesnt the groovy bot get into issues? Too many requests or API limit. I could not understand xd

fallow steppe
#

So && means either has perms or is the owner?

golden condor
#

Instead of || you say &&

pale vessel
#

because groovy uses proxies?

#

&& means that the member does not have permissions AND it's not the owner

summer torrent
#

&& = and

pale vessel
#

then it will return

#

^

fallow steppe
#

So how do I make it or instead of and?

earnest phoenix
#

&& = or

pale vessel
#

you want it to bypass owner right? use &&

golden condor
#

In this scenario

summer torrent
#

no

#

||

fallow steppe
#

Ok

clever tree
#

I think ||

fallow steppe
#

I'm confused. || or &&?

pale vessel
#

confusion 100

golden condor
#

No &&

#

It's &&

fallow steppe
#

.

#

Lemme try both

clever tree
#

I think it is ||

summer torrent
#

|| is or
&& is and

golden condor
#

In this circumstance it's &&

pale vessel
#

it's &&

#

you showed it in your code

golden condor
#

It means if this person does not have permissions and they are not the owner then return

pale vessel
#

use logic next time

fallow steppe
#

Ok, && worked. However I want it to work this way: If user has the permission, they can execute the command. Or if it's the set ID, they can bypass this and execute command. Would I use && for it?

pale vessel
#

you did that

fallow steppe
#

Alright

pale vessel
#

that's what the && is for

fallow steppe
#

So || would mean they need both conditions?

pale vessel
#

yeah

#

correct

fallow steppe
#

Ok cool

#

Yeah worked. Thanks

tight forum
#

damn what happened here

summer torrent
#

nothing

surreal notch
#

I want to use words instead of numbers

#

could someone tell me how to do tha

#

that

summer torrent
#

wdym by that

surreal notch
#

there is written var numbers but i don't want to put numbers

#

i want to but words like hello

gleaming glen
#

just change those to words ๐Ÿค”

surreal notch
#

i did but its not wrking

#

working

#

could i give values like 1 = hi, 2= bye

#

@gleaming glen

gleaming glen
#

well thats how that is

#

0, 1, 2 for the things you put

#

they get a number so that you can get them

white anvil
#

use an object

#

if you rlly want to hardcode the numbers

surreal notch
#

```if(message.content.toLowerCase() === ${prefix}numbers) {

var numbers = [0, "hi", "hi"];

let cdata = db.get(cdata_${message.author.id})

if(cdata === null) db.set(cdata_${message.author.id}, 0)

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

if(answer === 0) {
return message.channel.send(":scream: You didn't catch anything better luck next time")

}

var answer = numbers[Math.floor(Math.random()*numbers.length)];
var embed = new Discord.MessageEmbed().setColor("#FF4500").setTitle("Hmm")

.setDescription(`:star_struck: Hurray! You have **${answer}** h\n\n*Contact ULTRON#4070 or Server Onwer To report issues*`)
db.add(`cdata_${message.author.id}`, answer)
await message.channel.send(embed)


  
}
}

})

well this is my codes i wanted to do like that if 0 comes then that mssg came and if answer is not 0 then any random word came
surreal notch
quartz kindle
#

@rain jacinth make your function async

#

@surreal notch you're randomizing it twice

rain jacinth
#

yeah i did that

#

but got this

quartz kindle
#

rank.js line 8

#

trying to use .get() on something that doesnt exist

surreal notch
#

what is meant by randomizing it twice?

#

@quartz kindle

quartz kindle
#

you get a random item from numbers

#

if its 0, you send the message

#

if its not 0, you get a random item again

#

the random item again can be 0 again

surreal notch
quartz kindle
#

and you will get Hurray! You have 0

surreal notch
#

so what's the solution

#

;/

quartz kindle
#

dont randomize it again

#

use the same answer

surreal notch
#

but if 0 cames there is another message and if he won something then there is another message

#

if he get 0 then what is that ... hurray you got 0

quartz kindle
#

because you have 2 answers

#

and both are random, so they can be different or be the same

restive night
#

how to use resetTimer() in reaction collector? I want to stop the collector after inactivity

edit: I use djs v12

quartz kindle
#

you can use this

restive night
#

@quartz kindle ah you're right, I didn't see it there all this time lol
thanks Tim!

golden condor
#

I keep getting this error in go and I;m not sure why

mossy vine
#

isnt that just a linting thing

surreal notch
#

client.on('message', message => {
if(message.content.toLowerCase() === ${prefix}pokemon) {
var numbers = ["Hello", "Bye", "Cya"];
var answer = numbers[Math.floor(Math.random()*numbers.length)];
var embed = new Discord.MessageEmbed().setColor("#FF4500").setTitle("You got a - ").setDescription(answer)
message.channel.send(embed)
}
})

i am not randomizing it twice but it is also not working

#

@quartz kindle

golden condor
restive night
#

@surreal notch I think it works

surreal notch
#

nope

restive night
quartz kindle
#

yes the code should work

surreal notch
#

wait

#

lemme check again

knotty steeple
#

can u make private functions in js classes

modest maple
#

not that ik of

knotty steeple
#

ree

modest maple
#

just do the standard notation for a private class

#

_class_method_thats_private or in js _classMethodThatsPrivate

knotty steeple
#

thats what i usually do

modest maple
#

Most IDEs pick up on it and register it as private

#

Transferring 8TB of Data onto the VPS be like an oof

neat ingot
#

@modest maple have you setup notifications for your netdata to send alarms to a discord channel via webhook?

modest maple
#

nah

neat ingot
#

ahh pants, was hoping you had lol

modest maple
#

I might at some point but im planning on making my own Panel for when i deploy my API and site

neat ingot
#

for some reason its not recognizing my custom config for it and never sending the alarms ๐Ÿ’”

quartz kindle
#

@knotty steeple you can in node 12+ afaik

modest maple
#

so i can manage DBs and see stats and rates on one apge

neat ingot
#

ahh yea, i've been messing around with custom dashboards too ๐Ÿ˜„

modest maple
#

cuz netdata gives alot of info but not rlly data i always need

neat ingot
#

i wish they had a kiosk mode or something by default

#

or a way to order charts by priority or such

modest maple
#

so im making a panel that i can view each Table's stats db latency etc...

#

api rates

neat ingot
#

oh nice

#

i keep seeing more reason to -de-docker my netdata

#

but im being stubborn!

#

afaik though, i have it completely setup to recognize everything from the host os, except my custom docker network names (it recognizes the networks, just not the names)

modest maple
#

i dont docker my netdata

neat ingot
#

I have noticed it seems to take a chunk of cpu when im viewing the interface tho

modest maple
#

just a simple dameon

#

it handles itself quite well

#

auto updates and self contains

neat ingot
#

yea tbh there is no real need to have it dockerized, I just did cause them my entire system can be easily moved to another host and started witha docker-compose up

modest maple
#

i mean you can still do that with netdata lul

neat ingot
#

like, i literally drag and drop via filezilla and run compoose up and am done

modest maple
#

its just a one line install

#

and auto runs

neat ingot
#

yea ik lol

#

i do feel it'd be easier to handle custom config if it wasnt in a container

white anvil
#

@quartz kindle itโ€™s node 13+ not 12

neat ingot
#

i'd at least be able to look through the files to make sure my custom config was actually loading properly lol

white anvil
#

#myFunction () => {}

#

but in reality itโ€™s not really finalised, only properties

quartz kindle
#

mozilla docs say its node 12

still merlin
#

how do i get a webhook port hostname and path

quartz kindle
white anvil
#

yeah thatโ€™s a private property not private function

#

I was wrong about the node version but yeah lol

quartz kindle
#

werent they both introduced together?

white anvil
#

apparently private functions havenโ€™t been finalised

quartz kindle
#

ah

#

i thought they were already finalized

#

well you can always do this

white anvil
#

yeah

uncut token
#

Hi, can someone help me with code that edit message wich bot has sended every 10 minutes?
I'll appreciate your help!

I am working with Java on JDA.

clever tree
#

How could i count all members from all server the bot is on ?

slender thistle
#

-faq 1

gilded plankBOT
slender thistle
#

-faq 2

gilded plankBOT
balmy knoll
#

I have a quite particular question, I have an image created with canvas-constructor and I want to edit a message with an embed with another embed that contains this canvas. How can I do it?

quartz kindle
#

message edits cannot send attachments

#

so you have to delete the previous message and send a new one in order to add or update an image

balmy knoll
#

@quartz kindle Okay, others have told me the same thing as you, but I can't understand one thing: why can this bot do it?

earnest phoenix
#

is there way to run multiple (more that 2 files) in python

slender thistle
#

Depends on what you mean by "run"

earnest phoenix
balmy knoll
#

So in discord.py you can do it, but in discord.js you can't, right?

slender thistle
#

import if I understand you correctly

#

Or use process managers if they need to run separately catshrug

balmy knoll
#

@slender thistle Wait, I didn't quite get that. Can you explain me again?

slender thistle
#

That wasn't directed at you bahahaha

balmy knoll
#

Ok PikaJoy

earnest phoenix
#

oh thanks

quartz kindle
#

@balmy knoll the discord api does not have a way to overwrite existing attachments, no lib can do that

#

that bot is probably doing something else

#

not updating an image

#

at least from what i know

balmy knoll
#

I try to ask the creator of the bot

quartz kindle
#

you can change the embed fields

#

for example change urls

#

but you cannot upload a new attachment

#

so if all your images are already uploaded somewhere

#

you can change the urls and the embed should update

#

but you cannot attach a new image

balmy knoll
#

Okay, thank you very much, so if I put the image in the url form, can I attach it?

quartz kindle
#

form of a scream? what?

earnest phoenix
#

idk

#

if discord supports dissplay it can

quartz kindle
#

what?

carmine steeple
surreal notch
#

How to make a bot which sends message in random channels

#

anytime

quartz kindle
#

thats against discord's rules

surreal notch
#

@quartz kindle Nope I want something which send messages in intervals like in this channel send a message in every 2 mins

opaque seal
#

How do I send an emoji in that form \โ— and not in that โ—

still merlin
#

do \โ—

opaque seal
#

I tried to do that in an embed but it still sends the normal onw

#

onw*

#

onw*

#

omg

#

one*

digital ibex
#

how can i check if a command exists?

#

like

#

i have ```js
{ name: 'hi', response: 'ee' },
{ name: 'ee', response: 'hi' }

#

if it isn't hi or ee how can i send a message saying something

#

using js

#

nvm

#

i found out how yeet

earnest phoenix
#

I tried to do that in an embed but it still sends the normal onw
@opaque seal

you're probably escaping it in code instead of actually sending the frontslash to discord. use double frontslashes

quartz kindle
#

@surreal notch thats still technically against the rules

#

but 2 mins should be fine, as long as its your own server, or if a server turns this option on. it should not be on by default

earnest phoenix
#

Methode in which one finds out the Invite Code with which the user has joined?

quartz kindle
#

if you use discord.js

pure lion
#

How do I get a list of all the guilds the bot is in?

#

I've tried console.log(bot.guilds) but got nothing

zenith terrace
#

bot.guilds.size

#

v12 is bot.guilds.cache.size

#

@pure lion

pure lion
#

Alright thanks

#

@zenith terrace I meant like, a list of the guild ID's, not the amount of guilds

zenith terrace
#

O

pure lion
#

Yems

#

Is that possible?

cinder patio
#

map the guilds by their ID

pure lion
#

Alright

#

How to search entire cache?!

surreal notch
#

Could someone help me in pure javascript for my website I wanted to make search box

#

Anyone please come in DM

cinder patio
#

Eli, a cache is a Collection (https://discord.js.org/#/docs/collection/master/class/Collection), you can get an entry by id with get or you can find an entry that satisfies a specific condition with find

pure lion
#

Thanks, that's all the info I need (very new to coding, barely know JavaScript)

#

a!ping

#

Huh

uneven monolith
#

Legit, I took my bot down for ten seconds in two weeks and in that ten seconds they declined my bot because it was not responsive

#

:(.

pure lion
#

@cinder patio do I need to do a forEach loop?

cinder patio
#

Can you describe what you're trying to get exactly?

pure lion
#

The guild ID

#

I've tried (Guild => Guild.ID) but it returned the first guild that appeared in the list and not the ID

cinder patio
#

So you want to get a guild id

pure lion
#

Yes

#

All of the guild ID's

cinder patio
#

ah, then you'd use the map function on the bot.guilds.cache Collection

pure lion
#

Already have that

cinder patio
#

In the map function, provide a function which returns the guild's id, like: guild => guild.id

#

oh you already told me you tried that

pure lion
#

Yeah

#

Logs the first guild

cinder patio
#

can you show how you're using ti?

#

it*

pure lion
#

Yeah sure

#
const botFind = new Map();
  botFind.set(bot.guilds.cache.find(guild => guild.id))
  console.log(botFind)
cinder patio
#

You should use the map function, not find. find returns a single element which satisfies the function, and since every guild has an id, the function is always satisfied so the first elements always gets returned

#

also, no need to create a new map and do all that, map returns an array of IDs: [id1, id2, id3...]

pure lion
#

alright

cinder patio
#

It's a little confusing, cause there is a data structure called Map and a function called map

pure lion
#

yeah i noticed

#

it works now!

#

thank you :)))

copper cradle
#

lmaoo

astral remnant
#

-_- Can someone tell me a better way?

async def queue(ctx):
 ctx.message.guild.name = []
 await ctx.message.channel.send('**-start of queue-**')
 await ctx.message.channel.send('**-type end when done-**')
 def ch(m):
  return m.author == ctx.message.author and m.channel == ctx.message.channel
 while True:
  song = await client.wait_for('message', check=ch, timeout=30)
  song_str = str(song.content)
  song_f = song_str.translate({ord(c): None for c in string.whitespace})
  if song_f == 'end':
   print(ctx.message.guild.name)
   break
  ctx.message.guild.name.append(song_str)
 for song in ctx.message.guild.name:
  vc = ctx.message.guild.voice_client
  if vc.is_playing():
   continue
  else:
   player = await YTDLSource.from_url(song, loop=client.loop)
   print(song)
   vc.play(player)```
unique nimbus
#

wait you are still using 0.16.4?

#

I thought YTDLSource is gone from the current version

astral remnant
#

Sorry, brb, just mention me when helping.

slender thistle
#

Why are you overwriting guild.name

#

Also I don't think a while True: is helpful in async code

astral remnant
#

The bit with while True: worked

#

It appends the input in the dict and breaks when the input is 'end'

astral remnant
#

Output

['NCS Jarico Island', 'NCS Jarico Landscape']
NCS Jarico Island```
#

It plays the first, but stops at that.

mystic violet
#

and apperently it says no code provided

prisma socket
#

_status

#

:(

rotund valley
#

Hi i am developer too

tight plinth
prisma socket
#

It doesn't work there either

#

My bot is on the server but does not execute the commands

tight plinth
#

Common prefix

#

Dmh

astral remnant
#

All I need to do is play songs based on the input provided in a dict.

prisma socket
#

What does Dmh mean?

#

I'm Brazilian

tight plinth
#

Smh but mistyped

astral remnant
#

Shake my head

rotund valley
#

Can i add my bot here?

earnest phoenix
astral remnant
#

Your bot will be added to this server if it is approved

rotund valley
#

How to approved it

pure lion
astral remnant
#

Anyway someone help me

#

Code :

async def queue(ctx):
 ctx.message.guild.name = []
 await ctx.message.channel.send('**-start of queue-**')
 await ctx.message.channel.send('**-type end when done-**')
 def ch(m):
  return m.author == ctx.message.author and m.channel == ctx.message.channel
 while True:
  song = await client.wait_for('message', check=ch, timeout=30)
  song_str = str(song.content)
  song_f = song_str.translate({ord(c): None for c in string.whitespace})
  if song_f == 'end':
   print(ctx.message.guild.name)
   break
  ctx.message.guild.name.append(song_str)
 for song in ctx.message.guild.name:
  vc = ctx.message.guild.voice_client
  if vc.is_playing():
   continue
  else:
   player = await YTDLSource.from_url(song, loop=client.loop)
   print(song)
   vc.play(player)```
#

Output:

['NCS Jarico Island', 'NCS Jarico Landscape']
NCS Jarico Island```
forest pond
#

Alright I Need Help

pure lion
#

What with?

forest pond
#

I Need A DiscordGo Master

astral remnant
#

It plays the first song in the dict, but stops at that.

forest pond
#

Ok

pure lion
#

How do I make my bot not try to add a role/send a message when it doesn't have the permissions to?

leaden flame
#
@has_permissions([PERMISSION]=True)
still merlin
#

@pure lion what libary

tulip ledge
#

let collector = msg.createReactionCollector((reaction, user) => user.id === message.author.id, {time: 1 * 60 * 1000});

How do I send a message when the time runs out?

pure lion
#

Discord.js

tulip ledge
#

client.hasPermission I think

#

Not sure tho

pure lion
#

let collector = msg.createReactionCollector((reaction, user) => user.id === message.author.id, {time: 1 * 60 * 1000});

How do I send a message when the time runs out?
@tulip ledge setTimeout.function

tulip ledge
#

N o lol

#

When the collector tuns out of time

pure lion
#

B r u j idk

tulip ledge
#

I need to send a message

earnest phoenix
#

y not use awaitReactions ?

tulip ledge
#

I'm pretty sure there's something like collector.on

#

Cuz collectors is faster

astral remnant
#

( discord.py ) I need to play songs present in a dict ( queue )

leaden flame
#

how would I make a url(text)

tulip ledge
#

I think its like text if not its (text)[url]

astral remnant
#

With the code up there it only plays the first song in the dict then stops.

still merlin
#
if (!message.bot.hasPermission(["premissions here"]))
        return message.channel.send(
          "message here"
        );
#

@pure lion

tulip ledge
#

why message.bot?

pure lion
#

Thx, I'll try

earnest phoenix
#

message.bot?

tulip ledge
molten coral
#

Hi

#

I have a very little problem

#

Can someone help ?

tulip ledge
#

Prob everyone here

pure lion
#

why message.bot?
@tulip ledge
CoNsT bOt = nEw DiScoRd.CLiEnt();

astral remnant
#

I regret asking help for raid bots in discord.py support server and getting banned.

tulip ledge
#

Then its not message.bot

#

But just bot

#

lol

molten coral
#

Just after a HTTP call, i get an object with properties. One of the properties is called 3v3Victories. I would like to access it with object.3v3Victories but i got An identifier or keyword cannot immediately follow a numeric literal. What can i do ?

still merlin
#

message.member and message.bot should work the same

tulip ledge
#

But-

#

Why

#

You should use bot not message.bot

molten coral
#

...

tulip ledge
#

Whats the logic?

#

MMmh

#

Try

#

let item = 3v3Victories
object[item]

#

prob not the best solution

#

But in theory it should work

astral remnant
#

I need to play songs from a dict

tulip ledge
#

Dont know discord py

astral remnant
#

Sad

molten coral
#

Could someone help ?

#

please

tulip ledge
#

Already did

still merlin
#

@molten coral stop asking to ask

tulip ledge
#

let item = 3v3Victories
object[item]
@tulip ledge

mossy vine
#

@molten coral what lang

molten coral
#

Just after a HTTP call, i get an object with properties. One of the properties is called 3v3Victories. I would like to access it with object.3v3Victories but i got An identifier or keyword cannot immediately follow a numeric literal. What can i do ?

#

Javascript

mossy vine
#

no

tulip ledge
mossy vine
#

programming language

tulip ledge
#

LOL

#

let item = "3v3Victories"
object[item]
@molten coral

mossy vine
#

object['3v3Victories']

tulip ledge
#

Try that

mossy vine
#

@tulip ledge that doesnt work

#

dont be stupid

tulip ledge
#

Or that

molten coral
#

Ow thx i didn't see

tulip ledge
#

Wdym

#

Its literally the same$

#

Except I use a variable and u dont lol

mossy vine
astral remnant
#

I will need to figure it out and it will take years, sad.

mossy vine
#

variables cant start with a number

molten coral
#

but...

tulip ledge
#

Thats why i said

#

item

#

let item = "3v3Victories"

molten coral
#

it's i get the object i can't change it

mossy vine
#

you did not put that as a string

#

just edited it

tulip ledge
#

I know lol

mossy vine
#

@molten coral i gave you the solution

tulip ledge
#

I noticed

molten coral
#

ยฐ-ยฐ' i try wait a sec sry

#

Oh i haven't read like that

#

Yea sure thx

#

(I'm a bit stupid sorry)

strange mango
scenic kelp
#

That one was probably made with a spreadsheet software

forest pond
#

I Need Help Which Bot Library I Should Choose Because I Want To See The Most Recommended

astral remnant
#

( discord.py ) How can I play songs from a dict? Like I have a dict ['song1', 'song2'] How can I play songs from the dict?

#

Using a for loop attempts to play the next song and does not wait for the first song to complete.

forest pond
#

Ok

astral remnant
#

A temporary solution would be to get duration of the song in seconds and do asyncio.sleep(sec) then attempt to play the next song, but it isn't really a solution

pure lion
#

How to delete message by it's ID

#

?

amber fractal
#

fetch message > delete message

pure lion
#

(node:9008) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel' of undefined

#

msg.channel.messages.fetch(args[1]).then(msg.delete)

#

(args1 is msg id)

golden condor
#

How do I use ffmpeg .pipe() (tryna make filters for music in discord.js)

earnest phoenix
#

@earnest phoenix type enable-pnpm in your console and wait.

mossy vine
#

unexpected token

#

use catch (e) {

golden condor
#

No you don't need to do that

mossy vine
#

catch { is only on newer node versions iirc

golden condor
#

o

#

But they have discord.js v12

#

So they must have a newer version of node

limber flume
#

hey have they done something my bots not able to kick members

#

or ban members

#

+_+

cinder patio
#

having an error argument in the catch block is required

limber flume
#

it was worling yesterday, i not change code

#

working

#

nothing wrong?

mossy vine
#

well does it have permissions

limber flume
#

yep

#

its just not working no error message either

slender thistle
#

Are you sure those commands are actually loaded

limber flume
#

wait i have no clue its working now

#

+_+

earnest phoenix
#

@mossy vine Im not using any code / command in my project , and my project just includes "ejs" , and some "js" files. and i can't access terminal...

limber flume
#

wym?

mossy vine
#

oh its not from ur code but d.js

#

yeah update node

earnest phoenix
#

Oh, nvm i fixed

#

life inv

#

Oops.

#

Wrong channel.

astral remnant
#

bot รงevrimdฤฑลŸฤฑydฤฑ kontrol etmek iรงin Glitche girdim ลŸu hata var en son bir gรผncelleme edit veya hiรง bir ลŸey yapmadฤฑm saฤŸlam รงalฤฑลŸฤฑyordu durduk yere bu hatayฤฑ verdi birden bire

internal/modules/cjs/loader.js:670
    throw err;
    ^
Error: Cannot find module '../build/better_sqlite3.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
    at Function.Module._load (internal/modules/cjs/loader.js:591:27)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/rbd/pnpm-volume/524ccb5d-22b9-48d9-8b23-e738be5eee1a/node_modules/.registry.npmjs.org/better-sqlite3/5.4.3/node_modules/better-sqlite3/lib/database.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)

bot was offline I entered Glitche to check it is the last error there was a recent update edit or did nothing I was working hard suddenly gave this error to the ground -- Google Translate

small prairie
#

how can i access the vars that i set in res.render in ejs in style tag

#

does anyone understand what i mean?

pliant needle
#

Recommended db for 32bit system? Mongodb is out since they cap @ 2gb

digital ibex
#

@rain jacinth send ur code

rain jacinth
#

it's fixed

vale merlin
#

@pliant needle SQLite maybe?

tulip ledge
#

So I have this colelction with 2 entries, how do I take the 2nd one?

small prairie
#

I dont think there is actually a way to do that

#

var something=collection.first(2)
something[1]

#

this can work idk

tulip ledge
#

Already tried that

small prairie
#

whats problem?

tulip ledge
#

Since I have the reactions.users.cache

rigid maple
#

pls help

tulip ledge
#

And I'm tryna get the one that's no the bot

small prairie
#

convert it to array

tulip ledge
#

how?

small prairie
#

ah

#

filter it

summer torrent
#

message.channel is undefined @rigid maple

rigid maple
#

what should I do ?

tulip ledge
#

filter is for an array not for a collection

small prairie
#

There is

tulip ledge
#

Or does filter wortk on a collection aswell?

summer torrent
#

console.log(message) and check

small prairie
rigid maple
#

I want him to message that channel @summer torrent

summer torrent
#

console.log(message) and check

small prairie
#

@rigid maple Can u console.log(message) and send me ss

tulip ledge
#

console.log(reaction.users.cache.filter(x => x !== client.user.id))

#

This should log the other entry?

small prairie
#

Yea

#

all the other entries

tulip ledge
#

Nope

small prairie
#

remember to cache that message tho

tulip ledge
#

Wdym?

small prairie
#

whats it logging?

rigid maple
small prairie
#

if you restart the bot the cache is deleted

tulip ledge
#

Both entries

rigid maple
#

shall i do that ?

small prairie
#

Weird

tulip ledge
#

That's no problem

#

Oh

#

I just noticed

#

I did x !==

small prairie
#

Ah

#

how can i access the vars that i set in res.render in ejs in style tag
does anyone understand what i mean?

#

res.render("delete", {
pageTitle: "Dashboard",
user: req.session.user
})

#

if i do this

rigid maple
#

I did as you say, but it doesn't throw away the help menu

hoary elm
#

<% code here %> @small prairie here is an example of how to use it that is used on My website/dashboard to fetch the users perms

<div class="card-columns">
  <% user.guilds.forEach(guild => {
    const permsOnGuild = new perms(guild.permissions);
    if(!permsOnGuild.has("MANAGE_GUILD")) return;
  %>
small prairie
#

i want it on style tag

#

Wait

#

doing that will work in style too?

hoary elm
#

Afaik you should be able to use it in the style tag

#

I just have it set as a div

small prairie
#

Yeah i think so

#

I am so dumb

#

thanks

rigid maple
#
const Discord = require('discord.js')
module.exports = {
  name: "yardฤฑm",
  description: "Komutlarฤฑ ve aรงฤฑklamalarฤฑnฤฑ gรถsterir",
  execute (client, message, args) {
    
     const embed = new Discord.MessageEmbed()
    
    .setTitle("Prowdy Yardฤฑm Menรผsรผ")
    .setURL("https://discord.com/oauth2/authorize?client_id=683667575565320439&scope=bot&permissions=8")
    .setColor("RANDOM")
    .addField("p!รงal","YouTube'dan ลŸarkฤฑ รงalar") 
    .addField("p!atla","ร‡almakta olan ลŸarkฤฑyฤฑ atlar")
    .addField("p!dur","ร‡almakta olan mรผziฤŸi durdurur")
    .addField("p!devam","ลžu anda รงalan mรผziฤŸe devam eder")
    .addField("p!ses","Geรงerli olarak รงalan sesin sesini deฤŸiลŸtirir")
    .addField("p!playlist","Youtube'dan bir oynatma listesi oynatฤฑr")
    .addField("p!liste","ลžarkฤฑ sฤฑrasฤฑnฤฑ gรถsterir ve ลŸimdi รงalan ลŸarkฤฑyฤฑ gรถsterir")

  console.log(message)

  }
}
#

I did as you say, but it doesn't throw away the help menu

small prairie
#

i literally wasted 2 hours figguring it out

#

@rigid maple did u actually code this bot?

hoary elm
#

i literally wasted 2 hours figguring it out
@small prairie lol it happens, my bots website is 100% ejs so hopefully that helped

small prairie
#

Thanks

rigid maple
#

Not really

small prairie
#

Yeah im just trying out a dashboard of a bot i thought would become a big one and now i feel depressed and down ;-;

rigid maple
#

I did as you say, but it doesn't throw away the help menu

#
const Discord = require('discord.js')
module.exports = {
  name: "yardฤฑm",
  description: "Komutlarฤฑ ve aรงฤฑklamalarฤฑnฤฑ gรถsterir",
  execute (client, message, args) {
    
     const embed = new Discord.MessageEmbed()
    
    .setTitle("Prowdy Yardฤฑm Menรผsรผ")
    .setURL("https://discord.com/oauth2/authorize?client_id=683667575565320439&scope=bot&permissions=8")
    .setColor("RANDOM")
    .addField("p!รงal","YouTube'dan ลŸarkฤฑ รงalar") 
    .addField("p!atla","ร‡almakta olan ลŸarkฤฑyฤฑ atlar")
    .addField("p!dur","ร‡almakta olan mรผziฤŸi durdurur")
    .addField("p!devam","ลžu anda รงalan mรผziฤŸe devam eder")
    .addField("p!ses","Geรงerli olarak รงalan sesin sesini deฤŸiลŸtirir")
    .addField("p!playlist","Youtube'dan bir oynatma listesi oynatฤฑr")
    .addField("p!liste","ลžarkฤฑ sฤฑrasฤฑnฤฑ gรถsterir ve ลŸimdi รงalan ลŸarkฤฑyฤฑ gรถsterir")

  console.log(message)

  }
}
small prairie
#

@rigid maple I cant help if you havent codeed the bot

rigid maple
#

are you Tรผrk ?

small prairie
#

sadly no sorry

rigid maple
#

What should I write in console.log(message)

#

I did not write message.channel.send(embed)

earnest phoenix
#

@rigid maple messge.channel.send(embed)?

rigid maple
#

?

#

msg.channel.send(embed) @earnest phoenix

summer torrent
#

??

earnest phoenix
#

ร‡alฤฑลŸmฤฑyor mu@rigid maple

rigid maple
#

deniyorum

#

Bu hatayฤฑ verdi

summer torrent
#

english only.

hoary elm
earnest phoenix
#

ร–yle birลŸey yazmฤฑyor@summer torrent

summer torrent
#

no

earnest phoenix
#

?

rigid maple
summer torrent
rigid maple
#

here is also considered support

hoary elm
#

Ooo I forgot about the support channel

rigid maple
#

but no problem

hoary elm
#

@rigid maple yes but this is a English only based channel

rigid maple
#

how will i solve

earnest phoenix
#

change msg to message

rigid maple
#

it wasn't working

earnest phoenix
#

tried?

earnest phoenix
#

lol

rigid maple
#

but i can't speak english much ๐Ÿ˜ซ

earnest phoenix
#

i can't see your "moderators" role

oblique thorn
#

@rigid maple message.channel.send(embed) try this

rigid maple
#

I've tried

#

send of undefined

#

@oblique thorn

oblique thorn
#

Print message output to the console. So console.log(message)

#

@rigid maple

rigid maple
#

it is useless because it is help command

oblique thorn
#

Sana diyorum ki message รงฤฑktฤฑsฤฑnฤฑ attฤฑr diyorum

rigid maple
#

ingilizcem yok .d

oblique thorn
#

sen diyorsun ki KullanฤฑลŸsฤฑz bu bir yardฤฑm komutu

rigid maple
#

รงeviri kullaฤฑnyorum

#

yardฤฑm komutu olduฤŸu iรงin bir iลŸe yaramaz yazdฤฑm

earnest phoenix
#

then delete it

#

:d??

heavy marsh
#

is shard reconnection and resuming taken as shard being disconnected?

earnest phoenix
#

i copy paste the kick command and change it to dm people as a warn command and it just say it cant find users every time

rigid maple
#

p!help

sudden geyser
#

Go to where you call the execute method and make sure the second argument is a message object.

nocturne dagger
#

How would I get a role's ID from a mention like (prefix)setrole @role

#

discord.js

summer torrent
#

check Message#mentions

nocturne dagger
#

thanks got it

#

How can I check to see if a category exists by name

steel drum
#
message.guild.channels.cache.find(c => c.type === "category" && c.name === "name");
#

@nocturne dagger ^

nocturne dagger
#

Thanks ๐Ÿ™‚

steel drum
#

np!

nocturne dagger
#

wait

#

so im trying to check if it exists

steel drum
#

yes

#

if you cant find it, it does not exist

nocturne dagger
#

No, i mean how can I do something if it does and then something different

#

if(message.guild.channels.cache.find(c => c.type === "category" && c.name === "name").exists())

#

?

#

@steel drum

steel drum
#

@nocturne dagger no, because if the find method returns undefined you'll have an error thrown at you along the lines of ```js
TypeError: Cannot read property 'exists' of undefined

nocturne dagger
#

so

steel drum
#

plus exists is not a method of the channel class (to my knowledge)

nocturne dagger
#

i could do if(!guild.findthing == null)

steel drum
#

you can just do ```js
let category = message.guild.channels.cache.find(c => c.type === "category" && c.name === "name");
if (!category) {
// ENTER CODE / ERROR HANDLING FOR WHEN THE CATEGORY WAS NOT FOUND
return; // to exit the function
}
// DO SOMETHING WITH CATEGORY
return;

nocturne dagger
#

ok

#

thanks

steel drum
#

np

neat gazelle
#

Can someone help me. I made a ticket command and for some reason the embeds want to duplicate sometimes. Does any know why it does this?

steel drum
#

@neat gazelle a snippet of the code related to this functionality would be nice

earnest phoenix
#

how many nodes is the bot working on

neat gazelle
#

Just one node

earnest phoenix
#

can you show us the code

#

of the commands that has duplicated embeds

#

can you show us the code

#

it must say the line of where is it

#

V12?

#

members.cache.get

#

and message.guild.roles.cache.find

wet iron
#

Im trying to check if args[0] is a string and if it is to return something. I tried to do the javascript way but the value is invalid cause i typed in (args[0]) is there any other way for me to check if args[0] is a string?

#

Im trying to check if args[0] is a string and if it is to return something. I tried to do the javascript way but the value is invalid cause i typed in (args[0]) is there any other way for me to check if args[0] is a string?

#

Anyone help?

earnest phoenix
#

typeof args[0]?

wet iron
#

yes

#

like if args[0] is a string return something

potent ivy
#

what would you consider a string though

#

theoretically all incoming arguments from discord are strings

#

"203" is a string

#

you want a non-number argument check?

wet iron
#

yes

#

i tried isNaN now

#

but it wont work

#

you want a non-number argument check?
@potent ivy yes

#

Im making economy

#

and when i type in $deposit a

#

it says it deposited a$

#

and then in userData it changes the bank balance to "0a"

#

i fixed it

#

i accidentaly typed if isNaN(args[0]) === true then the number instead of false

#

well now when I try to deposit or withdraw a specific number from the bank it turns into a string if for example type in $deposit 15 it will say that my bank account now has 015$ I think its because I did this userData[sender.id + msg.guild.id].bankBal += args[0]
userData[sender.id + msg.guild.id].money -= args[0]

#

okay

#

hm

quartz kindle
#

@wet iron you need to convert it to a number first

#
let number = Number(args[0]);
if(isNaN(number)) return
wet iron
#

thanks

#

lemme try

#

it works

#

thanks for the help

amber fractal
#

doesnt isNaN convert to number beforehand? So theoretically, you can save microseconds of processing time by switching the order mmLol

steel drum
#

it does

quartz kindle
#

but he would need to convert to number twice

#

once to check isNaN and again to use it

tulip ledge
#

So I have this collection:

Collection [Map] {
  '259776081316282368' => User {
    id: '259776081316282368',
    bot: false,
    username: 'ChickenDev',
    discriminator: '6181',
    avatar: 'da6a01a4e3c8e84ce7c7f295b11c2210',
    flags: UserFlags { bitfield: 131584 },
    lastMessageID: null,
    lastMessageChannelID: null
  }
}

I tried Collection.id but that doesn't work any idea how I get the ID?

quartz kindle
#

collection.first().id

tulip ledge
#

alr

unique nimbus
#

define cmd

rain jacinth
karmic crescent
opaque seal
#

I wanna send a message to a user and catch the error if the user ha DMs disabled without doing anything else, how do I do that?

newState.member.user.send(noPermissionEmbed)
                .catch();```
#

does that work?

tired nimbus
#

for some reason when I took an array to a string there was no closing }

pale vessel
#

that's the correct way @opaque seal

opaque seal
#

thank you

tired nimbus
#

want to see it just maybe figure out?

pale vessel
#

.catch(err => { do something });

opaque seal
#

Is that referred to me?

tired nimbus
#

you know what Im just gonna send my object wait

#

why is it an object

#

im just goiing to do some thonks

ember lodge
#

Who recommends a cheap and good host for a bot of suggestions that is in 101 servers?

cedar badge
#

@ember lodge Digital ocean

ember lodge
#

Another one? @cedar badge

#

I want less than $5

digital ibex
#

@ember lodge its free ^^

#

its good, just check it out first before saying free hosts r shit and stuff lmao

ember lodge
#

Thanks

#

Btw, how do i post the numbers of servers my bot is in?

slender thistle
#

-servercount

gilded plankBOT
#

To have your bot's server count displayed on DBL, please read the documentation on server/shard posting. Click here to see the docs.. You may also find #312614469819826177 useful; however it is strongly discouraged as most of the examples are extremely outdated.

earnest phoenix
#

Is there a way to get the user who invited the bot?

sudden geyser
#

[text here](url here)

#

It only works in embeds or messages sent by webhooks (even when in plain text).

#

As in webhooks can use them too. Bots can use them as well but limited to embeds only.

leaden flame
#

Hey! How do I get my discord bot status to change each time it joins a server? It only updates once I restart the VPS

placid vault
#

how i can get channel object, i tryed the same way i do for users but it's not working (py)

#

Hey! How do I get my discord bot status to change each time it joins a server? It only updates once I restart the VPS
@leaden flame make a loop

leaden flame
#

How

placid vault
#

you can use while

#

go dm i will show u how i did

fallow steppe
#

How do I make the bot check user roles? I use this: member.message.hasRole(["RoleID"])but does not work.

earnest phoenix
#

He didn't give such an error until 1 hour ago

leaden flame
#

your .catch()

#

read the error

onyx summit
#

the usual way you would add them in normal messages
<:name:id>

#

?

#

If they are gif emojis it's
<a:name:id>

earnest phoenix
#

From the computer, you can achieve this by typing: /:emoji:

#

Or \:emoji

#

![y_kkk](https://cdn.discordapp.com/emojis/709124548670259283.webp?size=128 "y_kkk")

#

![AngryAwooGlitch](https://cdn.discordapp.com/emojis/451933570252931083.webp?size=128 "AngryAwooGlitch")

onyx summit
#

use settings.developers.includes(devID)
currently you are returning from the forEach callback which makes no sense

ancient lichen
#

is it only me or sometimes the ytdl-core just goes crazy on playback? (discordjs)

fallow steppe
#

message.member.roles.cache.find(r => r.name === 'Moderator') .then(role.setMentionable(true)) .then(updated => console.log(`Role updated ${updated.name}`)) .catch(console.error);Is this correct?

vivid cedar
#

how can i get voice channel name by id discord.js v11.6.4

sudden geyser
#

@fallow steppe .then takes a function. then(role.setMentionable(true)) is wack. Did you try it out for yourself?

fallow steppe
#

Not yet, trying to know how to make the bot find a role and make it mentionable

onyx summit
#

doing .then on something that is not a promise is wrong either way

fallow steppe
#

So, replace first .then with ;?

grand dagger
#

To use emotes that Ive upload on my private server on my public bot on an embed can I just do :emote_name: in an embed

#

In the embed*?

fallow steppe
#

You use the entire emote id, doing it this way just prints it like that

#

For examples like this:
![Thonk](https://cdn.discordapp.com/emojis/356771720863940608.webp?size=128 "Thonk")

grand dagger
#

I see

#

Ty

fallow steppe
#

๐Ÿ‘Œ

rain jacinth
#

so ugh i just made a command handler and when i do a cmd it shows the cmd 3 times

#

instead of once

strong stone
#

maybe you have 3 instances

rain jacinth
#

my index.js file

#

serverinfo.js file

strong stone
rain jacinth
#

?

#

do i lower it?

strong stone
#

I just don't know why you put this here

strong stone
#

yeah but why ? this return nothing at all

rain jacinth
#

so i also remove the return?

strong stone
#

In your code the {return} doesn't do anything, you can remove it

#

that just trigger me lol

rain jacinth
#

it did 2 this time

#

and i did it like this

strong stone
#

you can remove {} too

rain jacinth
#

it did 3 again..

strong stone
#

I think you have multiple instance of your bot

rain jacinth
#

wym

strong stone
#

like 3 terminal with your bot launch

rain jacinth
#

OOOP

#

?

#

i have 3 terminals is what you're saying

#

?

strong stone
#

3 instance

#

But yeah that can be 3 terminals with your bot in it

rain jacinth
#

i'm only using one wym...

strong stone
#

I don't know but I didn't see other issue

#

All of your script seems like to be good

rain jacinth
#

time to use atom

strong stone
#

try to use console.log() if you need to know if it is your command or an other problem

hardy vector
#

does anyone know how to check if the given playlist has more than x number of songs

#

im using lavalink btw

sudden geyser
#

If the playlist is an array/set/map/etc. you should be able to check it's .length or .size.

earnest phoenix
#

it does

#
      try {
        message.member.createDM()
      } catch (error) {
        if (error) {
          return message.reply(`I was not able to access your DMs! Please open your DMs or ask another Admin to run the command.`);
        }
      }

I was trying to check if the user allows DMs from servers but this only crashes the bot and doesn't send the message.

#

can someone point out whats wrong?

#

nvm i was able to fix it

grizzled raven
#

@earnest phoenix that try/catch is useless because you dont await the error

#

wait oops nvm

#

im blind

hardy vector
#

does anyone know why this happens when i start my bot after 2 mins it shuts off these are the logs

0|npm  | 2020-06-01 02:31:29.435  INFO 204478 --- [  XNIO-1 task-1] lavalink.server.io.SocketServer          : Connection successfully established from /127.0.0.1:33624
0|npm  | 2020-06-01 02:31:29.438  INFO 204478 --- [  XNIO-1 task-2] lavalink.server.io.SocketServer          : Connection successfully established from /127.0.0.1:33626
0|npm  | 2020-06-01 02:31:44.006  INFO 204478 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketServer          : Connection closed from /127.0.0.1:33626 -- CloseStatus[code=1006, reason=]
0|npm  | 2020-06-01 02:31:44.009  INFO 204478 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketContext         : Shutting down 0 playing players.
0|npm  | 2020-06-01 02:31:44.034  INFO 204478 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketServer          : Connection closed from /127.0.0.1:33624 -- CloseStatus[code=1006, reason=]
0|npm  | 2020-06-01 02:31:44.041  INFO 204478 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketContext         : Shutting down 0 playing players.
0|npm  | 2020-06-01 02:32:25.141  WARN 204478 --- [ager-3-thread-1] c.s.d.l.tools.GarbageCollectionMonitor   : Suspicious GC results for the last 2 minutes: [Bucket 0 = 9] [Bucket 20 = 2] [Bucket 50 = 2] [Bucket 200 = 0] [Bucket 500 = 0] [Bucket 2000 = 0]```
sudden geyser
#

TheNoob wdym by? It doesn't look correct by what you're saying.

copper cradle
#

the dude above clearly has multiple instances of his bot running

merry quartz
#

Anyone work with rewrite .py?

wild mist
#

@hardy vector hey did you know why my lavalink server every 30 mins when i wanna play music,say

#

UnhandledPromiseRejectionWarning: Error: No available websocket connection for selected node.

#

I need to restart the node again

astral remnant
#

Had to do asyncio.sleep for the length of the song + 15 to avoid that already playing error

wild mist
#

Hello @astral remnant did u know how to fix my problem?

astral remnant
#

Sorry :/

#

Nope

#

Anyone work with rewrite .py?
@merry quartz Here!

merry quartz
#

I really need help making a simple pagination embed.

#

Are we allowed to do code for hire type stuff?

#

Cause I'll pay lol.

#

@astral remnant

astral remnant
#

Oh Sorry, going afk-

merry quartz
#

Oh. Aight.

fiery stream
#

Hey

#

anybody here who wanna help a python noob

slender thistle
#

-needdev @merry quartz

gilded plankBOT
#

@merry quartz

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

merry quartz
#

My apologies. I won't do that again.

#

Ty for the info on where I can go tho.

slender thistle
#

There's a built-in paginator you might want to use ๐Ÿ‘€

merry quartz
#

For rewrite .py?

fiery stream
#

        print(ctx)
        ctx._ = functools.partial(ctx, cog="ErrorHandler")
        error = getattr(error, 'original', error)
        etype = type(error)``` thats my code and it generates this error```C:\Users\Jassm\Desktop\Alpha>python main.py
Successfully logged in as Elusive ID: 709877224353955931
<discord.ext.commands.context.Context object at 0x0000024B4609A2E0>
Ignoring exception in on_command_error
Traceback (most recent call last):
  File "C:\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\Jassm\Desktop\Alpha\modules\core\error.py", 
line 19, in on_command_error
    ctx._ = functools.partial(ctx, cog="ErrorHandler")       
TypeError: the first argument must be callable
slender thistle
#

And if it's not what you want, module paginator on pypi suggests a convenient paginator with pages and stuff

merry quartz
#

Are you able to link me to it, please?

slender thistle
#

It's uhh... somewhere in the docs, can't really search for it on phone bahahaha

merry quartz
#

Ah.

slender thistle
merry quartz
#

Ok, there's 13 pages for it.

#

I'll see if I'm able to work with that.

#

Much appreciated.

fiery stream
#

so anybody tryna help me

steel drum
#

w/ what?

fiery stream
#

        print(ctx)
        ctx._ = functools.partial(ctx, cog="ErrorHandler")
        error = getattr(error, 'original', error)
        etype = type(error)``` thats my code and it generates this error```C:\Users\Jassm\Desktop\Alpha>python main.py
Successfully logged in as Elusive ID: 709877224353955931
<discord.ext.commands.context.Context object at 0x0000024B4609A2E0>
Ignoring exception in on_command_error
Traceback (most recent call last):
  File "C:\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\Jassm\Desktop\Alpha\modules\core\error.py", 
line 19, in on_command_error
    ctx._ = functools.partial(ctx, cog="ErrorHandler")       
TypeError: the first argument must be callable
merry quartz
#

Try this:

async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandNotFound):
        await ctx.send('Command does not exist.')```
#

Hopefully that'll work for you.

fiery stream
#

wait what was the problem tho

#

?

#

wait no that wrong

#

i already got that part

merry quartz
#

Oh.

#

My bad.

fiery stream
#
        if isinstance(error, commands.CommandNotFound):
            # Ignore Command Not Found
            return```
merry quartz
#

Then idk how to help with that. Sorry.

#

What I showed is everything I need for a on_command_error type scenario.

#

It just returns an error message.

slender thistle
#

Huh

fiery stream
#

oh

#

im pretty ure functools is causing the error

#

sure

merry quartz
#

Do you have a special way you want to do it? Or do you just want a basic response from your bot when someone sends the wrong command?

fiery stream
#

its kinda special yeah

merry quartz
#

Oh.

fiery stream
#

yeah

merry quartz
#

I am really not good at understanding how to read the docs.

#

It gives you some definitions and such but no examples.

fiery stream
#

yea i suck at reading stuff too

#

i usually mess around by my self

merry quartz
#

I learn better with examples and seeing the code be executed and the results.

#

Then I can see what exactly I'm changing.

fiery stream
#

oh nice

pure lion
#

How do I delete a role from the server :/

(Discord.js)

merry quartz
#

Do you need your bot to delete a role?

pure lion
#

Perhaps

merry quartz
#

Cause you can do it manually.

pure lion
#

HHhHhHH

merry quartz
#

Takes a few seconds to delete a role.

#

Go into your Server Settings > Roles > Select the role name > Scroll to the bottom of permissions area > Delete Role.

#

Unless you actually want to code a command that deletes a role for you?

pure lion
#

Why yes

#

I do

merry quartz
#

Oh. Sorry, I wouldn't be useful for that then. I don't use js.

pure lion
#

Oh that's alright

worn anchor
#

.

#

.

#

.

earnest phoenix
#

Does anybody know how to convert months and years and all into just days and only show the amount of days from
<moment>(...).fromNow()?.....

pale vessel
#

use moment.duration(time).asDays()

#

there's also asMonths(), etc.

#

time can be in milliseconds

earnest phoenix
#

Oh that's good

#

Veey good

pale vessel
#

if you have other than milliseconds, you need to specify the unit (e.g. duration("1", "seconds"))

earnest phoenix
#

Does it work with timestamps?

pale vessel
#

you need to calculate it first

earnest phoenix
#

Oh ok

pale vessel
#

i think there's a method in moment

#

but you can always do now - timestamp

earnest phoenix
#

Yea

forest pond
#

Iโ€™m Excited To Start Working On DiscordGo!

#

Never Mind Iโ€™m Using Discord.Js

#

How Do I Start?

restive pebble
#

chromebook

#

@forest pond

forest pond
#

Itโ€™s Useless My Chromebook Is Useless

restive pebble
#

or chrome OS

#

oh ok

forest pond
#

I Donโ€™t Think I Can Make A Bot

#

Whatever Iโ€™m Still Making It

pale vessel
#

how old are you?

forest pond
#
  1. Why?
pale vessel
#

ah okay, no worries

forest pond
#

Which One Do You Recommend?

pale vessel
#

which what?

forest pond
#

Which File/Page Code

grand dagger
#

Why didnโ€™t u use go

forest pond
#

Js Looks Better

grand dagger
#

bruh

mossy vine
#

Which File/Page Code
@forest pond thats.. not how it works. also please please please learn actual programming before doing bot development

forest pond
#

HoW

mossy vine
#

what how

#

you go on google

#

type "javascript programming pls help me"

#

and learn

forest pond
#

Dude I Donโ€™t Want To Do It

hoary lily
#

Read the discord.js guide if you wanna skip that. But you will encounter multiple errors.

grand dagger
#

LOL

#

Dude I Donโ€™t Want To Do It
@forest pond

forest pond
#

Dude I Canโ€™t Do Discord.Js Learning

pale vessel
#

are you sure you're 13? sorry to say that

forest pond
#

Yes

cinder patio
#

if you can't / don't want to learn then just don't do it

grand dagger
#

are you sure you're 13? sorry to say that
@pale vessel wdym

forest pond
#

Dude Iโ€™ve Been Applying For Too Many Things Now I Have To Wait For 1 Year

grand dagger
#

Applying for what

hoary lily
#

I don't have any backgrounds and knowledge on programming yet I programmed my own bot just by following the guide.

forest pond
#

I Was 12 When I Made My Account My Bday Was May 8th Now I Am 13

dusk cape
#

Hi!

grand dagger
#

Ye just follow some tutorial online till you get a decent grasp on the topic

forest pond
#

Iโ€™ll Do It At 11 PM CST Ugh

sick cloud
#

so i have this code here (nuxt/vue)

        <template v-if="userData !== null">
            <h1>Hey {{ userData.username }}</h1>
        </template>

yet it throws this error:
_vm.userData is undefined
any help?

cinder patio
#

Try with !=

pale vessel
#

how does that fix anything

sick cloud
#

that's genuinely a lol

cinder patio
#

userData is undefined in this case, and you are checking if it's strictly not null, or is that not how vue works?

sick cloud
#

it's set to null

#

in data i set it to { userData: null }

pale vessel
#

have you tried debugging

#

never used vue before but i think that's what i would do

steel heath
#

u can't do v-if's in template tags afaik

#

put it in that h1 or use a div

#

template is where Vue compiler reads data while it's building, it doesn't fetch anything on build just compiles the code

#

@sick cloud bb

tulip ledge
#

How do I remove the last index of an array? I rtried splice(-1,1) but that gives me the last index

#

let craftrole = collection.split(" ").splice(-1,1).join(" ");

pale vessel
#

why not just pop()?

tulip ledge
#

If I'd do .pop() I'll get the last value right?

#

ANd I need to remove the last index

pale vessel
#

it also modifies the array

tulip ledge
#

oh

pale vessel
#
const arr = [1, 2];
arr.pop();
arr; // [1]```
earnest phoenix
astral remnant
#

Problems with aiohttp ร—_ร—

earnest phoenix
#

how can i fix

#

:/

queen folio
earnest phoenix
#

:/

tulip ledge
#

How do I get the a role object based on the name in v12?

earnest phoenix
#

idk

spice smelt
pale vessel
earnest phoenix
#

Does anyone have suggestions on how to send a big package of data from DiscordJS / node to a PHP api?

queen folio
#

maybe because it's discord.com now and the ssl certificate on discordapp.com is no longer valid
@pale vessel I figured it might be something like that...
Possible fixes?

earnest phoenix
#
// on message
    /**
     * Collect profiles
     */

    if (Object.keys(members_cache).length <= 200 && members_cache[msg.author.id] === undefined) {
        members_cache[msg.author.id] = {
            'discord_id': msg.author.id,
            'username': msg.author.username + '#' + msg.author.discriminator,
            'avatar': msg.author.displayAvatarURL,
            'bot': msg.author.bot,
            'guilds': bot.getMutualServers(msg.author.id)
        };
    }
#
// sending the data
setInterval(function() {
    if (Object.keys(members_cache).length > 0) {
        form_settings.qs['request']             = 'insert_members';
        form_settings.form['cache']             = members_cache;
        bot.request(form_settings).then(function(result) {
            var result = JSON.parse(result);
            bot.log(result['response'], form_settings.qs['request']);
        }).catch(function(err) { console.log('API request failed: ' + request_settings.qs['request'] + ' -> ' + err) });
        members_cache = {};
    }
}, 60 * 1000); // 60 * 1000 milsec
#

For some reason my bot reaches 90% CPU after a few hours, even though it should clear the cache after each request sent

#

And it should never go over 200 profiles