#development

1 messages · Page 637 of 1

slender sphinx
pallid zinc
#

Easy

slender sphinx
#

Really sad when this server is better with support than the official Discord.Js server...

pallid zinc
#

channelname

slender sphinx
#

IMO

earnest phoenix
#

Idk, maybe map all users and check val.bot == true?

#

message.<guild>.member.bot

pale marsh
#

Subtract total number of members from number of bot members

earnest phoenix
#

hah

slender sphinx
#

okay ill try it thanks

earnest phoenix
#

Is there anything faster than Node.js out there?

#

But .js

slender sphinx
#

returns as undefined @earnest phoenix

sinful lotus
#

use another lang than js

earnest phoenix
#

I can not

sinful lotus
#

Im sure some other lang will perform better in AI

#

JS is single thread

#

that fact will never change

earnest phoenix
#

Not always

#

bruh

#

im coding an embed maker

#

but its goddamn eyerape

#

I can make it multiple thread if i want to...

sinful lotus
#

yes but thats new process

earnest phoenix
#

No

sinful lotus
#

not js being multithread

earnest phoenix
#

fox.js supports new threads

sinful lotus
#

its javascript

#

Js is not multithread

earnest phoenix
#

fox.js is...

#

Was...

#

So, yeah

#

I agree

sinful lotus
#

Javascript is single thread but its async due to event loop

earnest phoenix
#

Also, i bet some kinds of JS are faster than Python

sinful lotus
#

I suggest reading more about Javascript

earnest phoenix
#

I wrote a runtime....

#

I guess i know enough

sinful lotus
earnest phoenix
#

If you did not notice i am not speaking of Node

sinful lotus
#

thats not node thats js in general

earnest phoenix
#

May i DM you?

sinful lotus
#

try doing

while (true) {
  console.log('1')
}
// this will never run
setTimeout(() => console.log('timeout'), 2000)
earnest phoenix
#

I know...

#

May i DM you?

#

I will explain what i mean

sinful lotus
#

quite busy at the moment, probably you can just ask your inquiry here

earnest phoenix
#

That is not an inquiry, i just meant that fox.js runtime does not use any async stuff

pallid zinc
#

Which lang is fastest

quartz kindle
#

assembly

sinful lotus
#

if you mean by fox.js doing multiple threads thats not true multithread

#

its just your js process doing a new process to execute that code

#

then return the result

earnest phoenix
#

Not it is single thread and not async

#

I know, beacuse i wrote it, please do not try to say something about fox.js unless you really heard of it

quasi forge
quartz kindle
#

link to fox.js?

sinful lotus
#

the fact that its js and you are saying its multithread makes me doubt you

unreal oxide
earnest phoenix
#

Not yet but i may post a Linux executable here

quasi forge
#

Thonk

earnest phoenix
#

Is that okay?

quasi forge
#

@unreal oxide how!???

pallid zinc
#

Which language is fastest

unreal oxide
quartz kindle
#

@pallid zinc assembly

unreal oxide
#

yur the one making it not me

pallid zinc
#

What

quasi forge
#

More like why?

unreal oxide
#

oh

quartz kindle
#

@pallid zinc assembly is the fastest language

unreal oxide
#

ublock breaks it

earnest phoenix
#

but hard

#

@quartz kindle Is Linux executable alright for you?

quartz kindle
#

i would like to see some source code

earnest phoenix
#

How to make a listening go xx users for modmail

earnest phoenix
#

Sure

#

Send it in DM?

pallid zinc
#

It give this result

sinful lotus
#

uhmm offtopic things not in here

quartz kindle
#

An assembly language (or assembler language), often abbreviated asm, is any low-level programming language in which there is a very strong correspondence between the program's statements and the architecture's machine code instructions.Assembly code is converted into executab...

sinful lotus
#

it floods the channel

pallid zinc
#

@quartz kindle

#

Ok

earnest phoenix
#

How to make a listening go xx users for modmail

quartz kindle
#

sure Tin

earnest phoenix
#

Okay

#

@quartz kindle If you did not notice yet, the source code arrived

quartz kindle
#

yes im taking a look

earnest phoenix
#

Okay

#

But i am a bit shy about networking stuff.. because it mostly uses libcurl

late hill
#

can i change the amount of spaces a tab inserts with nano

quartz kindle
#

im not well versed in C, so i cant really judge your code. i can see you're using duktape js engine, looks like an interesting project

mossy vine
#

iirc you just put set tabsize number in your nanorc@late hill

sinful lotus
#

then its not multithreaded

#

js as ducktape means js is still not multithreaded

earnest phoenix
#

Oh, thanks

#

I know...

sinful lotus
#

you should have worded what you said earlier better

earnest phoenix
#

But i preiously used pthreads in it

#

I forgot that i do it no more

#

And i even said i did forget

sinful lotus
#

pthread is more on C languages im afaik as far as I see on google

earnest phoenix
#

Yes... Of course

#

Why should it be anywhere else?

sinful lotus
#

so its not js what is multithreaded

late hill
#

oh

#

ebic

earnest phoenix
#

Sorry, i agree

sinful lotus
#

its fine as long as the misunderstanding is cleared RaphiThumbsUp

earnest phoenix
#

But it was underlying C that was multithreaded, so i think i am partially right but anyways, yeah, no more misunderstading

late hill
#

Do you use internal and external sharding combined saya?

sinful lotus
#

yes

late hill
#

How many servers do you put per shard

sinful lotus
#

3k

late hill
#

oh

heady zinc
#

the only difference between js and multi-threaded languages is that in js you have to implement it yourself blobshrug

late hill
#

Like 3k per process then?

sinful lotus
#

workerthreads is avail on node.js

#

so its practically multithread a bit

#

but the overhead is still there

#

just less

#

not like in langs that is really multithreaded

earnest phoenix
#

Like,what langs are you speaking about?

sinful lotus
#

example Java, C langs

#

you can use js to your ai

#

but you need to use worker threads

earnest phoenix
#

I know but node.js is too slow for it

sinful lotus
#

yeah thats why just spawn worker threads

earnest phoenix
#

So i am usiing fox for it

#

But i am interested how to implement it

sinful lotus
#

are you familiar with workerthreads?

