#development

1 messages ¡ Page 703 of 1

earnest phoenix
#

ill try

#

and ty

steel heath
#

np

sudden geyser
#

new Array() scared

steel heath
#

or just [] who cares

quartz kindle
#

you can also do js users.map(t => `<div class="card">${t}</div>`).join("")

steel heath
#

^^

stone robin
#

Um help guys

#

Can someone edit this code

#

To give me embeds

amber fractal
#

we dont spoonfeed here

summer torrent
#

How do I make emojis look big? (example: jumbo command)

#

in discord.js

earnest phoenix
#

nope

#

still gives number 1 data

amber fractal
#

@summer torrent just send the emoji's url

#

only works for custom ones iirc

#

you can make it 128x128 (default) and smaller by appending ?size=x

earnest phoenix
#

:/ tried so much ways to get indivisual data 😂

sudden geyser
#

tiny mmLul mmWheresMyNose

amber fractal
#

smol boye

abstract crow
#

Does anyone know what the difference is between a Scheme and a Theme in Webstorm(IntelliJ) products?

#

nvm I think the scheme is how the text color part looks and theme is how the program looks

broken shale
#

Whats DBD bots

abstract crow
#

Discord Bot Developer

#

An Android app

broken shale
copper cradle
#

Designer not developer

tulip ledge
#

Well

#

So I just added an auto assign role

#

And my bot is like 100x slower now

#

Any idea why

quartz kindle
#

maybe your code is slow

#

review it and see if you did something wrong

loud salmon
#

@tulip ledge discord is dying right now

grizzled jackal
#

So its not just me, oof

carmine echo
#

What lang?

celest spear
#

client.user.setStatus('dnd')

#

This for js

wicked mango
#

k

vernal willow
#

oh

#

@wicked mango what u coding in?

wicked mango
loud salmon
#

@wicked mango dont use codeblocks to make your message look larger

wicked mango
#

k

#

where do I need to type client.user.setStatus('dnd')?

#

Hello?

quartz kindle
#

in your code

wicked mango
#

really?

quartz kindle
#

well, what did you expect?

grizzled jackal
#

All depends when you want it to change lmao

wicked mango
mossy vine
#

oh god

quartz kindle
#

i suggest you learn some javascript first

wicked mango
#

Im trash at coding

quartz kindle
#

everyone is when they begin

grizzled jackal
#

You gotta start somewhere

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

unique nimbus
#

wait a bit it might be still loading itself up again

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

maybe try later and see if it works. Also you don't have to await console.log

broken shale
#

just log it since you're already awaiting the sql

earnest phoenix
#

alright last part i need help with

#

its the css part

#

then my leaderboard is done

#

need help with it though because i tried many ways to display leaderboards into boxs which would be in rows

#

but the boxes keep going down straight

west spoke
#

<table>

earnest phoenix
#

when i map the the box one box is in the right place while the others arent ?

quartz kindle
#

as neko said, just use a table

#

if you really want boxes, use display: inline-block

abstract crow
#

How do you guys get really good looking Shields.io things?

earnest phoenix
#

