#development

1 messages · Page 1124 of 1

opal plank
#

why you even making it a var?

karmic compass
#

oh look stackoverflow is super cool

opal plank
#

just pass it in the params directly

karmic compass
#

if(member.guild.me.hasPermission("MANAGE_ROLES"))

#

i'd replace whatever i want to be there btw

opal plank
#

thats bad

sudden geyser
#

plus that condition will return true if the bot has permission to manage channels in the channel, so you sort of have it backwards

opal plank
#

that doesn consider final permissions

#

aka channel overrides

#

its preferably to use channel final permissions over guild permissions

karmic compass
#

i don't plan to have the bot function without administrator permis

opal plank
#

bad

thick gull
#

Is there anyone in here fluent in Js/C#/Kotlin who can create an example block of code for requesting info from this API endpoint? https://nekos.club/api/sfw-nekos
@earnest phoenix that api will get you removed from top.gg as it can bring results of minors

opal plank
#

you should have a good reason for having admin rather than lazy coding

thick gull
#

also just do it yourself yikes

earnest phoenix
#

Its Nekos.club, not Nekos.life

thick gull
#

ohh okay

earnest phoenix
#

And I rather have someone who knows the languages do it for me

thick gull
#

well an api is pretty simple tbh

#

assuming

#

that it’s just. A simple here’s your image

sudden geyser
#

@earnest phoenix I know JS and Kotlin. Kotlin not so much in HTTP requests, but in JS just use the fetch API or whatever library you want to use.

opal plank
#

node fetch, axio, curl

#

whatever you want tbh

#

there are plenty of options out there

sudden geyser
#

I like node fetch as it's consistent with JavaScript's fetch API

opal plank
#

i prefer axios tbh

#

but, it just boils down to preference

karmic compass
#

i see what you mean by channel being undefined, if i defined a variable for channel then it would be successful right?

opal plank
#

huh?

karmic compass
#

const channel = client.channels.cache.get(message.channel.id) or something like that, i'm reciting off memory

sudden geyser
#

that's unnecessary

karmic compass
#

then if(member.guild.me.hasPermission("MANAGE_ROLES"))

sudden geyser
#

message.channel is already a channel

karmic compass
#

woops

solemn latch
#

Your getting a channel you already have

karmic compass
#

i t i s

opal plank
#

unless you need a channel different than the one your message is coming from, no need to use that

karmic compass
#

const theGuild = message.guild
if(message.channel.permissionsFor(theGuild.me).has("MANAGE_CHANNELS")) {
message.reply("I can't use this!")
} else {
// do the code
} (this is my last attempt before i do trial and error)

opal plank
#

why you making a var?

sudden geyser
#

you're already doing trial and error

opal plank
#

just pass it directly onto the parameter

#

also you need to invert that

#

if (has permission) reply(cant do this)

#

thats what you're doing basically

karmic compass
#

got 1 more question:
if a user has a role with just administrator as a permission, does discord (a discord bot) see them as having just that permission or all? (example: checking if they have manage messages with just administrator)

sudden geyser
#

Your library will handle the member as having all the permissions, but you can override that behavior to my knowledge.

#

The second argument of <Permission>.has accepts a boolean called checkAdmin which is true by default.

opal plank
#

doesnt member have the bit resolveable?

#

this

#

i assumed it'd have this and the methods just test for the proper value on the integer

rain cradle
#

websocket connection is closing.

#

what just happened?

faint prism
#

Did it reconnect?

rain cradle
#

yes

faint prism
#

That's normal

rain cradle
#

ok

cosmic kiln
#

i can't invite bot

radiant kraken
#

what is the message?

ivory seal
#

how do i create a web dashboard for my bot

radiant kraken
#

how do i create a web dashboard for my bot
@ivory seal use discord identify Oauth

ivory seal
#

what do u mean

cosmic kiln
#

i want to invite bot
but I can't any thing problem with mobile users to invite bot
only pc can invite
<@&265158261945270273>

thick gull
#

what

cosmic kiln
#

i can't invite bot in my server @thick gull

thick gull
#

okay..?

#

did you read any kind of guide or tutorial or learn anything?

cosmic kiln
#

nop@thick gull

thick gull
#

then you should start with the basics of JavaScript if your doing discordJS before trying to make a bot

cosmic kiln
thick gull
#

???

ivory seal
#

and not here

thick gull
#

I don’t know what he wants

#

I think he is trying to make a bot

ivory seal
#

he wants to add the dank memer bot

#

in his server

#

i guess

cosmic kiln
#

for example i want to invite this bot in server i can't @thick gull

ivory seal
#

this is the wrong cvhannle right

#

channel*

thick gull
#

do you have permissions in the server

#

99% sure it’s his roles

cosmic kiln
#

@ivory seal which channel i should go

ivory seal
#

idk

surreal notch
#

hey i m new to mongo how to create a url of mongo i m confused

restive pebble
#

go to clusters tab

#

and click on connect

#

and follow the in screen guide

surreal notch
#

can u explain whats the clusters tab

thick gull
surreal notch
#

ok w8 i got it

opal plank
#

fuck, it wasnt a @ moderators tag

#

@cosmic kiln you should prob avoid tagging roles

cosmic kiln
#

ok and sorry @opal plank

surreal notch
#

and how to open it

#

@restive pebble

#

☹️

restive pebble
surreal notch
radiant kraken
summer ferry
#

Can one of you help me make a bot?

radiant kraken
#

are you new to programming?

thick gull
#

learn basics first before trying to make a bot

summer ferry
#

@radiant kraken I want to learn.

radiant kraken
#

what programming language?

surreal notch
#

Choose a language and read docs @summer ferry

radiant kraken
#

there are a lot of languages and libraries to choose from

