#development

1 messages · Page 1248 of 1

sharp thicket
#

bruh

wind kayak
#

I get it from github

sharp thicket
#

yeah buddy

jaunty tide
#

Is invite manager down for y’all too?

sharp thicket
#

thats stealing code

#

@jaunty tide wrong server

jaunty tide
#

Close enough

#

Lmao

wind kayak
#

But they provided me

sharp thicket
#

thats stealing code

polar fiber
#

@wind kayak hope this is a joke

wind kayak
#

thats stealing code
No

slender thistle
#

-needdev

gilded plankBOT
#

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

polar fiber
#

No
@wind kayak it is

wind kayak
#

I cant because idk all things

#

Ok its

sharp thicket
#

yeah shivaco coming in to help :p

#

@wind kayak stealing code from github will get your bot deleted here

polar fiber
#

He doesnt even has a bot

sharp thicket
#

If you want to make a bot actually learn how to

polar fiber
#

-bots @wind kayak

gilded plankBOT
polar fiber
#

Wait what

sharp thicket
#

he does

polar fiber
#

They don't has the bot dev role

#

Im confused

#

lol

slender thistle
#

Awaiting review

polar fiber
#

Oh

sharp thicket
#

their bot is not approved..

polar fiber
#

oo

#

Im stupid

slender thistle
#

-bots lists bots even if they're not approved yet

polar fiber
#

ok

gilded plankBOT
#

tickNo This user has no bots

delicate shore
#

if you add this in your head

#

script

#

  <script>
if (location.protocol != 'https:') {
 location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
}
</script>```
#

then even if u don't have ssl

#

it will say your website as Secure

polar fiber
#

ok

sharp thicket
#

"Channel for chatting about (bot) development. If you have questions, ask the questions and wait for someone who can answer to help you. "

#

bot

polar fiber
#

I have already ssl but ok

#

What

#

Uh

sharp thicket
#

this channel is for chatting about bot development i belive

polar fiber
#

ye

slender thistle
#

Not restricted to bot development

sharp thicket
#

Oh

#

Sorry..

silver lintel
#
message.channel.send("Enter the channel");
    let filter = m => m.author.id === message.author.id;
    let collector = new Discord.MessageCollector(message.channel, filter);
    let destination = message.channel;
    collector.on('collect', (message, col) => {
      console.log("collected message:" + message.content);
      destination.send(message.content);
    });
    collector.on('end', collected => {
      console.log("messages collected:" + collected.size)
    })
``` ive got this code for a collector which works. how do i make it end after a certain time, like 10 seconds?
sharp thicket
#

settimeout?

#

settimeout

#

BRu

#

omg my keyboard

#

setTimeout

silver lintel
#

where do i add that

sharp thicket
#

in your code duh

silver lintel
#

where in it? ive returned from coding after a 2 year break, im a bit rusty

sharp thicket
#

when you want to end it..

silver lintel
#

ok

#
setTimeout(function() {  
      collector.on('end', collected => {
        console.log("messages collected:" + collected.size)
      })
    }, 10000);
sharp thicket
#

did you get that somewere?

#

or made it yourself?

silver lintel
#

which

sharp thicket
#

whihc??

silver lintel
#

i did myself

sick fable
#

discord.ext.commands.errors.CommandNotFound: Command "kick" is not found

#

What's bad with this thing?

sharp thicket
#

i personally never use setTimeout but i think function needs to be changed

sick fable
#

I also made a command

#

Ick command

#

Kick*

#

But why tf is it showing this?

sharp thicket
#

thats ur command handler

sick fable
#

I am sending the code tho

sharp thicket
#

and you don't know what that means because you prob copied the code......

#

how are you sending your code

#

eval?>

#

eval*

#

eval?**

#

¯_(ツ)_/¯

sick fable
#

@client.event async def kick(ctx, member : discord.member, *,reason=None): await member.kick(reason=reason)

#

and you don't know what that means because you prob copied the code......
@sharp thicket nah

sharp thicket
#

seems like it

sick fable
#

It's my first bot though

#

So everyone makes error

sharp thicket
#

so you stole the code?

sick fable
#

Nah.

sharp thicket
#

copied*

sick fable
#

I learned it through yt videos

sharp thicket
#

same thing

sick fable
#

So what's wrong in it ?

sharp thicket
#

How the actual fuck am i supposed to know how your command handler is setup

#

also add a premissions checker

#

make sure you don't give everyone kick perms

sick fable
#

Kk

primal wraith
#

So bots on the server list cannot include a welcome message feature?

#

(in DMs)

sharp thicket
#

No

#

your bot will be prob kicked from here

primal wraith
#

Kicked from this server or off the list?

sharp thicket
#

from server

silver lintel
#
message.channel.send("Enter the channel");
    let filter = m => m.author.id === message.author.id;
    const collector = message.channel.createMessageCollector(filter, { time: 10000 });
    collector.on('collect', m => {
        console.log(`colected ${m.content}`);
      message.channel.send("collected:" + m.content)
    });

    collector.on('end', collected => {
        console.log(`collected ${collected.size} items`);
      //message.channel.send("collect)
    });

i did this and it works. how to make it send a message when time is up? do i have to do a try and catch?

sharp thicket
#

i dont know @silver lintel

primal wraith
#

Oh okay so your bot can be on the list if it has welcome messages

sharp thicket
#

@primal wraith i could have a patch for that

silver lintel
#

wait im stupid, i can just send in collector end

primal wraith
#

@primal wraith i could have a patch for that
@sharp thicket a patch for what?

sharp thicket
#

client.on("guildMemberadd", (member) => {
if(member.guild.id === '264445053596991498') return;
\ ..
})

primal wraith
#

Oh you mean that

sharp thicket
#

check if the guilds id is dbls id

primal wraith
#

Yeah I could do that

#

I was just wondering

sharp thicket
#

oh okay

#

do you have a bot added yet?

#

-bots @primal wraith

gilded plankBOT
primal wraith
#

Ig so

earnest phoenix
#

@primal wraith They shouldn't be on by default and the bot will stay here
If they aren't disabled for this server it will be kicked only from here
Also #support

primal wraith
#

Idk I added it like 2 weeks ago but I never got a response

#

I think it's because it has admin perms enabled which is a mistake

#

I forgot to change it to just send and react perms

#

@primal wraith They shouldn't be on by default and the bot will stay here
If they aren't disabled for this server it will be kicked only from here
Also #support
@earnest phoenix thanks

sharp thicket
#

what about me ;c

#

lol

primal wraith
#

@sharp thicket u too xd

sharp thicket
#

Xd

forest drift
#

what database would you recommend to use if youre making an economy bot?

earnest phoenix
#

@forest drift mongodb

#

quick.db as a starter but after a few months switch to mongodb

forest drift
#

ive tried mongodb but im just not good enough yet, ive been looking at sequelize but cant find an external host version

carmine summit
#
  console.log(newMember.member.voice.channel.id)
  console.log(oldMember.member.voice.channel.id)
})```
cannot read property id of null
misty sigil
#

newMember.member.voice.channel is null

carmine summit
#

why tho

misty sigil
#

idk

#

try console logging it

pale vessel
#

because the member left the vc?

carmine summit
#

yes

#

buy old is also undefined?

pale vessel
#

you sure the oldMember is undefined?

carmine summit
#

idk

#

?

#

i wanna make it so that if everyone left the vc, a command wil run

misty sigil
#

try logging it

#

kek

carmine summit
#
  if (newMember.member.voice.channel)console.log(newMember.member.voice.channel.id)
  if (oldMember.member.voice.channel)console.log(oldMember.member.voice.channel.id)
})```
misty sigil
#

