#development

1 messages Β· Page 529 of 1

inner jewel
#

discord sharding uses a formula

#

to assign guilds to shard ids

quartz kindle
#

does it?

inner jewel
#

also the discord api is 100% on US east

#

only thing regions change is voice servers

#

yes

#

sharding is shard_id = (guild_id >> 22) % shard_count

quartz kindle
#

if you connect multiple processes using internal sharding, will it remove guilds from one process and assign the to the other?

inner jewel
#

no

#

if you connect two shard 0s

#

both will receive events

quartz kindle
#

thats what im talking about

inner jewel
#

for the same things

#

iirc

hallow prairie
#

Hm k

inner jewel
#

sharding is only really useful to split the load between multiple tcp connections

#

and, depending on the language, across multiple cores

hallow prairie
#

Will look more into sharding before I get more hosting servers

inner jewel
#

as far as bots are concerned

#

for discord it lowers the load because connections are split between possibly multiple machines

quartz kindle
#

yeah thats what he wants to do

inner jewel
#

instead of having a huge bot overloading a single machine

#

sharding for bots won't lower latency

#

if you want low pings, get a server in US east

#

regions only matter for voice servers

hallow prairie
#

I'm hosting on 3 servers in Amsterdam right now

quartz kindle
#

hows the ping?

inner jewel
#

i get about 100ms api/gateway ping on amsterdam

hallow prairie
#

Around 120ms

keen drift
#

it's a little more involved to orchestrate across machines

inner jewel
#

not really

#

if you just start X shards on each machine

hallow prairie
#

So us East will really improve my latency

inner jewel
#

but small bots can easily have all shards on a single machine

#

api/gateway ping, yes, us east will help

quartz kindle
#

you can specify total shards and current shards right?

inner jewel
#

total shards and shard id

quartz kindle
#

so same amount of total shards on all machines, and manually set shard ids on each machine

keen drift
#

the identify payload requires the total and current id

hallow prairie
#

Okay will rent a server in us east and try

inner jewel
#

you have to use the same total shards for all connections btw

#

or you get OP9'd

#

aka invalid session

quartz kindle
#

just make a command that edits/saves a config file containing the shard config

inner jewel
#

or use recommended shard count

#

if you have multiple machines you could have eg redis saving the shard count

keen drift
#

i'm currently going with groovy's method fetching shard id

inner jewel
#

i just run one process so using recommended works for me

#

i might override it with a lower count tho

keen drift
#

my goal is just to add a node to the network and it will find shard id to assign to itself

inner jewel
#

i'm planning on using lighthouse for that when i get to that point

hallow prairie
#

What about lavalink how many resources it uses per server playing music? Approximately

inner jewel
#

about 1-2MB per player

#

depends on jvm settings

#

and architecture

hallow prairie
#

kk

#

Thank you guys learned some new things!

mossy vine
#

can anyone reccommend a node module that emits an event when a streamer is live?

quartz kindle
#

on twitch?

mossy vine
#

yes

#

forgot to mention

quartz kindle
#

you can try this

mossy vine
#

that seems to be exactly what i need, thanks!

earnest phoenix
#

is this correct

#

message.guild.iconUrl

drowsy falcon
#

how can i make my bot ignore some roles when removing roles?

#

cuz it tries to remove all the roles (including the bot role) and gives me
DiscordAPIError : Invalid Role

#

it want the bot not to delete the bot role

quartz kindle
#

how are you removing all roles?

#

if you're looping over them, just add a check to skip said role

drowsy falcon
#

this is the code

#

im a newb btw

#

can someone help me please?

west raptor
#

i dont see why it wouldnt be

topaz fjord
#

Is she cheating on you

mossy vine
#

why do you allow these scam ads

topaz fjord
#

they dont

#

they allow google ads

valid frigate
#

i was using incognito zoomeyes

#

plus imagine having a gf lmao zoomeyes

mossy vine
#

imagine having friends
this post was made by the antisocial gang

amber junco
#

Lol

quartz kindle
#

if you had a gf you wouldnt be here coding

amber junco
#

How do you make your bots page have a back ground?

#

Certified bots only?

mossy vine
#

yees

amber junco
#

Ok

inner jewel
#

imagine memeing in the right channel
this post was made by the go to #memes-and-media gang

bright spear
#

@amber junco no it's not certified bots only

#

Just use css

cinder glacier
earnest phoenix
#

Heya! I was wondering if anyone knows a good js library for searching similar strings. I used string-similarity currently but I don’t think they do numbers quite well

sick cloud
#

just use js

#

.includes

#

and some regex

inner jewel
#

string similarity with regex will be hell

#

@earnest phoenix you can try a weighted levenshtein algorithm, giving numbers a weight of zero/very low

earnest phoenix
#

@inner jewel have you used levenshtein? Is it any better than string similarity or are they just similar to each other

inner jewel
#

it's just a formula for string similarity

earnest phoenix
#

😦

inner jewel
earnest phoenix
#

Thank you!

#

Any good image welcome message tutorials

hallow prairie
#

Use canvas

earnest phoenix
#

any good tutorials i said

#

nub

mossy vine
#

Use canvas

hallow prairie
#

Not specific tutorials for welcome images but if you Google canvas tutorials you will find

sick cloud
#

@earnest phoenix what lang

sturdy chasm
#

So Im nearing the end of what I need to do for my bot. I'm soon to move it over to an ec2 server, but before I do that I was going to move it over to a github to be safe. Before I do that, I was wondering what all needs to be in the .gitignore to make it work with javascript. The reason is bc I have the token in another file (which I think I named config.json)

sick cloud
#

add node_modules and config.json on sep lines

#

should work

mossy vine
#

node_modules/

sturdy chasm
#

Alright, thanks!

sick cloud
#

tfw your / key fails

earnest phoenix
#

Is there a way to get guild names where the bot is in

#

like if the bot is in server A it gets the name of server A

#

nvm im dumb

earnest phoenix
#

Lol

empty owl
#

@earnest phoenix yes but it gets all the server names

#

client.guilds.size

#

wait no

#

i think

marble elm
#

message.guild.name

empty owl
#

um

#

thats not u do that

earnest phoenix
#

i used client.guilds.array()

empty owl
#

@marble elm

sick cloud
#

what does this mean? SyntaxError: import declarations may only appear at top level of a module

empty owl
#

idk

sick cloud
#

happening here

marble elm
#

message.guild.name Gets the current guilds name, like they stated

empty owl
#

@marble elm client.guild.size gets the count

marble elm
#

yes

empty owl
#

and why do u need the name

marble elm
#