thick gull
#

you should learn your languages base before reading docs for discord

summer ferry
#

@surreal notch Do you know the BDFD app

radiant kraken
#

Bot designer for discord?

summer ferry
#

yep @radiant kraken

radiant kraken
#

yes

summer ferry
#

@radiant kraken Yes

#

Can I become a developer?

radiant kraken
#

yes, try reading the bdfd docs first

summer ferry
#

@radiant kraken Did you make a bot?

radiant kraken
#

yes, but i code it not on bdfd pepowot

surreal notch
#

Everyone here with that green color have made a bot

summer ferry
#

@radiant kraken Can you help me make a bot and just take

#

🇺🇸 emoji_17 pp121 devlopper

radiant kraken
#

sorry i can't help you because i am not a bdfd developer :(

thick gull
#

don’t code for the badge you won’t get anything good out of it but frustration

surreal notch
summer ferry
#

@radiant kraken Not on an app, but on what you want.

surreal notch
#

@summer ferry Have you tried googling about your interest

#

Read this ^

opal plank
#

well, at least they are asking how to make one and not coming here after they copied a shit bot from github/youtube asking 'why it errors, fiz pliz'

#

still a bit salty from earlier on

summer ferry
#

@surreal notch On what platform did you make a bot?

surreal notch
#

You can choose anything like visual studio or sublime text but if you wanted to make it online you need to host it

radiant kraken
surreal notch
#

And if you want hosting and coding both on one platform then maybe use Glitch

#

@restive pebble

#

How to get me data base name

#

means where i can find it

#

I have sucessfully connected it

dire obsidian
#

Well depend in what kind of file the data is storaged

surreal notch
#

Huh

dire obsidian
#

Idk i dont use data bases

#

For now

#

Ask someone else

#

Asterki dont cares

surreal notch
#

oof did i ask u

wanton anvil
#

how can I set a avatar webhook with a url from google

surreal notch
#
throw new MongooseError('The `uri` parameter to `openUri()` must be a ' +
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
at NativeConnection.Connection.openUri (/home/container/node_modules/mongoose/lib/connection.js:581:11)
at Mongoose.connect (/home/container/node_modules/mongoose/lib/index.js:335:15)
at Object.<anonymous> (/home/container/index.js:18:10)```
I m new to mongo so explain me where i m doing wrong
solemn latch
#

Says you provided undefined where it expected a uri

#
throw new MongooseError('The `uri` parameter to `openUri()` must be a ' +
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()`
wanton anvil
#

can anybody say me about asyncio.timeout() and how to use it

#

@everyone

rich yew
#

I need help

#

In Visual Studio Code and I open the terminal and type node .

#

it gives me a error

#

Heres the error

strange trout
#

Epic error

shadow niche
#

woo

solemn latch
#

I was waiting for that error

#

Hi

shadow niche
#

Uhh hi?

surreal notch
#

I need that error too

solemn latch
#

10 woobux says its package.json cant find the main file

oak cliff
#

Where's tim when you need him

sudden geyser
#

hibernating

verbal ferry
#

hey

torn ravine
#

hello

verbal ferry
#

how do i make my bots status be "watching" + client.guilds.users.cache.size

#

is that is

#

client.guilds.users.cache.size

crystal socket
#

just len(client.guilds)

verbal ferry
#

no

#

i want members

crystal socket
#

len(client.users) ¯_(ツ)_/¯

ivory seal
#

how do i put my bot in the digitalcloud vps

verbal ferry
#

client.user.setActivity(len(client.users) + " members!", { type: "Watching"});

thick gull
#

you evaporate it and then the micro particles go into the air

verbal ferry
#

yes

#

exactly

ivory seal
#

how do i put my bot in the digitalcloud vps
@ivory seal pls help

solemn latch
#

Digitalcloud?

thick gull
#

digitalocean

ivory seal
#

but i have built my bot

#

already

#

in visual studio code

solemn latch
#

You still have to do some things on the vps

ivory seal
#

like?

solemn latch
#

The guide explains it

thick gull
#

no it doesn’t I checked it

#

it’s your average how to make an if statement

ivory seal
#

ya so......

thick gull
#

I thought it would tell you how to host it

ivory seal
#

it’s your average how to make an if statement
@thick gull exactly

thick gull
#

im not really sure tbh you can try asking their support

ivory seal
#

they have a discord channel?

thick gull
#

not sure

ivory seal
#

yes they don't have

#

one

wanton anvil
#

who can I remove mentions in a message using dpy @everyone

thick gull
#

@everyone

#

:)

radiant kraken
#

pinging everyone doesnt work because you dont have the permissions

thick gull
#

yeah I know

wanton anvil
#

who can I remove mentions in a message using dpy

#

who can I remove mentions in a message using dpy

restive pebble
#

lul

thick gull
#

can you format your question into a readable English question

wanton anvil
#

sorry

radiant kraken
#

who can I remove mentions in a message using dpy
@wanton anvil like what

wanton anvil
#

how can I remove mentions in a message using dpy

restive pebble
#

@radiant kraken

radiant kraken
#

bots cannot edit other message

wanton anvil
#

they can

restive pebble
#

no:

sonic lodge
#

..if they have permission

wanton anvil
#

yes

#

they can

restive pebble
#

even admins cannot edit idot

wanton anvil
#

with adminstrator role bots can edit

restive pebble
#

no

#

this will be an raid then GWjianWut

radiant kraken
#

huh? i didn't know that

restive pebble
#

u edit and blame on users

wanton anvil
#

i didn't ask for a message edit

restive pebble
#

what u think discord wont prevent that lul

radiant kraken
#

see it can't

sonic lodge
#

are you trying to turn @sonic lodge into @​OOPLED

wanton anvil
#