earnest phoenix
#

No

sinful lotus
#

a sec

earnest phoenix
#

Roughly, How faster do they make it?

sinful lotus
#

a lot faster since you can run "separate threads"

#

and they can Unlike child_process or cluster, worker_threads can share memory. They do so by transferring ArrayBuffer instances or sharing SharedArrayBuffer instances.

#

so the overhead is less

earnest phoenix
#

2 or 3 times?

#

Or even more?

sinful lotus
#

depends on how you implement it but thats basically how you can run task in parallel

earnest phoenix
#

Yes.. thanks a lot

sinful lotus
#

and Im sure you know the more workers you have

#

the faster it can be

earnest phoenix
#

im making rock paper scissors code

heady zinc
#

as long as your machine as enough processing power for it*

earnest phoenix
#

but i get typeerror

sinful lotus
#

yes thats a factor as well but since you are making an ai

earnest phoenix
#

But even if it makes it 2 times faster, fox stull overruns it, so i want to be sure it is needed

sinful lotus
#

im sure you may have the beefy server you need

earnest phoenix
#

Yes, also, thanks for the advice

heady zinc
#

it doesn't make it any faster, it just allows you to do it in parallel, how much faster it will be will entirely depend on how well you implement it

earnest phoenix
#

I know, that is why i said roughly

#

But thanks for the explanation

opaque eagle
#

Why doesn't this code work? ```rb
fib = Array[1, 2]
until fib.at(fib.length - 1) < 4e6
fib << calc(fib)
end

fib.delete_if { |n| n % 2 != 0 }
sum = fib.inject(:+)
puts sum

def calc(s)
return s.at(s.length - 1) + s.at(s.length - 2)
end```

#

I'm supposed to get 4613732 but I get 2

#

That's ruby

earnest phoenix
#

it would be nice to know where you're getting it

mossy vine
#

likely at puts

opaque eagle
spring ember
#

is that fibonacci?

#

@opaque eagle

opaque eagle
#

Yeah

spring ember
#

what is that supposed to do?

#

oh I see

#

umm

opaque eagle
spring ember
#

what about fib.sum() @opaque eagle

opaque eagle
#

There's a method like that?

spring ember
#

yep

opaque eagle
#

Wow

#
$ ruby 002/002.rb
002/002.rb:7:in `<main>': undefined method `sum' for [2]:Array (NoMethodError)```
#

ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

#

idk if that's useful or not ^

spring ember
#

your code was supposed to work with the inject

#

.reduce(:+) try this

#

@opaque eagle

earnest phoenix
#

Does anyone need a spam link ML model? I already asked yesterday but got abut no answers due to business

#

And if yes, what features should it use to judge the link?

#
const prefixRegex = new RegExp(`^(<@!?${client.user.id}>|\\${prefix})\\s*`);
  if (!prefixRegex.test(message.content)) return;
  let [, matchedPrefix] = message.content.match(prefixRegex);
``` Is there any code here that makes the entire code not work if prefix is a 2-word character string?
unreal oxide
#

Curious why you needed ML for that MomoHmm

earnest phoenix
#

Because it may make things easier in the futures...

#

When they start using new links

spring ember
#

@earnest phoenix sounds like a natural language processing model if you want to be more accurate

#

but again, it's unnecessary, people are stupid when they spam

earnest phoenix
#

Hmmm... okay

opaque eagle
#

I won’t be home for a couple hours, I’ll try when I get back

peak quail
#

How can I let my bot leave by all servers

#

🤔

warm marsh
#

Force leave all servers?

mossy vine
#

loop through all of the guilds, and make the bot leave it

pale compass
#

CODE: https://hasteb.in/cisaqoka.js

Hey my command actually works but there is still a bug. If there are more than 1 winners, someone can win several times, and I do not want that

turbid gale
#

Just make sure the user object isn't already in the winners array

pale compass
#

How?

turbid gale
#

An if statement

pale compass
#

Yes, but how is it structured?

#

if( whats here) return; ?

sinful lotus
#

Im quite having a hardtime reading that code myself

#

probably indent it properly first

pale compass
#

In Line 43 - 47 the winner is selected but I have to write something that can not be selected 2 times

pallid zinc
#

Can we catch up vote

sinful lotus
#

probably if (winners.includes(peopleReacted[index])) continue

#

thats just a guess cause your code is really hard to read

pale compass
#

Sorry, I'll test

quartz kindle
#

I already told you, you can remove the winner after you add it to the winners array >.>

sinful lotus
#

probably it gets duplicated GWahreeVampySmug

pale compass
#

Tim, splice or filter?

#

and I write this in line 43-47?

sinful lotus
#

you can try the continue method since that also ignores the users when added on winners array

pale compass
#

In which line I should write?

sinful lotus
#

but tbh idk if you will even use the var reactions or something

#

inside the loop ofc

quartz kindle
#

If you wrote the code, it should be easy for you to figure out where to write what

pallid zinc
#

My code not working idk why

#

Err on const youTube = new youtube();

#

Youtube is not define

pale compass
#

why in line 4 YouTube('')

pallid zinc
#

add YouTube there

#

YouTube('youTube')

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sinful lotus
#

the mentioned variable has no haspermission function

#

probably its null

sage bobcat
#

One message removed from a suspended account.

sinful lotus
#

check first if the executor mentioned someone

#

if he did not mention someone return

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sinful lotus
#

just show the code

sage bobcat
#

One message removed from a suspended account.

sinful lotus
#

the users

sage bobcat
#

One message removed from a suspended account.

sinful lotus
#

change it to members.first()

#

not users.first()

#

users is the user object

#

members is where hasPermission exist

sage bobcat
#

One message removed from a suspended account.

reef jacinth
pallid zinc
#

How to leave the voice channel

cursive dagger
#

What lib?

pallid zinc
#

client.guild.voiceChannel.leave()

#

It's not working

#

Node.js

#

Err

copper cradle
#

@PancakeLord#5000 bruh

#

message.guild*

pallid zinc
#

Lol

copper cradle
#

client.guild? yeah which guild and which channel

#

but if you use message.guild.me.voiceChannel.leave()

#

it'll work

pallid zinc
#

Lol

#

I am noob

#

Thank