I don't

#

Microsoft#3027 asked for it

empty owl
#

then wwaht

#

o

marble elm
#

πŸ€”

inner jewel
#

do imports even work in browser js

marble elm
#

Every time I post my bots server count my bots memory goes up by 20mb, how can I fix this?

sick cloud
#

it should

#

i think i need chrome

#

to use it

inner jewel
#

type="module" in the script tag with the module declarations?

sick cloud
#

with module as type it outputs TypeError: Error resolving module specifier: speech-to-text

#

and whats that mean

inner jewel
#

why not webpack it into a bundle?

sick cloud
#

uhh, idk how?

topaz fjord
#

I mean it can natan

#

With babel

sick cloud
#

i thought it'd work in node.js at first lol

inner jewel
#

yeah if you crosspile it then ofc you can use imports

#

but look at the code he showed

topaz fjord
#

Well it can but with special args when running i think

inner jewel
#

it's directly in a script tag

sick cloud
#

ah in chrome it shows Uncaught TypeError: Failed to resolve module specifier "speech-to-text". Relative references must start with either "/", "./", or "../".

inner jewel
#

but anyway

topaz fjord
#

node --experimental-modules my-app.mjs

inner jewel
#

using webpack/etc also allows your code to run in browsers that don't support the feature

topaz fjord
#

that's how u use imports in node

sick cloud
#

okay

#

how do i require modules in browser js then think

topaz fjord
#

there is requirejs

inner jewel
#

you don't

topaz fjord
#

or use webpack like natan said

inner jewel
#

just webpack + babel it so you can have code full of requires, imports, etc

#

while still having compat for old as hell browsers

sick cloud
#

okay

#

time to go learn all this then

#
    at HTMLButtonElement.onclick (index.html:46)```
how do you fix this tho
#

it is defined

earnest phoenix
#

how is this wrong

!eval client.members.get("274284493043531776").addRole('518601743324545037')
inner jewel
#

client.members.get

#

get guild, then get member

last ferry
#

I haven't really messed with channel permissions in dotnet before. Is there a way for me to inherit all the current permissions for a role and change just one of them?

#

I tried changing one of them and it set all the other permissions back to the default value

#

var overrides = new OverwritePermissions(sendMessages: PermValue.Deny);
await channel.AddPermissionOverwriteAsync(role, eoverrides);
mental solstice
#

does upvote still post user id?

sick cloud
#

yes

mental solstice
#

not seeing it in the request payload

sick cloud
#

its sent as user

#

read the docs

brittle nova
#

aaaaaaaaaa

#

how can I submit a captcha form and do something right after it is checked? like the discord bot invite captcha
I don't want to have a submit button

#

or something extra like that

sick cloud
#

captcha might have a done event

mental solstice
#

maybe not sending because im getting a 401 error

earnest phoenix
#

How can i make it to where it shows the latest voter and to see if the person has voted for the bot?

brittle nova
#

Is it possible to use an EJS variable in a js file referenced by <script>?

haughty jewel
#

yes

#

put the variable in a script and reference it in the script

obsidian badger
#

my bot wont join a voice channel

#

it was made in js btw

shy rose
#

@obsidian badger what lib?

obsidian badger
#

discord.js

#
if(command === "summon"){
  if(message.member.voiceChannel){
    if(message.guild.voiceConnection){
      message.member.voiceChannel.join()
      .then (message.reply("successfully joined"))
    }
  }
    else{
      message.reply("you need to be in a voice channel for me to be summoned!")
    }
}
#

that doesnt work for some reason

west raptor
#

uh because

#

u are checking

#

if the bot is in a vc

#

and if not it ignores it

earnest phoenix
#

^

obsidian badger
#

uhhh........... im smart arent i?

earnest phoenix
#

depends

#

on if you're smart

obsidian badger
#

not really. im 13

#

tweenies arent smart.

#

atleast i aint a twelvie

earnest phoenix
#

what's a "tweenie"

obsidian badger
#

basically twelvie for 13s

earnest phoenix
#

a word only "tweenies" use with their low levels of intelligence

#

jk

#

tf is a twelvie

#

youie cantie justie putie "ie" afterie everythingie

obsidian badger
#

yesie youie canie

rigid crane
#

teenagers?

obsidian badger
#

13yo

#

s

earnest phoenix
#

guys what is the best way to keep track of how much your app is beimg used

bright spear
#

Analytics

earnest phoenix
#

analytics?

#

can you be more precise

#

what do you mean?

#

all i need is a simple way to keep usage of a bot

#

how can i achieve that

#

like how many messages does it send

obsidian badger
#
if(command === "summon"){
  if(message.member.voiceChannel){
    if(!message.guild.voiceConnection){
      message.member.voiceChannel.join()
      .then (connection =>{
        message.reply("successfully joined");
    })
  }
    else{
      message.reply("you need to be in a voice channel for me to be summoned!")
    }
  }
}
#

can someone make that work

#

ive been trying for like, hours

earnest phoenix
#

you have triple === in the first line

obsidian badger
#

yes....

earnest phoenix
#

it shall be ==

obsidian badger
#

it is now

earnest phoenix
#

did it work

#

?

brittle nova
#

=== is fine

earnest phoenix
#

wait in python you use === as ==?

brittle nova
#

javascript

earnest phoenix
#

javascript

obsidian badger
#

this is js

#

btw

earnest phoenix
#

oh

#

im familiar with c#

obsidian badger
#

still not working

earnest phoenix
#

what does message.member.voicechannel return

#

a boolean?

obsidian badger
#

wdym? i dont know these big words. i know them but dont

earnest phoenix
#

what doesnt work there is there an error

obsidian badger
#

these are variables in discord.js or something idk

earnest phoenix
#

can yo show me the error

obsidian badger
#

there is no error

earnest phoenix
#

im not familiar with js but ill try to help

obsidian badger
#

it just doesnt join

earnest phoenix
#

ahh

obsidian badger
#

o ik

#

the ffmpeg install failed

earnest phoenix
#

πŸ‘€

#

did you install opis

#

opus

#

libsodium

#

?

obsidian badger
#

i did install opus

earnest phoenix
#

libsodium

#

too

#

what os are you using?

obsidian badger
#

what is that?

earnest phoenix
#

hahah

#

πŸ€” πŸ˜‚

#

what os

obsidian badger
#

operating sys?

earnest phoenix
#

ye0s

#

yws

#

yes

obsidian badger
#

vsc

earnest phoenix
#

visual studio code?

#

πŸ‘€

obsidian badger
#

yee

earnest phoenix
#

i mean operarign systwm

obsidian badger
#

wut? like w10???

earnest phoenix
#

omg yes

obsidian badger
#

well windows 10

#

thats a stupid question

earnest phoenix
#

i think you need libsodium

obsidian badger
#

more like libtardium

earnest phoenix
#

no

#

yoi dont need libsodium

obsidian badger
#

what do i need?

earnest phoenix
#

im not sure on c# you need libsodium too

#

but on js im not sure

obsidian badger
#

cuz ffmpeg keeps failing

#

i need ffmpeg.binaries apparently

#

but it keeps failing

#

(-_-)

earnest phoenix
#

πŸ‘€

brittle nova
#

there is a discord.js server you know

obsidian badger
#

no i didnt know

#

and this is the error:

npm ERR! code E404
npm ERR! 404 Not Found: ffmpeg.binaries@latest

#

i know why! its ffmpeg-binaries not ffmpeg.binaries

brittle nova
obsidian badger
#

ty. once i get the vc join and music working, what else should i add?

brittle nova
#

Β―_(ツ)_/Β―

#

You could come up with a unique idea

obsidian badger
#

me?

#

i have no creativity

earnest phoenix
#

Are we able to use 3.7 now?

keen drift
#

3.7 of what

earnest phoenix
#

python

keen drift
#

for

earnest phoenix
keen drift
#

I don't see why not

earnest phoenix
#

it used to not work

keen drift
#

the requirement says Python 3.4.2+

#

so I'm assuming anything beyond would work

#

looks like there's some compatibility issue with 3.7

#

They said you should use 3.4-3.6.

#

looks like it's the async reserve word issue

earnest phoenix
slender thistle
#

@earnest phoenix REMOVE THAT IMPORT BOT

#

Thank you

earnest phoenix
#

Oof

slender thistle
#

Also, 3.7 is supported on rewrite branch

#

not async one

earnest phoenix
#

this is an old bot

slender thistle
#

So, I bet it uses an async branch, aye?

earnest phoenix
slender thistle
#

No, I mean

#

That from ... import Bot

earnest phoenix
#

Oh

#

...

slender thistle
#

And can you do pip show discord.py in your command line

earnest phoenix
slender thistle
#

0.16.12 is async, Python 3.7+ not supported

earnest phoenix
#

Fishy told me it was

slender thistle
#

Either downgrade or move to rewrite

#

@keen drift Bad Fishy! >:(

earnest phoenix
#

i tried python 3.6.6

#

And told me ASync def on_ready( ): ASync was an error

slender thistle
#

ASync?

earnest phoenix
#

async

#

stfu

#

Ree

slender thistle
#

Try downgrading to 3.5 and try again

earnest phoenix
#

3.5.4?

slender thistle
#

That'll do

earnest phoenix
#

k deleting 3.7 files

keen drift
#

@slender thistle the fuck, then I said it wasn't

#

it's literally within the same construct

#

I read the requirement, didn't see a maximum version

#

then I read some issues and mentioned the async keyword

slender thistle
#

:^)

#

Chill fam

earnest phoenix
#

DArk is for homos get Reed

#

hmm

#
const DBL = require('dblapi.js');
const express = require('express');
const http = require('http');

const app = express();
const server = http.createServer(app);
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });

dbl.webhook.on('ready', hook => {
  console.log(`Webhook running with path ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});