i asked how can I changed the message that I got from the user

thick gull
#

I think he’s trying to post a message and remove any mentions in his own post

#

so it doesn’t ping anything

wanton anvil
#

I want remove first mention of message

restive pebble
#

ur bot's message or some other user's?

thick gull
#

his own

#

probably

wanton anvil
#

some other user's

#

@restive pebble

restive pebble
#

not possible then

thick gull
#

? ? ?

sonic lodge
#

you can't edit another user's message

radiant kraken
#

yes

thick gull
#

99% sure we have a language barrier here

wanton anvil
#

I didn't ask for a message edit

#

I am clear about it

sonic lodge
#

how else are you going to remove a mention from another user's message

radiant kraken
#

is it change other people's message?

#

then you can't

restive pebble
#

then delete the message if it has any

radiant kraken
#

you can only delete them

wanton anvil
#

somebody who is professional in dpy can you come to my server and see how my bot is working

thick gull
#

there is a language barrier here

#

100%

restive pebble
#

idk python rip

wanton anvil
#

any potterheads here?

#

they can understand my problem

thick gull
#

???

sonic lodge
#

you want to remove a mention from another user's message

thick gull
#

what does Harry Potter have to do with dpy

sonic lodge
#

you simply can't do that

wanton anvil
#

see? I took a message of some other user and I am trying to send it with bot with removing first mention of message got it @sonic lodge

radiant kraken
#

or you can delete other users message and resending the content without mention

wanton anvil
#

and it actually worked

#

@sonic lodge

sonic lodge
#

ah, you wanted to DELETE the message that contained the mention

#

everyone here thought you wanted to remove the mention by changing the message's content

wanton anvil
#

no

#

i didn't wanted that

sonic lodge
#

i am thoroughly confused

thick gull
#

I was saying that

torn ravine
#

@wanton anvil are you using message.reply?

thick gull
#

but he was saying no

#

so im like

wanton anvil
#

no pikachu

#

I am using message.channel.send()

#

@torn ravine

torn ravine
#

what are you trying to do?

wanton anvil
#

should i have to explain again??

torn ravine
#

yes I just got here

thick gull
#

manoj

#

what language do you speak

sonic lodge
#

he is trying to remove a mention from a user sent message

thick gull
#

and or is that true

radiant kraken
#

as an alternative, you can just remove the message

wanton anvil
#

@sonic lodge yeah correct and I want to send it through bot

torn ravine
#

he can delete the message and make the bot send one

#

without the mentions

thick gull
#

he wants the bot to send the text and remove the ping

#

yeah

torn ravine
#

however that would cause alot of ghost pings

sonic lodge
#

yeah that's what i thought

radiant kraken
#

sad

earnest phoenix
#

my bot is going tto be verified before 4+ week when it will be verified

radiant kraken
#

just wait

#

3**+** weeks, mind the + in it

earnest phoenix
#

it just been 4+ yesterday

wanton anvil
#

you got it @thick gull

thick gull
#

I don’t know anything about dpy

torn ravine
#

@earnest phoenix they say you were declined

sonic lodge
#

get the content of the user's message, and replace occurences of mentions, which appear in the form <@user_id> with nothing

#

and then send the newly formatted message

radiant kraken
#

or resend it as an embed

torn ravine
#

I’ll write out piece of the code. you do the rest

sonic lodge
#

oh yah an embed works as well

elfin marsh
#

he speaks hindi my guess

thick gull
#

yeah

elfin marsh
#

i aslo lol

thick gull
#

i can’t type Hindi though so I’m like

elfin marsh
#

same country

thick gull
torn ravine
#

if (message.mentions.users.first) {
// You do the rest
}

wanton anvil
#

message.mentions has no attribute users

#

list has no attribute users

radiant kraken
#

message.mentions returns a list/array

#

you can use message.mentions[0] to get the user

wanton anvil
#

not working @radiant kraken

torn ravine
#

Message.mentions is undefined

radiant kraken
torn ravine
#

w a i t

#

I A M D U M B A F

wanton anvil
#

not at all @earnest phoenix

radiant kraken
wanton anvil
#

yes

earnest phoenix
#

hi

wanton anvil
#

I know @earnest phoenix you think I am a fool?

radiant kraken
#

try message.mentions[0], it should work @wanton anvil

wanton anvil
#

not working @radiant kraken

radiant kraken
#

what is the error?

wanton anvil
#

nonetype

radiant kraken
#

it's because the message didn't mention any user @wanton anvil

wanton anvil
#

I mentioned null

#

leave it guys Have a good day

#

thanks anyways

surreal notch
#

How to make my bot certified bot In top.gg

torn ravine
#

@surreal notch certifications are closed rn

surreal notch
#

Y

radiant kraken
#

sure np @wanton anvil

torn ravine
#

Not aure

scarlet folio
#

h

#

how can I make the server count show on top.gg for my bot?

earnest phoenix
#

-servercount @scarlet folio

gilded plankBOT
#

@scarlet folio

To have your bot's server count displayed on DBL, please read the documentation on server/shard posting. Click here to see the docs.. You may also find #312614469819826177 useful; however it is strongly discouraged as most of the examples are extremely outdated.

scarlet folio
#

cool thanks!

earnest phoenix
#

You're welcome!

pure lion
#

@earnest phoenix learn the rest of js dblWink

marsh sapphire
#

GWeulixThonk what type of bot should i make?

#

Idk what type of bot to make?

pure lion
#

Try to innovate

#

What haven't you seen a bot do

marsh sapphire
#

Hmmm

pure lion
#

global chat
Yggdrasil

#

¯\_(ツ)_/¯

marsh sapphire
#

@pure lion what would you want out of a bot?

lusty quest
#