bleak vortex
#

how can I avoid the message rate limit?

mossy vine
#

you cant

unique nimbus
#

you cant

bleak vortex
#

like putting a timer between each message

mossy vine
#

add a delay

unique nimbus
#

yes

bleak vortex
#

how

warm sail
#

you need to use a token bucket or something similar

bleak vortex
#

what is a token bucket

warm sail
#

Ideally you would use a framework that already takes care of that for you, rather than doing it yourself.

bleak vortex
#

isnt there a method for adding a delay

warm sail
#

sure, but you would probably be slowing yourself down more than you need to with that approach

night imp
#

@pallid zinc you may want to delete that screenshot, you exposed your YouTube api key

slender thistle
#

(As well as reset it)

earnest phoenix
#

Im getting a whole bunch of unhandled promise rejections for connect EMFILE discordapp.com and i dont know what i do thats causing it. I googled the error and its too many open sockets. If i inspect open sockets, my node process has 1000 sockets open to different ports on discordapp.com. I dont manually open any sockets there so it must be discord.js. What am i doing to cause this?

sinful lotus
#

I dont have issues with EMFILE

#

so it means its not with d.js unless you did a mistake like I did before

earnest phoenix
#

I get more of them the more servers add my boto

#

are you using a free hosting with a ping script/autorestart

#

No im on a vps

mossy vine
#

"1000 sockets open to different ports on discordapp.com" that doesnt sound right

earnest phoenix
#

Ye

#

Ik its happening somewhere inside d.js but idk what im doing to cause it

lavish forge
#

inside d.js

earnest phoenix
#

new LibDiscord.Client({disabledEvents:['TYPING_START']});
heres how i declare the client

#

inside d.js as in something im doing is causeing code inside discord.js to open tons of sockets

#

i know its inside discord.js because my code doesnt manually interact with discordapp.com

#

it only does it through discord.js

sinful lotus
#

unless you are doing spoopy things

earnest phoenix
sinful lotus
#

that shoudnt happen

earnest phoenix
#

ik, but what spoopy things are i doing

sinful lotus
#

I pretty think this is more on your code

earnest phoenix
#

what could i do that causes this

sinful lotus
#

loops a lot of them probably

#

or probably some request that you keep on doing

slender thistle
#

login on a loop? mmLol

earnest phoenix
#

could this happen from my .on('message') calling an async function?

sinful lotus
#

yeah I personally own a bot with 200 files

#

but I never had that problem

earnest phoenix
#

mine is only 1 file xd

sinful lotus
#

async is just a wrapper on promise

#

thats not a problem

earnest phoenix
#

ik, but could it mess stuff up if u have one event working with the client and another comes in while its halfway done

#

would that make the socket busy or something then it has to make a new one

#

because i process a whole bunch of events

sinful lotus
#

without a view on your code idk what bad thing you are doing

earnest phoenix
#

would you be willing to take a look?

sinful lotus
#

but

  • badly designed loops
  • not breaking your loops properly
  • nesting listeners and not removing them
  • bad implementation of intervals
sullen yacht
#

Where is the webhook creation section on the website? can't find it

pallid zinc
#

        if (!voiceChannel) return msg.channel.send('I'm sorry but you need to be in a voice channel to play music.');```
#

It's not working

#

The !voiceChannel think

#

No err

west raptor
#

what version of discord.js are you on

pallid zinc
#

Me

#

??

west raptor
#

yes

#

you

pallid zinc
#

11.4.2

west raptor
#

hmm

#

What's not working about it

pallid zinc
#

It not sending any message even if I don't join vc

sinful lotus
pallid zinc
#

Ohh

#

Even if I remove '

#

Between I and m

#

It don't work

west raptor
#

huh odd

late hill
#

Considering that your syntax error didn't throw an error

#

The code probably isn't being executed

sinful lotus
#

yes

pallid zinc
#

It have been

west raptor
#

but a console.log('a') under const voiceChannel = ...

pallid zinc
#

It work nice if I join vc

west raptor
#

: )

#

you are joining the channel before checking if it's valid

pallid zinc
#

Lol

earnest phoenix
#

Hey guys, I wanted to add some sort of tracking to my bot to see how many times it is called, any ideas on how I could go about it?

mossy vine
#

every time a command is ran, increment a value in cache or in a database if you want to track it in the long term

warm flame
#

this thats what i do for bot to track usage

mossy vine
#

^ thats what i dont do

earnest phoenix
#

A database might be a good idea

warm flame
#

see for me its just a counter that counts up after each reboot with simple stats like commands processed, messages received and stuff like that

earnest phoenix
#

If a person creates a new Discord API lib, how do they register it or what should they do?

pallid zinc
#

How could I track if someone upvote my bot??

stone plaza
#

what charity do you all support

slender thistle
#

Wrong channel

stone plaza
#

sorry

opaque eagle
#

That's unnecessary

#

Those two codeblocks are the same. You don't have to make it an arrow function.js const log = s => console.log(s);``````js const log = console.log;

mossy vine
#

its just an example

#

i want to know what theyre called in general

opaque eagle
#

Heck, you can even do this: js const { log } = console;

#

oh

#

my bad

mossy vine
#

or console['log'](s) if youre feeling wild :p

opaque eagle
#

Rofl

mossy vine
#

anyways, gonna repost for visibility

#

in js what do you call a function thats defined like this in general instead of "arrow function"