app.get('/', (req, res) => {
  // ...
});

server.listen(5000, () => {
  console.log('Listening');
});```
#

is that js?

#

thanks @slender thistle It fixed

#

yeah its js

#

im new to JS

#

ive been coding for 6 months

#

obtained very little

uneven rover
#

try something unusual

earnest phoenix
#

learn?

#

ive been learning basics of python for 1 year

obsidian badger
#

ok i need some help. this wont work:

if(command == "avatar"){
  let user = message.metions.users.first() || message.author; 
  let embed = new Discord.RichEmbed()
  .setAuthor(`${user.username}`)
  .setImage(user.displayAvatarURL)
  message.channel.send(embed)
keen drift
#

is it throwing promise errors

obsidian badger
#

yes. sigh

keen drift
#

and that error is...?

obsidian badger
#

like every other error i get

keen drift
#

i think an embed needs a body, can't remember

earnest phoenix
#

message.channel.send({embed: embed})

#

.setDescription()

keen drift
#

.send can take embed directly

earnest phoenix
#

.setDescription is the body im p sure

uneven rover
#

${user.user.username}

keen drift
#

you don't need to construct it

earnest phoenix
#

ah didnt know

#

i usually did it that way

#

.setField

#

idk

obsidian badger
#

maybe it needs a title?

keen drift
#

what's the error first

earnest phoenix
#

^

#

did you make it a variable?

obsidian badger
#

(node:16320) 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: 1)
(node:16320) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

keen drift
#

useful

#

...

earnest phoenix
keen drift
#

perhaps do some then and catch around send

obsidian badger
#

ok

#

my server info works. does this help?

if(command == "serverinfo") {
  let embed = new Discord.RichEmbed()
 .setTitle(`$(msg.guild) infomation`)
 .addField("Id", message.guild.id) 
 .addField("Owner", message.guild.owner)
 .addField("Owner Id", message.guild.ownerID)
 .addField("Roles", message.guild.roles.size)
 .addField("Region", message.guild.region)
 .setThumbnail(message.guild.iconURL)
 message.channel.send(embed)
}
keen drift
#

From what I remember, an embed needs at least a description or fields

#

Your avatar example only has author and image

obsidian badger
#

o ok

keen drift
#

yeah I can't find the doc for that, you'll going to have to try it

uneven rover
#

this might help ['uncaughtException', 'unhandledRejection'].forEach(err => { process.on(err, async (reason) => { console.log(`${err}: ${reason}`); //process.exit(0); }) })

#

in .setTitle() you forgot to construct something

sick cloud
#

take a look at the api docs

#

they list everything about discord's inners

obsidian badger
#
if(command == "avatar"){
  let user = message.metions.users.first() || message.author; 
  let embed = new Discord.RichEmbed()
  .setAuthor(`${user.username}`)
  .setImage(user.displayAvatarURL)
  message.channel.send(embed)```
#

this is the problem

earnest phoenix
#

I was thinking of linking my bot commands to a mysql table so I can link them to web easier

#

would that be efficient or should i just do it manually

#

reapplying my bot

#

it was offline last time i did it

sick cloud
earnest phoenix
#

oops mb

#

how to turn a user id to a username?

idle mountain
#

what language

earnest phoenix
#

dblapi

idle mountain
#

and lib

