#development

1 messages · Page 892 of 1

summer torrent
#

coding on mobile is so bad idea

languid heart
#

Why?

earnest phoenix
#

good idea for me because my computer isnt work properly

summer torrent
#

small screen and keyboard

earnest phoenix
#

not matter for me

languid heart
#

Ooo

#

But how i do that

mossy vine
#

shit keyboard and no access to proper developer tools which will bite you in the ass as a beginner

languid heart
#

Please

#

I have a good app for that

earnest phoenix
#

nope

languid heart
#

His name is termux

mossy vine
earnest phoenix
#

whateverr

#

nothing beats a real computer MoyaiCool

languid heart
#

Yes but i works on mobile

#

I use a tablet

earnest phoenix
#

yes it beats süper computer

languid heart
#

Ik

#

But i dont have computer

mossy vine
languid heart
#

Mhhhhhhhh

#

Stop sending me that

#

I read it

mossy vine
#

you dont seem to understand it tho

earnest phoenix
#

didnt i need to help

languid heart
#

please

  • dont code on mobile
  • learn the language you want to use
  • LEARN THE BASICS OF HOW BOTS WORK
    @mossy vine i read this
#

Ik computer is better but mobile works

earnest phoenix
#

didnt i need to help can you stop saying taht

mossy vine
#

what language are you using

#

@woven sundial literally scroll up like 20 messages

languid heart
#

@woven sundial i want to put mod commands to my bot

#

I use termux to code

earnest phoenix
#

i need to learn what lang you are using

#

what lang

languid heart
#

English

mossy vine
#

aight this lad is helpless

#

im out

#

figure this out urself

summer torrent
#

where is your bot's files?

earnest phoenix
#

what proggaimg lang

languid heart
#

I can send u my code on termux

mossy vine
#

THEY LITERALLY DONT KNOW WHAT PROGRAMMING LANGUAGE THEY WANT TO USE AND YALL ARE ASKING FOR GH AND FILES LMAOOO

earnest phoenix
#

can you stop @mossy vine

mossy vine
#

sorry for trying to give actual helpful advice omegalul

earnest phoenix
#

STOP @mossy vine pls

mossy vine
#

and starting with bot development on a phone with an ssh app is not the way to start

earnest phoenix
#

at least do research before starting kek

summer torrent
#

calm down

languid heart
#

Ok can u help me i copy the start my bot on mybot guide and put my token and my commands

#

And it works

#

But i dont know how to put mod commands

summer torrent
mossy vine
#

you put mod commands by learning the fucking language and library you are using

languid heart
#

@woven sundial i cant i dont have any

earnest phoenix
#

oof didnt i need to help

languid heart
#

For me works only say me how

earnest phoenix
#

what is your bots proggaming lang

mossy vine
#

oh god this is only getting worse

languid heart
#

Idk whats that

#

what is your bots proggaming lang
@earnest phoenix whats that?

earnest phoenix
#

no

summer torrent
#

@languid heart which language do you use for coding

mossy vine
#

agreed but not for fucking phone development

earnest phoenix
#

True

#

They do? Cool

mossy vine
#

does anyone here actually want to give helpful advice 🙃

#

if by mobile friendly you mean fucked up ui yes

earnest phoenix
#

in here everyone and my keyboard hettin worse

languid heart
#

My lang is english

summer torrent
#

I mean programming language

earnest phoenix
#

@languid heart what programming language

#

i am asking proggramin lang not your lang

mossy vine
#

im not saying that, im saying to take a big fucking step back and learn the basics

summer torrent
#

Javascript, Python etc.

earnest phoenix
#

yes

languid heart
#

Say language not lang and is english

oak imp
#

JavaScript, just saying 😏

mossy vine
#

THEY DONT KNOWW HAT A PROGRAMMING LANGUAGE IS HOW ARE YOU GOING TO ASK

earnest phoenix
#

^

summer torrent
#

@mossy vine calm down

languid heart
#

Ok i am new at this so help me

earnest phoenix
#

are you using dbscript

languid heart
#

Termux with node

mossy vine
#

ok here is help
take a huge step back
learn programming
learn a language
PROPERLY
then make a bot

#

and DONT COPY PASTE CODE, you wont learn anything from it

earnest phoenix
#

can you send photo of your code

languid heart
#

Ok

modest maple
#

outdated

mossy vine
#

outdated and only teaches how to ctrl c ctrl v

#

oh sorry not even that cuz they are on mobile omegalul

oak imp
#

@woven sundial lmao, that's where I started, yeeaarrsss ago aha

earnest phoenix
#

can you send photo of code @languid heart

pale vessel
#

i started by copying the docs example and learn from there lol

earnest phoenix
#

2012 gang trying to make minecraft plugins with the horrendous bukkit api

languid heart
#

There ya go

earnest phoenix
#

javascript

pale vessel
#

events

#

oh my gid

#

Ebhd

#

Dmnxjdd

#

sorry

languid heart
#

Ok

pale vessel
#

what the fuck are you doing

mossy vine
#

see this is why you actually learn programming

#

this is the result

earnest phoenix
#

javascript you are using

summer torrent
#

^^

languid heart
#

Ok

mossy vine
#

anyone wanna suggest more great ideas that will result in this but 10x worse?

pale vessel
#

no

languid heart
#

Javascript ok hoe i put mod commands

summer torrent
#

🤦‍♂️

mossy vine
#

and u wanna guess what that is

#

🎉 thats right its shitty code 🎉

#

wtf

#

no

pale vessel
#

no it's not

earnest phoenix
#

big ooooooooooooooofffffff

mossy vine
#

learning bad concepts and continuing with them is not helpful in any way what the fuck are you saying

pale vessel
#

he literally created an event for every command

languid heart
#

Emmmmmmmmm how i put mod commands

pale vessel
#

no

#

you do not

mossy vine
#

oh ye cutting a finger off every time you cut tomatoes is ok cuz after doing it for years and having -7213648128 fingers you will learn :)

summer torrent
#

@languid heart you need to first learn basics of javascript. Copy&Paste is so so bad idea

pale vessel
#

learn English first because the docs is in English

languid heart
#

Ok

summer torrent
#

and stop saying "how i put mod commands" please

earnest phoenix
#

we need to help not argue

languid heart
#

I can talk on english

pale vessel
#

well your code says different

earnest phoenix
#

you're really bullying this man lol

#

@languid heart my advice is try to understand code i dont say dont copy paste try to understand copy pasted code

mossy vine
#

hey here is a better advice

#

dont copy paste

pale vessel
#

my advice is to refer the library docs before asking anything rarted

lucid pasture
#

yo does anyone know how to make your bot connect to voice and play an audio file?

pale vessel
#

docs

#

god damn it

mossy vine
#

what lib

lucid pasture
#

the docs dont show that great of description...

earnest phoenix
#

in which lib

pale vessel
#

they do though

lucid pasture
#

mabie to you, but for starter programmers they arent that great

mossy vine
#

just answer

#

what library

lucid pasture
#

uhh like audio library i guess?

earnest phoenix
#

oh god

pale vessel
#

yeah i would give up

summer torrent
#

discord library

mossy vine
lucid pasture
#

js

#

srry

pale vessel
#

what js

summer torrent
#

discord.js ?

summer torrent
#

or eris

lucid pasture
#

discord.js

mossy vine
pale vessel
#

the docs basically explained everything

mossy vine
#

and its actually good documentation

summer torrent
lucid pasture
#

ill try these, if they dont work ill try something else

mossy vine
#