const log = s => console.log(s)```
late hill
#

function literal?

amber fractal
#

Lambda function?

#

Anonymous function?

#

Has a lot of names

earnest phoenix
#

Anyone willing to help find the problem in some code it uses quick.db

#

Dm me

peak quail
#
const Discord = require("discord.js");
const botconfig = require("../config.json");
const { insperct } = require("utill");
const ownerid = "484857307369439233";
module.exports.run = async (bot, message, args) => {
    if (message.author.id == ownerid) {
        let toEval = args.Join(" ");
        let evaluated = utill.insperct(eval(toEval, { depth: 0 }));
        try {
            if (toEval) {
                let hrStart = process.hrTime();
                let hrDiff;
                hrDiff = process.hrTime(hrStart);
                return message.channel.send(`*Executed in ${hrDiff[0] > 0 ? `${hrDiff[0]}s` : ''}${hrDiff[1] / 1000000}ms.*\`\`\`javaskript\n${evaluated}\n\`\`\``, { maxLength: 1900 });
            } else {
                message.reply("Error: kann nicht ohne args was machen....").then(m => m.delete(5000));
            }
        } catch (e) {
            message.channel.send(`Error whilst evaluating: \`${e.message}\``);
        }
    } else {
        return message.reply("Diesen command kann nur der Owner benutzen").then(M => m.delete(100000));
    }
};```
#

rror: Cannot find module 'utill'

#

?...

idle basalt
#

util not utill

peak quail
#

oh

#

i had over 20 typos ....

icy matrix
#

how to define .tag?

Channel.send(`${member.user.tag} joined using invite code ${invite.code} .`)
TypeError: Cannot read property 'tag' of undefined
peak quail
#

_ _

idle basalt
#

yea you have quite a few typos

#

member.user is undefined

#

that happens because member is probably the wrong value

icy matrix
idle basalt
#

show surrounding code

icy matrix
#

can be replaced member to client and it will work ?

idle basalt
#

yes but it will always show your bots tag

icy matrix
#

deam

#

...

idle basalt
#

client.user is your bot lol

icy matrix
#

i forgot xD

idle basalt
#

show the surrounding code

icy matrix
#

on priv

earnest phoenix
#

i need some help tring to figure out how to make a hello/goodbye in embed for js

idle basalt
#

why not here? dw nobody is stealing or judging

icy matrix
#

as you wish

idle basalt
#

if its a huge block, use hastebin

icy matrix
#

nah i do somethink like inviter menager

idle basalt
#

...? just show me how you defined member

icy matrix
#
const channelID = 'someID :P'
const invites = {}
const wait = require('util').promisify(setTimeout)

client.on('ready', () => {
  wait(1000)
  client.guilds.forEach((g) => {
    g.fetchInvites().then(guildInvites => {
      invites[g.id] = guildInvites
    })
  })
})

client.on('guildMemberAdd', member => {
  member.guild.fetchInvites().then(guildInvites => {
    const ei = invites[member.guild.id]
    invites[member.guild.id] = guildInvites
    const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses)
    const inviter = client.users.get(invite.inviter.id)
    const logChannel = member.guild.channels.get(channelID)
    logChannel.send(`${member.user.tag} joined using invite code ${invite.code} from ${inviter.tag}. Invite was used ${invite.uses} times since its creation.`)
  })
})
#

all work just this .tag not

idle basalt
#

hmm that should work

icy matrix
#

but not working bc still is TypeError: Cannot read property 'tag' of undefined

idle basalt
#

ohhh maybe its inviter.tag

slender thistle
#

Is it really member.user

idle basalt
#

members and users are different so yes

#

inviter is an uncached user

icy matrix
#
const inviter = client.users.get(invite.inviter.id)
#

what i miss here

idle basalt
#

just use invite.inviter.tag

icy matrix
#

so not .id ?

idle basalt
#

invite.inviter is already a user

#

you dont need to search for them with client.users.get()

#

if invite.inviter is defined then you can just that to get the tag

icy matrix
#

const inviter = client.users.get(invite.inviter.tag)
and then just ${inviter} ?

idle basalt
#

...no

#

${invite.inviter.tag}

icy matrix
#

hmm

#

i will try

idle basalt
#

this will work unless the invite doesnt have an inviter (which isnt a guaranteed property according to the docs)

icy matrix
#

nah

#

it have same error

earnest phoenix
#

what are you using?

#

vsc or atom?

idle basalt
#

lol

earnest phoenix
#

no your program

icy matrix
#

notepad++ xD

earnest phoenix
#

k

idle basalt
#

console.log(invite)

earnest phoenix
#

vsc and atom Sublime Text better than all

#

invite.url

icy matrix
earnest phoenix
icy matrix
#

@idle basalt so how to make it working ?

idle basalt
#

i have to go, but im sure someone else can help you. if theres nobody here you can try the d.js server

#

sorry i couldnt finish

icy matrix
earnest phoenix
#

@icy matrix what did you need

icy matrix
#

look up

#

i create simple invite menager

#

but

#

.tag not working

#

all without it works

#

so idk

earnest phoenix
#

@icy matrix normal

icy matrix
earnest phoenix
#

try message.guild.members.get

icy matrix
#

why message ?

solar lark
#

the guild where the message has been sent

#

you don't want any random guild

earnest phoenix
#

or predefine the guild and dont use message

slender thistle
#

Isn't it guildmemberadd event

solar lark
#

oh

#

so <member>.guild.members.get

earnest phoenix
#

nah

#

let guild = message.guild

solar lark
#

theres no message object

earnest phoenix
#

oh

earnest phoenix
#

stop links

#

@icy matrix member.guild.members.get

#

edited

#

Can someone help me with discord.js quick.db?

opaque eagle
#

What's quick.db

earnest phoenix
#

a database

amber fractal
#

I would guess it's like enmap

opaque eagle
#

Yeah I looked it up lol

#

It's pretty much like keyv or enmap

#

Except it's bad cuz it doesn't have a strong community behind it

earnest phoenix
#

Do you know how to use it tho?

opaque eagle
#

No why would I use that stuff rofl

potent wagon
#

Can anyone explain how to make a unban command in discord.py please?

earnest phoenix
#

@potent wagon I don’t use py but I found this.

potent wagon
#

Lemme check

earnest phoenix
#

Hu?

opaque eagle
potent wagon
#

I think I know how to do it

opaque eagle
#

Cool

peak quail
#

    let prefix = "M!"
    let messageArray = message.content.split(" ")
    let cmd = messageArray[0];
    let args = messageArray.slice(1);```
#

let messageArray = message.content.split(" ")
^

ReferenceError: message is not defined

slim heart
#

show your message event

peak quail
#

D-;

slim heart
#

?

peak quail
#