earnest phoenix
#

js

mossy vine
#

what lib

#

d.js?

earnest phoenix
#

whoops other way around.

#

dblapi.js

mossy vine
#

i mean

idle mountain
#

for your bot

mossy vine
#

what lib is the bot written in

earnest phoenix
#

js

mossy vine
#

thats a language

idle mountain
#

lmfao

earnest phoenix
#

djs

#

fuck

mossy vine
#

okay

#

client.users.get(id).username should work if im not mistaken lemme check

earnest phoenix
#

im having trouble with getting votes for the bot/

#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});```
mossy vine
#

what does vote return again?

sick cloud
#

look at the docs

mossy vine
#

thats what im doing but my internet is slow as fuck

#

replace vote.user with client.users.get(vote.user).username that should work

earnest phoenix
#

thanks but i think i sent the wrong code

sick cloud
#

if the user isnt cached that'll return undefined

#

use fetchUser on stable and users.fetch on master

earnest phoenix
#
dbl.hasVoted("95579865788456960").then(voted => {
    if (voted) console.log("Tonkku has voted!!!")
});```
#

im confused on how i can turn this into a message

#

this shows the .hasVoted

#

im trying to do where it says !vote and it shows if the person voted or not

mossy vine
#

wait fetchUser can get the data even if there are no mutual servers??

#

i mean

#

since youre trying to run it as a command

#

just do the authors username?

earnest phoenix
#

idk?

#

wait yeah

#

i think

#

@mossy vine but how can it check if the person that did !vote coted.

#

voted*

#

cause that code shows that if that id has voted

mossy vine
#

replace Tonkku with ${message.author.username} ig

earnest phoenix
#

prob wont work.

#

dbl.hasVoted("id")

mossy vine
#

but its ran in a command, isnt it? so you already have the message author

earnest phoenix
#

so let userid = message.author.id

#

and js dbl.hasVoted(userid).then(voted => { if (voted) message.channel.send("You have voted") if (!voted) message.channel.send("You have not voted") });

#

or should i use an else

mossy vine
#

you could use else, or be a fancy es6 boi with

voted ? message.channel.send("You have voted") : message.channel.send("You have not voted")```
sick cloud
#
const voted = await dbl.hasVoted(msg.author.id);
msg.channel.send(voted ? 'You have voted!' : 'You haven\'t voted :(');
mossy vine
#

or that

#

yeah thats way better

earnest phoenix
#

i wouldnt understand that lmao

#

nope dont understand ill use an else.

mossy vine
#

a ? : is basically a simplified else

valid frigate
#

i'm planning to make a web dashboard for my bot eventually, does anyone have good resources on how to get started with this kind of stuff

mossy vine
#

statement ? if true : if not true

earnest phoenix
#

glitch

valid frigate
#

imagine using glitch

earnest phoenix
#

honestly the free website i know so far is glitch, weebly, or wix

jagged plume
#

glitch

valid frigate
#

we're talking oauth2 and whatnot so weebly and wix wont cut it mmLol

jagged plume
earnest phoenix
#

who here wants to get pinged to hell

#

as a test dummy

#

dead chat

mossy vine
molten edge
#

Hey guys, so when i try and play a age restricted video the song auto skips and sends undefined in the console
here's the code^

earnest phoenix
#

@mossy vine the tertiary operator has been in javascript for years, so it's not an es6-only feature

#

@molten edge cuz ytdl cant download age-restricted, nothing you can do about that

molten edge
#

😒

sick cloud
#

just add a warning

molten edge
#

how?

mossy vine
#

Oh

earnest phoenix
#

@valid frigate Well you need to learn front end (html, css, js) and a back end of your choice

#

Preferably the same as your bot's

vapid sand
#

Plsgivemoney

earnest phoenix
#

Problem

#

Im trying to make a vote command

#

But it says 401 Unauthorized

#

As the error

#
//To check the dblapi
const dbltoken = process.env.DBL
const DBL = require('dblapi.js');

module.exports.run = async (bot, message, args, ops) => {
  const dbl = new DBL(dbltoken, { webhookPort: 5000, webhookAuth: 'password' });
const voted = await dbl.hasVoted(message.author.id);
message.channel.send(voted ? 'You have voted!' : 'You haven\'t voted :(');
}
module.exports.help = {
  name: "vote"
}```
#

Please ping me if u have an answer

hoary sphinx
#

@earnest phoenix Do you have access to port 5000?

sick cloud
#

dbltoken is invalid

tight heath
#

did you require('dotenv')

#

otherwise process.env.DBL is probably not gonna return anything

mossy vine
#

based on the horrible indentation i assume this is glitch, which makes this stuff automatically work

sinful lotus
#

I dont think itsa good idea to make a new websocket on each command run GWunuDrakeNo zoomeyes GWunuDrakeNo

mossy vine
#

not wrong

hallow prairie
#

moved my database, redis and bot server to us east for better api response times

#

ping is now 63ms instead of 150

sick cloud
#
if (msg.content.search(/@covert dove/) >= 0 && msg.content.search(/@covert dove/) >= 0) { ...

any advice on how to improve this

tight heath
#

what language is that

sinful lotus
#

GWomoDrakeYea When it doubt, Use a regex GWomoDrakeYea

if (msg.content.match(new RegExp(`^<@!?${client.user.id}>`))) {
     msg.chanel.send('hi')
};
tight heath
#

but yeah regex is always better

#

especially with that !

sick cloud
#

okay

#

regex doesnt work

#

@sinful lotus

sinful lotus
#

how did you use it tho

sick cloud
#
if (msg.content.match(new RegExp(`^<@!?${bot.user.id}>`))) {
#

i just chucked it in

sinful lotus
#

u sure it isnt working?

sick cloud
#

i dont get any response

sinful lotus
#

lemme doublecheck my implementation

sick cloud
sinful lotus
#

I dont see any reason for it not to work

#
    if (msg.content.match(new RegExp(`^<@!?${client.user.id}>`))) {
        const parse = !args[1] ? undefined : args[1].toLowerCase();
        if (!parse)
            return await Mentioned.noticed(client, msg, config);
        else if (parse === 'settings')
            return await Mentioned.settings(client, msg, config);
        else return;
    };

I double checked it because I may have misspelled something but I dont thing there is

sick cloud
#

oh ok i see it bugged

#

kek

#

dw

sinful lotus
keen drift
#

anyone got some experience with building inside of docker

earnest phoenix
#

First, 500? Second, Its correct Third, what do i call it?

#

@hoary sphinx @sick cloud @tight heath

tight heath
#

nothing

#

just

#

require('dotenv').config();

earnest phoenix
#

Alright ill try

tight heath
#

also where are you storing your DBL token?

#

in a .env?

earnest phoenix
#

Using glitch

#
  • that wasnt a problem
#

I logged in a webhook instead of the actual dbl

#

πŸ˜‚ sorry

tight heath
#

oh lol glitch

#

ewwww

earnest phoenix
#

;-;

#

Can u help me test something?
@tight heath

#

Took me 3 hours on mobile to see if it works πŸ˜‚

tight heath
#

oof

earnest phoenix
amber junco
#

What is RegExp

keen drift
#

Regex expression

amber junco
#

Whats that?

knotty steeple
#

regular expression*

#

@keen drift

keen drift
#

right, forgot about the first part

mossy vine
#

okay so i know this is kinda spoonfeeding but can someone link me to a simple guide on how to set up a github pages with an actual domain?

keen drift
#

goto settings > enable github pages

#

tada

#

πŸ‘

knotty steeple
#

all you need is a file called CNAME afaik

#

on ur

#

page

keen drift
#

you can do that on the settings page as well

earnest phoenix
#

Alright Imma sleep heres my code.

mossy vine
keen drift
#

but the settings creates CNAME file for you

knotty steeple
#

@mossy vine thats how

keen drift
#

then set it up in github

#

πŸ‘

mossy vine
#

oh ok

earnest phoenix
#
//To check the dblapi
const DBL = require('dblapi.js');
let Discord = require('discord.js')

module.exports.run = async (bot, message, args, ops) => {
  
  let novote = new Discord.RichEmbed()
  .setColor(0x36393f)
  .setDescription("You have not voted! Please vote by clicking [here](https://discordbots.org/bot/508122813299818511/vote)")
  .setFooter(`Recent Voter: undefined`)
  
  let yesvote = new Discord.RichEmbed()
  .setColor(0x36393f)
  .setDescription("You have voted! Thank you for supporting Void! Heres a cookie.. :cookie:")
  .setFooter(`Recent Voter: undefined`)
  
  const dbltoken = process.env.DBL
  const dbl = new DBL(dbltoken, bot);
const voted = await dbl.hasVoted(message.author.id);
message.channel.send(voted ? yesvote : novote);
  
}
module.exports.help = {
  name: "vote"
}``` Ping me if u have the answer. My error is that even tho I voted it says i didnt. K gn
#