eh that page is not very good

#

d.js topic voice is great

summer torrent
#

@lucid pasture what is your discord.js version

sudden geyser
fervent goblet
#

I still haven't decided to go to discord.js v12

pale vessel
#

you should

#

it's good

earnest phoenix
#

you shouldn't go into voice without even knowing fundamentals of the programming language you're working with lol

fervent goblet
#

Yeah its just im lazy to rewrite

pale vessel
#

you'll have to anyway

fervent goblet
#

Eventually

#

Yeah

pale vessel
#

yeah

fervent goblet
#

You probably right

pale vessel
#

so why not now? :)

earnest phoenix
#

i wonder when they'll kill gateway v6

fervent goblet
#

Yeah will get on that

earnest phoenix
#

v7 is basically v6 with more words in the error messages and nothing else lol

pale vessel
#

probably because the changes with intents and stuff

quartz kindle
#

why isnt v7 even documented anywhere

#

yet every single library uses v7

#

they should at least mention it in the docs since everyone is using it anyway

mossy vine
#

wait what v7 is a thing wtf

#

should i switch to it

#

or can i like not get support for it

earnest phoenix
#

How do I remove an embed from a message using JDA? I have a message (from the bot) that has a message and an embed, and I want to edit the message and remove the embed.

quartz kindle
#

you can switch to v7 whenever you want

mossy vine
#

is there a list of changes anywhere

quartz kindle
#

no

#

afaik

mossy vine
#

any dev i can bully with questions about it mmLol

quartz kindle
#

as cry said it should be exactly the same thing

#

just better error messages

mossy vine
#

arent intents also required

quartz kindle
#

all libraries are using it, so it wont be anything new anyway

#

they are not required

#

discord.js has been using v7 for years afaik

mossy vine
#

well i mean i can read js so i could just steal the code no? mmLol

quartz kindle
#

thats what im doing

mossy vine
#

for light?

quartz kindle
#

for my next lib

#

light uses djs

mossy vine
#

is it open sauce yet

amber fractal
#

tim's lib?

pale vessel
#

did tim give up on light

quartz kindle
#

not yet, its in early alpha, working on websocket compression and shit

#

light its mostly finished, ill keep maintaining it while djs v12 runs its course

mossy vine
#

ok but is ur own lib open sauce yet

#

i need some code to steal for mine

quartz kindle
#

maybe add support for more of djs's features if needed

#

not yet

#

you can steal from djs and eris tho

mossy vine
#

i know, ive been stealing way too much from eris

#