bot.on("message", async message => {
    if(message.author.bot || message.channel.type === "dm") return;
})

    let prefix = "M!"
    let messageArray = message.content.split(" ")
    let cmd = messageArray[0];
    let args = messageArray.slice(1);


    let commandfile = bot.commands.get(cmd.slice(prefix.length)) || bot.aliases.get(prefix-length)
        if(commandfile) commandfile.run(bot,message,args)```
earnest phoenix
#

missing ;

slim heart
#

you closed your message event

earnest phoenix
#

after split

slim heart
#

@earnest phoenix js doesnt care

peak quail
#

oh

slim heart
#

@peak quail

peak quail
#

pull.config.aliases.setImmediate(aliases, pull.config.name)
^

ReferenceError: aliases is not defined

#


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

    if(err) console.log("konnte keinen ordner mit dem namen commands finden")
            console.log(err)
    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0) {
        return console.log("KONNTE KEINE COMMANDS FINDEN |")
    }
    jsfile.forEach((f, i) => {
        let pull = require(`./commands/${f}`);
        bot.commands.set(pull.config.name,pull);
        pull.config.aliases.setImmediate(aliases, pull.config.name)
    });
});```
slim heart
#

well its pretty self explanatory

#

you didnt define aliases

lyric hawk
#

Hey, could someone explain me what's wrong with this line? ^^

mod_chan = yield from discord.utils.get(message.guild.text_channels, id=mod_channel_id)
TypeError: 'TextChannel' object is not iterable
earnest phoenix
#

wtf

lyric hawk
#

Just installed rewrite branch

#

Works on async

earnest phoenix
#

@peak quail aliases is not defined

slim heart
#

i already said that -_-

earnest phoenix
#

You need to define it

#

@slim heart ablobrage

lyric hawk
#

Why does it throw this error wtf

#

I followed the doc

earnest phoenix
#

@lyric hawk wath is discord utils

lyric hawk
#

Maybe it's not a coroutine

#

Lemme try

slim heart
#

log .text_channels

#

it should already be a list

lyric hawk
#

Oh yeah figured it out

#

Should have removed the yield from

#

discord.utils is not a corountine

slim heart
#

👌

lyric hawk
slim heart
#

can tell u rn he just doesnt know discord.py and thought it was something else but 👀

earnest phoenix
#

Anyone know quick.db and discord.js There is some type of error in my code but I cant find it.

slim heart
#

error message?

earnest phoenix
#

no

#

The command just dont work.

#

Like it should.

#

Pretty much half of use know Discord.js and if you still need help with quick.db ask

#

Me

#

Although it is pretty simple...

#

Can you just look at the code and see if you see anything wrong?

#

Sure

#

Hello, I would like to retrieve a server ID through the guildDelete event, more generally, I would like to simply retrieve a server ID before the server disappears, would you know how to do that? (Discordjs as library)

slim heart
#

it supplies you a guild in the event

#

which has the .id prop

earnest phoenix
#

What do you mean, can you develop?

opaque eagle
#

lol wdym

slim heart
#

if you dont know what youre doing then you need to figure it out yourself

#

thats all you should need to know and if it isnt you need some time to yourself to actually learn the lib

mossy vine
#

The guildDelete event gives you the deleted guild object which has an id. I highly doubt the event fires before the guild is actually gone though

slim heart
#

djs still has it in its collection, it deletes it after the fact

#

you just wont be able to make any api calls about it

earnest phoenix
#

the api only sends the id in the payload anyways, not like you can do much with that

grim aspen
#

i've been trying to figure this out all day (discord.js) <https://glitch.com/edit/#!/hickory-yarn?path=server.js:60:3>, <https://discordapp.com/channels/264445053596991498/265156322012561408/590351781725339684>, i'm using glitch since i can't remember my github login nor is hastebin working properly

earnest phoenix
#

< > your urls if you can so they don't clog up the chat btw

grim aspen
#

my bad

slim heart
#

whatre you trying to do

#

im lost

cinder tendon
#

let me give an explanation

#

since last night we we're trying to make the bot recognize both our ids since we're it's developers

slim heart
cinder tendon
#

problem is that whenever I tried to work with )eval2 it would send the evaled message and the return message at the same time

late hill
#

that code

earnest phoenix
#

So how can I get around my problem with guildDelete?

slim heart
#

we told you

late hill
#

is literally 2 message listeners with extremely similar code

earnest phoenix
#

Well

slim heart
#

and if you dont understand learn yourself

#

because we arent here to baby you through every simple thing

cinder tendon
#

who me or him?

#

or both

slim heart
#

on your eval command being called, do if(![id1, id2].includes(message.author.id)) return message.reply(ur deny message)

late hill
#

why if (evaled.includes(client.token))

grim aspen
#

if it includes client.token, it will literally send the bot's token

late hill
#

If you think you'll actually accidently eval client.token

#

Just don't even create an eval command then lol

earnest phoenix
#

fun fact

slim heart
#

smh

earnest phoenix
#

you can manipulate strings

late hill
#

^^

slim heart
#

^ lol

late hill
#

If a random user gets access to your eval command, that check is useless.

slim heart
#

you should just, make sure they dont have access lmfao

cinder tendon
#

Jesus Christ we can't explain ourselves correctly without it being worse

earnest phoenix
#

libraries that directly expose the token in a prop are dumb, change my mind

slim heart
#

then how would you send api calls smh

#

you needa store it somewhere

earnest phoenix
#

private property

#

private or internal

grim aspen
#

that's for later on

earnest phoenix
#

the token's been inputed already and is known, there's no reason to keep it exposed in a public prop

slim heart
#

and infact i actually use client.token often for making raw requests myself smfh

grim aspen
#

you know what i give up for now

#

thanks for trying to help

slim heart
#

i told u exactly how to do it so easily but ok

cinder tendon
#

ok

late hill
#

Literally just remove the second message listener and change one line of code in the first one

cinder tendon
#

I will try what you said

late hill
cinder tendon
#

we both have access to the same code in a private call

earnest phoenix
#

imagine not using gh

grim aspen
#

which we don't use

earnest phoenix
#

that's

late hill
#

Also just from the looks of it

earnest phoenix
#

the point of what i just said

#

but ok

late hill
#

If you're using one message listener for each command atm

#

Please change that

#

There's no reason for that

earnest phoenix
#

also i love people who run debug builds in prod

cinder tendon
#

ok

#

I've figured it out

#

thanks

rugged kelp
#

How ?

