#development

1 messages · Page 782 of 1

earnest phoenix
#

i don't get anything from right clicking the icon

obtuse wind
#

whot?

#

no its ===

#

not just = or ==

grizzled raven
obtuse wind
#

no

#

thats outdated

#

its 3 =

#

===

grizzled raven
#

what

#

ok

obtuse wind
#

I can put more equals if you want

earnest phoenix
#

i am right clicking the emoji column nothing is popping up

obtuse wind
#

then Zerp you would have to post the emoji and manually copy it

earnest phoenix
#

but i can't post it because it's a gif emoji and i don't have nitro

obtuse wind
#

you could always have someone post it for you

earnest phoenix
#

can you do it?

obtuse wind
#

I do not have nitro. Nor do I want to spend 10 dollars a month for it, if someone in ur server does then they can do it

earnest phoenix
#

any1 have nitro and wanna post a random emoji from my test server?

grizzled raven
#

get your client to post it for you

earnest phoenix
#

client?

#

my bot?

grizzled raven
#

bot

obtuse wind
#

Also this isn't #general so maybe try asking there + take the conversation there.

earnest phoenix
#

but i need the emoji id to use it

grizzled raven
#

client.emojis.find

earnest phoenix
#

is that discord.js syntax?

obtuse wind
#

yeah.

#

Its node's syntax.

summer torrent
#

how can I relocate words in string? for example:
February 2 => 2 February

obtuse wind
#

can I have the full line of that code?

grizzled raven
#

String.split(" ").reverse().join(" ")

earnest phoenix
obtuse wind
#

because of its

or nott
it cant be changed.

earnest phoenix
#

@grizzled raven that is completly reversing the string

#

i can't find anything related to "find" in the documentation

grizzled raven
#

no its not

earnest phoenix
#

Well it isnt but it would be reversing each word

#

Example

grizzled raven
#

bruh

earnest phoenix
#

Hello world, how are you => you are how world, Hello

uneven wyvern
#

@obtuse wind well what does that bring

grizzled raven
#

that is what he wants

earnest phoenix
obtuse wind
#

Dont have more than 2 words

grizzled raven
#

well all he asked was to reverse that string specifically

earnest phoenix
#

Alright

grizzled raven
#

if he wanted more, he couldve specified more

obtuse wind
#

@uneven wyvern it is a bit more efficient, sometimes if you just have message.channel.send(embed); it says your embed is empty and cannot be sent.

earnest phoenix
#

it doesn't work

#
console.log(bot.ppHop.find)
obtuse wind
#

no thats not how you find

#

an emoji

grizzled raven
#

client.emojis.find(e => Function)

earnest phoenix
#

where does is it in the documentation?

obtuse wind
#
let emote1 = bot.emojis.find(e => e.name === `emote name`)
console.log(`${emote1} has been found`)
#

try that

earnest phoenix
#

i can't find anything that looks like that

#

hmm mkay lemme try that

grizzled raven
#

are you in discord stable?

earnest phoenix
#

discord stable?

#

the desktop app?

grizzled raven
#

what version

#

is your discord.js

obtuse wind
#

wait hold up

#

my bad let me fix that

earnest phoenix
#
"discord.js": "11.5.1",
grizzled raven
#

yeah

#

ok

obtuse wind
#
let server01 = bot.guilds.find(s => s.name === `server name`)
let emote01 = server01.emojis.find(e => e.name === `emote name`)

console.log(`${emote01} has been found???`)
#

try something like that and see if you can find the emoji

#

because bot.emojis will only map it

earnest phoenix
#

i think i got it

obtuse wind
#

if you got it

#

just paste those lines into whatever and add it to like your message

earnest phoenix
#

lemme test to see if i can send it in chat with my bot

#

oh

#

really?

#

the "a" too ? :ppHop:

obtuse wind
#
let server01 = bot.guilds.find(s => s.name === `server name`)
let emote01 = server01.emojis.find(e => e.name === `emote name`)

console.log(`${emote01} has been found???`);

message.channel.send(`Aloha, ${emote01} how are you today???`)
#

like something like that if you put it in a command

earnest phoenix
#

what is the "a" for?

obtuse wind
#

yeah copy those numbers

late hill
#

animated

earnest phoenix
#

ahh

fervent osprey
#

@everyone can someone send me a discord.js file for a music bot

modest maple
#

@fervent osprey Read the rules

#

also dont try @ everyone

#

and dont beg for code

#

ty

grizzled raven
fervent osprey
#

i wasn't beging for nout mate just asking for some help as im new to java and python wasnt expecting to be spoon fed either just some help would be much appreciated

modest maple
#

send me a discord.js file for a music bot

#

that is not asking for help

#

that is asking for code

earnest phoenix
#

hmm what's the scope of that function @obtuse wind

modest maple
#

i also advise not doing a discord bot when your new to the language

earnest phoenix
#

can i store the value into a var?

#

like

var emote = {emote01}
#

wait nvm

#

just need to make let -> var

#

or not

fervent osprey
#

ive already done a few

earnest phoenix
obtuse wind
#

huh

#

oh I would help further but I just got on work

#

I'll have to help you program later, just DM me @earnest phoenix

grizzled raven
#

cough

snow pine
#

anyone have a plan how to get the emoji from other servers ? i talk about a command like "?biggeremoji EMOJI FROM OTHER SERVER" ?

earnest phoenix
#

yes

#

cdn.discordapp.com/emojis/emojiID.png

#

or change it to .gif if it's a gif

snow pine
#

and how to get the emoji id?

earnest phoenix
#

\:emoji:

#

that returns an emoji like <:emojiName:id>

snow pine
#

but from args? 🤔

earnest phoenix
#

you would have to make an emoji regex or something like that

#

you dont have to have an extension iirc

#

just the id alone will return the correct format in the cdn url

#

oh ok