tim i did use table but when im mapping it ``` <% for (var i = 8; i < resp.length; i++) { %>

#

one is in the correct postion while the other one isnt

#

if you get me

earnest phoenix
#

Is there a way a bot can reward you or do any actions after you voted?
How will it recognize?

#

I don't know this feature but I want to implement it sooner or later.

modern elm
#

depending on which language you are using, yes there is

earnest phoenix
#

oh nice!

mossy vine
#

@modern elm doesnt really depend on the language. if it can make http requests (and it can, you are making a bot with it) it can interact with the api

modern elm
#

jesus i meant there is support in the docs depending on the language chill

lost cove
#

Does anyone here know how the hell these weird ass generics work when you get a message asynchronously in C#

#

I'm just trying to get one god damn message and it's like wtf

#
[RequireOwner]
        [Command("react", RunMode = RunMode.Async)]
        public async Task React([Remainder]string reaction)
        {
            //await Context.Message.DeleteAsync();
            var targetMsg = Context.Channel.GetMessagesAsync(1).FlattenAsync();

            List<Emoji> emotes = new List<Emoji>();

            foreach (char character in reaction)
            {
                Emoji emojiLetter = new Emoji($"regional_indicator_{character.ToString().ToLower()}");
                emotes.Add(emojiLetter);
            }

            //Add emojis to the one message

        }
earnest phoenix
#

Hey, I'm new here. I just started playing openttd, and I was wondering if there's an easy way to keep road vehichles evenly separated. If you can help me with that and other things, that would be great.

quartz kindle
#

Wrong server mate

earnest phoenix
#

you got told how to use it in dapi, also if you want to access the message that invoked the command you can use Context.Message @lost cove

lost cove
#

Ik that, basically I'm getting the message immediately before mine

earnest phoenix
#

What?

lost cove
#

Like the most recent message in chat besides the one I sent to invoke the cmd @earnest phoenix

earnest phoenix
#

ah

lost cove
#

It's so annoying because it's a collection and idk how to iterate through it

#

I can't just cast it to a socketusermessage and be done with it

earnest phoenix
#

you can also use linq extension methods

lost cove
#

linq doesn't work for this at all

#

im reading through the link tho

earnest phoenix
#

how does it not

#

lol

hybrid cradle
#

Can anybody help me make a virtual server for the bot running in 24/7 ? Cause currently it runs on my pc

lost cove
#

The only thing I can change it to is ToAsyncEnumerable, and then if I do like .GetFirstOrDefault() etc on top of that, I can't cast it to a SocketUserMessage

hybrid cradle
#

Hmm ?

earnest phoenix
#

await your flattenasync

#

and you'll have the collection alone

quartz kindle
#

@hybrid cradle check pins

hybrid cradle
#

Okay

lost cove
#

Well I'll be a god damn son of a bitch

#

bend me over and call me sally

#

Thank you cry

hybrid cradle
#

And are there servers for free ?

earnest phoenix
#

no

hybrid cradle
#

Or I have to buy it anywqy

quartz kindle
#

There are some free options

#

But they have limits or are weird

hybrid cradle
#

Can you send me some ?

#

Thats not a problem

quartz kindle
#

Google and amazon offer fully functional servers free for 12 months

#

Glitch and heroku offer free forever solutions with certain limits

hybrid cradle
#

Okay, thanks!

jade thistle
#

is there a way to make a bot check if the person giving the command is the bot owner?

quartz kindle
#

Yes

mossy vine
#

compare ids

quartz kindle
#

Check if the message author id is the same as the owners id

jade thistle
#

ok, and i do that by message.author.id?

quartz kindle
#

Yes

jade thistle
#

nice

#

thanks

livid rivet
#

uhm question

#

i wanna do a Timezone Bot

#

and long story short

#

is it okay if the bot edits a certain role (rolename) once an hour?

#

or is that considered too much?

loud salmon
#

once an hour is ok @livid rivet

livid rivet
#

okay nice

lunar crystal
#

Do you know some way to learn basics of js asap ?

#

When I do F5 : Error "discord.js" can't be found

mossy vine
#

bruh

#

just

#

any js learning method

lunar crystal
#

Ok

#

U thinks it's possible for me ?

mossy vine
#

if you take a step back and relearn from the start, yes

hallow forge
#

hi, does anyone know how to detect when a member types with python discord?

livid rivet
#

its an event

#

wait

#

on_typing()

hallow forge
#

Thanks so much, couldn't find a working typing command anywhere

valid frigate
#

not related too much to development but when people call something a "cluster"is it the same thing as a "worker"

#

e.g. when forking 2 processes those are called clusters? mm

quartz kindle
#

not as far as i understand it

#

a cluster would be sibling processes under a load balancer

#

each process being stateless

valid frigate
#

yeah like that's what i'm trying to understand here

#

the terminology mmLol

quartz kindle
#

for me there is a difference between clusters and master-slave setup, but idk what terminology would be technically correct

valid frigate
#

i guess

#

like when i call cluster.fork() for some reason people call that forked process a cluster

quartz kindle
#

if you're using node-cluster it makes sense

#

because all children are exact copies of each other, except the master

valid frigate
#

yeah i'm using the native cluster module

quartz kindle
#

so the master becomes the load balancer

valid frigate
#

ahhhh

#

oh i get it now mm

quartz kindle
#

a non-cluster master-children setup could have each children be designed for a specific job

valid frigate
#

where each child does a different thing

quartz kindle
#

instead of all chilren being identical copies

valid frigate
#

oh i see

#

so master-slave is where each child does a different thing, cluster is when every child is the same

quartz kindle
#

kinda yeah

valid frigate
#

mm ok

#

thanks for explaining mmWeird

quartz kindle
#

although there is also master-slave replication

#

which is a term used in databases and database clusters

valid frigate
#

hmm

#

ive heard of that before when reading db docs

#

never really bothered to look at it though

quartz kindle
#

replication would be something like

#

all children repeat each other's actions

#

if child A receives a connection and does a job, the job is repeated on all children, so they are all in sync

#

or something like that

valid frigate
#

interesting

quartz kindle
#

so if children go offline, they can get a log of actions from other children and re sync when it comes back online

valid frigate
#

thats cool mmulu

#

wouldnt them being in sync cause a race condition or is that an entirely different term

quartz kindle
#

that would probably be different, as they are not really competing

valid frigate
#

mm they're only listening

quartz kindle
#

they are just sharing state with each other

valid frigate
#

o ok

#

rn i'm just focused on whether a cluster is actually named a cluster mmulu

quartz kindle
#

so its like stateful clusters instead of stateless

valid frigate
#

spooky

quartz kindle
#

but im half talking out of my ass here, so dont take my words for an authority on the matter lol

valid frigate
#

yeah its fine

#

db replication or smth seems confusing

quartz kindle
#

dbs are a special case because data integrity is more important than anything else

#

if they want to be ACID compliant

amber fractal
#

does require work from the root directory or the current directory? I forgot mmulu

quartz kindle
#

working directory of the process

#

or the node-modules folder

#

i believe it looks into the node-modules folder first, and then the working directory

west raptor
#

I remember having to be in the dir of the require if it was a local file

#

or else it was looking at nothing

#

and would error

#

atleast iirc

#

might be wrong

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

amber fractal
#

It's relative to the file the require is in it seems

#

which makes life easier

slim heart
#

so wait when storing bearers and returning a backend auth for bot dashboard they have to request my backend to get their guilds right?

#

and i make a request with their bearer

#

also whats the best way to make my dashboard like /dash/serverid while still using just some html and js as the actual frontend

peak bloom
#

whatever backend framework you're using probably supports route parameters which is what serverid would be in that url

#

serves the same document but populated with different info based on the route parameter

#

doesn't typically have much to do with what you're doing in the frontend

slim heart
#

I got an answer for my first question already

#

Tho I still need help with the second

#

for /dash/serverid I mean like that’s what somebody see’s and it knows that’s the id because rn I have /dash/#serverid

hushed berry
#

im not exactly sure what youre asking

peak bloom
#

yup, me neither

slim heart
#

I have a backend built right, with api/guilds/serverid/settings get and post to that url to change settings
Currently the frontend dashboard that people actually see is /dash/#serverid which lets you edit that server and it uses js to make those requests to the api
I wanna be able to make it so that I can just do /dash/serverid

peak bloom
#

so you're using a URI fragment to do this right now and want to just use a route parameter instead

#

again, just look up your backend framework + "route parameter" and figure out how to do that

#

can't really offer more specific advice without knowing your tech stack lol

slim heart
#

The route parameter is not what I need help with

#

I might be misunderstanding, are you saying I should be pushing html/css/js through express?

#

I already have the backend set up like /guilds/:guild/... that’s not the issue

peak bloom
#

what i got from your question is "how do i make /dash/#123456789 into /dash/123456789", so just removing the #

slim heart
#

But actually doing it, logistically. Because obviously with just static html and js you can just do that

peak bloom
#

yes but.. your website definitely should not be set up just using static documents lol

#

ideally you've got some kind of webserver like express that is serving your dashboard and stuff

#

and through express you can set up the routing to make the 123456789 part a route parameter

slim heart
#

So I actually push html through the express server?

peak bloom
#

this wording confuses me

#

pushing html through an express server is kinda what express is meant to do lol

slim heart
#

Uh

#

No not really afaik express is meant to be endpointing for serveing and receiving data in things like json

peak bloom
#

it can be that

slim heart
#

Mk

peak bloom
#

but it is very much a webapp framework and serving html is one of its main functions

slim heart
#

Sounds good thanks

peak bloom
#

well, i guess more specifically, serving any kind of content is its main function, it doesn't care whether it's json or html

#

anyway yeah

#

good luck!

slim heart
#

I’ll need it lol

earnest phoenix
#

can you make bots in eclispe

#

java photon June 2018

loud salmon
#

uh

#

sure?

#

making bots isnt limited to your ide

slim heart
#

is there an easier way to do x-form-www-urlencoded data in fetch similar to the way ajax takes data

earnest phoenix
#
bot.on("messageDelete", message => {// message logs

    const logchannel = message.guild.channels.find(channel => channel.name === "message-logs");
    const user = message.author
    if(!logchannel) return
    let deleteEmbed = new Discord.RichEmbed()
    .setTitle("⚠️ A message was deleted!")
    .addField("Sent by User", user.tag)
    .addField("Deleted Message", `${message}`) ``<==== This is the line it picking up on the error``
    .addField("Deleted In", `${message.guild.channels.get(message.channel.id).toString()}` + ` (${message.channel.id})`)
    .setFooter(`Author ID: ${user.id}| Message ID: ${message.id}`, bot.user.avatarURL)
    .setColor("#FF0000")
    logchannel.send(deleteEmbed)
});

bot.on("messageUpdate", function(oldMessage, newMessage){

  if(oldMessage.content == newMessage.content) return
    const user = newMessage.author;

  let logsChannel = oldMessage.guild.channels.find(channel => channel.name === "message-logs");

    if(!logsChannel) return

    let messageEditEmbed = new Discord.RichEmbed()
    .setTitle("⚠️ A message was edited!")
    .addField("Sent by User", user.tag)
    .addField("Before", oldMessage.content)
    .addField("After", newMessage.content)
    .addField("Edited In", `${oldMessage.guild.channels.get(oldMessage.channel.id).toString()}` + ` (${oldMessage.channel.id})`)
    .setFooter(`Author ID: ${user.id}| Message ID: ${oldMessage.id}`, bot.user.avatarURL)
    .setColor("#FFFF00")
    return logsChannel.send(messageEditEmbed)
});
#

i keep getting this crash error on line 53 and i have tried multiple ways to try fix it but i dont seem to get anywhere wondering if anyone can spot my error and maybe help me correct it please

peak bloom
#

@earnest phoenix message is evidently a message object, you even use it as such in several other places, so just doing ${message} is not only redundant but also is trying to insert an entire object into the field instead of its content

earnest phoenix
#

@peak bloom so how would I fix it as I tried message with and without ${}

#

But I got the same error every time I did even try message.content same error

#

And now it's just began to annoy me more than anything

peak bloom
#

console.log the values, figure out which one's empty, figure out why

earnest phoenix
#

Yeah that's what in stock on tbh I tried console.logging it and it didn't show anything

#

But it shows a error on the libe 53 which is what you picked out

slim heart
#

how can i format strings that were "browserified" with the things like %## because they were put as a query back into the normal strings?

#

or maybe how i can get the cryptos without those certain characters

quasi forge
#

D.js help required.
I have a messageReactionAdd even handler and it only logs Reaction added to the console. The thing is, it doesn't fire for messages sent more than a few minutes ago. Like I add any reaction to a message that was sent more than 10 minutes ago, the handler isn't executed. Any clues as to why this might be happening. Or, how to prevent this? Or, is there some workaround for this?

#

(Using master branch btw)

slim heart
#

use partials

#

it will only fire if you have the message cached

quasi forge
#

yea thanks

#

will use partials

pliant needle
#

discord.js, what's the easiest way to grab the last message in a channel to send to another channel? Google is failing me

quasi forge
#
myChannel.send(originalChannel.lastMessage);
pliant needle
#

tyvm

quasi forge
#
new TextChannel(msg.guild, myChannel.toJSON()).messages.fetch(message_id);
``` Can this piece of code be simplified? (myChannel != msg.channel)
slim heart
#