Shit 4:21 byee

#

why wont the leaderboard part of this go in order of xp?

#

ping me

earnest phoenix
#

why is this not working?

  if(message.content.startsWith("!give")) {
    if(!message.author.id === message.guild.owner) return message.reply("You're not the boss of me, you can't do that!");
  var args = message.content.substring(prefix.length).split(" ");

    const user = message.mentions.users.first() || client.users.get(args[0]);
    if(!user) return message.reply("You must mention someone or give their ID!");

    const pointsToAdd = parseInt(args[1]);
    if(!pointsToAdd) return message.reply("You didn't tell me how many points to give...");
    
    const key = `${message.guild.id}-${user.id}`;
    client.points.ensure(key, {
      user: message.author.id,
      guild: message.guild.id,
      points: 0,
      level: 1,
      lastSeen: new Date()
    });
    
    client.points.math(key, "+", pointsToAdd, "xp");

    message.channel.send(`${user.tag} has received ${pointsToAdd} points and now stands at ${client.points.get(key, "xp")} xp.`);
  }

It says i did not say how much points to give even though i did

keen drift
#

how about you add some debug lines

earnest phoenix
#

It says fetched is not defined, where am I going wrong?

#
const Discord = require("discord.js");
const ytdl = require("ytdl-core");
const opusscript = require("opusscript");

exports.run = async (client, message, args, ops) => {

    if(!message.content.startsWith("/")) return;
    if (!fetched) return message.channel.send("**I am not playing anything!**");
    if (message.member.voiceChannel !== message.guild.me.voiceChannel) return message.channel.send('**Please be in the same voice channel as Apollo!**');
    if (isNaN(args[0]) || args[0] > 200 || args[0] < 0) return message.channel.send('**Please insert a number less than 200!**');
    fetched.dispatcher.setVolume(args[0]/100);
    message.channel.send(`**Succesfully set the volume of ${fetched.queue[0].songTitle} to ${args[0]}**`);
}```
keen drift
#

fetch is not defined

#

where is fetch defined

earnest phoenix
#

How do I define it?

keen drift
#

you set it equal to something?

#

How are you making this without knowing what defining is

earnest phoenix
#

I dunno.

#

Im trying to define it.

fierce thorn
#

What?

lament meteor
#

maybe your reading the wrong file

earnest phoenix
lament meteor
#

im not sure if canvas can read fies

sick cloud
#

it can't

#

you need fs or something

quartz kindle
#

node-canvas does have a loadImage method

earnest phoenix
#

why im getting this error while im trying to add my bot in discord bots list ?

queen sentinel
#

screenshot how you're putting in the server IDs

empty owl
#

hey

#
 bot.on('guildMemberAdd', member => {
  if (member.guild.id !== serverStats.guildID) return;
  let ifbot = member.guild.members.filter(m => !m.user.bot).size
   bot.channels.get(serverStats.TotalMemberID).setName(`Total Members: ${member.guild.memberCount}`);
     bot.channels.get(serverStats.memberCountID).setName(`Humans: ${ifbot}`);
  member.send("Welcome to Bob!!! \n There sure are many discord servers out there, but Bob is a special one. \n Welcome to our family and community! We've noticed that people join then they just leave, but if you must leave, here is an invite back! https://discord.gg/XGNeFYd \n Might as well tell you the details of this server! \n Our server is based on art, anime, gaming, fun, and much much more! \n First, please check out [#459671870598283275](/guild/264445053596991498/channel/459671870598283275/) to make sure you don't do anything bad! ")
   
   
   
   
   
 });
``` thisworks eh?
tight heath
#

Try it?

empty owl
#

yup ok

lament meteor
#

ads

tight heath
#

A d S

quartz kindle
#

a
d
s

brittle nova
#

"sda".split("").reverse().join("");

knotty steeple
#

"cipot-ffo# ot og".split("").reverse().join("");

quartz kindle
#

"sda".split("").sort((a,b) => a.localeCompare(b)).join("")

earnest phoenix
#

Hello

#

I was looking to maybe in the deleted messages log (a channel where my bot shows all the deleted messages) to also include who deleted them

brittle nova
#

audit logs

earnest phoenix
#

I am pretty sure you need to access the Audit logs yeah