did someone got a idea how to increment a value in a subarray in a Mongoose Schema?

votes: [
{ String, Number},
{ String, Number},
{ String, Number},
{ String, Number}
]
```my array in the Schema Looks like this.  i know i can use the $inc operator but cant figure out how to define the Field i want to update (check where string = string and then update the number for it)
pure lion
#

isNaN to check and if it is update the number next to it?

lusty quest
#

you cant use isNaN inside a Mongodb Query

pure lion
#

O

stable eagle
#

So uh, I am new to discord.js

And I entered some code, but I also need to somehow make the command work.

Like, <help it will respond with an embed, but idk how to make command triggers...
Does anyone know?

lusty quest
#

@pure lion found a way to solve it

pure lion
#

Share

#

It might be useful to me in future too

restive furnace
#

you are comepletelly new to whole js then, i guess 🤷, but make a message listener and then check if the message content matches the content you want it to be

raven nimbus
#

Who can help me ?

pure lion
#

No idea

#

Don't ask to ask, just ask

raven nimbus
#

@pure lion Dice?

restive furnace
#

dont ask to ask

lusty quest
#
await Poll.updateOne({"pollmessageid":message,"votes.vote":vot},{$inc:{"votes.$.votes":1}});
                             |-> Primary key       |                |      |  |   |    |
                                                   |-> Key for the Item in the object  |
                                                                    |-> Increment |    |
                                                                           |->Object Field
                                                                              |-> Replaces the Index number
                                                                                   |-> Field Name in the Object to update
                                                                                       |->Amount to Increment
restive pebble
lusty quest
#

votes: [{vote:String, votes:Number}], this is the line for this in my Schema

pure lion
#

O w O

earnest phoenix
#

if it is array just .push() it

pure lion
#

Why push into an array when you can increment a single ID'd value

#

But maps and arrays are good at what they're made for

earnest phoenix
#

or .find

#

it is good 2

#

if ur array has object inside

#

Guys idk how Ultron got vertified dev role

#

like he asking the most basic things in djs

crystal socket
#

@earnest phoenix hbd

earnest phoenix
#

thx

#

i recoment ya guys add this

crystal socket
#

n0 aDvErTiSiNg!1!!!1

golden condor
#

Use webhooks smh

restive furnace
#

^

earnest phoenix
#

@crystal socket this is not ads

#

just recomment for functions

#

:))

crystal socket
#

my mistake, 🤦‍♂️ thought you were saying "add the bot", not "add this feature"

earnest phoenix
#

:))

golden condor
#

USE WEBHOOKS

wanton anvil
#

can anyone say me what is best api for random memes

golden condor
#

ksoft

lusty quest
#

reddit api

wanton anvil
#

thanks

ember oak
#

Hey, so I made gay command and the percentage is same all the time. How can I make it same per user? (discord.js v12)
Code:

            if (message.content.startsWith(prefix + "gay")) {
            let embed = new Discord.MessageEmbed()
            .setDescription(`${message.author}, you are ` + Math.floor(Math.random() * 25) + `% gay. :rainbow_flag:`)
            .setColor("#A4C9F6")
            message.channel.send(embed)
            message.delete()
        }});```
earnest phoenix
#

what

#

is a v11

#

v12 trash :/

restive furnace
#

ok live with api errors then when v7 deprecated

#

v6*

earnest phoenix
#

😄

restive furnace
#

or switch lib

#