but i cant find a non-bloated voice implementation anywhere :(

quartz kindle
#

my next lib wont be worth stealing anyway

#

its actually a replacement for stealing from other libs

mossy vine
#

oh boy

quartz kindle
#

so instead of stealing, you can just use it directly and build on top of it

pale vessel
#

is it a light lib?

amber fractal
#

I need to learn websockets lol

quartz kindle
#

im aiming to fill a nieche market that i havent seen on npm yet

#

a core rest/websocket manager with 0 caching and 0 managing

mossy vine
#

thats what i wanted to do with mine but then i was like "lmao no fuck this" and i want to make it like serenity where you can completely customize what features you use

quartz kindle
#

for people to build their own libs on top of it

mossy vine
#

ye thats pretty easy

#

and pretty fucking cool

quartz kindle
#

i also found a way to use zlib without zlib-sync

mossy vine
#

wtf

#

share

quartz kindle
#

will when i put it on github

mossy vine
#

ye but you can tell me how you implemented that mmLol

quartz kindle
#

i stole from a package called minizlib

#

its a weird ass way to do it tho

#

but it works lmao

#

i still need to benchmark it, but performance should be close to zlib-sync

#

maybe a tiny bit slower, dont know yet

low bolt
#

Hey guys, why I'm getting map error?

winners.map

+ CODE:
const winners = await client.roll(giveaway.ServerID, giveaway.ChannelID, giveaway.MessageID, giveaway.WinnerCount)
const formattedwinners = winners.map(w => `<@${w.id}>`).join(', ');

+ ROLL FUNCTION:
  client.roll = async (serverid, channelid, messageid, winner) => {
    const server = client.guilds.get(serverid);
    const channel = server.channels.get(channelid);
    const msg = channel.fetchMessage(messageid).then(message => {
      const reaction = message.reactions.find(r => r.emoji.name === "🎉");
      if (!reaction) return new Discord.Collection();
      //map hatası var la burayı elleme
      let users = message.reactions.get('🎉').users
        .filter(u => u.bot === true)
        .filter(u => u.id !== message.author.id)
        .filter(u => server.members.get(u.id))
        .random(winner || "1")
        .filter(u => u);
      return users;
    })
  }```
quartz kindle
#

show error

low bolt
#
    at C:\Users\sedat\Desktop\Projeler\GiveawaySystem\modules\functions.js:98:40
(node:6464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 72)```
#

Here.

amber fractal
#

winners is undefined

low bolt
#

@amber fractal

#

Can you help me for getting users' reactions

timid blade
#

I am trying to use chrome devtools for debugging my bot (node.js) and i cannot get it to work properly. i am at chrome://inspect, and i added the hostname and port to the network targets, but it isnt seeing my node process. i can go to the port in browser and it will say "websockets request was expected", but the devtools doesnt seem to see it. anyone have experience with this?

quartz kindle
#

i did it with an ssh tunnel

timid blade
#

i temporarily have the port open so that i can test before adding authentication, but i cant get it to work at all

quartz kindle
#

but i found it much better and easier to use something else

timid blade
#

im running with node . --inspect=0.0.0.0:9229 and i have my.domain:9229 as the target discovery thing in chrome

quartz kindle
#

ssh tunneling is easier and safer than any auth

#

but what i do is to simply run a test version of my bot in nwjs, and use the dev tools there

timid blade
#

i am unable to run my bot locally without a whole bunch of work, so accesing it remotely is the only feasable option

sudden geyser
#

@low bolt return msg.

#

You aren't returning anything.

timid blade
#

idc whether i end up using ssh tunneling or something else for auth, rn im trying to figure out how to connect at all

quartz kindle
#

try ssh tunneling, its easier to set up

lime jewel
#

Is there an avaibility to get the avatarURL of an User by ID if User and bot doesn't Share a Guild?

quartz kindle
#

you create a tunnel connection to your host via ssh, then you connect to it the same way as if it were in localhost

sudden geyser
#

LP you'd need to fetch the user by ID.

timid blade
#

can i use the chrome devtools ui through that? or is it all CLI

quartz kindle
#

it will also get autodiscovered in dev tools

sudden geyser
#

aka users.fetch on the client users manager/collection.

lime jewel
#

Ok I'll try

quartz kindle
#

once you setup the ssh tunnel, the dev tools will autodiscover it as if it were in localhost

amber fractal
#

@lime jewel yes you can fetch any user if you have their id and get their avatar hash

timid blade
#

ok

amber fractal
#

oh your question was answered lol

timid blade
#

ok ive never used ssh tunnel before, is this right? cuz i still dont see the process
ssh -L 9221:localhost:9229 user@my.domain -i my_key

#

ah it showed up finally, nvm

#

thanks tim

still merlin
#

my bot is being a fool and wont turn on. (Moderators don't delete my screenshot I'll regen my token art software is broken)

#

ive waited ages and my bot wont turn on

summer torrent
#

where is client.login()?

still merlin
#

oops-

quartz kindle
#

lmfao

earnest phoenix
turbid bough
#

you could just copy the text 👀

earnest phoenix
#

My bot had wrong prefix the whole time

turbid bough
#

also, its funny to see the token variable being grayed

#

signing that its not even being used

sudden geyser
#

it's also fun to see a private token become public

#

change your token!!!!

nimble escarp
#

anyone who has a more elegant TS solution? 😅

handleCommand = (message: Discord.Message): void => {
        if (message.guild?.id === this.config.DISCORD.GUILD_ID) {
            if (message.channel.type === "text") {
                if (message.content.startsWith(this.config.DISCORD.CMD_PREFIX)) {
                    let cmd = message.content.substr(
                        this.config.DISCORD.CMD_PREFIX.length,
                    );

                    if (cmd.indexOf(" ") !== -1) {
                        cmd = cmd.split(" ")[0];
                    }

                    if ((commands as never)[cmd]) {
                        const cmds: Command[] = (commands as unknown) as Command[];
                        cmds[cmd](message, this.config);
                    }
                }
            }
        }
    };
turbid bough
#

dont nest if's

#

use if() return

sudden geyser
#

or just use if (condition && condition2 && condition3) {...}

nimble escarp
#

Well, I'm talking more about this part.

if ((commands as never)[cmd]) {
    const cmds: Command[] = (commands as unknown) as Command[];
    cmds[cmd](message, this.config);
}
sudden geyser
#

but that'll become messy if you have a lot

nimble escarp
#

I'm loading commands from separate files and I don't like the idea of casting them as never and unknown to satisfy typescript
EDIT: and then invoking them.

#
import * as commands from "./commands";
#
/* src/modules/CommandHandler/commands/index.ts */
export * from "./embed";
export * from "./rank";
export * from "./leaderboards";
#
const embed = async (
    message: Discord.Message,
    config?: Config,
): Promise<void> => {};

export { embed }
#

I lost so much time trying to come up with something more elegant pepeShrugCry

#

Also, the last time I tried using less ifs it ended up like this 😅

return uA.level > uB.level
            ? -1
            : uB.level > uA.level
            ? 1
            : uA.level === uB.level
            ? uA.xp > uB.xp
                ? -1
                : uB.xp > uA.xp
                ? 1
                : 0
            : 0;
topaz fjord
#

I'm reading a file and storing the contents in a variable. Should I make that variable public so that any file can read/write to it or should I make it read only and add helper functions for it

mossy vine
#

that depends on how the rest of your project is structured ig

topaz fjord
#

most functions depend on that config file

mossy vine
#

then i guess helper functions would be good

topaz fjord
#

this is going to be comment hell

nimble escarp
#

any suggestions on a command handler? MonjiroPray

turbid bough
#

@nimble escarp lol, never said use less if's, just make the if's structured.

mossy vine
#

lol just make 10k well structured if statements instead of an efficient structure

twin marsh
#

How can I get my bot to delete messages if the messages are older than 7 hours, regardless if the bot restarts?

earnest phoenix
#

in which library

twin marsh
#

discord.js

earnest phoenix
#

wait

#

you want to delete all messages older than 7 hours?

finite bough
twin marsh
#

In a certain channel only

pale vessel
#

you shouldn't do that

earnest phoenix
#

it's possible, but it can take over a day to complete depending on how many messages there are

#

you'll constantly get ratelimited

#

and possibly api banned for api spam

twin marsh
#

It's a channel where I have been deleting messages older than 48 hours

earnest phoenix
#

why not just delete and recreate the channel

twin marsh
#

so that wouldn't be a big deal to implement for that channel, right? but how

finite bough
#

how many msgs will the bot delete?

#

more than 100?

twin marsh
#

There is just 8 messages or something now

#

But we're getting tired removing them constantly

finite bough
#

so like

#

there ain't that many messages right?

twin marsh
#

Nope
Yeah

earnest phoenix
nimble escarp
#

I'd do something like "if the last message is older than eight hours then delete the channel and recreate it" pepeshrug

finite bough
#

u can store the time when u want to delete the msg

#

and then execute the message.delete at that time

nimble escarp
#

It would keep the channel clean once activity goes down.

finite bough
#

so if u save the time it will delete it regardless if the bot gets reseted

pale vessel
#

or make an interval, fetch the messages and filter them by time and delete them

twin marsh
#

ok

turbid bough
#

@nimble escarp ```js
if(uA.level == uB.level) return uA.xp > uB.xp;
if(uA.level > uB.level) return -1;
if(uB.level < uA.level) return 1;
return 0;

#

looks much better than this mess

return uA.level > uB.level
            ? -1
            : uB.level > uA.level
            ? 1
            : uA.level === uB.level
            ? uA.xp > uB.xp
                ? -1
                : uB.xp > uA.xp
                ? 1
                : 0
            : 0;```
#

oh wait, im missing one xp part

nimble escarp
#

I agree. I scrapped that code some time ago though.
This wouldn't work tho

#

since uA.xp > uB.xp needs to return either -1 or 1
false doesn't resolve to -1

turbid bough
#

yes, but false was meant to go to 0

nimble escarp
#

0 shouldn't really happen though

turbid bough
#

ik, but i read wrong

#

that code is a mess i cant read it

nimble escarp
#

True

#

It's basically for the sort function.

#

I was sorting people by their level and xp.

turbid bough
#

ok that make it much more readable

nimble escarp
#

I used the shorthand operator basically for fun afterwards.

#

It was never supposed to be production code.

modest maple
#

bubble sorts exist

turbid bough
#

i made it even smaller

#
if(uA.level == uB.level){
    if(uA.xp == uB.xp) return 0;
    if(uA.xp > uB.xp) return -1;
    else return 1;
}
if(uA.level > uB.level) return -1;
else return 1;```
nimble escarp
turbid bough
#

nvm, here is the smaller one

#
if(uA.level == uB.level){
    if(uA.xp == uB.xp) return 0;
    return uA.xp > uB.xp ? -1 : 1;
}
return uA.level > uB.level ? -1 : 1;```
nimble escarp
#

it'd need to be switched around (-1 and 1s) but it looks good

turbid bough
#

ah right yea.

#

also cause there is no need to double check if their ex/level is higher or lower. if you check if they are the same or not first

#

so the if(uB.level > uA.level) would replaced with just an else if you move the last non-nested if function to the top

main laurel
#

Guys i have to catch DiscordApi Missing Permission Error in discord.js how can i do that?

earnest phoenix
#

by catching

main laurel
#

@earnest phoenix yes but in this case i have to use a lot of try catch statements

earnest phoenix
#

why

#

just place your entire closure inside of a try catch

#

boom problem solved

main laurel
#

:d

earnest phoenix
#

that is if you're using async/await

#

if you're doing promise pattern then there's no way to make it pretty, use async/await

main laurel
#

I'm not sure, but I've heard that large try catch statements aren't working right?

nimble escarp
#

Why wouldn't they work?

main laurel
#

I don't know i only see this in site

earnest phoenix
#

try catch is expensive on memory so instead of putting a band aid on it, a proper solution would be to check if you have the sufficient perms to execute the action before actually executing it

main laurel
#

thanks guys

valid gyro
#

hey im looking for some node help

pale vessel
#

don't ask to ask

nimble escarp
#

-ask2ask

pale vessel
#

mods only oof

valid gyro
#

my bot runs off an api, and i wanted to know if anyone could help me make my bot filter spaces into dashes so that users dont have to query with dashes

quartz kindle
#

our asian friend is back to being an asian again?

valid gyro
#

code is there

nimble escarp
#

Someone removed my nickname yesterday pepeshrug

quartz kindle
#

lmao

topaz fjord
#

@quartz kindle amazing spelling

#

"asian"

valid gyro
#

?

#

thats the correct spelling...

topaz fjord
#

is it tho

pale vessel
#

okay vsauce

topaz fjord
#

I temporarily gained autism

slender thistle
quartz kindle
#

@valid gyro wdym filter spaces into dashes?

topaz fjord
#

don't bully

pale vessel
#

replace them maybe

valid gyro
#

the bot takes te args and plugs them into a url

#

but people have to put dashes

pale vessel
#

so you want to replace spaces with dashes?

valid gyro
#

yeah

#

ive tried using a delim

#

and that didnt work to great

quartz kindle
valid gyro
#

yeah

pale vessel
#

you can just join the args with -

quartz kindle
#

so split the message on spaces and join them by dashes?

valid gyro
quartz kindle
#

.split(" ").join("-")

valid gyro
#

k one sec ill try that

pale vessel
#

you can also use regex for whitespace characters

quartz kindle
#

you may need to remove the initial command from it: .split(" ").slice(1).join("-")

#

depending on how your command works

pale vessel
#

so .split(/\s+/)

nimble escarp
#

Now I'm curious as to why not use .replace.
That would be the best course of action if he already had arguments split from the command.

quartz kindle
#

replace is also an option yes

#

there is no specific reason to go with one over another, it just depends on how much control over it you want, and what you want to accomplish

#

there's a million ways to manipulate strings

valid gyro
#

join throws an unterminated string constant

quartz kindle
#

wat

valid gyro
#

oh fuck

#

i had an extra "

nimble escarp
#

Well, I'd personally create a copy instead of mutating first.

#

like .split(" ").map().join("-")

quartz kindle
#

split creates a copy already

#

it doesnt change the string

valid gyro
#

ok so my code looks like this now

#

const args = msg.content.split(" ").slice(prefix.length).join("-");
const command = args.shift().toLowerCase();

#

and with the new join im getting args shift is not a function

quartz kindle
#

slice prefix length should be first

#

before splitting

valid gyro
#

o

quartz kindle
#

else you will remove as many args as your prefix length

nimble escarp
#

I'm doing it like this personally

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
earnest phoenix
#

same here

quartz kindle
#

but if you're not using the command itself in the query, you can skip that part

#

and do .split().slice(1) instead, to remove the entire first word, prefix included

valid gyro
#

that time i got msg.slice is not a function, let me try some things and see if i can fix it

turbid bough
#

try catch is expensive on memory so instead of putting a band aid on it, a proper solution would be to check if you have the sufficient perms to execute the action before actually executing it
@earnest phoenix i did a permission check once, and somehow it still managed to execute it and discord gave me a 403 error

#

and its cause i didnt check for channel overrides

#

but to check for channel overrides, you would need to check for your role

#

oh, nvm found it

barren pumice
#

Hello, I'm looking for a free hosting for my bot, do you have any suggestions ?

valid gyro
iron steeple
#

Heroku or glitch

nimble escarp
#

The best I can think of is the free tier for Heroku.

valid gyro
#

heroku will only run for 5 mins im pretty sure

#

is the issue

nimble escarp
#

30 mins + you get limited monthly hours

iron steeple
#

I used to use it and it worked fine as long as it’s optimised

#

I had mine running for around 25 days before it shut off

nimble escarp
#

Personal accounts are given a base of 550 free dyno hours each month. In addition to these base hours, accounts which verify with a credit card will receive an additional 450 hours added to the monthly free dyno quota. This means you can receive a total of 1000 free dyno hours per month, if you verify your account with a credit card.

#

1000 hours is around 40 days

valid gyro
#

const args = msg.content.slice(prefix.length).split(/\s+/);
const command = args.shift().toLowerCase();

#

this seems to split my args with a ,

nimble escarp
#

This splits the args into an array, you can join them afterwards.

valid gyro
#

o

nimble escarp
#

args.join("-")

barren pumice
#

Thanks for your suggestions ^^

valid gyro
#

still gives me commas

#

i think that needs to happen before it joins them with commas is the ting @nimble escarp

nimble escarp
#

That code doesn't really join them with commas though.

valid gyro
#

I read somewhere that node does it by default

#

o wait

#

no, its still sending an array

#

when its sends an array it seperates with,

nimble escarp
#

You have to join it while you're sending it.

quartz kindle
#

it joins with commas if you dont join it yourself

valid gyro
#

i have a constant set up that joins it

quartz kindle
#

comma is the default join when you convert it to a string

nimble escarp
#

Show us the code.

valid gyro
#

const badargs = msg.content.slice(prefix.length).split(/\s+/);
const args = badargs.join("-")

#

const command = args.shift().toLowerCase();

earnest phoenix
#

what

quartz kindle
#

shift is an array method, toLowerCase is a string method

#

youre mixing things up

valid gyro
#

so shift needs to go first?

quartz kindle
#

use toLowerCase before splitting or after joining. use shift after splitting and before joining

nimble escarp
#

.shift() returns the first element in the array

#

while removing it from the original array

valid gyro
#

ooooooohhh

nimble escarp
#

@valid gyro

const badargs = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
const args = badargs.join("-"); 
#

Oh you probably shouldn't mutate the args, my bad.

barren pumice
#

@valid gyro is Glitch up 24h/7 for a small app ? 😮

valid gyro
#

with some extra scripts and uptime robot yes

#

cause glitch is designed for websites

#

so it will fall asleeo unless you html ping it every 5 mins

#

damn still getting commas even after shifting things around

nimble escarp
#

Show us how you use the args constant

#

Any relevant code.

valid gyro
#

oops

#

one sec

#

request(
http://www.dnd5eapi.co/api/spells/${args},
{ json: true },

quartz kindle
#

show the rest of the code

valid gyro
#

although rn i just have it set up to send the args constant as a message for testing

#

all of the code

#

at least the current version that im tinkering with

#

its a little messy

nimble escarp
#
const badargs = msg.content.slice(prefix.length).split(/ +/);
- const command = args.shift().toLowerCase();
+ const command = badargs.shift().toLowerCase();
const args = badargs.join("-");
valid gyro
#

o jeez

#

how did i miss that lmo

quartz kindle
#

your code should be throwing an error, not showing args with commas

valid gyro
#

it would throw an error, but i disable the api commands with // and replaced it with a command that sends the args constant to discord

quartz kindle
#

yeah but it should throw args is not defined

#

right at the beginning

valid gyro
#

args is defined tho

#

const argd

nimble escarp
#

it wasn't

valid gyro
#

o

#

idk

nimble escarp
#

it was defined after being used

quartz kindle
#

i mean before you made the changes ovxr showed you

valid gyro
#

o, yeah idk then

nimble escarp
#
  const badargs = message.content.slice(prefix.length).split(/ +/);
  const command = args.shift().toLowerCase();
  const args = badargs.join("-");

this is from your code, here on L2 args is being used before it's been defined

quartz kindle
#

anyways it should work now

valid gyro
#

maybe glitch was doing something funky

#

yeah it works now]

#

thanks so much for your guys help!!

nimble escarp
#

You're welcome!

gloomy imp
#

Ok so, is it possible to pass a bot a link to a message and have it retrieve the message object?

quartz kindle
#

if the message is accessible yes

#

i have a bot that does exactly this (its his entire purpose lol)

gloomy imp
#

:O

#

How?

quartz kindle
#

you need to process the IDs from the link

#

the guild id, the channel id and the message id

earnest phoenix
#

my bot throws back a sentence 2 times

gloomy imp
#

oho

#

And what function do I need to use those with

quartz kindle
#

check if your bot is in the guild (guilds.get or guild.cache.get)

#

check if your bot can see the channel (guild.channels.get or guild.channels.cache.get)

#

then try fetching the message (channel.messages.fetch)

gloomy imp
#

aha

quartz kindle
#

assuming you're using discord.js

gloomy imp
#

oof

#

no

quartz kindle
#

ah then idk the functions

gloomy imp
#

hmm

quartz kindle
#

but its simple

#

get the guild, get the channel, fetch the message

gloomy imp
#

aight, guess I'll dig through the api for that for nw :9

turbid bough
#

or if nobody is able to get trough it

valid gyro
#

how would i change my bots status in node? client.user.setActivity isnt working, im thinking maybe i put it on the wrong line, if so what is the intended line

earnest phoenix
#

show us da code GWossuKannaSip

#

aight then, guess not

dull terrace
#

If someone are already use the Shards in Discord.py mention me please x)