snow pine
#
if (emoji.animated == true) {
                embed.setImage(`https://cdn.discordapp.com/emojis/${emoji.id}.gif`)
                message.channel.send(`animated`)
            }
            if (emoji.animated == false) {
            embed.setImage(`https://cdn.discordapp.com/emojis/${emoji.id}.png`)
            message.channel.send(`Not animated`)
                //}
            message.channel.send(embed)
``` this just works for guild emojis
earnest phoenix
#

look at the thing i posted

#

and i said you would have to use a regex

summer torrent
#

Discord.Util.parseEmoji("emoji")

snow pine
#
var emojiid = args[0].split(":")[2]; // only get ID part from emoji
        if (emojiid == undefined){
            return message.reply("An error occur while executing. this emoji is a default / non knowed emoji")
        }
        emojiid = emojiid.replace('>', "")
        var emojiname = args[0].split(":")[1]; // only get ID part from emoji
        //emojiid = emojiid.replace('>', "")
        
        console.log(emojiid)
        var embed = new MessageEmbed()
            .setTitle(`Emoji got! name from the emoji is: ${emojiname}`)
            .setColor("GREEN")
            .setTimestamp()
            .setImage(`https://cdn.discordapp.com/emojis/${emojiid}.png`)
            message.channel.send(embed)
``` worked good. but bcs the default emojis (🤔) Cant be get and return an undefined i made the if.
earnest phoenix
#

those are unicode

#

you will have to use this for unicode emojis

lean palm
#

is there anyway to generate a url invite link for your bot using the discord.js library?

earnest phoenix
#

Channel#createInvite ?

#

oh wait i misread

#

generate a invite for a bot?

lean palm
#

yeah

earnest phoenix
#

there is nothing to generate

lean palm
#

well i didn't really mean generate, but rather just fetch a url

earnest phoenix
#

like discordapp.com/oauth2/authorize?client_id=<id>&permissions=<number>&scope=bot

#

quite literally put your client id in a invite link and you're done

lean palm
#

ah ok

#

thanks just wasn't sure if there was another method

summer torrent
#

@lean palm yes

earnest phoenix
#

LOL how convenient, docs are so helpful

#

confused how i didn't see that earlier lol

shell obsidian
#

Which should I use to create a bot, Eris or discord.js?

earnest phoenix
#

whatever you want

shell obsidian
#

Like, which has more features and better interaction?

summer torrent
#

in my opinion, discord.js

shell obsidian
#

Also, can discord.js download videos then play them using YTDL, or does it only allow streams?

amber fractal
#

you plan to use ytdl (youtube downloader) to play videos and discord.js (a discord api wrapper) to download them Thonk

shell obsidian
#

I'm making a music bot here.

amber fractal
#

Not my point, but ok

quartz kindle
#

discord.js allows music files, if thats what you're asking

#

and ytdl should support downloading (i mean, just pipe the stream to a file)

still merlin
#

You need FFMPEG for a music bot ytdl-core and something else

west raptor
#

sanity

amber geyser
#

How can I make the bot react to a message that it sent but with a custom emoji? In discord.js

snow pine
#

my discordjs music bot is buggy. idk why it midway trough the track it pauses. stops or crashes

#
if (!song) {
                 console.log("this?1");
                 message.member.voice.channel.leave();
                 message.client.queue.delete(message.guild.id);
                 return;
             }
``` this crashes ...
#

idk why though

west raptor
#

channel can be undefined

earnest phoenix
#

You need FFMPEG for a music bot ytdl-core and something else
you don't need ffmpeg, it's just commonly used

mossy vine
#

yes it can tho?

shy turret
#

how do you get how many lines are in a file with discord.js

#

a function

blissful scaffold
#

probably count the number of newline characters in a file

shy turret
#

ikr, i just realized something else was causing the problem of me trying to get the amount of lines in my file in my code

shy turret
#

or nvm

#
function linesCount(filename) {
  var i;
  var count = 0;
  fs.createReadStream(filename)
    .on('data', function(chunk) {
      for (i=0; i < chunk.length; ++i)
        if (chunk[i] == 10) count++;
    })
    .on('end', function() {
//      console.log(count);
      return count;
    });
}

the console.log(count) works but it returns "undefined"

quartz kindle
#

functions return immediately

#

events are not sync

#

you need to either wrap everything into a promise or use a callback

shy turret
#

just gonna use a simplier way

#

how do you find how many times it says "\n" in a string

#

im looking at this rn:

var fs = require('fs');
filePath = process.argv[2];
fileBuffer =  fs.readFileSync(filePath);
to_string = fileBuffer.toString();
split_lines = to_string.split("\n");
console.log(split_lines.length-1);
quartz kindle
#

thats one way yes

#

keep in mind that using readFileSync will attempt to put the entire file in memory before proceeding, which will not work for very large files

#

also you dont need to convert buffer to string if you use readFileSync with the utf8 option

shy turret
#

just txt files btw and wdym

#

wait im dumb, i think there's another simplier way i could've done it

quartz kindle
#

fs.readFileSync(filePath,"utf8")

high dagger
#

Hi How to Register

shy turret
#

i alr fixed

#

using a require(), is there a way for the file ran by require() give information to the base file?

#

like:

require("somefile.js"),somehow_add_something_here_to_recieve_a_variable_back
message.channel.send(variablefromfile);
amber fractal
#

using functions and return values?

warm marsh
#

Object and gather props?

shy turret
#

i know this sounds ugly but i guess the only solution is global vars

stiff laurel
#

I don't know if i am asking in the right channel, but is there a bot that can pull data from a XML file and create an embed with a custom command? idk if this is what i should be approaching. Or an API. (I have absolutely no clue)
Basically I want to pull info about an item in a game and display it in an embedded post.

ionic compass
#

Why does discord.net return a collection for attachments per message? I cant even figure a way to attach multiple files without it being multiple messages

blissful scaffold
#

it is possible to receive more than one attachment

ionic compass
#

is it possible for a user to send more than one per message?

slender thistle
#

Yes

#

Android client allows users to send multiple attachments at once

#

Doubts about the iOS one

blissful scaffold
#

I think bots can also send more than one file per message, but it depends on what library you use

ionic compass
#

ahhh ok i didnt know mobile had a different system... Thank you!

blissful scaffold
#

I use 2 different libraries for different bots and I noticed that one does support multiple attachments while the other doesnt

ionic compass
#

sadness because i can't ditch the filename_{attachNumber} scheme

blissful scaffold
#

just use 0 if you don't care about maybe multiple files 😛

ionic compass
#

hmmm i could, i might... But then again mass-uploading files from mobile would be neat, especially for uploading custom scripts

crude juniper
#

you can send multiple files at once on iphone

slender thistle
#

Cute

crude juniper
#

they were wondering ^

shy turret
#

how do you cache/store console.logs

earnest phoenix
#

you dont

#

make your own logger

#

that way you can control the string before it actually goes to console.log

shy turret
#

...

#

like in a require() function

terse vine
#

hey where y can find a code to make a logger?

shy turret
#

@terse vine wdym

terse vine
#

what is that?

summer torrent
#

code yourself

terse vine
#

I just want a guide

summer torrent
#

which library

terse vine
#

to know how can i code it

shy turret
#

I've seen some people make things that logged console.logs using require()...

#

discordjs

terse vine
#

djs

summer torrent
terse vine
#

ok thanks

#

mdf

earnest phoenix
#

use this

#

this is more updated and maintained by the community not an idiots guide

terse vine
#

@earnest phoenix thank you so much bro ☺️

earnest phoenix
#

np

sonic skiff
#

Im using the got module, but it wont run on my raspberry

#

Ive made sure everythings up to date

#

is there a replacement I could use for it?

shy turret
#
           let letterNumber = /\[^0-9]/+-*();
           if (inputtxt.value.match(letterNumber)) {
             // success
           } else {
             // fail
          }
#

im trying to make only 1234567890+-*/() allowed in an argument in a discord bot...

sudden geyser
#

You need to escape special characters like /, +, (), etc. with a backslash.

obtuse wind
#

It says ...(message.author)... is not defined

tiny tinsel
#

Because mssage.guild.member(message.author) doesn't exist.

#

@obtuse wind

#

@obtuse wind I think what you want is message.member.hasPermission('MANAGE_MESSSAGES')

grizzled raven
#

@tiny tinsel message.guild.member is a function

#

which resolves a member object from a user or other object

#

so technically hes not wrong, he just couldve used message.member to save time

tiny tinsel
#

@grizzled raven What no.

#

message.guild.member is a GuildMember object.

#

I think you are confusing yourself with fetchMember.

#

Oh wait no you're right I didn't know.

#

Returns the GuildMember form of a User object, if the user is present in the guild.

#

So the issue is user is probablyt not part of the guild.

earnest phoenix
#

I still dont get how id use voting when my bot is sharded

#

cuz i cant really but it into my main file as then it would make 2 instances of dbl and get mad about the port already being used HmmmWeeb

modest maple
#

I'd say have a glibal db

#

And store votes there

#

Then check if X user in in

earnest phoenix
#

that seems baddd

weak parrot
#

A DB seems sorta overkill for me for vote checking unless you want to store them for the long run. If you only need them for the short run just save them in JSON

#

Also storing votes and stuff isn't really a bad idea Daaku

late hill
#

You should provide more information on what you're even trying to do

#

Having it running on just one shard could work completely fine depending on what you're trying to do

#

In fact, it seems that's the only issue you're mentioning

#

And I can't think of any reason why you'd want to put multiple listeners for the vote webhook

earnest phoenix
#

Check /app/package.json: command not found. Is a start script missing? https://glitch.com/help/failstart/help me in this error

earnest phoenix
#
      throw er; // Unhandled 'error' event
      ^
Error: listen EADDRINUSE: address already in use :::3235
    at Server.setupListenHandle [as _listen2] (net.js:1270:14)
    at listenInCluster (net.js:1318:12)``` help me in this error
modest maple
#

Your port is already in use

earnest phoenix
#

so how i fix

#

i have try 8080 port also

modest maple
#

Use a different port?

earnest phoenix
#

like

#

how i use different port

modest maple
#

Pick one between 80 -65500

earnest phoenix
#

TypeError: giveaways.launch is not a function getting this error

lunar hill
blissful scaffold
#

The ip address of your bot

lunar hill
#

what

#

But how do I know the ip address of the bot?

earnest phoenix
#

it isnt the address of the bot

#

it's the web location of the web server, would it be an ip or a named domain

blissful scaffold
#

True, but smokey doesn't even know what a webhook is so I don't think he will get a separate web server on a different machine

lunar hill
#

so what do i need to do to create this webhook?

blissful scaffold
#

Get the library and the documentation should explain how to use it

lunar hill
#

I reviewed all the documentation

sinful lotus
#

just think if it DBL doing a POST request on a server of your choice

#

do you know POST?

tidal parrot
#

@delicate zephyr

ruby talon
#

Heyo, I'm trying to do error handling in JS but it doesn't really work.
Is error handling in js different qua logic than eg C# or so?

const local_url = "http://127.0.0.1:5000/", mail = "mail@mail.mail";
let token = null;

console.log("Retrieving token...");
try {
    token = mySE.gen_token(local_url, mail);
} catch (e) {
    console.log("An error occured!");
    console.log(e);
}
console.log("Retrieved token:\r\n" + token);
console.log("defukk");
Retrieving token...
Retrieved token:
undefined
defukk
D:\code\5INFO\sem2\ICT-Electronica\mySE\API wrappers\JavaScript\mySE\meSE.js:28
            if (reqValue["statusCode"] !== 201) throw new UnauthorizedError(reqValue["error"]);
#

Shouldn't it raise the error instantly, because now it seems like it raises it after the program is done running?

sinful lotus
#

is mySE.gen_token async ? @ruby talon

#

or a promise since its undefined

#

but I doubt it is because its logging undefined

#

so probs mySE.gen_token(local_url, mail); is borked

ruby talon
#

Promise, already looking at docs.

earnest phoenix
#

hey in webhook password what i should put

sinful lotus
#

ur choice

blissful scaffold
#

SpiritIsTheBest is always a good password, but you can have any password you want as long as it's the same on your top.gg bot page and your bot self

earnest phoenix
#

means its own choice

ruby talon
#

123mySeCuRePass is a great passsword.

earnest phoenix
#

Hello, I am new to Discord and heard you can develop Bots on here, I'm a JavaScript Developer, is there an API for that?

blissful scaffold
#

I think there are multiple libraries for JS, but Discord.JS is the most used

earnest phoenix
#

Ok, what's the Best Version to use?

#

How to make bot online

#

in glitch

#

anyone can help

#

?

#

plesse

#

node main.js

blissful scaffold
#

Im a Java dev, so I can't really help with JS questions

earnest phoenix
#

don't use free hosting

#

in the start script @earnest phoenix

#

dm

blissful scaffold
#

But I think almost half of the bot devs here are JS devs

earnest phoenix
#

@earnest phoenix it really depends, if your goal is to have the newest features use master, it's not going to be as reliable but you'll have new features. if you want a stable build which is known to not crash etc use stable

summer torrent
#

@earnest phoenix are you using d.js?

earnest phoenix
#

But I think almost half of the bot devs here are JS devs
true, and for a very specific reason lol

#

@earnest phoenix The newest Version is v12?

#

yup

sterile minnow
#

@earnest phoenix cause JS is good

earnest phoenix
#

no

#

javascript doesn't require much thinking, or logic really, and discord.js does a lot for the end user because most of their userbase is idiotic

sterile minnow
#

And JS is good is my opinion

earnest phoenix
#

Lmao

#

@sterile minnow it's easy

#

interpreted languages will never measure up to compiled ones and that's facts

#

🤷‍♂️

sterile minnow
#

Yeah. I can JS, PY, JAVA, HTML and CSS. But main is JS

blissful scaffold
#

did you just confuse Java with JS? 😛

sinful lotus
#

@blissful scaffold the only reason I use js is because its not that strictly typed

#

or in general not that strict

#

it can be a quick whip of code in some scenarios

blissful scaffold
#

I prefer strictly typed languages

sinful lotus
#

which saves me effort

#

I use other langs for specific work loads

#

for example why use js if you plan to do cpu intensive code

blissful scaffold
#

But I can see the uses of a losely typed language

sinful lotus
#

or if you really need to do a blocking thing

#

then use a lang with actual threads

#

and probably connect it via ws or rest on your js code

#

thats how I roll my bot

blissful scaffold
#

i think JS really needs an easy way to make/use multiple threads

sinful lotus
#

probs never gonna happen

#

workers are kinda like that but js is single threaded still

blissful scaffold
#

maybe only for the backend/node version else websites will start using 100% of your cpu in no time

sinful lotus
#

like you can call it multithreaded

#

but at the same time its not really

#

thats how js workers farce rn

earnest phoenix
#

js is very good for frontend work

#

i can't recommend it more over any other language

#

but for backend... not so much

#

it fails to perform up to standards

blissful scaffold
#

I dont know much about JS, I use it sometimes for frontend stuff but always with the help of Google

sinful lotus
#

as a bridge for backend it can be but it just adds more work

#

like what if you want to do this specific thing, and js do it slowly

#

you can use workers at that point but still its js

#

so yeah

#

probably just use a better language if you hit that point

blissful scaffold
#

JS is good for 90% of the bots, but if you really want to do something cpu intensive then it's better to switch to another language

earnest phoenix
#

i feel like people choose js for backend because they're lazy to do more than 20 lines of code which isn't really... good, you should focus on performance, security, diversity etc etc, not the simplicity of it

sinful lotus
#

thats me ^

#

but my bot doesnt really need to much js processing other than calculating time

#

and outputting images and stuff

#

so js would be fine for it

#

until I think it needs a new rework

languid sedge
#

guys who wants to see my code its massive

earnest phoenix
#

no

sinful lotus
#

massive one file

blissful scaffold
#

massive code files are for devs who hate themselves

sturdy wyvern
#

Okay thank you!

blissful scaffold
#

if you change your bot token on the discord developer page then you also need to update the token in your bot

sturdy wyvern
#

Okay thank you!

#

@blissful scaffold there is no option for the bot token

blissful scaffold
#

where?

sturdy wyvern
blissful scaffold
#

do NOT put your bot token anywhere on the top.gg page

sturdy wyvern
#

Oh kk

#

I didnt

blissful scaffold
#

do NOT share your bot token ever

sturdy wyvern
#

I wasnt going to

#

I thought there was an option to update the bot token

blissful scaffold
#

if you change your bot token then you need to update your token in your bot

sturdy wyvern
#

Ohhhhh

#

I already did that

#

👍

blissful scaffold
#

discord uses the bot token to identify your bot, only your bot needs to know the token

#

also never put your token on github or any other version control tool

quartz kindle
#

convert your token to a qr code and tattoo it on your arm

blissful scaffold
#

I heard yesterday about a guy who tattooed a QR code for a youtube video on his arm... And then his video got flagged for copy right claims and youtube removed the video

earnest phoenix
#

lol

#

discord and qr codes don't go hand in hand

#

the qr code login has no protection whatsoever so if someone gets the qr code they have full access to your account

#

im starting to think discord cut back on their budget for developers so they only hire amateurs

blissful scaffold
#

if someone scans YOUR discord QR code then YOU get access to their account

#

you give away your account if you scan a QR code of someone else

quartz kindle
#

just tattoo a rickroll qr code on your arm

snow pine
#

@quartz kindle thats interesting.

#

Gonna do it.

#

-botinfo 673160436363034626

gilded plankBOT
#
Bot info
ID

673160436363034626

Username

Rom.

Discriminator

0743

Short Description

My first bot to be released. i made an multi funtional bot it has fun commands, moderator commands, some info commands too!

Library

discord.js

Prefix

?

Total Upvotes

1

Monthly Upvotes

0

Server Count

No server count

Owner(s)

@snow pine

snow pine
#

1 upvote🤔

gilded plankBOT
#
Bot info
ID

665501346262155266

Username

Davetçi

Discriminator

5673

Short Description

Gelişmiş Türkçe davet botu. Ayarlanabilir özellikler, davet takip sistemi ve dahası için sunucuna davet et!

Library

discord.js

Prefix

!

Total Upvotes

3

Monthly Upvotes

2

Server Count

No server count

Owner(s)

@sacred widget

Links
earnest phoenix
#

How to make a music bot in djs v12 without lavalink

snow pine
#

Wtf is lavalini

#

Link

earnest phoenix
snow pine
#

@earnest phoenix What the feick is lavalink

earnest phoenix
#

Googke

#

Google

tawny lantern
#

?\

mossy vine
#

@earnest phoenix ytdl or anything else to get a music stream/file

#

@snow pine if you dont even know maybe dont even try to help??

earnest phoenix
#

@mossy vine nothing work

#

I tried like 20 music libs

#

And nothinf

#

*nothing

quartz kindle
#

Youre gonna have to be more specific than that

#

As an old client of mine would often say: "the problem lies between the chair and the keyboard"

mossy vine
#

my cup of tea?

quartz kindle
#

Your cup of tea

blissful scaffold
#

pebcak?

earnest phoenix
#
            data.memberData.workStreak = 0;
        }

        let toWait = Date.now() + 21600000;
        data.memberData.cooldowns.work = toWait;
        data.memberData.markModified("cooldowns");``` when i use command 2nd time it shows me use after 5hrs i want to decrease to 10mins how i do help
late hill
#

Do you understand your own code

earnest phoenix
#

i want 10mins in ms

blissful scaffold
#

im not going to do math for you

late hill
#

Do you want a little trick to make those times easier

blissful scaffold
#

just remember that there are 1000ms in 1 second

late hill
#

It's code, it can do math

#

10 * 60 * 60 * 1000 // wow it's 10 hours and I don't need a calculator to see that

earnest phoenix
#

can u edit in my code only the time period

#

and send me plzz

late hill
#

You should know what you're supposed to change

valid frigate
#

bruh

late hill
#

And assuming you're 13+ you should also have the knowledge to be able to convert minutes to milliseconds

sinful lotus
#

too much spoonfeeding is not good, you are already told what you need to change

valid frigate
#

is that the equivalent of 1 dayOMEGALUL

late hill
#

do ppl at 13 know how to do that

#

idk actually

#

but tbh you could literally google it

valid frigate
#

oh the cooldown is 1 hour

earnest phoenix
#

What's different to Typescript and JavaScript?

quartz kindle
#

its a superset of javascript, sort of like a massive framework. you code in typescript and then your code gets "built" into javascript by a pseudo-compiler

#

or something like that, i dont use it myself

valid frigate
#

typescript is js with types

#

also you compile it to js

west raptor
#

typescript is like writing safe javascript without having to worry about writing safe javascript

prime cliff
earnest phoenix
#

How to avatar command photo size text/link/command ?

digital ibex
#

@earnest phoenix What library do you use?

#

and Dart, i cant help you as idk what language you are using, I am guessing py

blissful scaffold
#

maybe it's dart? but I have no idea what might be wrong without an error log

modest maple
#

@earnest phoenix oh god i just saw that, right

#

you are not actually awaiting any response

#

you cannot send a list

#

you are not actually awaiting any response
2)
you cannot send a list