Why

#

Are you doing this

#

And not just getting the channel from cache

quasi forge
#

cuz channel from cache is object of Channel class and not TextChannel although TextChannel is derived from Channel, I don't think it supports sending messages.

#

anyways, can embeds have multiple images?

slim heart
#

No

earnest phoenix
#

No

slim heart
#

And also TextChannel Extends Channel

#

If it’s not a textchannel you don’t need sending methods

quasi forge
#

I need to send message in a channel whose ID I have.

slim heart
#

Then get that channel and send

quasi forge
#

So you are saying, if I do myChannel.send even if myChannel is a Channel object and not a TextChannel Object, it will send the message?

slim heart
#

You make no sense

#

If you can send a message

#

To that channel

#

Then it’s already a TextChannel

#

Why do you have to create a whole new instance of a channel that already exists and if you can send to it already has send methods

earnest phoenix
#

Can i ask a question, too?

quasi forge
#

It is a text channel in discord but the object is not of TextChannel class, that's what I am saying. Will it still send the message.

#

@earnest phoenix I think maybe yes

slim heart
#

Why is it not of the TextChannel class

earnest phoenix
#

How can i get OAuth2 access code?

#

I started searching 2 hours ago

quasi forge
#

cuz the channels fetched from the cache are objects of the Channel class and even if the TextChannel extends Channel doesn't mean Channel will have the methods of the TextChannel class.

#

@earnest phoenix lang?

slim heart
#

I-

#

Have you ever used djs?

earnest phoenix
#

discord.js

quasi forge
#

I have used djs but never in this way

slim heart
#

Channels that are cached are that of their types, if it’s a text channel then it’s already of the TextChannel class in the cache

quasi forge
slim heart
#

It’s kind of implied

#

They all extend channel

#

Therefore they’re all channels

#

However that doesn’t mean their class isn’t other channels

#

How do you think you can send messages to a channel?

quasi forge
#

yea but they're all Channels, but it doesn't really imply that they're all of their own types

earnest phoenix
slim heart
#

Because it’s a TextChannel

#

If they were all just Channel’s you wouldn’t be able to message.channel.send facepalm

#

You’ll never really be presented with just a channel either

quasi forge
#

They're all https://discord.js.org/#/docs/main/master/class/Channel which doesn't have send method.

slim heart
#

Yes good job

#

Like I said

#

If they weren’t cached as things other then Channel then you wouldn’t be able to do any of the shit that you and everyone else already uses

#

I can’t tell if you’re trolling or not because this is genuinely stupid

quasi forge
#

XD

earnest phoenix
#

I will try, thanks.

quasi forge
#

Well, @slim heart it isn't neccessarily stupid because it isn't said anywhere that the channel objects inside the cached ChannelStore are objects of their respective types and since all the various Channel types derive from Channel class, that's why it's written in the docs even tho the channels are objects of classes that extend the Channel class and not direct objects of the Channel class.

slim heart
#

It’s extremely implied

#

Considering there are bazillions of examples of people using channels.get().send

earnest phoenix
#

hey i need some help im trying to make it so you can @ my bot and that will work as a prefix

#

my prefix is in the .env file on glitch

quasi forge
#

Lang?

earnest phoenix
#

i did @menshen < yes i know that is not spell right

#

and js

quasi forge
#

(TBH whatever lang, just use a commands framework)

earnest phoenix
#

?

quasi forge
earnest phoenix
#

kk thx

#

@quasi forge I couldn't... 😦

#

It wants auth code but i couldn't

quartz kindle
#

@quasi forge if you actually log them, they are not simply channel instances

quasi forge
#

Welp, I need a little help with discordjs. I have a text channel's ID and a message ID of a message which belongs to that text channel. And then I need to edit the message. I can't seem to be able to do this...

#

the part about editing

quartz kindle
#

what have you tried?

quasi forge
#
bot.channels.get(channelId).messages.fetch(messageId).edit(...)
#

wait nvm, I AM STEWPIED

#

fetch returns a promise

quasi forge
#

Ok, another discord.js issue, when installing the master branch, I am it keeps getting stuck at this for some reason.

#

I waited for like 10 minutes at first and then I redid with verbose

quartz kindle
#

Do you have git installed?

stray garnet
#

dumb Question, how to get the shards size?

quartz kindle
#

Master requires git, althougt a missing git should give an error, not get stuck

#

What do you mean shards size? How many shards is the current process handling?

stray garnet
#

Yea

quartz kindle
#

In djs should be somewhere in client

#

Check the docs, client.shard or client.shards

twilit rapids
#

v12 and v11 sharding are totally different, so it would be nice if you said what version of Discord.js you are using mmLol

quartz kindle
#

Also ^ yeah

twilit rapids
#

I remember how I had sharding on v11, it was perfect and then I upgraded to v12 and I was completely lost

stray garnet
#

@twilit rapids 11.5.1

quartz kindle
#

Also, internal sharding or shardmanager?

#

Or both

stray garnet
#

shardmanager

azure oxide
#

can I code a bot in python?

twilit rapids
#

yes

quartz kindle
#

Yes

twilit rapids
#

<Client>.shard.manager.totalShards iirc

azure oxide
#

oh really?

#

that's great

twilit rapids
#

Yes

#

Yes

quartz kindle
#

Any language can code a bot

#

As long as it supports websockets

slender thistle
azure oxide
#

does python support them

quartz kindle
#

Most languages do

#

Give it a try