#

Cant find the documentation on how to do that in Python though

#

Could anyone help me with finding that info?

visual zenith
#

How do I get the total amount of commands the bot uses? - Discord.js

topaz fjord
#

You find the size of the array/object/collection/etc where you stored them

loud salmon
#

@empty owl could you remove the invite code in your message, just so we dont have the invite embed :p

empty owl
#

Sure

earnest phoenix
#

How do we find the highest role of a user? is it member.roles.highest in d.js

west raptor
#

read the docs

zealous veldt
#

RTFM

earnest phoenix
#

i did but returns undefined

#

:\

eager kite
#

i see lot of bot have level up thing. If someone free can someone teach me how to do the level up in mongodb cuz now i only have xp

zealous veldt
#

York has a guide using SQLite

#

I'm sure you can translate it into mongo

eager kite
#

i dont think its close

#

lemme see it

west raptor
#

if you read the docs you would see this

earnest phoenix
#

yeah i did, but it is returning undefined

eager kite
#

i never heard a youtube call york

earnest phoenix
#

i said it returned undefined and did not say it's not there

west raptor
#

code rn?

eager kite
#

@zealous veldt u sure its york?

#

i never heard of it

#

and i cant find it

earnest phoenix
#

hello. I"'m a beginner in the bot dev. Someone can say me how to know if a msg is embed ?

tight heath
#

programming language?

earnest phoenix
#

Js

tight heath
#

message.embed

#

lmao

earnest phoenix
#

return boolean ?

tight heath
#

you can use it as a boolean

#

if there's no embed it returns null

#

or undefined

#

which evaluates to false

west raptor
#

that pfp tho...

tight heath
#

if there is an embed, it returns an object

west raptor
#

my eyes

tight heath
#

which evaluates to true

west raptor
#

@earnest phoenix That's probably not the best pfp

tight heath
#

so you could do

#

Boolean(message.embed)

earnest phoenix
#

Ok ty for your help.

tight heath
earnest phoenix
#

While youre not ephileptic, everything okay @west raptor

#

hmm

west raptor
#

what if someone was though?

earnest phoenix
#

ok i'll try later

west raptor
#

What would you do then

earnest phoenix
#

see you later

west raptor
#

ok

tight heath
#

understandable have a nice day

mossy vine
#
try {
            message.channel.send(createEmbed(message.author))
        } catch (err) {
            message.channel.send('Something went wrong. Make sure I have the `Embed Links` Permission!')
        }```
#

why does this not catch if there is no embed links permission

tight heath
#

because that's a promise rejection

#

you catch that using .catch()

mossy vine
#

oh

#

shit u right

#

thanks

brazen gust
#

hello anyone know where can i host a discord bot for free ?

mossy vine
#

glitch

brazen gust
#

ok thx

quartz kindle
#

google gce, but you need a credit card to create an account

earnest phoenix
#

@west raptor if you won't see my pp animation, juste don't pass your mouse on it

#

or

#

block me (no problem i understand)

#

Guys?

#

Is this the SRC of DBL?

vernal rivet
#

yes

#

src is any url

quartz kindle
#
A Java wrapper for the discordbots.org API```
vernal rivet
#

in html, lol

earnest phoenix
#

So if I copy it and upload it on my Webserver will it be the DBL?

mossy vine
#

what the fuck

quartz kindle
#

no lol

#

did you read?

earnest phoenix
#

My own Site

quartz kindle
#

its a java wrapper for the dbl api

earnest phoenix
#

Oh

#

So there is no Src of the Site?

mossy vine
#

not public

quartz kindle
#

of course not, its not open source

earnest phoenix
#

Why are there no tutorials on how to make a own discord bot list on yt

mossy vine
#

smfh

quartz kindle
#

because its not a simple thing

vernal rivet
#

oh yea i forgot it has to be an open source to be a src

earnest phoenix
#

There are just how to program Discord bot tutorials

quartz kindle
#

you need to be a full stack developer to make a bot list

mossy vine
#

or do nothing and hire volunteers to do it for you

vernal rivet
#

yeet

quartz kindle
#

a discord bot only involves one language in one environment

#

a website involves several languages and systems

vernal rivet
#

hypothetically it has like about 5 most used languages for a website

earnest phoenix
#

Sry that I wrote oof

#

just find some other open source listing site and add all that oauth crap to make it for discord bots

#

ez pz

#

Which site

#

There are no sites with open source @earnest phoenix

vernal rivet
#

you can look to find a js version of it

mossy vine
earnest phoenix
#

question how do i implement css into Dbl like make the profile of the bot move?

quartz kindle
#

move in what way?

earnest phoenix
#

@mossy vine I mean bot list site

heady zinc
#

there is tho

#

terminal bot list is open source

mossy vine
heady zinc
#

^

vernal rivet
#

css is mainly made to style the website. if your asking about like effects i suggest you look up w3schools for website tutorials

inner jewel
#

not like anyone needs yet another bot list

#

there's like

inner jewel
#

30 already?

heady zinc
#

ofc we do

mossy vine
#

finna make a bot list on paper :bigbrain:

heady zinc
#

MOAR BOTLISTS

#

we can never have enough

quartz kindle
#

@earnest phoenix css animations

earnest phoenix
#

where would i put the css?

vernal rivet
#

look up w3schools for css and look for animations

quartz kindle
#

in your html description

earnest phoenix
#

waiting for another botlist to dethrone dbl

#

ooo

#

how to get title of an embed msg ? (js)

vernal rivet
quartz kindle
#

message.embeds

earnest phoenix
#

i havent found the method for get title in embeds

vernal rivet
#

.setTitle

quartz kindle
#

message.embeds returns an array of embeds

earnest phoenix
#

not set

#

get

quartz kindle
#

so you need to select an item from it

#

then you get an embed object

earnest phoenix
#

mmm mm mmm

quartz kindle
#

then from there just get the title property

vernal rivet
#

lol

unkempt garnet
#

Hey, how you made that ur bot is responding with text like that:

TEST2
TEST3
TEST4```

Also what about this little color square at the left side.
vernal rivet
#

message.channel.send(`TEST2\nTEST3\nTEST4`);

unkempt garnet
#

love

earnest phoenix
#

i saw it

vernal rivet
#

test

#

it would be 3 ` instead of one

#

i think i did that wrong, i did

#

lol

quartz kindle
#

shame on you

vernal rivet
#

@unkempt garnet it would be ` three times

#

\

#

in front of the `

unkempt garnet
#

πŸ‘Œ

vernal rivet
#

πŸ‘Œ

#