Hey, so I made gay command and the percentage is same all the time. How can I make it same per user? (discord.js v12)
Code:

            if (message.content.startsWith(prefix + "gay")) {
            let embed = new Discord.MessageEmbed()
            .setDescription(`${message.author}, you are ` + Math.floor(Math.random() * 25) + `% gay. 🏳️‍🌈`)
            .setColor("#A4C9F6")
            message.channel.send(embed)
            message.delete()
        }});```

@ember oak database

ember oak
#

how can I do that? I started coding few weeks ago so I'm kinda new here

cerulean venture
wanton anvil
#

ok

golden condor
#

You shouldn't rely on an API that's on heroku

wanton anvil
#

thanks

#

why

golden condor
#

It could go down at any moment

cerulean venture
#

yeah that's true as well

#

are there any better alternatives for reddit stuff ?

golden condor
#

I would suggest the Reddit api

cerulean venture
#

oh they actually have their own? whoops

golden condor
#

Yeah

ember oak
#
        if (message.content.startsWith(prefix + "meme")) {
        const api = require('imageapi.js');
        let subreddits = [
            "pewdiepiesubmissions",
            "dankmemes",
        ]    
        let subreddit = subreddits[Math.floor(Math.random()*(subreddits.length)-1)]
        let image = await api(subreddit)
        let embed = new Discord.MessageEmbed()
        .setTitle(`Random meme from r/${subreddit}`)
        .setURL(`https://reddit.com/r/${subreddit}`)
        .setImage(image)
        .setColor("#A4C9F6")
        message.channel.send(embed)
}}); ```
wanton anvil
#

what lang do you use?? @cerulean venture

golden condor
#

They do

ember oak
#

Random meme from reddit code

restive furnace
#

that heroku one uses reddit api thp

golden condor
#

imageapi.js is unrealiable

cerulean venture
#

what lang do you use?? @cerulean venture
@wanton anvil nodejs

restive furnace
#

just go with node-fetch

wanton anvil
#

oh

golden condor
#

Plus it's just a port of random-puppy

cerulean venture
#

ah

wanton anvil
#

I use python

golden condor
#

Imageapi.js is on glitch which is quite possibly worse than heroku

#

In this case

earnest phoenix
#

@ember oak database
@restive furnace for something like this you actually don't need a database, you can create an algorithm working from the user's id

#

mobile ;(

restive furnace
#

well, thats another possibility

golden condor
#

Yeah I am on mobile too

#

I don't quote on mobile

#

Lol

ember oak
#

But I still don't know how to do it lmfaoo

#

:c

golden condor
#

I made that mistake once with like 7 people

earnest phoenix
#

creating an algorithm is literally just doing math

golden condor
#

Who were pinged in the message

earnest phoenix
#

you can do anything you want with the user id

golden condor
#

Every single ID is a special little snowflake

cerulean venture
#

So I actually have a question.
I stored user id's in a database and now I wanna check if the id is actually on the server where the bot would @ them. How would I do that?

#

could probably loop through them I guess?

earnest phoenix
#

fetch the user from the guild

golden condor
#

you could get the membr

#

And if it isn't there

#

It will return undefined

earnest phoenix
#

you aren't sure if they're cached or not so looping through cached members would not be reliable

cerulean venture
#

hmm true

earnest phoenix
#

you need to loop -> if not found make a request to get the user -> if not found they don't exist in the guild anymore

#

if you're using djs, the fetch method does exactly that

cerulean venture
#

oh neat

wanton anvil
#

how to create a avatar with a link from google

#

image link

cerulean venture
#

if you're using djs, the fetch method does exactly that
that actually helped a lot 🙂 thanks

earnest phoenix
#

what do the different http requests do?

misty sigil
#

wdym?

#

like get, put, delete, post?

earnest phoenix
#

yep

mild flower
#

how do i remove the first 5 letters of a string?

#

more specifically i want to remove the ;vote from the first choice

earnest phoenix
#

You do substring

#

(string).substring(number to start at)

mild flower
#

k

earnest phoenix
#

what do the different http requests do?
@earnest phoenix
they're just indicators on what to do, some (like POST) allow providing content in the body, see https://restfulapi.net/http-methods/

mild flower
#

ehurm

#

thishappened

earnest phoenix
#

wtf is rest

#

thishappended
@mild flower happeneded

#

thishappened
@mild flower you wrote your code wrong

mild flower
#

?

earnest phoenix
#

show it

mild flower
#

wait

delicate shore
#

just recomment for functions
@earnest phoenix i am using it from last 1 month lmaoa

#

a

mild flower
delicate shore
#

what?

earnest phoenix
#

Bruh

#

REST is an architecture meant to standardize how APIs are provided and used

delicate shore
#

what the heck

earnest phoenix
#

Subatring doesn't return an array

delicate shore
#

is that code

earnest phoenix
#

Yoir getting the first letter of the string

mild flower
#

epic gamer code

delicate shore
#

and instead of doing like that

earnest phoenix
#

Look at this:

delicate shore
#

u could simply just

#

split it with ,

#

and then

earnest phoenix
#
var votefinal = (smth).substring(5);
votefinal[1]

Which just gets the second letter of the string

mild flower
#

then how do i fix that

earnest phoenix
#

don't put [1]

delicate shore
#

;-; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

earnest phoenix
#

duh

delicate shore
#

DUH

#

lol

earnest phoenix
#

i gtg

delicate shore
#

Bye

earnest phoenix
#

Hello Devs

#

Does someone knows how to see over how many members you bot is watching, I know how to do with servers

delicate shore
#

yeh but

#

it's never acurate

earnest phoenix
#

${client.guilds.cache.size}

#

Oh

#

I used that

#

for servers

delicate shore
#

yes

#

for membercount it'ssomething like

#

no

#

hold on

earnest phoenix
#

${client.member.cache.size}

#

like that?

#

i thought

cerulean venture
#

Well here I am again with another question.
I'm trying to use node-cron in my index.js to be precise in my on("message".

Somehow its just doing nothing, it gave me a few errors before so I know it's actually getting called but somehow it just does nothing?

https://pastebin.com/wW9qVSs7 <- that's the cronjob, has anyone any clue why that happens?

delicate shore
#
<client>.users.cache.size;
earnest phoenix
#

Nearly as i said

delicate shore
#

ye

#

u can't get exact

#

users

#

in v12

#

discord limits

earnest phoenix
#

lmfao

#

sad

delicate shore
#

wym be Reduce?

#

loop = more api requests = Ratelimit = F'ed up

#

if i am not wrong

#

i had ;-;

#

so i want to be on safer side

river sedge
#
const type = channel.type === 'text' ? 'SEND_MESSAGES' : 'CONNECT';
        
        const locked = await chan.createOverwrite(chan.guild.roles.cache.find(r => r.name === '@everyone').id, {
          [type]: null
        });``` it also makes the channel read message as null
#

how do I make it only change send message to null

delicate shore
#

I-

#

BRUH

river sedge
#

?

delicate shore
#

not you

royal laurel
#

i just posted minecraft coords lol

delicate shore
#

lmao

next ridge
#

sa

#

hello

mild flower
#

YES I DID IT

delicate shore
#

Hi!!!!

mild flower
#

i did epic gamer moment with le substring

royal laurel
#

lol

mild flower
#

yEA BOI

royal laurel
#

didnt work

mild flower
#

``let votesplit = votechoice.split(',')
if(!votesplit[1]) return message.channel.send(Evote);

        let votechoice1 = votesplit[0].substring(5)``
delicate shore
#

wrong gif

mild flower
#

all i had to do

#

was that

earnest phoenix
#

You could just do - if not sharded:

amount = 0;
<client>.guilds.cache.forEach((guild) => {
  amount = amount + guild.memberCount;
});
#

or reduce it as somebody sent above as well

restive furnace
#

or js guildsCache.reduce((a, b) => a.memberCount + b.memberCount)

#

smth

royal laurel
#

anyone know how to check if someone has a specified role, i've looked everywhere and cant seem to find one. im using disc js