jade thistle
#

how fast is discord api abuse?

slender thistle
#

Anything that is fast

#

For what exactly

jade thistle
#

to see how long a delay has to be

#

so it isnt api abuse

toxic oracle
#

what are you trying to do

smoky briar
#

I was wondering. Why my bot isn't show as connected on the site ?

jade thistle
#

nothing much (for now), i saw the "api abuse" declined messages and i am wondering how fast is api abuse.

toxic oracle
#

u can send 5 messages a second before u get rate limited

#

iirc

jade thistle
#

ok

#

1 message a second then

toxic oracle
#

yea u will be fine

jade thistle
#

good

slender thistle
#

Hitting ratelimits, doing many things at once

smoky briar
#

?

jade thistle
#

was an answer to my question of the speed which equals api abuse

smoky briar
#

hum

jade thistle
#

whta

slender thistle
#

hotaskickedbot @smoky briar

covert turtleBOT
#

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

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

smoky briar
#

@slender thistle so he has beeen kicked because he has dm when added ?

slender thistle
#

Correct

jade thistle
#

how do bots make the boxes with the color at the left

smoky briar
#

wow

#

is there a way to add it again and fix this ?

jade thistle
#

you fix it before you add it

#

remove the codes that causes rule breaks and do again

smoky briar
#

@jade thistle you mean create the bot on the website again ?

slender thistle
#

Fix the issue and ask a moderator to re-invite the bot

jade thistle
#

what do you mean on the website

#

i code bots in a text editor

smoky briar
#

@slender thistle can you reinvite the bot ?

slender thistle
#

Did you fix the issue

smoky briar
#

i think it's fixed

#

I hope so xD

quartz kindle
#

@jade thistle how do bots make the boxes with the color at the left

#

those are called embeds

#

most discord libraries have functions to help you build them, but you can also build one with an object literal

jade thistle
#

ok

quartz kindle
#

you can use this to preview it and see how the embed structure looks like

jade thistle
#

thanks

earnest phoenix
#

Now I Am Unable To Add My Server

vagrant heart
earnest phoenix
#

Then With Which It Is Associated With?

#

Anyone?

quartz kindle
#

@pliant gorge

#

it is that bot lol

#

does your server not appear in your profile?

toxic oracle
#

@vagrant heart yes it is

vagrant heart
#

oh sorry, thought it was something else

toxic oracle
snow urchin
#

nodejs

app.get("/catmaniabot", checkAuth, async function(req, res) {
  res.render("/app/website/page/guildList.ejs", {
    userGuilds: req.user.guilds
  })
})

html

<script>
var slides = <%- JSON.stringify(userGuilds) %>
var str = '<ul>'
slides.forEach(s => {
    str += '<li>'+ slides + '</li>';
})
str += '</ul>';
setTimeout(() => {
  document.getElementById("slideContainer").innerHTML = str;
},1000)
</script>
<div class="guildList" id="slideContainer">
</div>

Why is this happening? Probably something very obvious

late hill
#

First of all, you're using slides inside the forEach

#

Probably meant to use s there

#

[object Object] is the default toString() of an object

#

So that's what's happening there

earnest phoenix
#

////

west raptor
earnest phoenix
#

oke

slim heart
#

on dashboard for /server/:serverid im gonna do .use to authenticate a user on that endpoint, though idk how i should authenticate, should i fetch guild list again with the filtered permissions that i used to give the guild list in the first place or should i eval on the shard and check if they have perms?

#

and since i have guild list cached for a bit

earnest phoenix
#