no

pale vessel
#

bruh

carmine summit
misty sigil
#

Remove those absolutely fucking useless unnecessary and probably stuff breaking if statements

carmine summit
#

that is only what i got

misty sigil
#

log the entire object

carmine summit
#

i will get error if

#

there is no if

misty sigil
#

no you won’t

carmine summit
#

yes i will

misty sigil
#

do you really not understand how console.log works or do I not

#

cuz I’m fairly sure it’d just log null

carmine summit
#

yes it logged null when there is no .id

#

therefore i cannot get which VC the guy left

pale vessel
#

you can get the old VC's ID and check the member size:

if (!oldMember.guild.channels.cache.get(oldMember.member.voice.channel.id).members.size) // empty vc```
misty sigil
#

But wouldn’t the bot count as one member

carmine summit
pale vessel
#

true

#

-1

#

or .filter() if the bot can be outside the vc

carmine summit
#

YES

#

how do i use that thing

warm marsh
#

Is oldMember not a <Member>?

pale vessel
#

voiceStateUpdate event

carmine summit
#

or .filter() if the bot can be outside the vc
@pale vessel how do i use this doohickey

pale vessel
#

use it on what

carmine summit
#

on the thing

#

so it wont get error

pale vessel
#

what are you trying to achieve?

carmine summit
pale vessel
#

check member.voice.channel first before accessing id

#

or ?.

#

but node v14+ only

carmine summit
#

hmm?

pale vessel
#

you can't access a property of null or undefined

carmine summit
#

null

#

^ when user leaves the VC

pale vessel
#

yes

carmine summit
#

how do i make it not null?

pale vessel
#

the user left, it can't be other than null

#

they're not in any vc

carmine summit
#

how do I make it that if someone leaves the VC, the VC's id will get logged?

misty sigil
#

It can’t be?

carmine summit
#

?

pale vessel
#

use oldMember

carmine summit
#

its impossible

pale vessel
#

not newMember

misty sigil
#

if oldMember doesn’t work then Shrug

carmine summit
#

oldmember gives null if someone leaves VC

pale vessel
#

you sure?

carmine summit
#

i think so

misty sigil
#

It shouldn’t

carmine summit
#

i know right

#

i would have this over now if it wouldnt be null

pale vessel
#

make sure that they actually left by making sure newMember.voice.channel is null

carmine summit
#

by they you mean me...

#

both newMember and oldMember will go null if I left the VC

misty sigil
#

could it be caching funniness

carmine summit
#

i would expect newMember would be null while oldMember be the last VC I am on

#

and when i join i would expect the opposite

earnest phoenix
#

I think you can create a JavaScript on Android

viral plover
#

To make a bot work properly on multiple servers, you have to make it use separate global variables for every server, right?

wind kayak
#

-bots

gilded plankBOT
viral plover
#

Otherwise, depending on the bot, data can mix if its being used at the same time in multiple places, right?

#

If I use the ".flip" command on one server to change a global variable to true, and use the ".check" command on another server to check that variable's value, it'd be true, right?

#

I came here to double check with devs that the above is true and that I have to put in a lot of work to make scenarios like above not happen unless I want them to.

earnest phoenix
delicate shore
#

I wanna do message filters

#

like someone said Shit

#

I have done message.content.includes.......

#

and added shit

#

but if S is capital then it does not work

viral plover
#

Try .toLowerCase() or your language's equivalent for the message content.

gilded plankBOT
#
Bots <:dblAdmin:483994951961673738> <:dblMod:483995659054088193>

@rocky edge
@pliant gorge
@tacit grail
@gilded plank
@smoky prairie
@opaque adder
@finite olive
@exotic kite

earnest phoenix
#

How to make Pokécord Spwan Feature

delicate shore
#
  const swearWords = ['words here']
  if(swearWords.some(word => message.content.includes(word.toLocaleLowerCase)) ) {
    if(message.guild.id !== "690557545965813770") return 
    if(msg.channel.id === "736428278969270342") return 
 message.delete()
 
   message.author.send('Cursing is not allowed in this server So better watch out')
   msg.channel.send(`![boi](https://cdn.discordapp.com/emojis/756070485560787004.webp?size=128 "boi") No Cursing or you'll be muted`)
   
 }``` @viral plover this is how i do it but it does not work
#

don't pay attention to msg and message

#

they both are same

#

I have done const msg = message

viral plover
#

You mentioned the wrong person. weirdsip

delicate shore
#

oh

#

sorry

#

Try .toLowerCase() or your language's equivalent for the message content.
@viral plover no you only said this tho

viral plover
#

Yeah, but I typed that to help--
Oh, sorry.
I uh, misunderstood.

delicate shore
#

ok

faint prism
#

Might want a fast database for swear words

#

Like in memory perhaps

viral plover
#

I use JS so Python's a bit weird to me but...
This is in the "on message" event, right?

#

Though if it is I'd expect the swear list to be declared elsewhere.

#

I'm probably just nitpicking. >.>

delicate shore
#

Might want a fast database for swear words
@faint prism ok but why doesn't the bot respond

viral plover
#

As long as there's no issue with msg vs message like you mentioned, I don't see why it wouldn't work.

#

Have you checked if any of the code is triggering?

soft eagle
#

is there a way ping another bots ip:port with my other bot to see if that bot is online or not? it uses discord.js

delicate shore
#

@faint prism I got an error

#

finally

#

it says cannot read property some

#

of undefined

viral plover
#

I don't know about pinging another bot's ip:port, but you can check its status just like a regular user, right?

cobalt scaffold
#

ye there is, I use js on my bot and have a way to check statuses. you could filter that by bots or just check a certain Id to make that work

soft eagle
#

how did you figure it out ?

#

bc im stumped

cobalt scaffold
#

google

soft eagle
#

ive tried i found nothing on it

cobalt scaffold
#

idk code tbh I look everything up

#

ok uh there should be a tutorial on a server info command which has that and a ton other stuff

#

I cant remember the exact one though

#

I'll see if I can find it

#

ok it's the one by menudocs

#

if you search up discord.js serverinfo then go to around 11 minutes that should help you

#

@soft eagle

faint prism
#

@faint prism ok but why doesn't the bot respond
@delicate shore no idea. Use break points

soft eagle
#

@cobalt scaffold im not looking for serverinfo im looking for a ststus of an ip:port

#

to see if my bot is up ort down so if the bots status is offline i can tell its online

earnest phoenix
#

do you want to ping a minecraft server

#

my message sent late

#

ok anyways

soft eagle
#

i know mc and websites

#

trying to ping the bots ip:port

#

from another bot

earnest phoenix
#

bots don't do inbound traffic

fast loom
#

does anyone know if there is a limit to how many channels the bot can send message to at the same time?
Or it depends on the server it's hosted on cuz of the processes

earnest phoenix
#

they don't have a ip:port, bots are just connecting to discord

soft eagle
#

i did ```const http = require(http);
const app = http.createServer((request, response) => {
response.writeHead(200, {"Content-Type": "text/html"});
response.write('works');
response.end();
});