mossy vine
#

Make the field inline

#

Did you try.. Idk... Reading the documentation maybe?

rugged kelp
#

Yup

#

Thanks : )

uneven pond
#

setTimeout(function() {
const kanal = client.channels.get('590346893398245377')
kanal.send('Her gün 18:00'da: Günlük eventler ve Her Cumartesi 20:00'da Dev event!')
}, ms(1080000));

Error: 'send' undefined

opaque eagle
#
  1. That's definitely not what the error said word-for-word... don't try dumb down the message next time.
  2. Make sure that channel exists.
amber fractal
#

It most likely said Cannot read property send of undefined

#

Cutting an error helps no one

dawn patio
#

@uneven pond

uneven pond
#

Error for setTimeout(function() {

#

function = async

pale glen
#

What

graceful cipher
#

а э руские

#

???

warm flame
opaque eagle
#

Basically the code is trying to find the largest palindrome number that can be formed by multiplying two three-digit numbers.

#

Interesting observation: both the go code and the ruby code output palindromes... that imo means I'm not stopping code execution when I should, since the result decreases with each iteration (the counter counts down: x -= 1 y -= 1)

shy turret
#

how do you .toLowerCase

opaque eagle
#

What's ur question @shy turret

shy turret
#

I'm trying to make my command non-cap sensitive

#

but I'm failing

opaque eagle
#

Yeah, so call .toLowerCase() on the command when resolving it

#

Show code

shy turret
#

nvm, someone just gave me code lol

opaque eagle
#

Ok now can someone help me with my question above plsssss

#

im dumb

inner jewel
#

while x > 0
    x -= 1
    while y > 0
        y -= 1
        p = x * y
        a = isP(p) && p > a ? p : a
    end
end```
#

you decrement them before running the loop's code

#

move the -= 1 to the end of their blocks

#
for A; B; C {
    D
}```is equivalent to```go
A
while B {
    D
    C
}```
pallid zinc
#
if(!voiceChannel){message.channel.send('i am not in a voice channel')
}else{
message.guild.me.voiceChannel.leave
.then(() message.channel.send( 'successfully disconnected')}```
#

it's only sending I am not in a voice channel

slim heart
#

what is voiceChannel

balmy lantern
#

hey, i need some help with finding a channel type?

sinful lotus
#

get the channel then look on .type property

balmy lantern
#

ik this is wrong but

#

        if(member.guild.channels.find("name", "join")== null)return; else {
          if(member.guild.channels.type == 0```
languid dragon
#

why ur code look like that

#

learn to indent your code properly and you wont have so many issues lmao

balmy lantern
#

cuz a tab changes the code

languid dragon
#

then make it not do that thinkW

sinful lotus
#

learn to use eslint as well

#

problem on your indents solved

#
  • it helps you avoid bad practices
languid dragon
#
if (!member.guild.channels.find(...)) return;
// no need for else
balmy lantern
#

the indent doesnt change the code is what im saying

#

okay

languid dragon
#

it literally does

#

it makes your code clean, so you can actually read and understand why it's not working

balmy lantern
#

Oook

pallid zinc
#

Jpb voiceChannel is defined as mesage.member.voiceChannel.join()

languid dragon
#

how are you defining it

pallid zinc
#

var voiceChannel = mesage.member.voiceChannel

languid dragon
#

can you take a screenshot of all the code lmao

pallid zinc
#

Why

#

It's very big

languid dragon
#

i just mean the code where voiceChannel is used

pallid zinc
#

Ok

#

U mehanat leave command

#

Mean*

languid dragon
#

i wouldn't have a clue dude

languid dragon
#

that's still not enough

#

are you coding on a mobile device?

pallid zinc
#

Nope

#

My pc burn

#

That way I am on mobile

languid dragon
#

so you are on a mobile device coding

pallid zinc
#

U can say

languid dragon
#

its a yes or no, it wasn't a trick question

pallid zinc
#

I still have a potato one

#

Yes I use mobile

#

??

balmy lantern
#

I think their mirroring the pc to a tablet

languid dragon
#

then dont do that

pallid zinc
#

Let me send ss from my potato pc

#

Wait

languid dragon
#

because that's only going to make doing anything absolute hell and constantly asking here for help when you're only making it harder for yourself is wasting peoples time

#

]]useful_js_debugging

covert turtleBOT
pallid zinc
#

you want ss or writren code

languid dragon
#

I want you to read what i sent and click the link and also read that

pallid zinc
#

done

languid dragon
#

you did not read it

pallid zinc
#

done

#

but why u send me that?

languid dragon
#

click the links and learn how to debug

pallid zinc
#

ok

languid dragon
#

literally half of all the messages you've sent in the server were in this channel

#

surely you could try and learn for yourself instead of relying on others to constantly fix your code

#

if you have a problem and it keeps happening, google it or learn how to not have that error to begin with

pallid zinc
#

ok

queen bone
#

i have a question ...
I want my bot to start recording my voice whenever i speak in that channel and then convert that into .wav file.
How can i do this ? any help is greatly appreciated.

split lantern
#

Bots dont ofically support receiving Audio

unique nimbus
#

Make it record incoming sound idk how tho

queen bone
#

@split lantern but there is a bot that does that idk how

split lantern
#

There is an git issue on dapi for voice receiving

mossy vine
queen bone
#

its complex men
is there any example code ?

mossy vine
#

no men, read docs

#

discord.js documentation is the best ive ever read

#

hello

#

nothing really, but lets keep this channel related to development

earnest phoenix
#

I saw there is is an other option for library, does that mean i can use a custom one or not?

mossy vine
#

yes

#

its also what you would use if you made your bot with something like dbm or dbd

earnest phoenix
#

Okay, thanks for the answer

#

Not directly related but may libCURL and libwebsockets interfere?

peak quail
#

client.login(botconfig.token);
^

SyntaxError: Unexpected end of input

#

wtf why ....

earnest phoenix
#

Hello, someone knows why my bot can't get user id properly? Seems like it usually gets with no errors, but sometimes the result is just "null"

late hill
#

If that code is reachable from a DM

#

message.member won't exist

earnest phoenix
#

nope, it gets id only from servers, also I noticed it returns null when some user sends a message on my server

#

member isn't in cache, aka you need to request a download of all members

#

or you can request to get a specific user, dunno how in other libraries though

#

oh it worked thanks

#

Not related but what do i do if all the media on Discord has error 502

#

In the client

#

And it states that Bad Gateway is me

#

5xx is a server side error, you can't do anything about it

#

the cdn just had a stroke

prime cliff
#

Yea can confirm image proxy is being a derp right now

earnest phoenix
#

Oh, okay, thanks, i knew it is server side but it explicitly stated that it was my problem, thanks for the explanation

trail sedge
#

Does anyone know any ip pullers

mossy vine
#

mate are you serious

#

we tell you whats wrong about them, and then you literally ask in the same server but a different channel

earnest phoenix
#

Heya, if i am making an API which requires some data, should i rather use the data section or headers for getting it?

#

The amount of it may vary but not much usually

sinful lotus
#

query string if you want

earnest phoenix
#

Hmm, thanks, do you mean query parameters? I am still a newbie with this

sinful lotus
#

are you familiar with query string?

earnest phoenix
#

Oh, sorry that was just my misunderstanding

opaque eagle
#

Like /search?q=hellothere

sinful lotus
#

yes

#

then put the token on headers

earnest phoenix
#

Yeah, thanks, understood, it's just that my English is not that good

sand crown
#

How do you get a guild"splash"(background) for your server?

#

HTML is not supported.

earnest phoenix
#

@sand crown .png

alpine heath
#

/help

#

bruh

earnest phoenix
#

@alpine heath how old are you

sand crown
#

What do you mean...

#

Just a png file?

split lantern
#

Yea

earnest phoenix
#

@sand crown the splash background need to be a image

alpine heath
#

don't waste my time, idfc

hushed berry
#

lmfao

sand crown
#

how do I upload it as a ".png" file to discord? Doesn't it get converted to a jpg?

grim aspen
#

ok, someone's being toxic

split lantern
#

Just take a normal Image

earnest phoenix
#

no

#

Yes

split lantern
#

jpeg jpg or png

earnest phoenix
#

or apng

sand crown
#

I still don't get how I put it on the site

#

when the html is not supported

split lantern
#

You need to get your Server to 25 boost

earnest phoenix
#

2 boost

#

Not 50

sand crown
#

OH

#

so it get's the background from the server?

#

via the bot?

earnest phoenix
#

you can define it in the server settings

sand crown
#

that's cool

#

thanks

earnest phoenix
#

1920x1080

#

The dimension

real helm
#

Hello 😃

#

Who used npm fortnite?

#

I need help, and nobody help me. I asked to the creator, but he says ask to another person

earnest phoenix
#

It seems a pretty simple one, what is your problem?

scarlet bane
#

why on earth would the creator ask you to ask someone else...

heady zinc
#

why would he waste time trying to explain how it works to someone who obviously has no idea of what they're doing

grim aspen
#

i'd ask the same question as raid

#

he's not a good creator if he says that

real helm
#

ins't good creator

#
fortnite.user('username', 'platform [pc, xbl, psn]').then(console.log);
fortnite.store().then(console.log);
fortnite.challenges().then(console.log);
#

This insformation are in the npm information

earnest phoenix
#

i mean it's pretty straight forward

#

tells you how to use it

real helm
#

No, if you put it in the code, don't do anything xD

#

Do you need a lot of things to do it

quartz kindle
#

What code did you put in?

earnest phoenix
#

and your token is valid?

#

and you haven't spent all of your api calls?

real helm
#

All is valid

#

all works

#

but, i don't know how to do more things

quartz kindle
#

What things?

real helm
#

the code

#

xD

quartz kindle
#

What do you want to do?

real helm
#

I need more information of npm fortnite

earnest phoenix
#

what else do you need

quartz kindle
#

Look at its source code then

real helm
#

It don't have

earnest phoenix
#

provide context, you keep saying the same thing over and over again but rephrased

real helm
#

and the creator block me xD

earnest phoenix
#

the package is on github but ok

real helm
#

yes

#

okay, thanks

#

😃

quartz kindle
#

Did you get an api key from fortnitetracker?

earnest phoenix
#

Bot is sent link this.

#

And don't ping.

#

How can I help?

pale marsh
#

Because maybe it doesn't have permission to use @ everyone?

earnest phoenix
#

it have.

#
KefToday at 3:07 PM
Because maybe it doesn't have permission to use @ everyone?```

it would still appear as a mention, just it wouldn't ping
#

bot have admin perms

#

i presume you're using d.js; there's a setting in the client to disable everyone, set it to false

#

do you just need to mention everyone or do you actually have to access the role

#

Nvm, I fix it.

pallid zinc
#

It always say sorry, please input a valid calculation

quartz kindle
#

Put console.log(e) in your catch

#

It will tell you the error

amber fractal
#

math.eval probably uses a specific syntax aswell as what tim said

pallid zinc
#

Eval have renamed to evoluate

#

In 6v

#

That way err

#

But still

#

It say undefined symbol math

mossy vine
#

args.slice(1).join(' ')

pallid zinc
#

Ok

warm marsh
#

const mathEmbed = new Discord.RichEmbed()

earnest phoenix
#

hmm, i have still the same error, happens very rarely and bot can read a lot of user ids

mossy vine
#

@earnest phoenix it returns a Member object which doesnt have an id. to get the id you need to use wUser.user.id

heady zinc
#

im fairly sure member objects do have IDs

warm marsh
mossy vine
#

when i tried it like 2 days ago it didnt work with that

warm marsh
opaque eagle
#

Im tryna find the smallest positive number that's divisible by all of the numbers from 1 to 20```rb
#!/usr/bin/env ruby
def evenlyDivisible(n)
(1..20).each do |a|
if n % a != 0
return false
end
end
return true
end

i = 1
until evenlyDivisible(i)
i += 1
end

puts i```

#

The code just runs infinitely

earnest phoenix
#

hmm ok, so I changed to wUser.user.id, seems like it didn't read only few members, weird

west spoke
#

I get a similar error in py when running for 30+ hours without a code restart

#

Though if it gets spammy I just remove the warning error completely

slender thistle
#

message.server is None if message was sent in DMs.

warm marsh
#

Yeah, Add something to check type.

opaque eagle
#

:(

warm marsh
#

Idk any ruby so cant help you eslint.

opaque eagle
#

Nvm I'm dumb, I realized ruby has some cool shit by default: rb #!/usr/bin/env ruby puts (11..20).reduce(1, :lcm)

#

Although would that be considered cheating?

#

Others r taking some elaborate ways to get there

amber fractal
#

Wtf is cheating in programming

opaque eagle
#

Idk that seems too easy

amber fractal
#

There's just multiple ways to take care of a problem

opaque eagle
#

Those who chose JavaScript for these challenges r suffering

west spoke
#

@slender thistle it checks for messages with symbols, then checks server

#

So it's very unlikely there are 10 "!" in one of my bot's dm(s)

#

I saw that

slender thistle
#

Checking for msg.server works just fine

slender thistle
#

Doesn't matter

worthy pine
#

hi

mossy vine
#

i love how that screenshot doesnt show neither the error or the code itself

mossy vine
#

there is no such thing as messageEmbed, and its not even a constructor

#
const mathembed = new Discord.RichEmbed()```
pallid zinc
#

I show this in a video

#

And that work

earnest phoenix
#

Because he define messageEmbed

#

But its Discord.RichEmbed()

mossy vine
#

just because you copy paste a small bit of code you see in a fucking video doesnt mean it will work

earnest phoenix
#

Or he using a old version of discord

pallid zinc
#

Now it give err at const mathembed = new discord.richEmbed()

earnest phoenix
#

Discord

#

RichEmbed

mossy vine
#

you cant even copy and paste properly omg

pallid zinc
#

I defined discord

#

Why I write discord

#

??

earnest phoenix
#

Just copy past this new Discord.RichEmbed()

#

Caps is important

quartz kindle
#

He said he defined discord with a small d

mossy vine
#

RichEmbed would still have to be written like that

pallid zinc
#

Lol

#

I spell send weong

#

Wrong

opaque eagle
#

Why don't u get home first and code on ur computer

#

That would make the biggest difference on ur code rn

mossy vine
#

and using a proper code editor

pallid zinc
#

It was coded on pc only

quartz kindle
#

Because its year 2035, computers do not exist anymore, people only have phones /s (sorry for shitpost)

opaque eagle
#

Go home first and log onto ur computer... code there on an IDE like vscode, atom, webstorm, sublime, vim, etc

azure rain
woeful glacier
#

Hi, I have an question... Can I get the ID of a server before leaving it, in the "guildDelete" event?

Library: "DiscordJS"

earnest phoenix
#

vscode, atom, sublime and vim are not IDEs by the way

mossy vine
#

not before leaving it, as the event is emitted after the guild is already "deleted"

woeful glacier
#

Okay, thank you for the fast answer @mossy vine =}