amber fractal
#

you're returning in a .then

summer torrent
#

resolve promise

amber fractal
#

your function doesn't actually have a return value

summer torrent
#

^

amber fractal
#

I would await the fetchMessage instead of using .then

valid gyro
#

ok woah, anyone else just get a random lagspike on their bot

low bolt
#

@summer torrent can you look dm?

valid gyro
#

not just a lag spike anymore, didnt even mod the code, and now im getting no response at all

sudden geyser
sly fjord
#

Just curious, is there anything wrong with sharding a bot under 1,000 discord servers?

summer torrent
#

yeah

quartz kindle
#

there is nothing wrong

#

it just might not be ideal for performance reasons

#

but definitely nothing wrong

sly fjord
#

Yeah, that's what I was thinking. I saw it wasn't recommended, just wondering why. I added it, but commented it out until then. Thank you

lucid pasture
#

yo, does anyone know a fix for the voiceChannel/textChannel lines, cause it keeps saying channel is undefined

turbid bough
#

what code?

lucid pasture
#

js

#

but nvm im gonna use a different thing

#

yo does anyone know how to make your bot actually play audio instead of joining and having a green ring but no audio

prime cliff
#

channel is undefined

#

You should probably debug your code then and look at the d.js docs on how to connect properly

earnest phoenix
#