app.listen(2028);``` on the bot i want to check bc uptimerobot required that

earnest phoenix
#

@fast loom 5/5 is the known limit however your lib should handle it for you

soft eagle
#

i just want a way to see if the port is running or not

fast loom
#

so a bot can only send a message to 5 channels at the same time? if that's so it'd suck big time pandasad

earnest phoenix
#

the limit is per channel

#

5 messages per 5 seconds

fast loom
#

yeah, I know the limit per channel

#

so it doesn't have any limit for multiple channels

earnest phoenix
#

i dont get what you mean by at the same time

fast loom
#

like... to send a message in all channels in this server

#

at the same time, as an example

earnest phoenix
#

requests will never happen at the same time regardless, it's impossible

silver lintel
#

how do you check if a variable/args is a channel in the server and not just random letters?

cobalt scaffold
#

depending on what its for i might be able to help

warm marsh
#

For it to be a channel either check it's name or use it's id

#

or better yet check for a mention of a channel

silver lintel
#

yes, how do i see if its that

warm marsh
#

A mention?

silver lintel
cobalt scaffold
#

yes

silver lintel
#

okay, i want to check if it is a mention of a channel

warm marsh
#

Depending on library used the way of checking that is done slightly different

silver lintel
#

discord.js v12

#

node v12

warm marsh
#

<message>.mentions.channels

#

iirc

#

Returns a collection

silver lintel
#

and see if its in the collection?

warm marsh
#

Yeah

#

if collection's size is > 0 then .first

#

or something

cobalt scaffold
#

oh the way i always did it was just message.mentions.channels.first

warm marsh
#

Either works

cobalt scaffold
#

if you do .first then make sure to filter out #deleted-channel

warm marsh
#

Just using .first returns undefined if not found

silver lintel
#

how would it be done in if statement form?

warm marsh
#
if (collection.size > 0)
{
  // do code here
  let first = collection.first();
}```
soft eagle
#

nvm figured it out i just check if the port is reachable using isPortReachable

const isPortReachable = require("is-port-reachable");
(async() => {
        //console.log();

        if ((await isPortReachable(2028, { host: botip })) === true) {
            console.log("Up");
        } else {
            console.log("down");
        }
        //=> true
    })();```
visual robin
#

@gilded plank

soft eagle
#

so if i need to send like 9 msgs how would i split it to send within the limit

#

so i dont get api banned

#

like how many seconds should i make each timeout be to be within limit

zenith patio
#

like how many seconds should i make each timeout be to be within limit

cobalt scaffold
#

you would probably only need like 1 second in between each message

#

maybe 1.5 to be safe

#

because im pretty sure its 5 messages in 5 seconds max

#

i think i saw that earlier

zenith patio
soft eagle
#

so each msg should be sent 2 seconds apart from each other then

cobalt scaffold
#

ye ig

#

just make it at least 1 second

zenith patio
#

How to show it in my server

#

I can not

cobalt scaffold
#

do you want to make that feature yourself or add the bot thats doing it in the screenshot

zenith patio
#

YEs

#

YES

cobalt scaffold
#

yes to what

#

which one

zenith patio
#

Yes, I want to do this in my server

cobalt scaffold
#

with your own bot or the one in the screenshot

arctic cape
#

Why is my member.username undefined ? 😥

zenith patio
#

Yes

cobalt scaffold
#

@arctic cape what language are you using

arctic cape
#

Discord. Js v12

cobalt scaffold
#

im pretty sure member.username isnt a thing

arctic cape
#

Wait wth

cobalt scaffold
#

what are you trying to do

zenith patio
#

Can you do to me with the picture?

arctic cape
#

Brb wait

cobalt scaffold
#

Can you do to me with the picture?
@zenith patio i dont know how you want to actually do it

#

are you using someone elses bot or your own one

#

to show those

#

dont just say yes

arctic cape
#

Member is first mentioned user or author.

zenith patio
#

You do it

arctic cape
#

And .nickname is resolving but username doesnt work am i stupid ? 🤔

cobalt scaffold
#

wdym first mentioned user or author

arctic cape
#

Yes

#

Wait

cobalt scaffold
#

You do it
@zenith patio so you want to get someone elses bot to do it?

zenith patio
#

Someone else

cobalt scaffold
#

ok

arctic cape
#

let member = message.mentions.members.first() || message.member

zenith patio
#

Yes

cobalt scaffold
#

find out what bot it is thats doing it in the screenshot you sent then add that bot to your server

#

let member = message.mentions.members.first() || message.member
@arctic cape ok so what are you using this for

arctic cape
#

Userinfo

#

Nickname

#

I want to set my nick variable as the username of member

zenith patio
#

Fetchr bot and id do server

arctic cape
#

In case of no nick is there

zenith patio
#

Furure*

#

T

cobalt scaffold
#

ok i havent really done anything with nicks but you can probably just make it so if they have a nick, show it and if there isnt any then just leave it out

arctic cape
#

Leave it ? 🧐

#

That could be a way out

#

Thnkx

feral aspen
#

Hello

#

How does this work?

#

How can I make something like [2020-1-1, 00:00]: ???

#

The date and time?

#

Do I use Date.Now()?

neon sphinx
#

!help

feral aspen
#

Seriously.

#

Guys

#

Is this a command?

#

if(!money[user.id] || !bank[user.id]) return message.channel.send(noMoneyEmbed)

fringe axle
#

Try and see

feral aspen
#

Like can I use 2 !s at the same time?

fringe axle
#

And what tf you are trying?

feral aspen
#

I am asking.

#

Is it a command or not?

fringe axle
#

I don‘t know what the code should do

#

And IDK what are you trying

feral aspen
#

if the user does not have a money or bank account it returns

#

like that

#

so I made this

fringe axle
#

Just try it and see

feral aspen
#

if(!money[user.id] || !bank[user.id]) return message.channel.send(noMoneyEmbed)

arctic cape
#

@feral aspen use && like a && !b

#

I think [not sure]

feral aspen
#

Thx @arctic cape

silver lintel
#

That current code is saying if a user doesn't have money, or that user doesn't have money in the bank

#

If you to send the nomoney embed if the net worth is 0

#

Then you need &&

feral aspen
#

so

#

if(!money[user.id] && !bank[user.id]) return message.channel.send(noMoneyEmbed)

silver lintel
#

Yes

feral aspen
#

Alright

#

Thank you! 🙂

silver lintel
#

If the user has 0 in money but 1 in bank, it won't trigger

#

Np

arctic cape
#

Is there a way to get mentioned user's username except length substring of user.tag ?

#

If he has no nickname

#

Discord. Js v12

quartz kindle
#

what

faint prism
#

What

#

@arctic cape So the username minus the descriminator?

arctic cape
#

See i made a userinfo command which has field nickname

#

So if a person doesn't have a username which i check using !nickname i. E variable i want to set this var to the username and it doesn't work 😥

wicked pivot
#

hello, i coded this yesterday but its not working, is the syntax correct?

if(client.channels.cache.get(VoiceTemp.users[newState.id].ChannelID).members.size > 1){
                client.channels.cache.get(VoiceTemp.users[newState.id].ChannelID).members.map(async(user) => {
                    user.voice.setChannel("534847940959666196")
                })
            }

VoiceTemp.users[newState.id].ChannelID = ID VoiceChannel```
#