Why is this not working:
mega!eval let imageembed = new Discord.RichEmbed()
.setTitle('My stats')
.setImage(https://discordbots.org/api/widget/618037965888684032.svg)
message.channel.send(imageembed)

#

Which requirements you need to be certified developer?

sudden geyser
stone robin
#

How to add embeds in js

#

Ik u won't spoonfeed but pls help

mossy vine
#

<script src="file.js"></script>

stone robin
#

Tell where to put

west spoke
mossy vine
#

in your <head>

west spoke
#

This isnt html cyber

mossy vine
#

wait no

#

you can put it anywh-

#

wait what

west spoke
#

node

mossy vine
#

isnt he asking about embedding js?

west spoke
#

js

mossy vine
#

ouch

west spoke
#

discord.js embeds

mossy vine
#

wait i dont understand the question then lol

#

oh

west spoke
jade thistle
#

bruh

mossy vine
#

stable or master?

west spoke
#

Now I know how cry feels

mossy vine
#

im just bad ok

stone robin
#

Ok nvm my disc got fked

#

Can't copy paste

mossy vine
west spoke
#

@stone robin send a screenshot

stone robin
#

Like in the playing Queues part

#

And yes I'm on phone and this is glitch

west spoke
#

...

jade thistle
#

you are god if you can edit on phone

quasi forge
#

Using discord.js, can I fetch the username of a user, who may not share a guild with the bot but whose ID is available?

stone robin
#

Is there a code to make music in python?

west spoke
#

@quasi forge no

stone robin
#

Music bot in 1 file on python?

loud salmon
#

@stone robin no

#

we dont spoon feed code here

stone robin
#

Rip

quasi forge
#

@west spoke so gotta make an API request from discord API directly?

stone robin
#

Is it possible? @loud salmon

#

Through python

unique nimbus
#

Music Bots can be made in one file

stone robin
#

In python?

unique nimbus
#

however spoonfeeding is not allowed

west spoke
#

@quasi forge the user has to be in a shared

unique nimbus
#

yes

west spoke
#

Its how the discord api works

unique nimbus
#

I am in python

#

however its just long

#

and spammy

west spoke
#

or it has to have been dm'd at one point @quasi forge

slender thistle
#

@stone robin It's possible

sudden geyser
#

@quasi forge you can I believe

distant oar
#

Does glitch work for you on phone?

sudden geyser
#

If you have the ID, you can use <Client>.users.fetch

west spoke
#

it seems it has just disconnected

distant oar
#

ok nvm

quasi forge
#

@sudden geyser that doesn't seem to work

#

that's why I asked

west spoke
#

@stone robin get over here

#

Lock your project now

#

and I mean now

loud salmon
#

👏

west spoke
#

Your token is very easily leaked

#

You are very lucky I'm a nice neko

sudden geyser
#

TheDrone are you on stable

west spoke
#

but you may wanna reset your token

quasi forge
#

Master

#

@sudden geyser

sudden geyser
quasi forge
#

Yea I thought so too, but it doesn't seem to work that way

sudden geyser
#

what happens when you try?

quasi forge
#

undefined

sudden geyser
#

code? Remember it returns a promise

quasi forge
#

let user = await bot.users.fetch(userId)

#

user is undefined

quartz kindle
#

i dont believe you can get a user the bot doesnt share a guild with

slender thistle
#

Unless you fetch that user directly from API

quartz kindle
#

but that requires oauth no?

west spoke
#

^

quartz kindle
#

with permission from said user

west spoke
#

it would require oauth

#

if it's not in a shared server

slender thistle
sudden geyser
stone robin
#

OOF

slender thistle
#

or am I the one going the wrong path rn

west spoke
#

@stone robin dude seriously lock your project

#

or make a .env

#

I'm not even signed in and I already see your bot token

quasi forge
#

NVM, @sudden geyser was right, I was just editing the wrong part

quartz kindle
#

so you actually can fetch any user

sudden geyser
#

yep

quartz kindle
#

interesting

sudden geyser
#

stalker

slender thistle
#

Yeah

stone robin
#

Thx

quartz kindle
#

brute-forces snowflakes to get info from all 250 millions discord users

slender thistle
stone robin
#

@west spoke how?

quasi forge
#

It only gives partial user tho

west spoke
sudden geyser
#

I think it gives most info provided. You just can't do stuff like send a dm to them with no shared guilds.

stone robin
#

Oh

#

Done thanks

jade thistle
#

how to make my js bot edit a comment?

sudden geyser
#

get the message, then call the edit method

jade thistle
#

and how do i do that?

pallid zinc
#

One way doing that is by reading docs

sudden geyser
#

By getting the message, then calling the edit method.

#

example you've tried?

jade thistle
#

not, because i dont know the edit method because google doesnt fucking help

sudden geyser
#

Okay, then visit the documentation and search for the edit function.

jade thistle
#

okk

west spoke
#

@stone robin also may wanna reset your token. You can do that through the discord developer console

stone robin
#

Reseted it @west spoke

#

Thanks

jade thistle
#

@sudden geyser thanks for help, it was much more easy than espected.

sudden geyser
#

np

stone robin
#

Instead of glitch how to host 24/7

slender thistle
#

There's plenty of hosting companies in pinned messages

toxic oracle
#

not free, not for me

#

@stone robin ur gonna have to spend a little if u want actual good hosting

earnest phoenix
#

c!eval

toxic oracle
stone robin
#

Rip

toxic oracle
#

you can buy a vps off of hetzner for literally 2.99 euros a month

stray garnet
#
          ```

it should let me do `ay help` but it only lets me do ayhelp
#

but why

sudden geyser
#

is there a space at the end of "ay"

spark kelp
#

how can i clear my bots cache like cached members messages etc.

quartz kindle
#

in djs v12 all collections have a sweep() method

#

as well as a clear() method

#

sweep lets you pass a function to filter which items should be deleted, while clear deletes everything in the collection

snow urchin
toxic oracle
#

thats a pretty vague question lol

slender thistle
#

Are you sure it's a good idea to do that

snow urchin
#

Well, I do need it..

quartz kindle
#

exposing information from guilds to third parties is considered a breach of privacy

#

unless you lock it for yourself only

#

or for any specific server-side function you may need

snow urchin
#

I will be adding authorisation to it.

quartz kindle
#

even with authorisation, user A should not be able to freely access information from a guild he is not in

earnest phoenix
snow urchin
#

Thats why I need the members, to see if the user is in that guild

quartz kindle
#

how are you getting this guild object?

snow urchin
#
app.get("/dashboardGetGuild", (req, res) => {
    var parts = url.parse(req.url, true);
    var query = parts.query;
    if(query.authorisation !== "this is hidden") return res.send("{\"Status\"}: \" 400\", \"error\": \"Unauthorised\"");
let g = client.guilds.get(query.guild_id);
res.json(g)
})
stray garnet
#

@KATAY#9559 when i do that nothing works

#

@spark kelp

quartz kindle
#

@snow urchin if you log g does all content show up?

earnest phoenix
#

you're using the wrong http code

snow urchin
#

Let me check.

earnest phoenix
#

401 is unauthorized

#

403 is forbidden

slender thistle
#

I am getting data for DBL with that link

quartz kindle
#

he said he is working on locking its access to guild members only

earnest phoenix
#

also auth keys/jwts should be sent in the headers

#

making users provide it in the query is unsafe

quartz kindle
#

well google apis put their keys on query parameters

snow urchin
#

Yes, all the content shows up when I log g

quartz kindle
#

then res.json() is stripping the content out

#

possibly because it doesnt support complex structures like collections

snow urchin
#

Is there any solution?

quartz kindle
#

you can turn collections into array

#

collection.array()

#

you could loop over keys, and turn them into arrays if they are collections

lavish shuttle
#

@snow urchin if(query.authorisation !== "this is hidden") return res.send("{\"Status\"}: \" 400\", \"error\": \"Unauthorised\"");

#

What's the point of faking JSON?

#

Sending an object should work the same way but much better

earnest phoenix
#

you should also set the code itself in the response

#

can't rely on that the client will read the body of the response

#

i think that's how i do it atleast

#

on the second thought, that doesn't matter if the api is going to be hit only by the user on the website

toxic oracle
#

res.status(400).json({ status: 400, error: "Unauthorised" });

#

is how u can do it with express atleast

#

that will also set the content-type header for u too

stray garnet
#

@sudden geyser Then it dont works at all

sudden geyser
#

If you're slicing by its length, it should work. Is prefix exactly "ay " (with the space at the end)

#

are you sure the first arg you're using (command) is valid

slim heart
#

in html is there a way to make a checkbox activated by default without using any js yet?

earnest phoenix
#

use the checked attribute

slim heart
#

wait

#

oh

#

i was doing a dumb cuz i was testing it by changing it in the browser and it wasnt working

#

thnx

earnest phoenix
#

oof

spark kelp
quartz kindle
#

client.users.clear() = delete all users

vivid spruce
#

Hello guys, so I made a live countdown on a website and im wondering how can I show it on my discord server?

quartz kindle
#

client.users.sweep(t => t.bot) = delete all bot users

#

@spark kelp

earnest phoenix
#

@vivid spruce the countdown itself? you can't

vivid spruce
#

I gotta make a countdown with a bot then?

quartz kindle
#

a bot cannot update data in real time

earnest phoenix
#

don't do that either

#

just post a link to the countdown itself

vivid spruce
#

Okay

quartz kindle
#

the most a bot can do it post something and update it regularly

spark kelp
#

thanks and one more thing

quartz kindle
#

like every 5-10 seconds

vivid spruce
#

Thank you guys

spark kelp
#

when users leave from guild my bot still cached that user

#

how can i filter them

#

like guildmemberdelete => client.users.filter(t => t.id != leaveduser.id) ?

quartz kindle
#

in v12, store collections have a .remove() method

#

client.users.remove(userID)

#

or you can just use the native map method .delete(id)

slim heart
#

in mongo how can i remove an entire row? i tried to set it to just undefined but it just sets it to null

mossy vine
#

deleteOne()

slim heart
#

or sorry

#

i mean a column

mossy vine
#

oh thats a good question

#

mongo doesnt really have rows/columns

slim heart
#

like i have {a: {}, b: true} i want to to remove a from it

#

but keep b

slender thistle
#

that'd be an updateOne

slim heart
#

set it to what?

slender thistle
#

with an option that I don't remember, one sec

slim heart
#

cuz when i set it to undefined it turns to null

slim heart
#

thanks

slender thistle
twin lion
#

const Discord = require("discord.js");
const superagent = require("superagent");

module.exports.run = async (bot, message, args) => {
let {body} = await superagent
.get(http://aws.random.cat//meow);

let catembed = new Discord.RichEmbed()
.setColor("#00ff26")
.setTitle("Cat 🐱")
.setImage(body.file);

message.channel.send(catembed);
}

module.exports.help = {
name: "cat"
}

#

this file stopped working for some reason

#

does anybody know where i went wrong?

snow urchin
#
app.get("/dashboardGetGuildMembers", (req, res) => {
    var parts = url.parse(req.url, true);
    var query = parts.query;
    if(query.authorisation !== "hidden x") return res.json({ status: 401, error: "Unauthorised" });

let g = client.guilds.get(query.guild_id).members;
console.log(g)
res.send(g)
})

why is this just showing an empty json instead of all the members for the guild specified

hushed berry
#

oh lord

short siren
#

@twin lion Show the error

stone robin
#

Help

grim aspen
#

with what?

stone robin
#

#main

#

My bot gets invited with 0 perms

#

No role

sudden geyser
#

@sour sandal what line does the error exactly happen

wide ruin
#

Html/js:

#

I have a navbar that just keeps getting bigger

sudden geyser
#

guild is null. Are you using it in a dm

wide ruin
#

How can I add it automatically from the script.js file?

sudden geyser
#

or is the guild not fetched for some reason

#

then that'd be why

#

@sour sandal if you're not using it in a guild, message.guild will be null. You could make a workaround, but I'd recommend locking the command to guild only or something. The id is good

broken shale
#

how would you use auth headers in node-fetch

amber fractal
lunar crystal
#

Can you explain me why ? Thanks in advance 😉

earnest phoenix
#

Says incorrect login details

#

Line 25 of warning.js holds the issue

#

@lunar crystal

lunar crystal
#

Ok but why 😬 ?

earnest phoenix
#

Open your warning.js and go to line 25

#

And see for any spelling mistakes

lunar crystal
#

Ok thanks u very much 😉

earnest phoenix
#

Np 🙂 hope it helps

lunar crystal
#

I can't see warning.js

earnest phoenix
#

Hmm

lunar crystal
#

Sorry 😅 I'm a beginner sorry haha

light stone
#

Hm

quartz kindle
#

warning.js is an internal error handling file

#

its not something you have to go look at, and its not the origin of the problem

#

your problem is incorrect login details, meaning either your token is wrong, or you didnt put it there correctly

quasi forge
ember atlas
#

Code:

 const { exec } = require('child_process');

module.exports = { 
    name: 'exec', 
    description: 'Runs a console command.', 
    usage: '<command>', 
    category: 'owner', 
    aliases: ['ex'], 
    run: async (client, message, args) => { 

}
  const command = args.join(' ');
  const outMessage = await msg.channel.send(`Running \`${command}\`...`);
  let stdOut = await doExec(command).catch(data=> outputErr(outMessage, data));
  stdOut = stdOut.substring(0, 1750);
  outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
};