i realized that if you did ` it would be came an object string(i think thats what its called, i know it allows you to enter a object in a string, lol)

quartz kindle
#

template literal

vernal rivet
#

template literal, lol, thats already a confusing name, are they trying to be confusing, lol

high raft
quartz kindle
#

well, its a literal code, like an array literal, string literal, object literal

vernal rivet
#

.setColor

quartz kindle
#

its called template because it allows templating/presetting/building

#

or whatever a template means

#

xD

vernal rivet
#

oh if you put it in that way, it makes more senses, lol

high raft
#

Is it possible to make bot put custom icons from server? I can't do this.

vernal rivet
#

yes

#

are asking like adding a emoji to the server, or using an emoji from the server?

high raft
#

Using emoji.

vernal rivet
#

if you put a \ in front of the emoji you want in discord you get a useable character like this \🐼

quartz kindle
#

thats only for default emojis no?

#

or does it work with custom

vernal rivet
#

idk if it works on custom, i don't have nitro you can try it if you have nitro

high raft
#

But It should work with custom emojis at my own server?

vernal rivet
#

try it

earnest phoenix
#

it does work on custom

#

bots also have access to animated emoji

high raft
#

Lol

#

I tried it and it didn't work.

earnest phoenix
vernal rivet
#

dud you put a \ in front of the emoji?

high raft
#

Ye, it's still don't works.

vernal rivet
#
high raft
#

Ok, I will check it.

earnest phoenix
#

my message.embeds is empty, however i've create an embed

vernal rivet
#

what is the error?

earnest phoenix
#

no error, just

#
client.on('message', message => {
  if(message.embed !== 'null'){
      message.reply(message.embeds.find(function(element) {
        return element.title}));
  

      }
  if (message.content === 'how to embed') {

    const embed = new RichEmbed()

      .setTitle('A slick little embed')

      .setColor(0xFF0000)

      .addField('hey', 'hello', true)
      .addField('111','222', false)

    message.channel.send(embed);
    
}```
#

he retun nothing

vernal rivet
#

its const embed.content = new Discord.RichEmbed()

earnest phoenix
#

instead of ?

#

oh

#

ok

vernal rivet
#

wait no content

earnest phoenix
#

but i want just get title of embed

vernal rivet
#

i saw the message.content then put embed.content TwT

earnest phoenix
#

=)

vernal rivet
#

but you have to have it = new Discord.RichEmbed()

earnest phoenix
#

In fact, i want check if title === 'theTitle', then do it

#

hi

#

hows the trouble

#

i want do something like this:

#

if(message.embed.title === 'thetile'){
DO...
}

#

But the embed array is empty

#

however before i've creted an embed

vernal rivet
#

its because it needs to equal a new Discord.RichEmbed not new RichEmbed.

earnest phoenix
#

i don't care about this part, focus on:

#
client.on('message', message => {
  if(message.embed !== 'null'){
      message.reply(message.embeds.find(function(element) {
        return element.title}));
  

      }
}```
vernal rivet
#

ask tim, he knows more than me on that

earnest phoenix
#

he's inactive mode

#

ok

#

what library

#

discord.js @earnest phoenix

#

k

#

it could be something like this

#
client.on('message', message => {
  if(message.embeds !== null) {
      message.reply(message.embeds[0].title)
      }
})
#

title not definied

#

strange

#

pls show full error

#
C:\Users\Elève\Desktop\Bot\index.js:13
      message.reply(message.reply(message.embeds[0].title))
                                                    ^

TypeError: Cannot read property 'title' of undefined
    at Client.client.on.message (C:\Users\Elève\Desktop\Bot\index.js:13:53)
    at Client.emit (events.js:182:13)
    at MessageCreateHandler.handle (C:\Users\Elève\Desktop\Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\Elève\Desktop\Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\Elève\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\Elève\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\Elève\Desktop\Bot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:182:13)
    at Receiver._receiver.onmessage (C:\Users\Elève\Desktop\Bot\node_modules\ws\lib\websocket.js:137:47)
    at Receiver.dataMessage (C:\Users\Elève\Desktop\Bot\node_modules\ws\lib\receiver.js:409:14)```
#

oh

#

theres no embeds

#

wait

quartz kindle
#

do if(message.embeds)

earnest phoenix
#

oh

quartz kindle
#

i dont think it ever returns null

earnest phoenix
#

it returns undefined

#

oh

#

but about title ?

#
 if (message.content === 'how to embed') {

    const embed = new RichEmbed()
      // Set the title of the field
      .setTitle('A slick little embed')
      // Set the color of the embed
      .setColor(0xFF0000)
      // Set the main content of the embed
      .addField('hey', 'hello', true)
      .addField('111','222', false)
      
      
      
    // Send the embed to the same channel as the message
    message.channel.send(embed);
    
}

});
#

i creat this, but always nothing

quartz kindle
#

did you define RichEmbed?

earnest phoenix
#

huh ?

#

oh

#

yeag

#

of course

quartz kindle
#

if you dont define RichEmbed separately, you have to use it with Discord.RichEmbed

#

afaik

earnest phoenix
#

const { Client, RichEmbed } = require('discord.js');

quartz kindle
#

alright

#

can you post the rest of the code? that part looks fine

earnest phoenix
#
const { Client, RichEmbed } = require('discord.js');


const client = new Client();


client.on('ready', () => {
  console.log('I am ready!');
});

client.on('message', message => {
  if(!message.embed){
      message.reply(message.reply(message.embeds[0].title))

  

      }
  if (message.content === 'how to embed') {

    const embed = new Client.RichEmbed()
      // Set the title of the field
      .setTitle('A slick little embed')
      // Set the color of the embed
      .setColor(0xFF0000)
      // Set the main content of the embed
      .addField('hey', 'hello', true)
      .addField('111','222', false)
      
      
      
    // Send the embed to the same channel as the message
    message.channel.send(embed);
    
}

});```
#

but i got eroor with Client.Richembed

#

the same*

#

message.embeds

#

and remove the exclamtion point

quartz kindle
#

you defined RichEmbed at the beginning already, you dont need to use Client.RichEmbed

earnest phoenix
#

just RichEmbed ?

quartz kindle
#

i believe so yes

#

like you had before

manic badger
#
if(!message.member.permissions.has("MANAGE_SERVER") || message.author.id !== process.env.OWNERID) return message.channel.send("Not enough perms")
``` Says invalid string... tried almost everything
earnest phoenix
#

Tim, he keep going to say me that the length is 0

quartz kindle
#

wut

earnest phoenix
#

message.embed.length is 0

#