mossy vine
#

i dont know if this would be a general discord api question or a discord.js question, but what even is a guild integration and why does d.js emit an event for it when the Guild object it passes doesnt even have any integrations-related property according to the documentation

opaque eagle
#

ik i wrote webstorm and vim first that's why I said ide

#

then i added in the rest with the edit

#

but i forgot to change "IDE"

earnest phoenix
mossy vine
#

oh, that

#

but why is there an event for it if the Guild object has no properties related to that

quasi forge
#

I made slight changes to https://www.goodanime.tk if anyone is willing, could you please let me know if there is some way I can improve this even further?

earnest phoenix
#

cyber, i've got no idea. d.js attempts to map the entire api regradless if it's for bot use or not, i guess they missed that

#

probably because integrations are rarely used

mossy vine
#

likely

earnest phoenix
#

@quasi forge the font is not casually readable

quasi forge
#

It's not supposed to be lol.

earnest phoenix
#

it isn't user friendly, which is bad if it's supposed to be a service

quasi forge
#

could you give examples of where the font was not readable enough

#

I was recommended this font by others

#

@earnest phoenix

earnest phoenix
#

everywhere imo

#

it's the kind of font you'd use to toy around, not use it on an actual website

#

i'd recommend using roboto/open sans/ubuntu instead