const outputErr = (msg, stdData) => {
  const { stdout, stderr } = stdData;
  const message = stdout.concat(`\`\`\`${stderr}\`\`\``);
  msg.edit(message);
};

const doExec = (cmd, opts = {}) => {
  return new Promise((resolve, reject) => {
    exec(cmd, opts, (err, stdout, stderr) => {
      if (err) return reject({ stdout, stderr });
      resolve(stdout);
    });
  });
};```

Error: ```js
  const command = args.join(' ');
  ^^^^^

SyntaxError: Unexpected token const
quasi forge
#

You never added an ending } for the exported run function

twin lion
#

const Discord = require("discord.js");
const superagent = require("superagent");

module.exports.run = async (bot, message, args) => {
let {body} = await superagent
.get(http://aws.random.cat//meow);

let catEmbed = new Discord.RichEmbed()
.setColor("#00ff26")
.setTitle("Cat 🐱")
.setImage(body.file);

message.channel.send(catEmbed);
}

module.exports.help = {
name: "cat"
}

#

does not give an error but just stoped working after some time i can not find wy sadly any sugestions?

hybrid river
#

whats bad on having commands that can be used in dms

ember atlas
#

@quasi forge So I am missing one }?

quasi forge
#

Yes @ember atlas

ember atlas
#

Ok Thanks

#

I added one and still got the same error

twilit rapids
#

I mean

#
run: async (client, message, args) => { 

}
  const command = args.join(' ');
#

You literally have your entire command outside your run

#

Move your entire command inside that

#
run: async (client, message, args) => { 
// code for your command goes here
}
ember atlas
#

I changed it and im getting unexpected tokens now

twilit rapids
#

Send your updated code

ember atlas
#
const { exec } = require('child_process');

module.exports = { 
    name: 'exec', 
    description: 'Runs a console command.', 
    usage: '<command>', 
    category: 'owner', 
    aliases: ['ex'], 
    run: async (client, message, args) => { 


  const command = args.join(' ');
  const outMessage = await msg.channel.send(`Running \`${command}\`...`);
  let stdOut = await doExec(command).catch(data=> outputErr(outMessage, data));
  stdOut = stdOut.substring(0, 1750);
  outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
};

const outputErr = (msg, stdData) => {
  const { stdout, stderr } = stdData;
  const message = stdout.concat(`\`\`\`${stderr}\`\`\``);
  msg.edit(message);
};

const doExec = (cmd, opts = {}) => {
  return new Promise((resolve, reject) => {
    exec(cmd, opts, (err, stdout, stderr) => {
      if (err) return reject({ stdout, stderr });
      resolve(stdout);
    });
  });
}
}
twilit rapids
#

What are you closing here?

#
\`\`\``);
};  <-----

ember atlas
#

oh am i not supposed to close it there

twilit rapids
#

If you want to close your exports there you need to add another bracket in the next line and remove the one from the last line

ember atlas
#

hm

#

I figured it out

#

But now I need to define msg and outputMessage and I am unsure how to do that

twilit rapids
#

Well first off

#
 run: async (client, message, args) => { 
#

Did you code this yourself?

ember atlas
#

Yes...

twilit rapids
#

then you know you defined your message object as message and not msg and you've been using msg in your entire command

ember atlas
#

Well msg.edit is a function

#

message.edit isn't

#

It runs the command fine, just want it to edit

vernal willow
#

Are you trying to edit await msg.channel.send(`Running \`${command}\`...`);?

ember atlas
#

no

#

wait yes

vernal willow
#

Ok theres your problem

#

msg.edit(message); I think message needs to be changed to outMessage

ember atlas
#

thats if theres an error

earnest phoenix
#

So none of them are doing the edit?

vernal willow
#

wait what, im confused

#

Wheres the other edit?

ember atlas
#
 outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
}
};

earnest phoenix
#

There’s a outMessage.edit and msg.edit

vernal willow
#

Oh

ember atlas
#

Yes, they are 2 different things

#

It's saying if there is an error, msg.edit and send the erro

earnest phoenix
#

Are they both not doing the edit though?

ember atlas
#

The one I want to do the edit right now isnt

#

So ya its not editing period

earnest phoenix
#

And is that the outMessage.edit ?

ember atlas
#

yes

earnest phoenix
#

Or the msg.edit

#

Ok

late hill
#

Did you fix your mixed usage of message and msg yet?

#

Maybe send the updated code if you have

#

Something I've noticed is that in your doExec() catch, you'll run outputErr() which edits the message, but right underneath that, you'll immediately edit it again because the code beyond the catch would still be executed

ember atlas
#
const { exec } = require('child_process');