the fact that the movement in the channel afk poses no problem?

faint prism
#

Get more logging or set breakpoints

drifting wedge
#
    mongo_url = "url"
    cluster = MongoClient("peepee")
    db = cluster["poopoo"]
    collection = db["u nerd"]
    guild_id = int(ctx.guild.id)
    guild_id2 = {"_id": guild_id}

    prf = collection.find(guild_id2)
    for pre in prf:
        prefix = pre["prefix"]

client = commands.Bot(command_prefix = getprefix)```
#

this is d.py and mongo

#

and i want to make like custom prefixes

#

plez help

#

giving this error TypeError: on_message() missing 1 required positional argument: 'message'

faint prism
#

I don't like your database naming convention

drifting wedge
#

its not that

faint prism
#

It should be descriptive of it's contents

drifting wedge
#

its just like i changed it

faint prism
#

Unless?

hazy sparrow
#

Is there a way to check if args[1] is a link to a discord server?

pale vessel
#

use regex

#

if (args[1].match(pattern)) <valid invite>

hazy sparrow
#

kk, thanks

silver lintel
#
message.channel.send("blah blah blah");
setTimeout(function() {
message.delete;
}, 3000);

How do you delete a message after 3 seconds in discord.js?

hazy sparrow
silver lintel
#

32k pings!

hazy sparrow
#

Dont question it lmao

umbral zealot
#

do what, the attachment or the screenshot

hazy sparrow
#

the screenshot

umbral zealot
#

probably a tool like puppeteer.

hazy sparrow
#

@silver lintel setTimeout

silver lintel
#

Yes

#

Did I format it correct ly?

#

Prolly not

faint prism
#

Or selenium

hazy sparrow
#

probably a tool like puppeteer.
@umbral zealot kk, thanks!

#

Why dont you test it @silver lintel

pale vessel
#

How do you delete a message after 3 seconds in discord.js?
@silver lintel you can use channel.send(data).then(sent => sent.delete({ timeout: 3000 }));. you send a message and get the sent message. after that, you delete it after 3 seconds (3000 in milliseconds)

faint prism
#

Selenium isn't headless, so it'll actually have a window to screenshot

charred kindle
#

What permissions does my bot need to give roles?

#

I tried Manage_Roles but it doesnt work, but when I give admin, it works

silver lintel
#

Thank you fazepe

warm marsh
#

MANAGE_ROLES works as long as the role you're trying to give is lower than the bots highest role

wicked pivot
#

every time I create a channel I would like it to be above afk

newState.guild.channels.create(`Vocal de : ` + client.users.cache.get(newState.id).username, {type: 'voice'}).then(tempchannel => {
            tempchannel.setParent("567883665435131904")
            tempchannel.setUserLimit(2)
})```
charred kindle
#

Ok, it works. I was just being dumb

earnest phoenix
#

Is there a way to get a users badge?

heavy anchor
#

Yes <User>.flags if your using discord.js

tired nimbus
#

is it possible to pass a sqlite table into parameters?

earnest phoenix
#

Yes <User>.flags if your using discord.js
@heavy anchor thank you

quartz kindle
#

@tired nimbus nope

tired nimbus
#

ok

earnest phoenix
#

what's SQLite
what's mongodb
what's the universe
what's life
what's life's true purpose

quartz kindle
#

42

earnest phoenix
#

darn

#

you got me

#

and you're now a reddit meme

quartz kindle
#

Nice

earnest phoenix
#

oops #general we're going general (not off-topic GENERAL cuz the channel name changed)

earnest phoenix
#

try to remove the www. in front of twitch's domain

#

maybe discord gets confused and doesnt allow that as a valid twitch url @earnest phoenix

#

hm

#

@earnest phoenix found the problem

#

you're passing a string as the first parameter instead of the string being INSIDE the object as the first parameter

#

it's supposed to be setActivty({ name: "fuck"}); NOT setActivity("fuck",{});

#

discord.js docs say otherwise

#

@earnest phoenix get the syntax correct boi

#

("name",options)

#

wut

#

@earnest phoenix gib link

#

client.user.setActivity('discord.js', { type: 'WATCHING' })
~ djs docs example

#

what

#

@earnest phoenix mine is VERY different:

    bot.user.setPresence({
        activity: {
            type: "STREAMING",
            url: "https://twitch.tv/nauticaljeans84",
            name: `c.help | ${bot.guilds.cache.size} servers| Support server discord . gg/Usv92Db | s t o p    r e a d i n g    m e`
        }
    });