however just before i created a embed

quartz kindle
#

how did you create an embed?

#

with another bot?

earnest phoenix
#

no

#

if (message.content === 'how to embed') {

    const embed = new Client.RichEmbed()
      // Set the title of the field
      .setTitle('A slick little embed')
      // Set the color of the embed
      .setColor(0xFF0000)
      // Set the main content of the embed
      .addField('hey', 'hello', true)
      .addField('111','222', false)
      
      
      
    // Send the embed to the same channel as the message
    message.channel.send(embed);
    
}

});```
#

i wrote how to embed

#

the created it

topaz fjord
#

message.embed checks if the message the user sends is an embed

earnest phoenix
#

...

#

It doesn't make sense

topaz fjord
#

it does

earnest phoenix
#

so...

quartz kindle
#

so basically

earnest phoenix
#

how to checks if the message the bot sends is an embed

quartz kindle
#

you wrote "how to embed"

#

and your bot send an embed

#

and it stays embed length is 0?

earnest phoenix
#

yh

quartz kindle
#

on the embed message?

earnest phoenix
#

yh u creted this method

#
      if (message.content === 'ah') { message.reply(message.embeds.length)}
#

before 0 after 0

#

Between "how to embed"

quartz kindle
#

but the message content is not ah

#

that code will only execute on messages that are ah

#

and the embed doesnt have ah

earnest phoenix
#

it's a new command command for see the array embed*

#

the array doesn't change ?

quartz kindle
#

you're checking the embeds length of the current message, not the one before

#

the current message is just ah

earnest phoenix
#

ohh

#

wait i try something

#

doesn't work

#

maybe i can try with id message or something

tight heath
#

does Client.RichEmbed even exist?

#

isn't it Discord.RichEmbed

earnest phoenix
#
//To check the dblapi
const DBL = require('dblapi.js');
let Discord = require('discord.js')

module.exports.run = async (bot, message, args, ops) => {
  
  let novote = new Discord.RichEmbed()
  .setColor(0x36393f)
  .setDescription("You have not voted! Please vote by clicking [here](https://discordbots.org/bot/508122813299818511/vote)")
  .setFooter(`Recent Voter: undefined`)
  
  let yesvote = new Discord.RichEmbed()
  .setColor(0x36393f)
  .setDescription("You have voted! Thank you for supporting Void! Heres a cookie.. :cookie:")
  .setFooter(`Recent Voter: undefined`)
  
  const dbltoken = process.env.DBL
  const dbl = new DBL(dbltoken, bot);
const voted = await dbl.hasVoted(message.author.id);
message.channel.send(voted ? yesvote : novote);
  
}
module.exports.help = {
  name: "vote"
}``` my vote command aint working πŸ˜‚
#

any help to fi

valid frigate
#

i hate to be picky but you could change novote and yesvote to const mmLol

quartz kindle
#

why lol

ornate shadow
#

it's MySQL 8.0

#

did the commands change or something?

knotty steeple
#

look at the error

ornate shadow
#

I am

#

I was for quite some time

#

and I see nothing wrong with it. that's why I am asking

#

has anything changed?

knotty steeple
#

obviously

ornate shadow
#

I mean my bot is working fine on Raspberry Pi and it has plenty of those queries...

#

I've also checked the documentation on MySQL 8.0 and the query I've issued seems valid

knotty steeple
#

well it is

ornate shadow
#

🀦

#

it was a misspelling

#

I typed FORM instead of FROM

#

now it works

knotty steeple
#

ok

#

how do you edit a line in the console

ornate shadow
#

oh nope that was just a little mistake of mine

#

but

#

any idea?

#

how to edit a line? you use the left and right arrow keys or home and end keys

#

then backspace/del

knotty steeple
#

what

#

im using it for a loading bar

topaz fjord
#

@knotty steeple in bash?

knotty steeple
#

js

sick cloud
#

use the process out and in things

#
const write = (str = '') => {
    process.stdout.cursorTo(0);
    process.stdout.clearLine(1);
    process.stdout.write(str);
}``` a function like this works
#

it clears the current like and writes there

#

pratically editing

knotty steeple
#

oh ok

serene sun
#

could anyone inform as how to be able to give a person a role as soon as they join the server?

fresh kernel
#

for starters maybe first give information what programming language you’re using and what package

#

I can’t exactly guess that, y’know
(also, sarcasm just in case)

serene sun
#

im using javascript

#

sorry, im pretty new to this coding stuff

fresh kernel
#

discord.js or discord.js-commando?

serene sun
#

discord.js i believe

fresh kernel
#

nah it’s all good, you need to start somewhere

serene sun
#

yeah just discord.js

#

@fresh kernel ^^

fresh kernel
#

Alrighty

#

Have you used

client.on();

before?

serene sun
#

yup

fresh kernel
#

assuming your Discord Client is called client

serene sun
#

it is indeed

fresh kernel
#

In the documentation, there is a whole list of Events that can be used with client.on β€”> https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=channelCreate

To execute code when someone joins the server, the guildMemberAdd Event should be used

sick cloud
#

join roles are discouraged

#

you shouldnt do them

fresh kernel
#

Unless the bot is server specific

#

or it creates the role when joining the guild

#

but sill, will cause errors, yeah

sick cloud
#

no, they're discouraged 100%

fresh kernel
#

and that

serene sun
#

alright, i’ll just use mee6 for that

#

thank you though !

sick cloud
#

takes nothing of the conversation

#

sure

late hill
#

"Prune members becomes useless"

prune members is always useless

bright spear
#

true

tepid laurel
#

quick question,

#

I was just wondering when doing this in a exports..

knotty steeple
#

an export* mmLol

tepid laurel
#

I'm using a separate script to preset embeds the bot will use.

#

oml

#
exports.embeds = {

    aEmbed: {
        title: '',
        description: '',
        fields: [{}, {}, {}]
    },

    logEmbed: (content, author) = {
        
    }
}
knotty steeple
#

you cant do that

tepid laurel
#

Im hoping that with logEmbed, with this its possible to pass those params to the object after

#

hm

knotty steeple
#

logEmbed: function(myargs) {}

tepid laurel
#

oh it has to be a function

#

alright

#

a function can return it ofc

#

thanks for the tip

knotty steeple
#

np

earnest phoenix
#

can bot DM "general" channel in all servers it is in?

knotty steeple
#

can you abuse the api?

#

no you cant

earnest phoenix
#

i can actually

bright spear
#

well dont

#

also i dont think u get what dming is

#

you dont dm a channel

#

you dm a person

earnest phoenix
#

you get the point