Hi guys

lucid pasture
#

kk

earnest phoenix
#

anyone know what FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory error means??

lucid pasture
#

to much storage taken up mabie??? idk

lyric mountain
#

Lol oom

#

First time I see that in js

#

Try to optimize your var/const/let usage

#

And have only one listener for each type

prime cliff
#

Dang you running your bot on a toaster

lucid pasture
#

lol

#

@prime cliff now its saying that server.dispatcher.on the on is undefined, anything i should use as a fix?

prime cliff
#

on is undefined

lucid pasture
#

ye

prime cliff
#

server.dispatcher.on is not a valid function

lucid pasture
#

oh it isnt?

#

😳 oof

prime cliff
#

Also what is server? a guild object?

lucid pasture
#

the server is a variable and yea a guild object

prime cliff
earnest phoenix
#

Also Here's part where error appeared ```js

function timer(arguments, receivedMessage){
var cnt = 0
arguments.forEach((value) => {
while(1 == 1) {
delay(1000);
cnt = cnt + 1}
if (arguments == "start") {

    timer = parseFloat(value)
    receivedMessage.channel.send(":clock8:Timer Started for"+timer+ " minutes:clock8:")
    
}
if (cnt == value) {
    receivedMessage.channel.send("Beep beep beep timer for "+ timer+"has ended!")
}
 })

}```

#

delay is a lib

lucid pasture
#

@prime cliff can i dm you and show you the code that i have?

prime cliff
#

You could just post the code here

lucid pasture
#

kk how do i put it in a box

prime cliff
#

```js
Code here
```

lucid pasture
#
bot.on('message' , msg=>{
    
    let args = msg.content.substring(PREFIX.length).split(" ");

    switch (args[0]) {
        case 'play':

            function play(connection, msg){
                var server = servers[msg.guild.id];

                server.dispatcher = connection.play(ytdl(server.queue[0], {filter: 'audioonly'}))
                server.queue.shift();
                server.dispacher.on("end", function(){
                    if(server.queue[0]){
                        play(connection, msg);
                    }else {
                        connection.disconnect();
                    }
                });
            }
            if(!args[1]){
                msg.channel.send("You need to provide a music link!");
                return;
            }

            if(!msg.member.voice.channel){
                msg.channel.send("Please join a channel and try again!");
                return;
            }
             
            if(!servers[msg.guild.id]) servers[msg.guild.id] = {
                queue: []
            }

            var server = servers[msg.guild.id];
            server.queue.push(args[1]);


            if(!msg.guild.voiceConnection) msg.member.voice.channel.join().then(function(connection){
                play(connection, msg);
            })



            break;
    }

})
#

its a mess

prime cliff
#

At least you have some kind of prefix and command checking though

lucid pasture
#

lol

prime cliff
#

And switch statement

earnest phoenix
#

😔 I guess not

#

bye😔

valid gyro
#

I cant access projects on glitch

earnest phoenix
#

guys please help
What does FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory error mean?
Also Here's part where error appeared ```js
function timer(arguments, receivedMessage){
var cnt = 0
arguments.forEach((value) => {
while(1 == 1) {
delay(1000);
cnt = cnt + 1}
if (arguments == "start") {

    timer = parseFloat(value)
    receivedMessage.channel.send(":clock8:Timer Started for"+timer+ " minutes:clock8:")
    
}
if (cnt == value) {
    receivedMessage.channel.send("Beep beep beep timer for "+ timer+"has ended!")
}
 })

}```

delay is a lib

valid gyro
#

and my bot is spamming people whenever they message

#

but i cant shut it off

prime cliff
earnest phoenix
#

ok thx

lucid pasture
#

@prime cliff do you have any tips for the code im writing

prime cliff
#

Not sure what ytdl lib you are using

lucid pasture
#

opusscript

prime cliff
#

You need to use the correct one for your lib version also you are not awaiting them?

lucid pasture
#

i dont think so

lavish fern
#

Hello, i was wondering if someone could help me

lucid pasture
#

with what

lavish fern
#

anyone know of a bot that can log time from when someone says !onduty till !offduty then have it outputed to a say Google doc for a log?

lucid pasture
#

you programming, or you looking for one?

#

cause i could find a way to implement it to my bot if you cant find one

lavish fern
#

Im looking for one

#

ive been looking for an hour or sooo but nothing came close

#

What kind of coding is it java> or C++

lucid pasture
#

i could put it in my bot, and then just have accsess to the doc and record the time there

lavish fern
#

that would be cool

lucid pasture
#

ok dm me and lets set something up

white shadow
remote yacht
#
playBack = `${passedTimeFormatted}  ${playBack}  ${totalDurationFormatted}`;
```my passedTimeFormatted and totalDurationFormatted comes as `[object Promise]`
lavish fern
#

sorry im rust when it comes to coding i havent done it in 6 years