#
for l in learned_things:
  if message.content==l:
    message.channel.send([answer(l),answerproved(l)]) <--- "Point 1 & 2"
  else:
    print(message.content)
    learn(message.content,answer(message.content))```
flat pelican
#

what the hell is answerproved(l)

#

is this a function

modest maple
#

we gonna ignore himtryna send a list aswell without awaiting anything

#

and what even are these functions

pure gust
#

anyone good with the node.js?

#

coz im needing help lmfao

summer torrent
#

read the error

earnest phoenix
#

What wromg w this

#

Wrong

atomic quarry
#

What library is recommended for a Moderation bot?

earnest phoenix
#

soneone help me pls

#

i use glitch

grim aspen
#

any errors?

earnest phoenix
#

no

quartz kindle
#

@earnest phoenix args[0] is not a number

earnest phoenix
#

can soneonehelp me

atomic quarry
#

@earnest phoenix at client.login() don't put the token there make a folder with the name config.js

#

Along with the prefix of the bot.

earnest phoenix
#

you don't need to do that

quartz kindle
#

@earnest phoenix show your log

earnest phoenix
#

yes

atomic quarry
#

@earnest phoenix I know what I'm talking about I use glitch

summer torrent
earnest phoenix
#

alright

#

what i whrite to config.js

#

Write

quartz kindle
#

not config.js

#

write it to the env file

#

because the env file is protected

#

other files are not

earnest phoenix
#

Ok

quartz kindle
#

but anyway thats not the problem

atomic quarry
#

@quartz kindle No he Mirku can just make the glitch project private.

quartz kindle
#

what is server.js?

earnest phoenix
#

@atomic quarry lets talk in dms

astral meteor
#

can you use custom emojis in embed author?

modest maple
#

no

astral meteor
#

aw

earnest phoenix
#

can anyone help me with glitch

#

i dont kbow how to mske bot onlinr

#

Ee

prime cliff
#

Value "unban" is not snowflake.

rugged minnow
#

do you guys know how to reduce the buffer jpeg quality on node-canvas?

quartz kindle
#

For image/jpeg, an object specifying the quality (0 to 1), if progressive compression should be used and/or if chroma subsampling should be used: {quality: 0.75, progressive: false, chromaSubsampling: true}. All properties are optional.

rugged minnow
#

oh ok, thanks

gritty bolt
#

does anybody know where to start to make a bot status page?

#

and control panel?

prime cliff
#

You would need a database or api for that

earnest phoenix
#

you should do research - it's complicated

#

you need a webserver, you need to choose if you want to have server side rendering or client side, do you want an SPA, do you want login etc etc

earnest phoenix
#
2|alpha  |     at WebSocketShard._cleanupConnection (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:718:31)
2|alpha  |     at WebSocketShard.<anonymous> (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketManager.js:248:15)
2|alpha  |     at WebSocketShard.emit (events.js:321:20)
2|alpha  |     at WebSocketShard.destroy (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:692:12)
2|alpha  |     at WebSocketShard._send (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:640:12)
2|alpha  |     at WebSocketShard.processQueue (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:666:12)
2|alpha  |     at WebSocketShard.send (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:628:10)
2|alpha  |     at WebSocketManager.broadcast (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketManager.js:333:53)
2|alpha  |     at ClientPresence.set (/root/alpha/node_modules/discord.js/src/structures/ClientPresence.js:21:22)```
#