delicate shore
#

umm

#

u read the docs?

restive furnace
#
royal laurel
#

k\

restive furnace
#

a + b.memberCount, huh?

#

or js guildsCache.reduce((a, b) => a.memberCount + b.memberCount)
@restive furnace this works

#

things inside [] in the dlcs are optional

earnest phoenix
#

that doesnt work

#

guildsCache isnt anything

#

where u talking about

restive furnace
#

i wont spoonfeed

#

thats why it is like that

earnest phoenix
#

ok fair enough srry

serene echo
#

embed.setDescription(*Name: @${message.author.tag}*)
^^^ How do I ping someone ^^^

earnest phoenix
#

but that wont work @restive furnace

restive furnace
#

messageAuthor#mention @serene echo

earnest phoenix
#

or @${msg.author.id}

pale vessel
#

they're on Eris?

restive furnace
#

no, eris doesnt have embed constructors

pale vessel
#

in discord.js, you can use message.author

#

user.mention is eris

serene echo
#

not really work...

pale vessel
#

use message.author

#

remove the @ before though

delicate shore
#

discord

#

should allow mentions in emebed too

pale vessel
#

that's not a good idea

delicate shore
#

i mean the one in which you get a ping

#

why ?

serene echo
#

@pale vessel
Thanks so much it works.

pale vessel
#

user info embeds will ping roles and users

delicate shore
#

oh

#

yeh

#

but

#

there should be a option

earnest phoenix
#

only description right

pale vessel
#

that's going to be a massive disaster

delicate shore
#

like .mention

#

something

pale vessel
#

maybe

#

like allowedMentions but for embeds?

delicate shore
#

yee

earnest phoenix
#

Wait my bot is watching over 110K people

#

tf

lusty quest
#

When you cant figure out why your changes on the code wont change the behavior of the expected output and you realize after 20 minutes you upload the wrong file all the time

earnest phoenix
#

where is the bot added

#

lol

delicate shore
#

nvm

earnest phoenix
#

nope

#

not here

delicate shore
#

yeh

earnest phoenix
#

Otherwise i would have the role developer

#

xd

delicate shore
#

yeh

lusty quest
#

Maybe a few other servers

delicate shore
#

XD

#

Maybe some like Plexi

#

and others

lusty quest
#

Discord bot land

delicate shore
#

yd

earnest phoenix
#

its kinda weird

#

its in 44 servers

#

and 110K people

#

thats a lot doe

delicate shore
#

my bot is in 447 servers

earnest phoenix
#

Wich bot is that?

delicate shore
#

and almost 600K

#

members

#

XD

lusty quest
#

There is nothing wired some guilds could have 20k users

earnest phoenix
#

But what bot is it

#

whats the name

restive furnace
#

black sheep

delicate shore
#

^^

earnest phoenix
#

can I have invite

#

I want to add

delicate shore
#

@earnest phoenix just do -bots @Black Sheep#5071 in #commands

earnest phoenix
#

K

delicate shore
#

no

#

sorry

#

no

#

-botinfo

gilded plankBOT
#

tickNo Please include a bot mention or ID

restive furnace
#

-bots @delicate shore

gilded plankBOT
restive furnace
#

that

pale vessel
#

lol

#

why

delicate shore
#

not here

#

;-;

pale vessel
#

but you did it anyway, what a madlad

earnest phoenix
#

-botinfo @outer marsh

gilded plankBOT
#

tickNo Please include a bot mention or ID

earnest phoenix
#

oh

pale vessel
#

dude

lusty quest
earnest phoenix
#

Not here

#

lemme switch

delicate shore
#

but you did it anyway, what a madlad
@pale vessel me?

earnest phoenix
#

How to make bot loop
Like Loop Script ( Discord.js )

restive furnace
#

basic javascriåt

#

not only discord.js

#

but fine: js for (let thing of client.users) { console.log(thing.tag); } for example.

#

theres 2 other types too of loops in js. for loop and forEach.

#

quick google search hould cover that up

last zephyr
#

while?

dreamy scarab
#

-bots

gilded plankBOT
restive furnace
#

well its not recommended for especially for beginners, since there can come memory leaks and etc.

earnest phoenix
#

Hello Pro-devs how do I make changing status?

#

You guys are insane

#

like PRO devs

pale vessel
#

no

earnest phoenix
#

yes

#

does someone knows a tutorial

#

or

restive furnace
#

iterate through array, and then set it to bot status, but dont change it like 30 times / min

#

make some cooldown

#

but thats basically how to make it

earnest phoenix
#

Oh

#

How do i put cooldown

restive furnace
#

use setInterval..

earnest phoenix
#

what

last zephyr
#

the

earnest phoenix
#

fack

last zephyr
#

indeed

earnest phoenix
#

add them to a map or set

#

and check if the map or set contains something specific

restive furnace
#

what?

#

hes talking about changing presnece

#

you dont need map or set for that

#

uhh

earnest phoenix
#

he said "how do i put cooldown"

pale vessel
#

you don't even need map for cooldown

restive furnace
#

^

pale vessel
#

just use normal objects and delete

earnest phoenix
#

no an interval will work best

pale vessel
#

how

restive furnace
#

what? and how?

earnest phoenix
#

thats what you said free

pale vessel
#

you misread the question

restive furnace
#
setInterval(() =>
{
     <clientUser>#setPresence(object.n);
}, 30000);
// i assume you are using discord.js, alternative for eris is <client>#editStatus(object)```
earnest phoenix
#

you misread the question
@pale vessel oke

normal ether
#

Hello

#

I’m trying to make a hot

#

Bot

#

But I need help

earnest phoenix
#

send the error

#

or problem

normal ether
restive furnace
#