remote yacht
#
const passedTimeFormatted = formatDuration(
                passedTimeInMSObj
            );

            const totalDurationObj = video.duration;
            const totalDurationFormatted = formatDuration(
                totalDurationObj
            );```
earnest phoenix
#

yeah sorry @white shadow my fault pandasad

cedar nova
#

i use discord js 11.3.x

earnest phoenix
#

Hi

#

Hi

#

@prime cliff I did do that

#

I guess you are here because of your latest problem with the max heap size

#

Your javascript sandbox is just out of ram to use

#

so it panicked and yeeted himself

#

i dont personally know how to let nodejs access more memory but there are docs online ig

#

How can I change the widget style
Because I want to put this: &style=for-the-badge

#

Pls, I want help with that

grizzled raven
#

how do i send back a message attachment as an attachment

earnest phoenix
#

you read out message.attachments and send them back, reformatted

grizzled raven
#

no you cant

#

thats the thing

#

is there a way

#

ok see

#

apparently attachments only support buffer resolvables or streams,

#

and all message attachments return are strings and width/height

earnest phoenix
#

you can send attachments as urls too

#

.send({attachments: [url1,url2...]})

#

i think

#

dont bully me if its not working

grizzled raven
earnest phoenix
#

@grizzled raven

grizzled raven
#

huh

earnest phoenix
grizzled raven
#

i was just there lol

#

i guess i didnt read the exampl

#

e

earnest phoenix
#

E

grizzled raven
#

oh okay that works thanks

#

sucks that embeds are below message attachments but

#

sigh

elder oasis
#

How can I add a bot in discord server list

balmy lantern
#

Yall know when the verification will be done?

sudden geyser
#

verification as in what. Discord bot verification (with the check mark)?

turbid bough
#

verification: probably 1-2 weeks.
for dbl verification: probably 1-2 weeks

#

both depends on how many requests they are getting

astral yoke
#

took mine three weeks

craggy cave
#

Does anyone have any like proxy setup for lavalink?

valid gyro
#

this code isnt returning anything

#

not errors not messages not nothing

#

i didnt change anything as far as I know, but it doesnt work

#

fixed it

fringe dragon
#

is that possible count user votes ?

granite sequoia
#

Few things wrong there at first glance Ragnarok

#

1.) startsWith needs an inverse if operator

#

2.) are you even logging in

fringe dragon
#

kk i fixed this with using database 👍

earnest phoenix
#

How do I shard with Eris?

turbid bough
#

i dont think you can?

#

nvm ofc you can

earnest phoenix
#

alr thanks

turbid bough
#

well, if you only want to use eris

#

Client initialization supports it with using options

#

firstShardID lastShardID maxShards

astral yoke
#

please dm me if you gonna help cause i aint gonna focus on this chat

mossy vine
#

@turbid bough yeah but that wont do clustering

#

which can be shit for bigger bots

earnest phoenix
#

@turbid bough which is better? eris sharder or just plain eris?

turbid bough
#

i dont use eris so idk

mossy vine
#

eris sharder supports clustering

#

if you need that, go for it

earnest phoenix
#

ok then im using eris sharder

turbid bough
#

im guessing clustering requires making your own database/connecton. or making very strict configuration

mossy vine
#

what

turbid bough
#

idk.

mossy vine
#

do you know what clustering is

turbid bough
#

yeah, multiple shards in different servers

mossy vine
#

different processes

turbid bough
#

oh ok

#

so if you have 4 cores for example, having one cluster per core is the most optimal?

mossy vine
#

why tf would you need to make your own db for that omegalul

#

idk whats optimal

turbid bough
#

ive tried sharding, but idk it does not work sometimes when trying to use different processes

#

or its just my library isnt up for it

#

just searching up "discord bot cluster" will come up eris sharder as the top search result

#

oo i think i found it

mossy vine
#

because.. thats its main selling point..

earnest phoenix
#

is glitch.com a good host for bots even tho it is not made for that?

turbid bough
#

Lavalink4NET

mossy vine
#

@earnest phoenix if the bot is in like 5 servers yes

earnest phoenix
#

how about 1 server only?

mossy vine
#

if you can deal with its limitiations then go for it

earnest phoenix
#

alr then cuz i just need a temp host to test Eris at while having my old d.js bot still running properly

coral trellis
#

@fair shoal

turbid bough
#

or maby you cant communicate between discord clusters directly with eachother

earnest phoenix
#

You would need some sort of IPC/RPC layer for that

turbid bough
#

ok, but i dont technically need any direct communication for them to work?

#

but, i noticed if you dont launch the shards in order, it wont connect or something

mossy vine
#

order shouldnt matter afaik? maybe it does and its just not mentioned in docs

turbid bough
#

so i can launch from any id?

#

like, 4?

mossy vine
#

¯\_(ツ)_/¯

#

i just told you i dont know

earnest phoenix
#

You have to specify the first and last shard ID

turbid bough
#

im not using eris btw.

earnest phoenix
#

I saw.

turbid bough
#

ah right i did tell that

#

what about totalshards?

#

is that total shard as in total with all the clusters?

#

or in total in just that one cluster?

lavish fern
#

Could a programmer help me fix my problem?

#

I cant get my libraries working

turbid bough
#

jeez, i cant test my bot lol, i dont have access to my database

worn sentinel
#

Hey, how long does it take to approve a bot?

turbid bough
#

1-2 weeks

worn sentinel
#

oh okay

earnest phoenix
#

@turbid bough total with all clusters

turbid bough
#

ah cool 👍

#

can you for example use id 100-199 for cluster 1 and 0-99 for cluster 0 but with only initializing 2 shards per cluster?

#

so you can expand them later easily

scenic nest
#

how to make bot status to Member counts?

#

and intervaling status

finite bough
#

.size to get the member count

scenic nest
#

script?

finite bough
#

setInterval for the status

scenic nest
#

and btw

#

discord.js 11.5.1

finite bough
#

just add .size

#

or

scenic nest
#

or?

finite bough
#

use memberCount

scenic nest
#

this my script

#

i want to make interval

#

and member count

#

bot.on('ready', () =>{
console.log('this bot is online');
bot.user.setActivity('idk')
})

#
bot.on('ready', () =>{
  console.log('this bot is online');
  bot.user.setActivity('idk')
})```
finite bough
#

setPresence

earnest phoenix
#

@scenic nest are you trying to show the bot's status and member count of it's users in it's custom status or something?

scenic nest
#

yes

restive furnace
#

@scenic nest example of setinterval

let p = 0;
setInterval(() => {
p++;
bot.user.setActivity(p.toString())
}, 12000) // 12 secs is minium to change the presence```
#

so every 12 secs it makes the number higher on status, so i think thats enough explaining to you.

true ravine
#

Right so I've queried a mysql table, mapped the result, sorted it by one of the columns and now I want to display the top 10 values (for a leaderboard) although when it comes to iterate through that array or map or whatever it's called it's out of order

#

I have a second leaderboard and I use identical code for it but that one works perfectly

#

I've console logged the sorted array and it's in the right order

#

Any things I should be looking for?

scenic nest
#

ok thx

true ravine
#

Ignore the above spiel I worked it out ^

fair gust
#

How to work Welcomer bot

#

?

gilded plankBOT
#