silk chasm
#
TypeError: 'module' object is not callable```
#

does anybody know about it?

#

it's not js

umbral zealot
#

Client is not the same as client

silk chasm
#

Client is not the same as client
@umbral zealot elaborate

umbral zealot
#

languages are usually case-sensitive

silk chasm
#

oh

#

i got it

#

it's capital c

#

languages are usually case-sensitive
@umbral zealot thanks! u will live 10 years...

umbral zealot
#

I really hope we live a whole lot longer than that, but thanks 😄

silk chasm
#

ur non-edited sentence was good

umbral zealot
#

there, now it's even better 😄

fast loom
#

hhaha

#

If 2020 actually manage to end someday

silk chasm
#

ok

#

i got a big error

#

i need some python programers

#

who use pycharm

#

and know about

#

anybody?

#

wtf is everyone here are javascript programers

fast loom
#

haha

#

@silk chasm what's the problem in pycharm?

silk chasm
#

not in pycharm

fast loom
silk chasm
#

i think

#

when i am running my code

#

that is of 25 lines

#

i got some actually very much

fast loom
#

send the code and/or the error

restive furnace
#

learn 👏 the 👏 language 👏 ✨ first ✨

fast loom
#

:d

silk chasm
fast loom
#

Or learn another language and check the syntax through google like I do

silk chasm
#

learn 👏 the 👏 language 👏 ✨ first ✨
@restive furnace ik python...any prob?

restive furnace
#

I like object oriented/based languages' syntax more than function oriented

fast loom
#

send the error text

#

like.. screenshot it

restive furnace
#

@restive furnace ik python...any prob?
@silk chasm then why do you ask beginner questions 🤔? but okay.

silk chasm
#

like.. screenshot it
@fast loom it has many errors can screenshot it

#

@silk chasm then why do you ask beginner questions 🤔? but okay.
@restive furnace what questions?

fast loom
#

certificate verify failed: certificate has expired

#

this is your error

gentle zenith
#

Does anyone know I how to make channels

restive furnace
#

isn't this question: i got big error, i need some python programmers etc.

fast loom
#

or was it the python version itself

#

One of the two

restive furnace
#

certificate verify failed: certificate has expired
@fast loom this means he's using windows and need to get the latest certificates

fast loom
#

i got the same error when they update his stuff

silk chasm
#

certificate verify failed: certificate has expired
@fast loom i got that error before also ... that's y uninstall and reinstall it... but still the same

long cipher
#

@gentle zenith What language and library?

fast loom
#

idk then... for me it worked after I reinstalled a couple libraries

gentle zenith
#

@long cipher dm me!

silk chasm
#

or was it the python version itself
@fast loom oh wait my python is showing "available updates"

fast loom
#

OFC after I spent 2 days trying to find how to do it all xD

silk chasm
#

pycharm

fast loom
#

oh LEL

restive furnace
#

pls someone du -checkdms

fast loom
#

well, still, I think it's the libraries

silk chasm
#

let me update my pycharm and then i'll see it...

restive furnace
#

paste that exact code and see

green kestrel
#

so yesterday we talked about translation, and how to handle it in a bot. I've settled on an external json file thats loaded when the bot starts: https://github.com/brainboxdotcc/triviabot/blob/master/lang.json
then this simple bit of code to find and translate a language string:

std::string _(const std::string &k, const guild_settings_t& settings)
{
    auto o = lang.find(k);
    if (o != lang.end()) {
        return o->find(settings.language)->get<std::string>();
    } else {
        bot->core.log->debug("Missing language string '{}'", k);
    }
    return k;
}

thoughts? seems to work and scale quite well.

tired nimbus
#

Is it possible to pass a sqlite table's gotten key to parameters?

lusty musk
#
client.on("ready", () => {
  function randomStatus() {
    let status = [
      `exompel -help`,
      `Your Website link here`,
      `${client.users.size} Users|${client.guilds.size} Servers ${client.channels.size} Channels`
    ]; // You can change it whatever you want.
    let rstatus = Math.floor(Math.random() * status.length);
    client.user.setActivity(status[rstatus], { type: "PLAYING" });
  }
  setInterval(randomStatus, 2000);
  console.log(
    `${client.guilds.size} servers have ${client.users.size} members ${client.channels.size} Channels `
  );
});
restive furnace
#

so yesterday we talked about translation, and how to handle it in a bot. I've settled on an external json file thats loaded when the bot starts: https://github.com/brainboxdotcc/triviabot/blob/master/lang.json
then this simple bit of code to find and translate a language string:

std::string _(const std::string &k, const guild_settings_t& settings)
{
    auto o = lang.find(k);
    if (o != lang.end()) {
        return o->find(settings.language)->get<std::string>();
    } else {
        bot->core.log->debug("Missing language string '{}'", k);
    }
    return k;
}

thoughts? seems to work and scale quite well.
is that std::format in the logging? or custom one?

green kestrel
#

no its fmt::format

restive furnace
#

ah

green kestrel
#

bundled with spdlog

restive furnace
#

i see

#

neat code

green kestrel
#

thanks 🙂

#

its using nlohmann::json as the json parser

restive furnace
#

cool

fluid widget
#

Hello, I had a problem playing some YouTube songs and it tells me when playing some of it, look at the picture

#

how can i fix it

green kestrel
#

make sure the config file exists and is in the right place and properly formed

#

the error says cant find config file.

fluid widget
#

You did not understand what I meant. I worked on this file and it works fine, but there is some music that is not playing and this talk appears to me, but the file is present

#

how i fix it

earnest phoenix
#

PING

unreal tapir
#

is botghost good host

twilit rapids
#

To use for a personal Discord server: yes
To use as a public bot for everyone to use: no

misty sigil
#

public bot ghost bot bad

#

for many reasons

#

who tf knows where they store your token

#

will they eventually cut service if your bot grows too big? YES

charred kindle
#

It's also free so 🤷

slow otter
charred kindle
#

@slow otter What library are you using?

slow otter
#

discord.js

eternal osprey
#

hey

#

so i have currently made a command that you can join queues

charred kindle
#
eternal osprey
#

and check your time uing !time.

charred kindle
#

Queues for what

eternal osprey
#

how do i actually just display the queue time next to a name

slow otter
#

tnx

eternal osprey
#

just a discord queue

#

if you join

#

your name appears on the list

fluid widget
eternal osprey
#

define a player config

silk chasm
#

if you join
@eternal osprey looks like mafia bot

eternal osprey
#

mafia bot?

charred kindle
#

@eternal osprey Well, you need to calculate the queue time first

eternal osprey
#

i already have that

charred kindle
#

Ok,

eternal osprey
#

i actually have a comman for that

#

i just want to display the time next to someones name

#
unction timeInQueue (userId, timeFormat = 'm') {
  const userIsInQueue = isUserInQueue(userId);
  const queuedUserObj = getUserFromQueueByUserId(userId);
  if (userIsInQueue && queuedUserObj) {
    let timeValueReturned = 0;
    const now = new Date();
    const queueJoined = queuedUserObj.timestamp;
    const diffMs = (now - queueJoined);
    const diffDays = Math.floor(diffMs / 86400000);
    const diffHrs = Math.floor((diffMs % 86400000) / 3600000);
    const diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000);
    switch (timeFormat) {
    case 'm':
      timeValueReturned = diffMins + ' minute(s)';
      break;
    case 'h':
      timeValueReturned = diffHrs + ' hour(s)';
      break;
    case 'd':
      timeValueReturned = diffDays + ' day(s)';
      break;
    default:
      timeValueReturned = diffMins + ' minute(s)';
    }
    return timeValueReturned;
  }
  return false;```
the snippet
#

for the time

silk chasm
#

mafia bot?
@eternal osprey it's a popular bot... just ur bot looks like that

charred kindle
#

erm

#

I dont work with js so i cant help, sorry

fluid widget
#

I have set a config, but some music is not working@eternal osprey

eternal osprey
#

it's okay dark42ed

earnest phoenix
#

What is the "Team User" Badge?

slow otter
#

How do I make a ticket system?

eternal osprey
#

hey guys

pale vessel
#

What is the "Team User" Badge?
@earnest phoenix application's owner that is from a team (only available through oauth iirc)

eternal osprey
#

this is my coe

#

i actually want to create a command that admins can remove people from the queue, how do i do that?

earnest phoenix
#

@earnest phoenix application's owner that is from a team (only available through oauth iirc)
@pale vessel ah okay thanks

pale vessel
thick gull
#

hey i know that bot ;eyes;

upper elm
#

ok so I'm working in discord.js and I have a map for every user and a value of "money". Every time I take the bot off and bring it back online to update the code, the map resets. Is there any way around this?

buoyant aspen
#

Use a database. Maps clear when the bot comes offline.

upper elm
#

im 13 what's that

#

lol

buoyant aspen
misty sigil
#

what does your age have to do with that

#

? ? ?

upper elm
#

im saying im pretty new to programming and not that great

#

thanks cam i like your status btw

buoyant aspen
#

It's all good, just watch some tutorials.

#

I assume you're using discord.js?

#

@upper elm

upper elm
#

yea

buoyant aspen
#

Okay, that video should work just fine for you. Good luck!

upper elm
#

thank you!

buoyant aspen
#

Of course!

#

Can I not use the author property of a message object?

message.reportedMessage.author.send('...');

discord.js

earnest phoenix
#

Ok how do I handle HTTP exceptions to stop being ratelimited by discord?

eternal osprey
#

https://hastebin.com/udilamutel.js this is my code. How do i show the time someone has been in the queue next to the name of the person, in the embed, I already have a !time command.

modest smelt
#

how do i make a bot that nukes a channel?
discordpy pls

fervent goblet
#

if i were to constantly get invites what interval should i use?

modest smelt
#

idk

#

u answer my question

#

how do i make a bot that nukes a channel?
discordpy pls

fervent goblet
#