Ok first of all, if you haven't learnt basics of the language, I recommend you to learn the basics. Second, dont ask to ask, thank you.

normal ether
#

Help

restive furnace
#

thats not development question

earnest phoenix
#

read what is says

normal ether
#

How do I do that

#

How do I add tags

earnest phoenix
#

with your eyes

normal ether
#

Can’t see nothing

#

What is Bot prefix

earnest phoenix
#

where you start your commands with

normal ether
#

Yes

#

Commands

#

White do I put commands at

#

Where

earnest phoenix
#

You don't have to

#

You just add a description of your bot

normal ether
#

Ok

#

Thank you

#

And what about this

#

What about those links

earnest phoenix
#

read what the say

#

How do i put cooldown
@earnest phoenix there are multiple ways i can teach you the method i use

#

@earnest phoenix your token is on github

normal ether
#

What is github

#

They say display names

#

Links

quartz kindle
#

@normal ether did you even make a bot?

earnest phoenix
#

@earnest phoenix and dont create 4389248932 message listeners

normal ether
#

Yes

earnest phoenix
#

you only need 1

normal ether
#

No

#

I made a developer portal

earnest phoenix
#

wtf

quartz kindle
#

@normal ether so you made a bot account

earnest phoenix
quartz kindle
#

not the actual bot

earnest phoenix
#

yeah

normal ether
#

Yes

earnest phoenix
#

you need to learn

quartz kindle
#

you have to code an actual bot before adding it

normal ether
#

Ok

#

Ok

earnest phoenix
#

how to speak english

quartz kindle
#

else you're basically adding a dead bot what will be declined

earnest phoenix
#

yep

normal ether
#

Ok

earnest phoenix
#

there is a joke server nuker bot

restive furnace
#

Ok first of all, if you haven't learnt basics of the language, I recommend you to learn the basics. Second, dont ask to ask, thank you.
@restive furnace third, you dont start making bot by posting it to top.gg

earnest phoenix
#

yep

normal ether
#

Ok

earnest phoenix
#

you dunno if you'll finish it before they review it

#

but that's an AWESOME timesaver

#

tbh

normal ether
#

Ok

earnest phoenix
#

but a risky one

#

mods are weird

#

🤣

normal ether
#

So can someone just help me code a bot

earnest phoenix
#

yep

#

this is the chanenl

#

for help

#

but we won't help if you ask us to make your bot or demand help

#

play it cool and everyone will help you

restive furnace
#

i would help, but my requirements for helping someone to create a bot are that he can knowledge about the basics of the lamguage

earnest phoenix
#

just realized i am kinda minimodding

#

f

#

i would help, but my requirements for helping someone to create a bot are that he can knowledge about the basics of the lamguage

he can know ledge

restive furnace
#

i dont think so

normal ether
#

Bro

#

Lmaguage lmaoooo

#

Yeah bro

earnest phoenix
#

i am telling you to fix your grammar

normal ether
#

That’s very funny

#

Coming from a guy

restive furnace
#

ok sorry for small mistakes when im writing fast, and "very funny" lol

normal ether
#

Ok

#

I know English

#

It’s just

#

I have a fun

#

Phone

pale vessel
normal ether
#

And auto correct

earnest phoenix
#

lol

golden condor
#

ok

earnest phoenix
#

do you know the basics of any programming language?

#

you should

#

you're zoom

normal ether
#

Yes

earnest phoenix
#

which one?

restive furnace
#

ok i could install grammarly for no mistakes but nah, and auto correct annyoing

earnest phoenix
#

Python probably

normal ether
#

Java

earnest phoenix
#

WTF

#

NOT REAL

quartz kindle
#

java or javascript?

earnest phoenix
#

IT'S NOT REAL

normal ether
#

Collage

#

College

earnest phoenix
#

how

normal ether
#

Freaking auto correct

#

Computer science

#

And computer learning

quartz kindle
#

so you know how to code in java?

earnest phoenix
#

HOW DID THEY TEACH YOU THE HARDEST LANGUAGE IN THE WORLD DEFINETELY NOT SUITABLE FOR BEGINNERS

normal ether
#

It’s all I focused on

earnest phoenix
#

bye guys

restive furnace
#

java or js?

pale vessel
#

seems legit

normal ether
#

Java

earnest phoenix
#

me gonna die

restive furnace
#

okay

normal ether
#

Ok

restive furnace
#

use java discord api then

#

aka jda

normal ether
#

Ok

restive furnace
#

well, theres others, but jda has best docu

normal ether
#

Where can I find it at

#

Or him

restive furnace
#

from google

quartz kindle
#

@normal ether if you know how to program with java, check out the JDA library

normal ether
#

Ok

#

How do I know that’s not grabify

restive furnace
#

its github

#

lol

normal ether
#

Yeah

earnest phoenix
#

github the bet

normal ether
#

You can use anything to disguise on grabify

earnest phoenix
#

*best

restive furnace
#

you cant

slender thistle
#

It's a direct link to github

restive furnace
#

and why would tim grab your ip uhh

earnest phoenix
#

You can use anything to disguise on grabify
BRO DOMAINS ARE BOUGHT BY GITHUB

1000 IQ verified

#

lol

pale vessel
#

can't have shit in detroit

earnest phoenix
#

what does this do?:

#

types

normal ether
#

Bruh

quartz kindle
#

how do i know that's not xyz
you read the url, you hover over the url and read the hyperlink on the bottom left corner of your browser if you dont believe the url

earnest phoenix
#
var phin = require("phin");
phin({
  url : "https://discord.com",
  method: "get"
});
normal ether
#

Yeah bro

earnest phoenix
#

what does the get method do

normal ether
#

Somebody did that before

#

And I still got fucking booted

quartz kindle
#

then you did something dumb