earnest phoenix
#

Error: 401 Unauthorized help pls

slender thistle
#

Invalid token

earnest phoenix
#

dbl token or bot?

slender thistle
#

DBL one if you are getting that error when sending a request to DBL

earnest phoenix
#

but token true

#

:/

#

How i can change my bot prefix in "dany" lib py

slender thistle
#

Try to reset it and use the new one

#

Dany? Do you mean R. Danny?

earnest phoenix
#

same

#

@slender thistle
Nah

#

://

slender thistle
#

Do your want your prefix to be "dany"?

earnest phoenix
#

Yea

slender thistle
#

Are you using discord.Client or Commands.Bot?

#

If you're even using d.py

earnest phoenix
#

Commands.Bot

#

i have problem with the bot can i put screenshot ?

west spoke
#

Sure

earnest phoenix
slender thistle
#

Right. You can set your prefix to "dany" by putting command_prefix kwarg in its parameters

west spoke
#

Is that yours

earnest phoenix
#

It's your bot? @earnest phoenix

west spoke
#

@earnest phoenix

earnest phoenix
#

no

#

Ok??

west spoke
#

Go to their supper server

earnest phoenix
#

^

west spoke
#

Suppoer

#

Ff

#

Support

#

I cant english

slender thistle
#

So, what's the problem? If it is not related to development, we should move to #general

west spoke
#

Not while listening to animu

urban lark
#

Why Koya is offline on my server

slender thistle
#

Ask in its support server

loud salmon
#

not our problem @urban lark

earnest phoenix
#

ok ok ty

urban lark
#

Useless

west spoke
#

We cant help with it

loud salmon
#

noU

earnest phoenix
#

@urban lark ask to Koyamie

slender thistle
#

They left anyway

loud salmon
west spoke
earnest phoenix
#

same error :/

#

What error

#

@earnest phoenix

#

I reseted but not working dbl token

#

401 Unauthorized

#

Invalid token

#

But true!

#

True token but not working

#

So i need to type "command_prefix kwarg"?

#

yes

slender thistle
#

Not literally

earnest phoenix
#

oh py

#

Nice "this page don't exist"