uhhhhhh

umbral zealot
#

define "nukes"

fervent goblet
#

^

umbral zealot
#

as in, deletes a channel?

fervent goblet
#

lowkey sounds like a raid term to me

shy turret
#

so... how would you add sharding with keyv?

umbral zealot
#

uhm keyv is a key/value database it has nothing to do with sharding?

shy turret
#

i also need to connect the variable client with a website dash

#

like

#

currently, i use

umbral zealot
#

each shard will need its own connection

shy turret
#
const db = new Keyv('sqlite://database.sqlite');
client.database = db;

but i dont know how i would add it with discordjs sharding

delicate zephyr
#

Is there an event fired when say for example someone changes the discord server name?

twilit rapids
#

guildUpdate no?

delicate zephyr
#

i meant directly from the WS

shy turret
#

im not sure if i can connect to the same database at the same time (not sure)

delicate zephyr
#

Since im not using a Lib

twilit rapids
#

Should be

umbral zealot
#

that's a question the keyv docs probably can answer.

delicate zephyr
#

oh

#

ok cool

#

looks like my shit isn't entirely fucked

#

I just missed the event entirely when I looked last

shy turret
#

there's nothing about sharding + keyv in docs

quartz kindle
#

sqlite supports concurrent read access, but not concurrent writing

#

idk which sqlite lib keyv uses behind the scenes, but better-sqlite3 is pretty smart about it and correctly queues reads when needed, so it should work out of the box

buoyant aspen
#

@eternal osprey I assume by "nuke" you mean "delete all of the messages". This is impossible, as the API limits the bot to mass-deleting messages to 2 weeks old or less.

quartz kindle
#

just delete the channel and create a new one

buoyant aspen
#

@quartz kindle Interesting approach, but you would need to copy over all of the channel settings as well.

quartz kindle
#

you can clone the channel

buoyant aspen
#

That is a very good point.

quartz kindle
#

most libs have a method to clone a channel

mystic ice
#

once again

#

im back to ask for your support

buoyant aspen
shy turret
#

so if i add sharding, i cant define client on the website dashboard i was working on anymore to check if the bot exists on a server

mystic ice
#

it seems like im stuck in an error loop

eternal osprey
#

hey boys and girls

umbral zealot
#

@shy turret you'll need to perhaps put that code in Shard 0 only, and communicate with other shards in order to get data from all of them.

quartz kindle
#

@shy turret why cant you? are you running the dashboard inside the bot process?

delicate zephyr
#

@shy turret it'll get to a point where you wom't have a join, although I recommend setting up a rest api to contact the process of your bot or something

eternal osprey
#

i have made a !join queue command but i want to have something different. I want to use the !join queue (THIS WILL BE FREE TEXT TO WRITE). Then it would add you to the embed with the free text you wrote behind your name

mystic ice
#

i cant start a mongod process bc it will error it cant make a file in lib/mongodb, after that it will say something about a socket file

#

then it will whine about tmp/mongodb

eternal osprey
mystic ice
#

then it will say the connection is already in use

eternal osprey
#

so everyone has another text behind their names.

quartz kindle
#

how about uninstalling mongo completely, then following the installation instructions from the mongodb website?

mystic ice
#

i did

#

like 4 times

shy turret
#

@umbral zealot smart idea, i can do that (except i never used sharding before)
@quartz kindle no, i just didnt know how

woeful pike
#

how about uninstalling mongo completely, then following the installation instructions from the mongodb postgresql website?

mystic ice
#

i gave 777 on every folder it wants to have access to

buoyant aspen
#

@shy turret How are you running your dashboard?

#

how is it communicating with your bot's DB, I mean?

mystic ice
#

nothing works

umbral zealot
#

there should definitely be a way to determine what shard you're in, check the library docs perhaps, @shy turret

buoyant aspen
#

@mystic ice Don't do that. Only give folders the permissions they need.

fluid widget
#

Hello, I encountered not only playing adult songs
This message appears to me and I don't know how to fix it Can you please help me the problem with ytdl-core-discord

shy turret
#

i made a index.js that communicates with botcode.js and webdashboard.js @umbral zealot

umbral zealot
#

something like if(client.currentShard == 0) or whatever. depends on the lib

mystic ice
#

i know @buoyant aspen just got fkn triggered nothing worked

buoyant aspen
#

@shy turret Not exactly a best practice... Your dashboard should be external and should interface via an API or by reading from the same DB.

shy turret
#

well i use client.database = <db var>

buoyant aspen
#

But it's still in the same instance, correct?

shy turret
#

same process

buoyant aspen
#

Yeah, that is probably your issue.

#

Your code might be trying to shard the webserver as well.

umbral zealot
#

yeah that's why it should only be added to a single shard, which Shard 0 would be a likely candidate.

#

so one shard has the dashboard, the others don't.

mystic ice
#

can someone walk me through the mongodb process?

buoyant aspen
#

I would just host it in a separate process if I were you.

mystic ice
#

some parts where i get an error i dont get info from the guide uno

eternal osprey
#

could anybody help me please

umbral zealot
#

yeah but then you have the added complication of communicating between that process and the shards, and that's nontrivial

shy turret
#
client.shard.broadcastEval('this.guilds.cache.get(SERVERIDHERE)')
    .then(results => {
        // what here
    })
    .catch(console.error);

?

mystic ice
#

@eternal osprey what u want?

shy turret
#

@buoyant aspen same process different files, it doesnt try to shard the websit

eternal osprey
#

i have basically made a !join queue command

#

it displays your name in the queue

buoyant aspen
#

Right, it would still be sharding your dashboard in that case @shy turret

umbral zealot
#

yeah that's a way to get data - however you can't actually send an entire guild object, so you'll need to figure out specifically what you want to transfer.

mystic ice
#

u want the text to be diff for everyone

eternal osprey
#

but how do i do something like: !joun queue (free text to write)

mystic ice
#

ok

#

oh

#

what

eternal osprey
#

and it would display your name and free text you wrote

#

next to you

mystic ice
#

well

eternal osprey
#

so

fluid widget
#

Hello, I encountered not only playing adult songs
This message appears to me and I don't know how to fix it Can you please help me the problem with ytdl-core-discord

shy turret
#

@buoyant aspen well... i dont think u know what i mean, it doesnt

fluid widget
#

help me

eternal osprey
#

!join queue fishing

mystic ice
#

u can take the args and put them together

eternal osprey
#

the embed shows: Awsome Fishing

shy turret
#

botcode.js is separated from webdashboard.js

mystic ice
#

just make eh

#

a loop that

#

that will

#

add every args behind eachother

eternal osprey
#

uhh

mystic ice
#

and start from like 2

buoyant aspen
#

@shy turret Maybe I am misunderstanding, are you only sharding botcode.js?

eternal osprey
#

mR good

#

sorry but idk what you are saying tbh

fluid widget
#

Hello, I encountered not only playing adult songs
This message appears to me and I don't know how to fix it Can you please help me the problem with ytdl-core-discord

shy turret
#

@buoyant aspen yah

#

@buoyant aspen confusion

warm prairie
#

why would a bot, whom has all the required permissions, be "missing access" to send a message to a channel?