module.exports = { 
    name: 'exec', 
    description: 'Runs a console command.', 
    usage: '<command>', 
    category: 'owner', 
    aliases: ['ex'], 
    run: async (client, message, args) => { 


  const command = args.join(' ');
  const outMessage = await msg.channel.send(`Running \`${command}\`...`).then(async (outMessage) => {
  let stdOut = await doExec(command).catch(data=> outputErr(outMessage, data));
  stdOut = stdOut.substring(0, 1750);
  outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
};
};

const outputErr = (msg, stdData) => {
  const { stdout, stderr } = stdData;
  const message = stdout.concat(`\`\`\`${stderr}\`\`\``).then((msg) => {
  msg.edit(message);
};
};

const doExec = (cmd, opts = {}) => {
  return new Promise((resolve, reject) => {
    exec(cmd, opts, (err, stdout, stderr) => {
      if (err) return reject({ stdout, stderr });
      resolve(stdout);
    });
  });
}
}

I nailed it down to this, but I keep getting

};
^

SyntaxError: missing ) after argument list
valid frigate
#

on line 21 you are missing a ) after the }

#

wait fuck

#

it should have given you an error saying what line #, make sure to look at that next time

grim aspen
#

what am i to do with this information ^

valid frigate
#

idk lol

earnest phoenix
#

Command

dusky marsh
#

We would need to see the code and more of an explanation to help you out

shy turret
#

How do you find the ID of the Discord bot by just using...?

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

//some function start
console.log(client.id)
//some function end

client.token("idc")
grim aspen
shy turret
#

thx

vernal willow
#

^^

grim aspen
#

fuck i just spoonfed

shy turret
#

im too lazy

    if (message.content === "<@" + client.user.id + ">") {
      message.channel.send("The prefix of <@" + client.user.id + "> is `--` and the help command is `--help`.")
    }
vernal willow
#

That would work I think

shy turret
#

would this work if i wanted to do it?

try {
 client.login("BOT TOKEN")
} catch(err) {
 console.log(err)
}
earnest phoenix
verbal basalt
grim aspen
quartz kindle
#

@shy turret no

#

.login() returns a promise

#

if you want to use try/catch on it, you have to await it

#

else, you need to use .catch()

knotty steeple
#

@verbal basalt reset ur token

verbal basalt
#

@knotty steeple is that to define the name command?

knotty steeple
#

no

#

just

#

reset ur token

verbal basalt
#

Okay

quartz kindle
#

@verbal basalt you revealed your token in that image

#

meaning anyone could use it to login into your bot

#

aka: "hack" it

verbal basalt
#

I have

#

I can't find away to define command

#

Has anyone got a solution?

near fractal
#

i need help

quartz kindle
#

explain what you need

#

we cant help if we dont know whats the problem

near fractal
#

oh

#

it says client id is wrong and make sure bot has account

#

i checked both

#

and its correct though

quartz kindle
#

where does it say that? please provide context

near fractal
#

wdym

grim aspen
#

are you trying to log in with the bot?

#

like put the id as the bot's token

quartz kindle
#

context as in, what are you trying to do when that message pops up

#

in which program does that message appear, in a browser, in a command line, in a code editor?

#

if in a browser, in which website, which page, where in the page? provide a screenshot with the error as well as what you did that caused it

grim aspen
#

i bet it was restricting a command by id

#

no wait

quartz kindle
#

in order to be able to help, we need as much information as possible, else we have no idea what you're even trying to do

#

explain what you want to do, the steps you tried, the result you were expecting, and the result you got

slim heart
#
function checkValidity(obj, guild) {
    if(typeof obj.base !== "boolean") return false;
    if(typeof obj.censor.msg !== "boolean") return false;
    if(typeof obj.censor.emsg !== "boolean") return false;
    if(typeof obj.censor.nick !== "boolean") return false;
    if(typeof obj.censor.react !== "boolean") return false;
    if(typeof obj.antighostping !== "boolean") return false;
    if(typeof obj.log !== "string" || !guild.c.some(x=>x.id === obj.log)) return false;
    if((typeof obj.role !== "string" && obj.role !== null) || (typeof obj.role == "string" && !guild.r.some(x=>x.id == obj.role))) return false;
    if(!(obj.filter instanceof Array)) return false;
    if(obj.filter.some(x=>x.match(/[^a-zA-Z0-9 ]/gi))) return false;
    if(obj.pop_delete !== null && typeof obj.pop_delete !== "number") return false;
    if(typeof obj.pop_delete == "number" && obj.pop_delete > 120 * 1000) return false;
    if(typeof obj.punishment.on !== "boolean") return false;
    if(typeof obj.punishment.amount !== "number" || obj.punishment.amount < 1) return false;
    if((typeof obj.punishment.role !== "string" || obj.punishment.role !== null) || (typeof obj.punishment.role == "string" && !guild.r.some(x=>x.id == obj.punishment.role))) return false;
    
    
    return true;
}```
ok current im using this function to validate incoming objects and for obj.role and obj.punishment.role it just seems to mess up with the second part of the if statement, the two of them can be null but im checking they're strings then make sure the guild has the roles as well (guild.r is roles)
vital lark
#

ok 1

#

(this is nothing to do with the code)

#

ur giving me an aneurysm just by looking it

sage bobcat
#

One message removed from a suspended account.

vital lark
#

what's the problem anyway

#

like

#

uhh

slim heart
#

I’m doing it like that because I’m returning numbers instead of false to troubleshoot

#

Then I’ll make it prettier once all the logic is done

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

slim heart
#

What

#

Wait

#

if((typeof obj.role !== "string" && obj.role !== null) || (typeof obj.role == "string" && !guild.r.some(x=>x.id == obj.role))) return false; this one

vital lark
#

"returning numbers instead of false"

#

I'm confused by this

#

just do

#
if (typeof validate === 'boolean') return doThis();
else doThisWithNumbers();
slim heart
#

I’m asking for help with the role logic

vital lark
#

I'm just confused of what u need help with

slim heart
#

I want obj.role to be able to be null or the roles ID which is a string

#

But it returns due to the second part making sure that the role is actually in the roles array

vital lark
#

uhh

slim heart
#

Even tho it is and I’m tired and it makes sense that the logic should work but it doesn’t

vital lark
#

i don't think i can help u with this since idk what do u mean HeheHehe

slim heart
#

Wait

#

@vital lark can u vc?

#

so i can show and explain better

vital lark
#

no

sterile minnow
#

Hi

#

I'm here

#

@short ocean

#

LoL

#

You Come?

slim heart
short ocean
#

sup

slender thistle
#

Are you sure you are in the right channel?

short ocean
#

Sorry had to do somethin

#

idk

#

We are just talking about our bots

#

and stuff

sterile minnow
#

Yes

#

Development stuft lol

#

Stuff

short ocean
#

Yea

#

when did u apply your bot

sterile minnow
#

Ahh i hate German keyyboards xD

short ocean
#

Oof

slim heart
#

dbl bot submission is nothing to do with development

short ocean
#

Okay

sterile minnow
#

My Mind is absolutely blowing xD

short ocean
#

hmm

sterile minnow
#

PN? ist better

#

There er have our own Rules xD

short ocean
#

ye

loud salmon
#

pls

short ocean
#

Kk

loud salmon
#

dbl needdev @torn folio

covert turtleBOT
#

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.

torn folio
#

Mkay

#

Who here has done sharding work for their bot before? <- Guidance question.

loud salmon
#

what lang?

torn folio
#

JS

keen drift
#

@loud salmon help me shard pls ExcusemeWtf

loud salmon
#

@keen drift go figure out how to shard between k8s instances yourself u fuckin nerd

keen drift
short ocean
#

oooof

pliant needle
#

Anyone know of a good module or api to help notify when a new video from a specific channel is uploaded?

#

Google just keeps showing youtube bot tuts

slim heart
#

Pubsubhubbub or whatever that is but you can also scrape YouTube in the US

pliant needle
#

Aweshum, spanks :)

hollow saddle
#

Pretty sure you can make a webhook for that using a service like IFTTT

pliant needle
#

Now for the fun part: learning how to make a webhook

#

It's been a long time coming

slender thistle
#

imo it's quite easy to setup a simple one
IFTTT makes it even easier

pliant needle
#

I appreciate the guidance, thank you :)

oblique portal
#

How would you connect your bot to a google drive account, or more specifically, how would you have it upload photos to the drive?

loud salmon
#

I have a feeling that reading this would help you @oblique portal There should be no reason for you to connect any bot to google drive http://xyproblem.info/

#

basically tldr

#
User wants to do X.
User doesn't know how to do X, but thinks they can fumble their way to a solution if they can just manage to do Y.
User doesn't know how to do Y either.
User asks for help with Y.
Others try to help user with Y, but are confused because Y seems like a strange problem to want to solve.
After much interaction and wasted time, it finally becomes clear that the user really wants help with X, and that Y wasn't even a suitable solution for X.```
oblique portal
#