confused y i am getting this error

blissful scaffold
#

TypeError: Cannot set property 'onmessage' of null

earnest phoenix
#

???

#

means whats that

#

i don't understand

#

and from where this error is coming

blissful scaffold
#

you try to set the property onmessage on a non existing object

quartz kindle
#

its related to setting your bot's presence it seems

earnest phoenix
#

means??

blissful scaffold
#

What does your code look like where you set your bot's presence?

rugged minnow
#

Hey, I’m trying to give a compression value to the buffer in a node-canvas, if I manually put the value it works just fine, if I try to use a variable like “args[0]” it doesn’t seem to work

#

Is there a way to fix it?

earnest phoenix
#

my bot status is in config.js @blissful scaffold

blissful scaffold
#

show us the lines of code where you set the bot status

earnest phoenix
#
                {                                                         
                        name: '"help  on {serversCount} servers',         
                        type: "LISTENING"                                 
                },                                                        
                {                                                         
                        name: "@Alpha Bot#4739 help",                     
                        type: "PLAYING"                                   
                }                                                         
        ],```
potent ivy
#

which discord lib takes such types

#

lol

blissful scaffold
#

I have 0 knowledge about JS libs, so I will leave this for someone else ^^

potent ivy
#

hm

#

well i dont use discord.js

#

but i always used just the number 0/1/2/3

#

aka streaming/playing/listening/watching

tawny lantern
#

Can any give me some tips

cosmic cairn
#

@earnest phoenix You shouldn't be passing two statuses to the User.SetPresence() function.
(Try passing only one object).

potent ivy
#

@earnest phoenix status array is not what you feed directly to your presence, right?

#

im pretty sure hes not, hes just swapping between them

#

makes sense if they are in array

#

¯_(ツ)_/¯

tawny lantern
#

how do i do a kick thing

earnest phoenix
#

which kick thing

potent ivy
#

anyways what im trying to sya, that object is wrong as a presence thing

tawny lantern
#

like how do i make a kick command for a certain rank

potent ivy
#

its correct as a game within presence thing

earnest phoenix
#

which lib are you using @tawny lantern

tawny lantern
#

Visual studio

earnest phoenix
#

lib

#

not IDE

tawny lantern
#

discord.js

#

@earnest phoenix

potent ivy
#

@earnest phoenix @cosmic cairn

.setPresence( { game: status[0] } )```
should be how youre putting it in, right?
earnest phoenix
#