export const welcome = async (member: GuildMember) => {
  try {
    console.log(await member.guild.systemChannel.send('test'))
  } catch (err) {
    console.error(err)
  }
  ....
#
DiscordAPIError: Missing Access
    at RequestHandler.execute (G:\WINDOWS\DESKTOP\PROJECTS\gitlab\mumbot\mumbot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  name: 'DiscordAPIError',
  message: 'Missing Access',
  method: 'post',
  path: '/channels/755151104878182452/messages',
  code: 50001,
  httpStatus: 403
}
delicate zephyr
#

Because someone invited it with permissions: 0

#

also

#

channel overrides exist

#

meaning someone can easily remove permissions

warm prairie
#

Yeah I checked all that ...

#

all the perms are there

#

its based of the client's permissions, not the "added" member's perms right?

#

eh crap, nvm, the role was wrong

#

(need more coffee)

final stone
#

Could someone please explain whats wrong here? Discord.Js v12.

                    if (response.first().content.toUpperCase() === code) {
                        await member.send(`:online: That was the correct code! Your access to \`${member.guild.name}\` has been granted.`)
                        let role = member.guild.cache.roles.find(r => r.id === `${id}`);
                        member.roles.add(role)
                    } else {
                        await member.send(":dnd: Sorry, but that code is invalid. You have been kicked from the server. If you wish to try again, rejoin the guild.").then(async () => {
                            await member.kick(`${member.user.tag} failed verification.`)
                        })```
Been working on this for around two to three hours now with no solution.

We can't get it to add the role when a code is inputted correctly.

entire file;  https://github.com/UndefinedDevelopers/Authenticator/blob/dev/events/guildMemberAdd.js
#

(node:223107) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied roles is not an Array or Collection of Roles or Snowflakes.

earnest phoenix
#

@final stone please use paste bin its really hard to read

final stone
#

alright...

#

the links is also appliciple

earnest phoenix
#

ok

final stone
#

Been working on it with some friends for hours, we are entirely stumped.

#

ignore the guild.cache, that was fixed to guild.roles.cache

earnest phoenix
#

okay i found the problem

#

member.guild.cache.find
what are you searching in the guild

#

use member.guild.roles.cache.find

#

oh sorry

final stone
#

yeah

#

sorry too ¯_(ツ)_/¯

#

I updated it to the code we have now.

earnest phoenix
#

well its says the provided role isn't a role

#

so yeah

final stone
#

The bottom number is the role id its pulling

#

so it has complete access to it

earnest phoenix
#

you can try doing

#

member.guild.roles.cache.get(id)

final stone
#

We sadly tried that too

#

Wait

#

you cache .get? I thought .get was like fetch

earnest phoenix
#

are u on v12?

warm prairie
#

its a collection get

final stone
#

Yes

#

I changed one color

#

in css

#

sush

fast loom
#

Is there a way to check if the bot has lost and re-established connection to Internet?

final stone
#

To the DB?

#

Im using keyv as a tester, so. Keyv.error maybe?

earnest phoenix
#

try doing let role = await member.guild.roles.cache.find(r => r.id === id);

final stone
#

*.on error

earnest phoenix
#

add the roles thingi

final stone
#

lemme try that

pale vessel
#

cache.find() does not return a promise so await is unnecessary

#

you can also use cache.get(id) if you only need to find via id

earnest phoenix
#

i told him

#

but he said he already tried

#

that

final stone
#

I did not try it cached

earnest phoenix
#

bruh

#

well do it then

final stone
#

Lemme do that

restive furnace
#

The roleID is valid, and I have also checked here;
client mods 😠

#

bot-tag is normally blue

final stone
#

client mods 😠
@restive furnace bruh this is not even part of this convo, and its called CSS. I can revert my damn css if you care so much

#

one color aint harming you

restive furnace
#

well ok

cerulean salmon
#

is it possible to make a 12h channel cooldown ?

final stone
#

I mean.. I have seen It I think, some bots do cooldown commands

#

My brain might just be messing with me

cerulean salmon
#

not bot commands cooldown
channel cooldown

final stone
#

Thats what I was talking about

#

I believe I have seen bots have timeout commands to set custom timeouts

cerulean salmon
#

👍

final stone
#

not 100% on that

restive furnace
final stone
#

ah so im not insane

cerulean salmon
#

@restive furnace i saw that ,the problem is in channel settings we see max cooldown is 6h ,they didn't mention max time

restive furnace
#

60 * 60 * 6 = max time in seconds

cerulean salmon
#

i meant this

restive furnace
#

yeah

#

it migjt be longer for bots

#

but who knows

eternal osprey
#

hey guys

cerulean salmon
eternal osprey
#

i have made a command that you can join a queue using !join queue and you can assign your own message behind your name

cerulean salmon
#

its for bots

eternal osprey
#

Awsome test test test

#

for example: !join queue test test test

#

would show this

#

but if someone else joins the queue

#

the message just disappears

#

and only the new message of the new member in the queue shows

#
    // If queueMessageId is still 0, no queue has been created
    if (queueMessageId === 0) {
      message.channel.send('A queue does not currently exist sailor '+ "<@" + message.author.id + ">");
      // Otherwise, the queue already exists, so users can join
    } else {
      message.channel.messages.fetch(queueMessageId).then(queueMessage => {
        if (addUserToQueue(message.member.displayName, message.member.id, args)) {
          assembleQueueMessage();
          queueMessageText += ' ' + message.content.slice(Config.prefix.length).replace(/^queue *join/, '').trim()
          if (Config.useEmbeds) {
            queueMessage.edit(embedQueue.setDescription(queueMessageText));
          } else {
            queueMessage.edit(queueMessageText);
          }
        } else {
          message.channel.send(`${message.author} already entered the ship queue!`);
        }
      })
        .catch(console.error);
    }```
#

could someone help please 🙂

earnest phoenix
#

Don't know if anyone will be able to help but this has been annoying me for some time now, all help is appreciated, ill add a few images below of the error:

valid frigate
#

around line 128 it seems like that is the only place youre specifying servantmaxhp

#

but it's undefined so results[0] might be undefined

earnest phoenix
#

maybe

#

the last image is console logging results then error then fields

eternal osprey
#

anyone that can help me with my problem above>

earnest phoenix
#

if that is of any importance there

feral aspen
#

Hello

#

I am doing an addrole command and this is the code for role setted as args 1

#

let role = message.guild.roles.cache.find(r => r.name == args[1]) || message.guild.roles.cache.find(r => r.id == args[1]) || message.mentions.roles.first()

#

Whenever I do like !addrole @HamoodiHajjiri#0001 @TestingRole, it doesnt work..

valid frigate
#

yeah

#

it means that results[0] doesnt have anything in it

#

what is the result of logging results

feral aspen
#

Wdym

earnest phoenix
#

its that [] at the top

#

which i dont understand as there is data for the userid (mine)

valid frigate
#

then its probably an issue with the query

#

or something because if theres nothing it means the database returned nothing that matched

earnest phoenix
#

hmm, its odd. I've used the exact same code part for other things ive coded and it worked fine...

#

I just cant tell if it's bad scripting or if I'm missing something obvious...

#

out of interest, would the result be different if i did let ServantMaxHp = rows[0].servantmaxhp or would it just break? I haven't tried it yet.

mystic ice
#

Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"Address already in use"}}}
Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
DBException in initAndListen, terminating","attr":{"error":"IllegalOperation: Attempted to create a lock file on a read-only directory: /var/lib/mongodb"}}
Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
these errors keep repeating anyone know how to fix this?