@fair gust

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(

fair gust
#

O

sacred mountain
#

How would I write a function to check if args[0] is larger than 100 because args is a string so I’m not sure how to sort of convert it into an integer

worn hill
mossy vine
#

@sacred mountain parseInt(args[0]) to convert it into an integer

sacred mountain
#

Would that be just for that function or does that permanently change it?

mossy vine
#

parseInt does not affect the original value, no

sacred mountain
#

still a bit stuck

#
                        if(args[0] === > 100)```
mossy vine
#

what the fuck no thats not how you compare a number

#

and i just told you it doesnt affect the original variable

glad charm
#

>=

wispy bough
#

Can i use Anime Gif API to my bot and add my bot to top?

sacred mountain
#

if(args[0] >=100)?

glad charm
#

If it might contain loli/shouta then no.

mossy vine
#

@sacred mountain you want to parseInt args[0] tho

wispy bough
#

I get stuck to create Picture/Gif API to my bot

#

Then I choose open source API

sacred mountain
#
                        if(args[0] >=100)```
#

is that correct

mossy vine
#

no

sacred mountain
#

then how

mossy vine
#
if (parseInt(args[0]) >= 100)```
wispy bough
#

But I think i will add my bot to website

#

Is Allow?

main laurel
#

Guys i want to reduce my memory usage , do you have any advise for that ?

mossy vine
#

use lighter libraries and packages

wispy bough
#

Can i use open API to my scripts?

hasty sparrow
#

What happens if you use parseInt instead of Number?

glad charm
#

Makes me think it's either, not a number,

#

or undefined when passed.

#

That's the result.

#

That doesn't show us what arg[0] is.

#

If arg[0] exist.

hasty sparrow
#

Log args[0] to console

glad charm
#

No, 5 is **5**

#

Right.

#

I recommend separating command from args.

#
const [command, ...args] = message.content.substring(length + 1).match(/\S+/g) || [];```

Example how I do it. (My bot uses mentions instead of prefix)
heady snow
#

can some1 tell me why this counter dont work in c#?

int counter = 0;
            foreach (var guild in Client.Guilds)
            {
                 counter++;
            }
            Console.WriteLine(counter);

i get 0 all the time

glad charm
#

I presume that means Client.Guilds is somehow empty.

#

Output it and find out.

heady snow
#

i did a command with the same code and i am getting a normal output but not when i do it like this

surreal notch
#

i want to take orders of gfx from my bot how to code it like that like someone order r!order logo then its info. will came to me

wispy bough
#

How to get my bot change status after 15minutes?

#

I'm use discord.js v12

summer torrent
#

setInterval()

molten yarrow
#

Number(args[1])

summer torrent
#

if(Number(args[1]) !== NaN)

wispy bough
#

How to get my bot change status after 15minutes?
I'm use discord.js v12

glad charm
#
Number.isNaN(args[1])```
wispy bough
#

Please help me

feral heath
#

frequent status change is probably a tos violation

turbid bough
#

15 minutes?

glad charm
#

15minutes isn't a TOS violation.

feral heath
#

idk what the rate limits are

#

but anyway

glad charm
#

@wispy bough google how to work with setInterval with javascript.

turbid bough
#

frequent change of status within 24 hours is very illegal /s

feral heath
#

ok buddy

restive furnace
#

12 secs = minium, even tho its little api abusing.

undone rose
#

You can check the ratelimits by making a request to that endpoint. whatever the x-ratelimit says, that's what it is. if it says 12 seconds, then waiting 12 seconds to do it again is not API abuse, not even a little bit

wispy bough
#

let activities = [ `${bot.guilds.size} servers!`, `${bot.channels.size} channels!`, `${bot.users.size} users!` ], i = 0; setInterval(() => bot.user.setActivity(`${bot.prefix}help | ${activities[i++ % activities.length]}`, { type: "PLAYING" }), 15000)

I'm use this command to get autochange status to my bot and get this bug
(node:3600) UnhandledPromiseRejectionWarning: ReferenceError: bot is not defined
Note : 15000 is not real number, I'm just use that to test my commands will work right.

quartz kindle
#

bot is not defined

earnest phoenix
#
const (the name you put) = new discord.client()
#

you need to put the name you put instead of bot

wispy bough
#

Yes. I added

#

thanks. i fixed

turbid bough
#

Clients are allowed 120 events every 60 seconds, meaning you can send on average at a rate of up to 2 events per second. Clients who surpass this limit are immediately disconnected from the Gateway, and similarly to the HTTP API, repeat offenders will have their API access revoked. Clients are also limited to one gateway connection per 5 seconds. If you hit this limit, the Gateway will respond with an Opcode 9 Invalid Session.

cinder dove
#

If a guild is deleted - the guild ID can be given to someone else?

#

Or it's gone forever?

quartz kindle
#

gone forever

surreal notch
#

@obsidian sky

sullen yacht
#

Why is ctx.guild.owner returning None in this server?

blissful scaffold
#

If a guild is deleted - the guild ID can be given to someone else?
@cinder dove ids are time based, once it is used it will never be used again

slender thistle
#

Why is ctx.guild.owner returning None in this server?
@sullen yacht The owner isn't cached

sullen yacht
#

Oh right

cinder dove
#

Thanks @blissful scaffold

sullen yacht
#

@slender thistle is there much i can do to fix it? i was told its likely just a discord issue as discord.py caches everything but im not sure

slender thistle
#

fetch_guild? blobshrug

sullen yacht
#

ahhhhhhhh i did not think of this thank you

golden condor
#

I really need some help figuring out lavalink, I will use any wrapper

#

that works

pale vessel
#

oh?

#

you need it?

golden condor
#

you need it?
@pale vessel be quiet

pale vessel
#

i thought you're fine with ffmpeg

golden condor
#

i am asking for help

#

i thought you're fine with ffmpeg
@pale vessel if there was a better option than the ytdl then yes i would be

pale vessel
#

it's simple, download the server, copy the application.yml, and start the jar file

golden condor
#

Nooo

pale vessel
#

and use a wrapper

golden condor
#

It's not the node stuff I am confused with]

pale vessel
#

shoukaku is good if you're using djs

#

then what is it

golden condor
#

I will take any help I can get

#

@pale vessel coding it, I am tryna use a tutorial, I have a node

#

And it doesn't work

#

Nothing works

pale vessel
#

what do you mean by "nothing works"?

#

how did you code it?

#

there's an example in the readme

golden condor
#

@pale vessel I tried lavacord

#

didn't work

#

Tried my friend's wrapper

#

Didn't work

lavish fern
#

Morning, would some be willing to help me fix my eclipse, im trying to get back into java joding and ive download eclipse and the lastest JDK and im trying to learn how to code a discord bot

pale vessel
#

"didn't work"
dude, come on

bold zenith
#

!p blinding lights

golden condor
#

@pale vessel kept giving errors like 401

glad charm
pale vessel
#

is the lavalink port you're using open?

#

probably has nothing to do with this

static nexus
#

Can you put multiple cogs in one file

#

dpy

golden condor
#

@pale vessel yes

pale vessel
#

your error is still vague

#

should probably send a screenshot of console

earnest phoenix
#

client.channels.get(`${captchaChannel}`).send("📌 | <@"+member.id+">, vous avez 15 secondes afin d´acceder au reste du serveur, veuillez envoyer ce code (`"+password+"`) dans ce salon.").then(m => m.delete(15000)).then((m) => { m.channel.awaitMessages({ maxMatches: 1, time: 15000, errors: ['time'] })

This is in guildMemberAdd event

#

v11.5.1

#

but don’t worked

sudden geyser
#

did a member join the server? Are you sure the event is firing? What are you getting?

#

and are you sure captchaChannel is a channel ID.

earnest phoenix
#

Yes it triggers but it tells me that it cannot read the awaitMessage property

#

yes.

#

oof

#

so

#

m.channel.awaitMessages don’t work :/ ExcuseMe

#

but idk why

hasty sparrow
#

What is the exact error message?

earnest phoenix
#

Now there is no more error but the awaitMessages does not work, when the user sends the message that the awaitMessage waits, the bot does not react. And the message deletes well after 15 seconds

#

@hasty sparrow

sudden geyser
#

shouldn't the first argument of awaitMessages be a filter.

pale vessel
#

yes

#

a function

earnest phoenix
#

What do I use as a filter?

sudden geyser
earnest phoenix
#

tjx

pale vessel
#

read the docs next time

earnest phoenix
#

isn’t worked

#

no error but isn’t work

crude heron
#

I have a a question that if a add a command call !invite it will give the bot invite link so that was against discord tos?

earnest phoenix
#
                length: "9",
                numbers: "5",
                symboles: "4"
            });
     
const filter = m => m.content === password
console.log(password)
client.channels.get(`${captchaChannel}`).send("📌 | <@"+member.id+">, vous avez 15 secondes afin d´acceder au reste du serveur, veuillez envoyer ce code (`"+password+"`) dans ce salon.").then(m => m.delete(15000)).then((m) => {
              m.channel.awaitMessages(filter, { 
              maxMatches: 1, 
              time: 15000, 
              errors: ['time'] 
              }).then((collected) => {
              member.send("✅ | Vous êtes maintenant vérifié dans le serveur **"+member.guild.name+"** !\n\n`Si vous ne voyez pas les salons, contacter l'administrateur du serveur.`")
              member.addRole(captchaRole).catch(err => {
              console.log("Impossible de donner le rôle.")
              })
              }).catch(collected => {
              collected.delete()
              member.send("❎ | Vous avez saisi le mauvais code de vérification : vous avez donc été kick (si ce n'est pas le cas, quittez et revenez dans le serveur).")
              member.kick()
        })
     })```
opaque seal
#

Hi guys, I've used this code to post my bot stats, but the number of servers on the page still shows up N/A:

setInterval(() => {
        dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
    }, 1800000);
#

Full ready event:

client.once('ready', async () => {
    console.log('Ready!');
    client.user.setActivity('$help');
    setInterval(() => {
        dbl.postStats(client.guilds.size);
    }, 1800000);
});
split hazel
#

Have you waited 30 minutes?

sudden geyser
#

@opaque seal what version of Discord.js are you using.

#

or in fact what library as well

opaque seal
#

v12

#

Have you waited 30 minutes?
@split hazel I had this code for a while but my bot didn't have any shards

setInterval(() => {
        dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
    }, 1800000);

So I changed it to this

client.once('ready', async () => {
    console.log('Ready!');
    client.user.setActivity('$help');
    setInterval(() => {
        dbl.postStats(client.guilds.size);
    }, 1800000);
});
sudden geyser
#

collections were moved to managers (e.g., guilds.size is now guilds.cache.size)

opaque seal
#

oh

#

thanks

twin marsh
#

Something errored this, and I cannot find the issue, I've let it run into a onlince character count and its not at the max a .json file can fit

sudden geyser
#

what was the error?

twin marsh
#

Thats the issue, it says it doesn't have a correct end of line thing like } or )

#

While it definitely has

static nexus
#

Cogs or one single file

sudden geyser
#

cogs if doing a lot

twin marsh
#

This issue appeared in 2 different .json files for economy and warning system

sudden geyser
#

I don't know if a json file can really have a max. If you're using JSON as a database, that may be your issue, but try putting it in a JSON beautifier and see if you can spot the issue.

pale vessel
#

i use this a lot

twin marsh
maiden mauve
#

So I'm trying to replace an eval sequence since everyone tells me its the devil

sudden geyser
#

yeah you have to be some witchcraft user to ever hit that character limit I never know about

maiden mauve
#

m.embedH0 (page 0) m.embedH4 (page 4)
m.embedR0 ...

etc

#

Would the next easiest option be finding objects by something in the datablock?

#

Ie, I can pull the footers as a string off whatever current one is displayed

static nexus
#

Is there a way to use cogs with heroku?

#

I tried but the bot doesn't recieve it

fresh kernel
#

I'm struggling with an updating message.
Here is the current behavior:

First user calls the !join command and everything runs as intended.
Second user calls the !join command and is added to queue. The database shows that both users are in queue, with the correct user IDs as well. However, for some reason that I cannot figure out the async function's variables are overwritten so it starts checking only for the second user twice.

Here are the console logs showing that there is an actual overwrite:

[16:17:35][Console/Log] start: 313367547028176898
[16:17:35][Console/Log] justBefore: 313367547028176898  313367547028176898
[16:17:40][Console/Log] checkPosition: 313367547028176898  313367547028176898
[16:17:45][Console/Log] checkPosition: 313367547028176898  313367547028176898
[16:17:49][Console/Log] start: 503649108163035158
[16:17:50][Console/Log] justBefore: 503649108163035158  503649108163035158
[16:17:50][Console/Log] checkPosition: 503649108163035158  503649108163035158
[16:17:55][Console/Log] checkPosition: 503649108163035158  503649108163035158
[16:17:55][Console/Log] checkPosition: 503649108163035158  503649108163035158

The logs at 16:17:50, and one from 16:17:55 should be the first user.

Here is the part that logs these values, and where the checkPosition function is being called.

hasty sparrow
#

@maiden mauve Why not use deeper nesting (m.embed.H[0], m.embed.R[4], etc.)?

maiden mauve
#

I think that's the answer I'm looking for

#

get the identifier for menu

#

and then ++ or -- the array

#

just a bit rusty on the syntax

hasty sparrow
#

I saw your eval sourcery yesterday, forgot to comment on it

maiden mauve
#

lol

#

it was a fun solution to the problem

#

but not a release to the public solution

hasty sparrow
#

As long as it works ¯_(ツ)_/¯

maiden mauve
#

so instead of that

#

it would be more like
embedH:
... array element 0
... array element 1

hasty sparrow
#

Yep

maiden mauve
#

will have to look up some syntax

#

but it seems very js-doable

dense ridge
#

So... my bot was just declined again. Who can I talk to to appeal that decision?

hasty sparrow
#

@fresh kernel Could you go into more detail?

split hazel
#

DM the moderator which denied your bot @dense ridge

#

-declinedbot

gilded plankBOT
#

Your bot was likely declined because it broke one of the "bot rules" listed in #rules-and-info.

To find out why your bot was declined and by who, use the search feature in #mod-logs:

dense ridge
#

Oh. So if I message the bot, someone will read it?

fresh kernel
#

Sure, what do you need to know more @hasty sparrow ?

split hazel
#

the moderator

lavish fern
dense ridge
#

Oh wait... yeah I don't know who that is. I just got something from Luca.

split hazel
#

-declinedbot

gilded plankBOT
#

Your bot was likely declined because it broke one of the "bot rules" listed in #rules-and-info.

To find out why your bot was declined and by who, use the search feature in #mod-logs:

split hazel
#

tells you how to find out who denied your bot

dense ridge
#

Cool thanks

maiden mauve
#

@hasty sparrow btw Duke, is that name from the Henry VIII show?

hasty sparrow
#

No

maiden mauve
#

aw

#

Henry Cavill is a boss

hasty sparrow
#

@fresh kernel You are creating a new timer whenever the command is run

fresh kernel
#

Yes, my I want a separate timer for every person that runs the command

static nexus
hasty sparrow
#

Unless there's important code missing I don't see the issue

static nexus
#

exactly

hasty sparrow
#

Ohh wait, now I get it

static nexus
#

what is it

hasty sparrow
#

Talking to DrCas

static nexus
#

???

fresh kernel
#

Oh, do tell me?