Ok thanks. I am new to the server, sorry

loud salmon
#

its alright

#

its just helpful to us if you tell us your end goal for hooking up to google drive for something

#

if its actually you wanting to do stuff with google drive then thats fine, but if you are looking to use it as a rudimentary image database to save on vps space then its no bueno

oblique portal
#

Ok

stray garnet
#

    message: (bot, utils, config, discord) => {
        bot.on('message', async message => {

         const fs = require ("fs") 
         const botconfig = require ("../settiings/config.json")
         
            if (message.author.bot) return;
            if (message.channel.type === "dm") return;

      let prefixes = JSON.parse(fs.readFileSync("prefixes.json", "utf8"));
    
       if(!prefixes[message.guild.id]){
         prefixes[message.guild.id] = {
           prefixes: botconfig.prefix
         };
       }
    
    let prefix = prefixes[message.guild.id].prefixes    
          
            //let prefix = config.prefix;
            let args = message.content.slice(prefix.length).trim().split(' ');
            let cmd = args.shift().toLowerCase();
            let command;

            utils.load(discord, bot, config, message, args, message.guild);
            if (!message.content.startsWith(config.prefix)) return;
            if (bot.commands.has(cmd)) {
                command = bot.commands.get(cmd);
            } else if (bot.aliases.has(cmd)) {
                command = bot.commands.get(bot.aliases.get(cmd));
            }

            if (config.commandNotFound == true) {
                try {
                    command.run(bot, message, args);
                } catch (err) {
                    if (err) utils.timed_msg(utils.cmd_fail(`Command \`${cmd}\` is not found!`, `${prefix}play <MUSIC/URL>`), 5000);
                }
            } else {
                try {
                    command.run(bot, message, args);
                } catch (err) {
                    if (err) return undefined;
                }
            }
        });
    }

}```

The Defaut Prefix n! works, but if i change it to ! or sth it dont
earnest phoenix
#

because you're returning if the content doesn't start with the default prefix, which i assume is config.prefix

stray garnet
#

Oh i see... F

#

Thank you!

earnest phoenix
#

Hello

stray garnet
#

Hello

earnest phoenix
#

I have a question? What is wrong? This is the failure message (node:12248) DeprecationWarning: Collection#find: pass a function instead
(node:12248) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at item.request.gen.end (C:\Users\wesle\Desktop\Funny bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
at then (C:\Users\wesle\Desktop\Funny bot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12248) 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: 6)

#

`This are my codes:

//Dit is aan het bewerken!! Dit is dus nog niet af!!

const discord = require("discord.js");
const ms = require("ms");

module.exports.run = async (bot, message, args) => {

if (!message.member.hasPermission("MANAGE_MEMBERS")) return message.channel.send("Sorry jij kan dit niet doen");

var user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));

if (!user) return message.channel.send("Geef een gebruiker op. Of deze gebruiker bestaat niet op deze server");

// if (user.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Sorry deze persoon kan jij niet muten");

var muteRole = message.guild.roles.find("name", "MUTED");

if (!muteRole) return message.channel.send("De rol MUTED bestaat niet!");

var muteTime = args[1];

if (!muteTime) return message.channel.send("Geef een tijd mee!!");

await (user.addRole(muteRole.id));

message.channel.send(`${user} is gemuted voor ${muteTime}`);

setTimeout(function () {

    user.removeRole(muteRole.id);

    message.channel.send(`${user} is geunmuted`);

}, ms(muteTime));

}

module.exports.help = {
name: "tempmute"
}`

drowsy sentinel
#

Probably best you choose to try pastebin or hastebin for your code rather than a giant essay.

lament meteor
#

rather than using message.guild.roles.find("name", "MUTED"); use the function method

#

look at the docs for that

earnest phoenix
#

no the problem was that de role stay above my bot. Then can't role my bot de player

#

but thank you!!!

inner sapphire
#

i need help

#

everytime i make my bot join vc it sends something

#

@hushed berry happy bday!

hushed berry
#

@inner sapphire where are you hosting your bot

inner sapphire
#

on a ubuntu vps

#

its only when i run a command

quartz kindle
#

which company is the vps hosted with?

inner sapphire
#

vultr

#

aws dont work either

#

but my pc works fine

#

so

#

now says this

quartz kindle
#

did you install the required dependencies for voice functions?

inner sapphire
#

erm

#

i don't think so

#

i have it fixed but now it ends the music

#

when running the command

#

the bot works fine on my pc but no the vps

#

😐

quartz kindle
#

make sure all your dependencies are correctly installed

inner sapphire
#

can u send me the dependencies link?

quartz kindle
#

also make sure any hardcoded paths are properly updated

#

just review your code and make sure you have installed all the packages you require and that all files and folders you open exist in the vps and are in the correct directories

inner sapphire
#

everything works now

#

but

#

when i play a song

#

it joins then ends the song

quartz kindle
#

where are you playing the song from?

inner sapphire
#

youtube

quartz kindle
#

which package are you using for that?

inner sapphire
#

ytdl-core

#

and ffmpeg

quartz kindle
#

check how to debug errors in that package, how to make sure the youtube link properly connects, the data is valid, etc

#

make it log all errors and status codes

inner sapphire
#

it joined without leaving

#

but aint doing anything

#

im stupid dude.

quartz kindle
#

there is probably an error somewhere but you cant see it because you're not logging and catching them

inner sapphire
#

my vps crashed....

quartz kindle
#

check the package documentation in their npm page or github page and see how to make it log errors

#

ehostunreach means the link could not be found

#

there is a possibility your vps is blocking youtube, or youtube is blocking your vps

inner sapphire
#

but the bot works completely fine on my pc

#

probs

#

aws is broken too

#

let me try that again tho

#

thats what my aws vps does

quartz kindle
#

again, missing dependencies

#

discord.js requires additional packages such as node-opus, depending on how you coded your voice functions

#

check the discord.js documentation