#

trying to install mongo and run a process

quaint hornet
#

Hey i want to make a lyric video command and i have 2 questions, 1 is a good idea and 2 how can i upload that sice videos are too heavy and gifs are hard to work with big musics

prime glacier
#

i created alarm/remind me command it is working but i want to do it to exact time because at the moment it is doing it hour bu hour like it can do 0-60mins but i want to do it like 1hour 23 mins etc
i dont know ms very much
i want to convert something like 80 mins to 1 hour 20 mins 0 sec

charred kindle
#

@prime glacier Can you please speak english?

eternal osprey
#

hey

charred kindle
#

hey

eternal osprey
#
    // If queueMessageId is still 0, no queue has been created
    if (queueMessageId === 0) {
      message.channel.send('A queue does not currently exist sailor '+ "<@" + message.author.id + ">");
      // Otherwise, the queue already exists, so users can join
    } else {
      message.channel.messages.fetch(queueMessageId).then(queueMessage => {
        if (addUserToQueue(message.member.displayName, message.member.id, args)) {
          assembleQueueMessage();
          queueMessageText += ' ' + message.content.slice(Config.prefix.length).replace(/^queue *join/, '').trim()
          if (Config.useEmbeds) {
            queueMessage.edit(embedQueue.setDescription(queueMessageText));
          } else {
            queueMessage.edit(queueMessageText);
          }
        } else {
          message.channel.send(`${message.author} already entered the ship queue!`);
        }
      })
        .catch(console.error);
    }
  }```
charred kindle
#

oh my

eternal osprey
#

this is a command taht when you use !queue join something

#

you will join an embed with something after your name

#

however when someone else join

prime glacier
#

@prime glacier Can you please speak english?
@charred kindle its english bro

eternal osprey
#

my older text behind my name deletes

charred kindle
#

I mean

eternal osprey
#

how would i fix that

charred kindle
#

Please correct your grammer since I cant really understand it

prime glacier
#

Please correct your grammer since I cant really understand it
@charred kindle oh wait

charred kindle
#

@eternal osprey Do you have different messages or 1 message?

eternal osprey
#

1 embed

#

that constantly updates

charred kindle
#

I mean

eternal osprey
#

look:

charred kindle
#

oh

#

so you are editing the embed?

eternal osprey
#

look

#

people can join

charred kindle
#

@prime glacier So you want to convert hours into minutes?

eternal osprey
#

and add their own twist

#

like extra text

#

but once someone else joins

#

my text deletes

charred kindle
#

so wait

eternal osprey
#

and his shows

charred kindle
#

you want to add the text onto the existing text?

prime glacier
#

i had created a command name alarm like carl bot has a command remind me
but i am facing an issue in my command that it one do alarm for hour's like if i do 0-60 mins it will work correctly but if i do it 1h30m it will do 1h only and if i do it 90m it will do it 2hours

#

i had created a command name alarm like carl bot has a command remind me
but i am facing an issue in my command that it one do alarm for hour's like if i do 0-60 mins it will work correctly but if i do it 1h30m it will do 1h only and if i do it 90m it will do it 2hours
@charred kindle

charred kindle
#

uh

eternal osprey
#

;ppl

charred kindle
#

I kinda need the code to see whats happening

eternal osprey
#

look

prime glacier
#

I kinda need the code to see whats happening
@charred kindle ok wait

eternal osprey
#

someone jons with !queue join test test

#

my message deletes

#

his shows

charred kindle
#

Do you want to add your message onto his?

eternal osprey
#

no i want the messages to be saved

#

for fucks sakes

#

wait

#

if i write !queue join text message

prime glacier
#

@charred kindle please watch your dm

eternal osprey
#

but if someone else joins, my message deletes

#

ya see?

charred kindle
#

@eternal osprey Then shouldnt you have multiple messages then, instead of editing one message?

eternal osprey
#

do you wanna see my source code?

#

cuz that isn't the problem

#

it is an args.

#

everyone can use it

charred kindle
#

oooh

#

so wait

#

you need seperate variables for each message, or put them in an array/dictionary

eternal osprey
#

how would i do that?

#

as i have no clue

vernal rivet
#

What's the problem?

restive furnace
#
const dict = new Map();```
eternal osprey
#

korean check above

#

how do i put them into an array?

vernal rivet
#

It doesn't seem like your awaiting messages.

slow otter
#

how can i make a music system?

vernal rivet
#

That's kind of a vague question. It differs on what library you are using.

slow otter
#

i am using discord.js

restive furnace
#

go use lavalink or ytdl and opus and ffmpeg

vernal rivet
#

^^^^^

feral aspen
#

Hello

#

I am making an addrole command

#

And I am trying to check that if the specific role that I am going to add for the member or user is higher than the bot or the message.author, it returns

#

Is this code correct?

#
    if(rMember.roles.highest.position >= message.member.roles.highest.position) return message.channel.send(noPermissions);```
#

like **!addrole @HamoodiHajjiri#0001 @role **, we check if the role is higher than the bot or the author, it returns

vernal rivet
#

Have you tested it yet?

feral aspen
#

Yes

earnest phoenix
feral aspen
#

It is wrong

vernal rivet
#

What did it do?

feral aspen
#

It didnt check for role

#

It checked for the User I am adding the role to

earnest phoenix
#

The guy:

Is this code correct?
The same guy:
It is wrong

feral aspen
#

idk how to make it check for the role

vernal rivet
#

Have you check docs yet?

feral aspen
#

Idk how to use docs! 😦

#

I just want to know how can I make the bot check for what I said above

digital ibex
#

toxicity101 ova here

vernal rivet
#

What type is rMember?

feral aspen
#

rMember is like the user I am adding the role to

#

how can I check that if the role is higher than the bot or the author, it returns

vernal rivet
#

I know, but I am asking what type is it. Is it a User type or GuildMember type

feral aspen
#

let rMember = message.mentions.members.first() || message.guild.members.cache.find(m => m.user.tag === args[0]) || message.guild.members.cache.get(args[0])

#

🙂

vernal rivet
#

So it's a GuildMember Type

earnest phoenix
#

let rMember = message.mentions.members.first() || message.guild.members.cache.find(m => m.user.tag === args[0]) || message.guild.members.cache.get(args[0])
@feral aspen i vomited

#

that's a FREAKING TERRRIBLE WAY to fetch users

feral aspen
#

😦

pale vessel
#

it's not that bad

#

i remember lost used .find() over and over instead of using ||

vernal rivet
#

It's better than casting it into a User type

earnest phoenix
#

no not that

#

he's mixing up member and user

vernal rivet
#

?

thick gull
#

no ?

earnest phoenix
#

you won't get it

thick gull
#

he's just finding the member with user tag

vernal rivet
#

User type is not associated with the guild

earnest phoenix
thick gull
#

hes not mixing it anywhere

feral aspen
#

how can I check that if the role is higher than the bot or the author, it returns

pale vessel
#

didn't i already help you with that?

thick gull
#

get position of role and bot

earnest phoenix
#

but seriously that is a 75% cool way of fetching users from the message

#

especially ===

vernal rivet
#

Can you show the declaration of the role variable please