earnest phoenix
#

please stop swearing it makes me uncomfortable

quartz kindle
#

anyway just google JDA discord

normal ether
#

I clicked on a YouTube link

#

That’s what I did

earnest phoenix
#

can anyone help me

#

scroll up

#

my own code doesn't make sense to me KEKW

quartz kindle
#

the get method is the same as opening the link in a browser

earnest phoenix
#

so it basically grabs informations?

quartz kindle
#

yes

#

it downloads the page

earnest phoenix
#

it downloads the page
then f

#

me hasn't got a lot of RAM/storage

quartz kindle
#

it doesnt store it lol

earnest phoenix
#

it basically stores it in RAM right?

#

is that why discord destroys my broswer

#

broswer

quartz kindle
#

yes, but only while you're using it

earnest phoenix
#

yep

#

the app is worse

quartz kindle
#

once it goes out of scope, it will be garbage collected

earnest phoenix
#

also

#

what is rest?

#

me needs to learn HTTP stuff

quartz kindle
#

representational state transfer

earnest phoenix
#

repe

quartz kindle
#

lul

earnest phoenix
#

idk wtf i just said

quartz kindle
#

its basically a stateless request

#

meaning that the request can be done from any computer at any time without any precondition and it will work

#

for example, it doesnt require logins, nor account sessions

earnest phoenix
#

cool

#

so i can't use REST stuff for the Discord API because some stuff requires my client secret

#

please say i understood right

slender thistle
#

Then that means me using OAuth2 for my API/website makes it non-REST, correct?

earnest phoenix
#

umm

quartz kindle
#

discord has a REST API, which works anywhere from any computer, as long as each and every request includes an authorization key

#

you dont need to login beforehand

earnest phoenix
#

sessions

#

got it

quartz kindle
#

you just need to send the api key

#

with every request

earnest phoenix
#

like this?

slender thistle
#

Oh, I see

earnest phoenix
#

<url>/file.html?stuff=stuffvalue

#

that's PHP right

#

man why does repl.it take forever to load

#

I JUST WANNA FIX A CORRUPT FILE

#

and they present me with a captcha

quartz kindle
#

those are called "query parameters" or "url parameters" or "query strings"

#

?bla=2&etc=3

earnest phoenix
#

PHP and JQuery can take stuff from those

#

right

#

or left

quartz kindle
#

yes

earnest phoenix
#

yeet

quartz kindle
#

php is server side, and jquery is client side (ie, inside your browser)

earnest phoenix
#

and nodejs is both

quartz kindle
#

nodejs is server side

#

there is no nodejs inside your browser, but browsers have their own built-in js engine

earnest phoenix
#

when you forget what nodejs's purpose is

#

to run code outside your browser

quartz kindle
#

they are both javascript engines

earnest phoenix
#

gay gapple got it wrong

#

a miracle just happened

#

repl.it loaded without presenting me with a reeeeeeeeeeeeeeeeCAPTCHA

#

also imma go embed my whole freaking bot website as my bot description KEKW

#

btw

#

if i do:

var phin = require("phin");
async var potato = await phin({
  url : "potato.com"
  method : "get",
  parse : "json"
});

potato.com returns:

<!DOCTYPE html>
<html>
<body>
<pre>
{
"yeet":"yeet"
}
</pre>
</body>
</html>

Will it "parse" the "JSON" on the page and potato.yeet will return yeet?

slender thistle
#

I assume it will attempt to parse the whole response as JSON

#

that will include all HTML

quartz kindle
#

yes

earnest phoenix
#

what is json?

quartz kindle
#

to parse a website response as json, it needs to send the response as json, not as html

#

javascript object notation

earnest phoenix
#

When you put a try{} catch(err){} function on your whole bot.on("message") function

#

ram and cpu wasted

slender thistle
#

Is it our browsers parsing JSON responses under <p> elements, actually?

earnest phoenix
#

because my ide automatically detects syntax errors

#

and i rarely make any other errors

quartz kindle
#

json is a portable way to represent basic javascript objects in plain text, in order to export them and transfer them to other programs and even other languages

earnest phoenix
#

what are JS objects

slender thistle
#

instances of classes

quartz kindle
#
let object = {
  a:10,
  b:20
}
``` this is an object
slender thistle
#

5 is an instance of integer, technically

earnest phoenix
#

other languages
me who's learning python for no reason: aah that killed me

normal ether
#

Thank you

slender thistle
#

They're dictionaries in Python

normal ether
#

You helped make my bot

#

Thank you

earnest phoenix
#

why is this.client undefined

normal ether
#

Very much

earnest phoenix
#

who

pale vessel
#

are you using classes

quartz kindle
#

what would this be

normal ether
#

But now

#

I will leave

earnest phoenix
#

are you complaining

#

or flooding chat

normal ether
#

No

earnest phoenix
#

or just doing random stuff

normal ether
#

I’m thanking

earnest phoenix
#

ok welcome

normal ether
#

You help me make my boy

earnest phoenix
normal ether
#

Bot

pure lion
#

What is this in py?

radiant kraken
#

self

quartz kindle
#

you're welcome and good luck using JDA

earnest phoenix
#

this means this

pure lion
#

Oh

slender thistle
#

usually self but you can make it anything

normal ether
#

It’s really easy

pure lion
#

Thanks null and shiv

earnest phoenix
#

no

radiant kraken
#

sure yw

slender thistle
#

I don't exactly remember if it's PEP or just people's preferences

normal ether
#

If you pass computer science

earnest phoenix
#

don't lie that Java is easy HAIL JAVASCRIPT

normal ether
#

Just study it in college

#

It’s not hard

earnest phoenix
#

me in high skool

slender thistle
#

Anything is easy if you have experience working with it