you first want to check if the member's roles contains the role you want to allow kicking for; https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=roles

tawny lantern
#

How do i do that

earnest phoenix
#

it's a collection

#

browse the docs for a bit

potent ivy
#

@tawny lantern do you have programming background of any sorts?

tawny lantern
#

i have the role ready

cosmic cairn
#

@potent ivy basically for discord.js

client.user.setPresence({
  game: {
    name: `nothing`,
    type: `WATCHING` || `PLAYING` || `LISTENING` || `STREAMING`
  },
  status: `dnd` || `idle` || `online` || `invisible`
});
tawny lantern
#

no

potent ivy
#

@cosmic cairn well yeah then its what i said, the only problem he could have are either:

  1. hes feeding an array to the game object, instead of a random element from an array
  2. hes feeding element of that array directly to setPresence, rather than to game field of setPresence
#

tho lmao at those d.js types

#

looks more like psudocode than actual code (i'd expect something like Discord.GameTypes.WATCHING rather than just a blunt string lol)

quartz kindle
#

@rugged minnow make sure you're passing a number and not a string

tawny lantern
#

@earnest phoenix friend me so we can do it in dms i need additional help

earnest phoenix
#

you can just ask your questions here

#

it's what the channel is for

tawny lantern
#

okay so when it says Collection<Snowflake, Role> what does it mean

earnest phoenix
#

that... it's a collection

tawny lantern
#

What do i put in it tho

earnest phoenix
#

keyed by a snowflake (id) and has a value with the role object

quartz kindle
#

a collection is like a Map, which is similar to an array/object, just a bit more complex

tawny lantern
#

So i put my discords admin role in it and other roles

quartz kindle
#

so essentially, when it says a Collection, it means it returns a list of things. in this case, a list of roles indexed by role id

tawny lantern
#

So i put my discords admin role in it and other roles

earnest phoenix
#

you can't edit properties directly

blissful scaffold
#

Snowflake = ID
in this case it is a collection/map of role objects listed by their ID/snowflake

tawny lantern
cosmic cairn
#

This is sorta falling into the spoonfeeding category.

quartz kindle
#

uhm.. what the fuck

#

do you have any knowledge on javascript?

#

at all?

tawny lantern
#

no

#

this is my first time

quartz kindle
#

lmao

blissful scaffold
#

a collection is not a list/array

quartz kindle
#

ok, so you should basically learn a little bit javascript first

#

it will save you a lot of trouble in the future

#

because discord.js is made with javascript, and everything related to it uses javascript, you cant use it effectivelly if you dont know a minimum of javascript

tawny lantern
quartz kindle
#

that doesnt mean you have to type that literally

#

it's just telling you what type of data it is

tawny lantern
#

SO WHAT DO I PUT IN IT LIKE IV BEEN ASKING

quartz kindle
#

we aint gonna tell you

#

go learn some javascript first

tawny lantern
#

please dont make me go to google

modest maple
#

Irony

quartz kindle
#

your name is literally "google"

#

lmao

blissful scaffold
#

follow some JS tutorials please, even basic tutorials should work for this

tawny lantern
#

now look

quartz kindle
#

we dont give code here, we teach people how to code

earnest phoenix
#

vv

#

v

#

v

#

v

#

v

tawny lantern
#

._.

earnest phoenix
#

v

#

v

cosmic cairn
#

@earnest phoenix What do you think you're doing?

quartz kindle
#

@weak parrot

blissful scaffold
#

@weak parrot ads

earnest phoenix
#

v

#

v

#

vv

#

v

tawny lantern
#

anyways

earnest phoenix
#

im trinying to post something'

quartz kindle
#

@modern sable

tawny lantern
#

yall are here to help

blissful scaffold
#

we are not here to be your code monkey @tawny lantern

earnest phoenix
#

they're definitely underage

#

linked yt channel lol

modest maple
#

They tryna advertise

earnest phoenix
#

nah i was pointing at the videos on the channel

modern sable
#

@gilded plank b @earnest phoenix ads for hacked accounts, spam in multiple channels, offering "free chegg" (whatever that is) in #general

gilded plankBOT
#

dblMod Banned Glove#8319 (@formal mountain)

quartz kindle
#

free chegg? wtf

modest maple
#

XD

blissful scaffold
#

I googled it, even google can't help me answer what a "free chegg" is

modest maple
#

It's a digital book company

#

For education

#

Completely shit tho

blissful scaffold
#

so free chegg is like ebook piracy probably

topaz fjord
#

no

#

chegg has hw answers as well mmLol

blissful scaffold
#

Now we know why no one here knows how to program, they use their cheggs to cheat on their coding hw

earnest phoenix
#

ie <#id>

sudden geyser
#

I mean, it's the only way they're represented in their tag form.

#

But you could match the ID too with \d

earnest phoenix
#

yea i mean i just ended up doing

#
const filteredChannel = message.content.replace(/[<#>]/g, '')
client.channels.fetch(filteredChannel)
.then(() => channel reachable)
.catch(() => Channel unreachable)```
#

if a regular id gets passed into that would be fine

#

is there still a default channel these days?

#

or should i just require owners to setup bot on add

quartz kindle
#

u sure that will work?

#

.fetch("some message here 982748240")

earnest phoenix
#

its already filtered down to that arg

quartz kindle
#

👍

earnest phoenix
#

but like i said is there still a default channel these days?

quartz kindle
#

not afaik

earnest phoenix
#

alright ill just make sure to make abundantly clear to setup the bot

low wasp
#

@earnest phoenix or look through all the channels on join and send a message in the first channel it can speak in or a common channel name like general

#

That's what I do

earnest phoenix
#

Can someone hook me up with a public NSFW api?

#

I've been looking for hours>

#

Hey, anyone can help me I don't know why my bot plays a song but not complete that song and leaves the channel.

#

Library: Eris, Version: 0.11.2

sinful lotus
#

highwatermark?

#

if you use ytdl

#

take a look on highwatermark option

#

or it should be on eris issues

#

if its not open, search for it on closed

earnest phoenix
#

Dear Saya,

#

Please say clearly, my english is not good

#

and I'm new with Eris

sinful lotus
earnest phoenix
#

Hmm

sinful lotus
#

I believe I encountered that issue in past

#

and highWaterMark option on play fixed it

earnest phoenix
#

Thanks I just shifted in Eris from D.js

sinful lotus
earnest phoenix
#

Thank you so much, Saya

#

I'm facing this issue from months

main aurora
#

What do I do if the "nod ." command isn't working in VSC

blissful scaffold
#

you don't nod?

main aurora
#

This is my first time making a bot and it said to install nod / VSC. But code in VSC

#

And this is the error
"nod : The term 'nod' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1

  • nod .
  •   + CategoryInfo          : ObjectNotFound: (nod:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException"
earnest phoenix
#

you mean node

main aurora
#

Yes

earnest phoenix
#

do you have node installed?

main aurora
#

I do

earnest phoenix
#

have you tried again but this time instead of doing nod ., do node .

main aurora
#

Oh, I'll try that

#

node . and node . aren't working @earnest phoenix

earnest phoenix
#

node mainFile.js

main aurora
#

Where do I put that command?

earnest phoenix
#

consolewaitWhat

main aurora
#

That doesn't work

#

It's wanting to turn on, because it'll switch from powershell to node for about 2 seconds

twin pendant
#

does your bot have an index.js, or an app.js?

#

if so then do node index.js or the same for whatever you called it

main aurora
#

Honestly man, I'm new to this. So I don't know where to check that

dusky marsh
#

What is the name of your main file

main aurora
#

I'll just post the code so you guys can tell me if there's something wrong

#

const Discord = require('discord.js');
const bot = new Discord.Client();

const token = 'Token';

bot.on('ready',() =>{
console.log('This bot is online');
})

bot.login(token);

dusky marsh
#

okay and that is in a file correct?

main aurora
#

Yes

dusky marsh
#

so what is the name of the file

main aurora
#

index

earnest phoenix
#

so

#

node index.js

dusky marsh
#

and make sure youre in the correct dir

earnest phoenix
#

^

main aurora
#

node index.js doesn't work either

dusky marsh
#

what does it say

earnest phoenix
#

Error?

main aurora
#

Nothing

earnest phoenix
#

Td

#

Tf

main aurora
#

It just switches to node for about 2 seconds and goes back to powershell

twin pendant
#

you got everything installed?

main aurora
#

Yes

dusky marsh
#

are you running this in a text editors powershell or an actual powershell window

earnest phoenix
#

oh

#

are u in vsc? @main aurora

main aurora
#

Yes

earnest phoenix
#

ok

dusky marsh
#

restart it

main aurora
#

So save and restart

earnest phoenix
#

have u saved the file?

main aurora
#

Yes

earnest phoenix
#

also u need to run node index.js in the actual vsc console section

dusky marsh
#

which is accessed by ctrl+shift+` i believe

main aurora
#

That's the point I'm at

earnest phoenix
#

ok that's weird

dusky marsh
#

did you install node after opening the editor

twin pendant
#

or click terminal > new terminal > 'your bot folder'

main aurora
#

Oh

dusky marsh
#

because vsc doesnt recognize new environment variables without a restart

main aurora
#

Thank you @dusky marsh

#

I've wrote the script 5 different times and restarted it, but this restart it worked

dusky marsh
#

ye np 😄

main aurora
#

VSC seems wonky eyesShake

earnest phoenix
#

ikr

dusky marsh
#

vim ftw

#

not really tho thats eh

earnest phoenix
#

vim is a hungry black hole you cannot escape

main aurora
#

Does my laptop have to be on all the time for the bot to be online?

manic terrace
#

if it runs from your laptop yes

main aurora
#

Big oof

manic terrace
#

heroku can deploy it for free for up to 1,000 or so hours a month

restive furnace
#

or pay few bucks for real hosting

#

you can get for 2€ or less a good hosting for bot that doesnt have over 5 shards

main aurora
#

Can you send me a link? @restive furnace

restive furnace
#

Just google, there is tons, but example you can use hostinger

main aurora
#

Thank you

manic terrace
#

hmm. i have a fully hosted website through dreamhost and i wonder if i can host my bot there

fluid basin
#

there is a list of decent hosting options in the pins

twin pendant
#

i use vultr for bot hosting, i got $50 free credit when i signed up (had to deposit $5 to get the account working tho)

manic terrace
#

I have no idea where I’d even look on my dreamhost account to see if that’s viable

earnest phoenix
#

Is there a method to see every guild a member is in>?

#

Using DiscordJS

#

nope

#

only through oauth

green kestrel
#

does anyone else here have any features in place in their bot globally to control or limit abuse and attacks by malicious users?

#

i just had someone try to flood my bot with malformed embeds from selfbots

#

it didnt work but i did notice it.

#

does anyone else here have anything like rate limiting of their commands, honeypots, alerts to bot owners for failed processing, etc?

#

is there any standard recommended approach beyond just 'respect discords rate limits'?

quartz kindle
#

i did something but i havent actually tested it yet

#

i put a check for the message queue in my message event, if the queue is bigger than 5, ignore command

#

that way if the bot is spammed with 100 commands, only 5 will register

#

i made this after my bot was spammed by raiders which caused it to queue um hundreds of responses and keep sending replies for hours due to rate limits

earnest phoenix
#
at /root/alpha123/helpers/functions.js:58:32
at new Promise ()
at Object.supportLink (/root/alpha123/helpers/functions.js:56:16)
at Help.run (/root/alpha123/commands/General/help.js:85:92)
at module.exports.run (/root/alpha123/events/message.js:224:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5)``` getting this error when run help command
amber fractal
#

Whatever your trying to get the property "me" from is undefined

earnest phoenix
#

i got it

late hill
#

Try just logging Discord.Util.parseEmoji(award[i])

earnest phoenix
#

means

late hill
#

Use console.log()

#

And check what exactly happens when you try to parseEmoji

#

with the value you provide

#

I think the name might straight up be the emoji

#

oh

#

show the config for the emojis

earnest phoenix
#

ohk

late hill
#

well then

#

of course it doesn't work

earnest phoenix
#

yy i have added proper ids

late hill
#

Assuming the parseEmoji thing works, you have the name of the emoji

#

You're doing this with it name.split("_")[1];

#

In an attempt to get the letter

#

But your emoji names are not in that format at all

earnest phoenix
#

which format i have to put my emoji name

late hill
#

Do you understand what name.split("_")[1] does

earnest phoenix
#

atlanta_a

#

like this

late hill
#

that would return a, yes

earnest phoenix
#

ohk thx

#

let mr try

#

still same error

#

@late hill

late hill
#

Show the config you used this time

earnest phoenix
#

ohk wait

late hill
#

ok

#

check if Discord.Util.parseEmoji(award[i]).name actually returns the name like you're expecting it to

#

What you could also do that would allow you to just skip this parseEmoji stuff entirely, is just creating a second array with the default emojis

#

So that all you have to do is index the right one

earnest phoenix
#

means??? @late hill

#

its work

#

thx

#

Lol you use Atlanta source

#

Don't delete your screenshot i'm not stupid...

#

And if you want help

green kestrel
#

whats atlanta source?

earnest phoenix
#

Atlanta = discord.js v12

#

yaa but i have done lots of changes

green kestrel
#

is this a bad thing, asks a non-djs user

earnest phoenix
#

and added my own codes also

#

@earnest phoenix Atlanta work with d.js v12(master)

green kestrel
#

ah its a bot fork, ok

earnest phoenix
#

no not fork

#

i just re write

#

just take some help form his codes

#

Just type in shell : npm i discord.js/discordjs

#

You lie but okay :)

#

nope

#

@earnest phoenix come to #commands i will show my bot

#

You have deleted tout screenshot When i have said "Lol you use Atlanta source"

toxic jolt
#

Help please.

earnest phoenix
#

@toxic jolt use a timeout

toxic jolt
#

I could not. Can you help me? @earnest phoenix

earnest phoenix
#

Yeah

toxic jolt
#

Thanks

amber fractal
#

setTimeout(callback, msToWait)

earnest phoenix
#
function leavewola() {voiceChannel.leave();}
setTimeout(leavewola, 30000);```
amber fractal
earnest phoenix
#

:)

amber fractal
#

Or spoonfeed

toxic jolt
#

thanks man

amber fractal
#

Thats fine

earnest phoenix
#

Np

toxic jolt
#

Thanks, @amber fractal and @earnest phoenix ❤️

earnest phoenix
#

Np x2

#

can soneone helo make bot online

#

I give acc

#

?

#

read it

zinc condor
twilit rapids
#

Could be that the user isn't cached for you

zinc condor
#

ah

#

on my phone its invalid-user

twilit rapids
#

Try mentioning the user yourself and then check again

blissful scaffold
#

Or there is no member with the given ID

zinc condor
#

at some point in the past it showed proper welcome

twilit rapids
#

Then member would be undefined @blissful scaffold, which wouldn't result in an ID

blissful scaffold
#

I don't know if riku uses a member object or manually puts an ID in the member variable

#

But you are probably right

zinc condor
#

its a welcome message

#

lemme get the code

twilit rapids
#

using the member object in the event

zinc condor
#

also yes pinging them fixes it

twilit rapids
#

Yeah so it's caching

#

Which is user side and there's nothing wrong with your code/bot

zinc condor
#

dont see other bots having that issue so im gettin confusedd

#

ah ok

#

yeah i looked in other ppls welcome channel and it all shows so i think my client just weird

twilit rapids
#

Discord caching is a mystery

#

One of the top 10 things science can't answer yet

earnest phoenix
#

Discord caching is a mystery

visual sandal
#

discord is a mystery

earnest phoenix
#

i really wonder what is going on inside of the heads of the head management and discord devs because whose idea was it to have this atrocious update

slender thistle
#

They're probably drunk 24/7

zinc condor
#

yeah i dont like this

#

they literally just stole the features from keybase and poorly merged them

visual sandal
#

I tried to make a second bot for testing new commands but it messed up my original bot... I fixed it tho

earnest phoenix
#

can soneone make me bot onlinr cD

#

XD

visual sandal
earnest phoenix
#

@earnest phoenix not the place for it & read faq

#

read the message link i sent you

#

i sent it for a reason

visual sandal
#

How would you get a user’s nickname for a specific server...

earnest phoenix
#

in

#

which

#

library

visual sandal
#

Discord js

pale vessel
#

Try member.nickname

visual sandal
#

Thx

earnest phoenix
#
#

@earnest phoenix What library do you use?
@digital ibex discord.js

zinc condor
#

discord.php

earnest phoenix
#

discord.js
dblSmile

south sky
#

@zinc condor try ${member.toString()}

zinc condor
#

that wont ping the tho?

#

will it?

south sky
#

it will

zinc condor
#

ah

#

alright im tryin it

earnest phoenix
#
/home/lumap/Desktop/pichu-rewrite/node_modules/discord.js/src/client/Client.js:39
    } catch {
            ^

SyntaxError: Unexpected token {
``` I'm getting this error with djs v12, why?
#

We'd need a bit more code I think

#

not much to go off of

#

other than it doesn't expect the bracket

zinc condor
#

@south sky thanks it worked sharkeh

earnest phoenix
#
3|alphabot |     at compileFunction (<anonymous>)
3|alphabot |     at wrapSafe (internal/modules/cjs/loader.js:1060:16)
3|alphabot |     at Module._compile (internal/modules/cjs/loader.js:1108:27)
3|alphabot |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
3|alphabot |     at Module.load (internal/modules/cjs/loader.js:993:32)
3|alphabot |     at Function.Module._load (internal/modules/cjs/loader.js:892:14)
3|alphabot |     at Module.require (internal/modules/cjs/loader.js:1033:19)
3|alphabot |     at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
3|alphabot |     at require (internal/modules/cjs/helpers.js:72:18)
3|alphabot |     at /root/alpha123/alphabot.js:33:28
3|alphabot |     at Array.forEach (<anonymous>)
3|alphabot |     at init (/root/alpha123/alphabot.js:30:14)
3|alphabot | /root/alpha123/events/.ready.js.swp:1
3|alphabot | b0nano 2.9.3
3|alphabot |        ^^^```
#

help me in this error

zinc condor
#

wait

#

it stopped working now :/

earnest phoenix
#

what???

#

@zinc condor what are you trying to do?

zinc condor
#

welcome command

#

welcome activity

earnest phoenix
#

ooh yeah

zinc condor
#
// Welcomer
client.on('guildMemberAdd', member => {
    // Send the message to a designated channel on a server:
    const channel = member.guild.channels.find(ch => ch.name === '┌📓・welcome');
    // Do nothing if the channel wasn't found on this server
    if (!channel) return;

    const verchannel = member.guild.channels.find(ch => ch.name === '✔・verify');
    const rulechannel = member.guild.channels.find(ch => ch.name === '├📗・rules');
    const wowemoji = client.emojis.find(emoji => emoji.name === "wow");
    const welcomeEmbed = new Discord.RichEmbed()
        .setColor("#FF99DA")
        .setAuthor(`Welcome to Weeb Safari, ${member.displayName} ◈`)

        .setDescription(`
        Welcome ${member.toString()}
        • Please be sure to ${verchannel}
        • Follow the  ${rulechannel}
        • And have fun ${wowemoji}`)

        .setThumbnail(member.user.displayAvatarURL)
        .setTimestamp()
        .setImage('https://riku.club/EjLHj.gif')
        .setFooter(`${member.guild.memberCount} Members`, `https://riku.club/ErT8G.png`);
    // Send the message, mentioning the member
    channel.send(welcomeEmbed);
});```
#

this is current

#

for now its a single server bot

sinful lotus
#

unexpected number

#

it means there is a forbidden number somewhere on ur syntax

zinc condor
#

me?

earnest phoenix
#

Assuming you want to ping the person get the id and I think you can wrap it in <@id>

sinful lotus
earnest phoenix
#

how i find that

zinc condor
#

wym

sinful lotus
#

stacktrace already tell you where

zinc condor
#

o

#

I want to ping the person and show the tag of the person aswell

#

like user#1111

#

or do i need literally everyone to cache everyone else(impossible) for that

earnest phoenix
zinc condor
#

ah i see im not the only one live editing my bot from nano on termius SSH mobile

visual sandal
#

I need help resolving the Promise.id

    if(command === 'setup') {        
        message.guild.createChannel('Logs', {
            type: 'text',
            permissionOverwrites: [{
              id: message.guild.id,
              deny: ['VIEW_CHANNEL'],
            }]
        })
        .then(message.channel.send(Promise.id))
        .catch(console.error);
sinful lotus
#

it should be somwhere on your compiler something

#

check that .ready.js.wp

#

not even sure why that exists

earnest phoenix
#

no that folder name doesn't exists

amber fractal
#

@earnest phoenix did you get an answer?

earnest phoenix
#

no, I just switched to v11.5 and it worke

#

I think my npm isnt up to date

amber fractal
#

Maybe, the syntax of try/catch (that I use anyways) is

// code
}catch(e){
// stuff
}```
quartz kindle
#

put your timeout outside

#

the timeout should start running when the person uses the command the first time

earnest phoenix
#

yeah but i have 2 timeouts

quartz kindle
#

why do you need two ?

earnest phoenix
#

if they have voted then the time cooldown time is 1500 ms

#

else its 3000ms

quartz kindle
#

then put the voting logic there

#
cooldown.add()
checkIfVoted.then(v => {
  if(voted) {
    setTimeout(1500)
  } else {
    setTimeout(3000)
  }
})```
earnest phoenix
#

im doing that alreadfy

quartz kindle
#

you're doing it only if cooldown exists

#

and before setting it

#

you're checking for cooldown.has() before setting the cooldown, so when the person uses the command, it has the cooldown added, but not the timeout set

sharp bolt
#

hi, someone to talk about problems in the discord? i need help

quartz kindle
#

state your problem

earnest phoenix
sharp bolt
#

the only thing who appear for me in the browser version is the fast reaction, nothing more

#

i can't see the edition points

#

to edit messages

cyan summit
#

Heya ! Someone made a bot for me, it's basically a bot that plays music, thanks to YT playlists, and it stays in the vc 24/7 even if no one is there.
Problem is, when I put a playlist it almost always says this.
How can I do to make it work ?

earnest phoenix
#

Too many reacuests

#

requests*

still merlin
#

Try and make a cooldown to stop overloading.

quartz kindle
#

if someone did it for you, get him to fix it as well

cyan summit
#

Ye but I tried with multiple sizes of playlist, even a playlist with 5 songs doesn't work

still merlin
#

Maybe youtube playlists are the issue

#

Try using just songs

#

a queue to

cyan summit
#

Ok, I'll ask him, thanks

still merlin
#

No problem :) try and add a 10s cooldown too

cyan summit
#

Ok

earnest phoenix
#

@quartz kindle

quartz kindle
#

?

quartz kindle
#

you're setting the cooldown again

#

you need an if else

#

also, you probably dont want to use hasVoted multiple times

earnest phoenix
#

else if() what then?

#

because im sure there isnt command hasNotVoted

quartz kindle
#

@earnest phoenix hasVoted sends a request to DBL then waits for it. thats why its a promise