#development

1 messages · Page 599 of 1

carmine echo
#

Whatever I'll just wait

earnest phoenix
#

I change my bot avatar yesterday, and it took 5m

carmine echo
#

maybe it refreshes every 30 minutes or every hour or something

earnest phoenix
#

Idk

#

it can be your browser cache

carmine echo
#

It is not

earnest phoenix
#

hm

carmine echo
#

It's only been like 20 minutes so I am not surprised, just really impatient

worthy pine
#

Hi

earnest phoenix
#

Ok

lament meteor
#

@carmine echo iirc avatar updating is 2 per hour. Check discords documentation on rate limits

carmine echo
#

That is not what I asked, but ok

errant spruce
#

how to keep our bot connected ?

earnest phoenix
#

?

#

@errant spruce

errant spruce
#

i coded my bot in js and i could he rest connected but when i close the program window, he is disconnected in my server

earnest phoenix
#

You got a vps?

errant spruce
#

no but i dont find a good free vps

earnest phoenix
#

Bruh

#

....

#

Just use Heroku or something

slender thistle
#

Please

#

Heroku is not for Discord bots

errant spruce
#

have you some tutorial because i absolutly don't know how to do and my google searches don't give me pertinent results

earnest phoenix
#

You can use it for bots

#

lol

slender thistle
earnest phoenix
#

But he wanted a free one. lol

errant spruce
#

yeh

slender thistle
#

There is no good free hosting

#

Unless you have a rich friend who would agree to host your bot

earnest phoenix
#

There is no somewhat decent free hosting

#

Just use an old computer or something

errant spruce
#

and heroku ?

earnest phoenix
#

?

#

You could host your bot on an old computer

errant spruce
#

is there a way to get a bot hosting on heroku ?

earnest phoenix
#

dont use free hosting

#

period

#

Free hosting wont get your far

slender thistle
#

There is but you won't be able to:

  1. Save anything in bot folder from the script.
  2. Have voice support.
  3. Have you bot not restart every 24 hours.
earnest phoenix
#

There is nothing bad with having it restart

#

or really have any optimal performance

#

^^

slender thistle
#

Having your bot to play some games that depend on cache

earnest phoenix
#

That's true.

slender thistle
#

Or anything related to cache, I would say

earnest phoenix
#

Just save it to a db or something.

#

Even tho that's not that performance friendly

slender thistle
#

You would need a db server

#

Saving to local won't work

earnest phoenix
#

there are serverless databases

#

^^

errant spruce
#

with datafire maby ?

slender thistle
#

What

earnest phoenix
#

Bruh

errant spruce
gleaming tulip
#

firebase

earnest phoenix
#

^^

trail dagger
#

how could i get my commands to work per guild only again? discord,py async

slender thistle
#

per guild?

#

You mean you want them not to work in DMs?

earnest phoenix
#

What's an app on mobile that I can use so I could host my bot?

#

Ping me for answer

neat falcon
#

hosting on mobile is possibly one of the worst ideas possible

carmine echo
#

Even though it's a bad idea, it can be possible. If you have an apple device then oof, nothing you can do, but if you have an android device you can download Termux from google play. You can install python, node and other languages on it

#

@earnest phoenix

earnest phoenix
#

I don't have an other devices

carmine echo
#

you only have an apple phone?

earnest phoenix
#

I have a Android Tablet

carmine echo
#

You can't do anything then. if you have an android then download termiux

#

read what I said again

dull bobcat
#

can any1 help me pls

carmine echo
#

help with what?

dull bobcat
#

my bot

#

xD

#

hold on

#

ill explain

#

sorry

carmine echo
#

I mean, I can't help yet because you didn't even say which language you are using, what the issue is and didn't provide the code. So please do those things

earnest phoenix
#

@trail dagger Language?

#

JS: if (!message.guild) return;

#

I believe

carmine echo
earnest phoenix
#

Ah

#

Didnt see

#

Guess I'm blind

carmine echo
#

but in js you should do message.channel.type !== 'text' instead

earnest phoenix
#

Ye

dull bobcat
#

Discord.js

// These are my variables:
let mGame = member.user.presence.game;
let type = { 0: "Playing", 3: "Watching" };

// And this is how I use it in my embed
.addField('Activity', `${mGame ? mGame : "Nothing"}`, true)

There is no error, but I've tried to solve my issue for hours now. So before, in my embed i had this:

.addField('Activity', `${type[mGame.type] || "Nothing"}(${mGame.type || ""}) ${mGame || ""}`, true)

This worked perfectly, but the thing is when the user doesn't play anything I get an error saying "can't read "type" of null", which makes sense, but really, the new one I made, it doesn't tell me the type of the mGame, which I wan't, it just tells me what the persons activity is. Can someone help me fix this problem?

carmine echo
#

wait

#

no

dull bobcat
#

No, I cant do if statements

#

Inside a field param

#

if i wanted to use if statements i already would

earnest phoenix
#

how about

if(statement) {
.addfield
}
else {
.addfield
}
dull bobcat
#

guys..

#

I'm not gonna use if statements

#

And that wouldn't solve the issue either

#

@earnest phoenix

earnest phoenix
#

yes it would

dull bobcat
#

No

carmine echo
#

ok I am trying to figure it out

dull bobcat
#

Because mGame would still be null

earnest phoenix
#

you havent even tried it

dull bobcat
#

The type wont be able to read mGame

earnest phoenix
#

please go try it before saying it wont work

dull bobcat
#

For fuck sake good help right there ^

earnest phoenix
#

if(object) in javascript checks if the object is null/undefined

carmine echo
#

is mgame.type defined?

dull bobcat
#

I've been trying to solve this goddamn issue with well experienced programmers for 3 hours straight and you think I / we haven't tried using if statements @earnest phoenix

#

@carmine echo there is literally a variable for mGame, I provided it xD

earnest phoenix
#

you're stubborn, lower your ego

#

i told you a simple fix

dull bobcat
#

That wont fix it

#

God

earnest phoenix
#

and your response is no i don't want to

dull bobcat
#

mGame is still null

carmine echo
#

@earnest phoenix calm down

dull bobcat
#

@earnest phoenix ive tried what you told me to hours ago

carmine echo
#

I've had a similar issue. When a bot performed anything that would send the user a DM, the message object would suddenly become null and crash the bot, even though it had no reason to

dull bobcat
#

God. That won't print the type @earnest phoenix

earnest phoenix
#

wat

dull bobcat
#

I'll just ask in another server

#

You guys are obviously not enough skilled

carmine echo
#

I am by no means a professional in js

#

Or any language, for that matter

earnest phoenix
#

it's literally

if(myobject) {
.addField("my object is defined, i can use props on it")
}
else {
.addField("my object is not defined, i can't use any props on it")
}
carmine echo
#

why would you need to put it in blocks

earnest phoenix
#

because formatting ™

dull bobcat
#

I don't wanna use if statements, how many times do I have to say this, for real?

earnest phoenix
#

great

slender thistle
#

Why don't you

carmine echo
#

I've seen people do this

function foo ()
{
    bar()
}

Like wtf why would anyone do this

dull bobcat
#

Because i dont want to

slender thistle
#

That's not bot dev-y from you

carmine echo
#

I completely refuse to use semicolons

#

My code has 0

#

I don't use for loops because of that

slender thistle
#

Just because you don't wanna use it doesn't mean it's not gonna work haHAA

earnest phoenix
#

^

dull bobcat
#

@slender thistle You have iPhone XS Max right?

#

Your pfp?

#

Typical iPhone selfie xD

carmine echo
#

But to be honest, not using if statements to prevent issues is a stupid idea

earnest phoenix
#

what does their avatar have to do with anything

slender thistle
#

I have an iPhone that is Huawei

carmine echo
#

that makes no sense

#

iPhones are made by apple

slender thistle
#

If you think hard enough, everything does

carmine echo
#

you seem to be confusing the terms iphone and smartphone

slender thistle
#

(Someone also didn't get a bit of sarcasm in there)

carmine echo
#

shit

#

I wooshed myself

slender thistle
earnest phoenix
#

apple invented discord

carmine echo
#

But I've heard someone say that they have an ipad made by samsung that runs windows

inner jewel
#

windows can run on arm

earnest phoenix
#

yes

inner jewel
#

and you could run windows on an x86 phone/tablet

earnest phoenix
#

someone managed to run windows on a switch

inner jewel
#

switch is arm /shrug

earnest phoenix
#

yeah

#

from what i've heard win10 arm on switch doesnt get past bsod

wanton walrus
inner jewel
#

just store them in plaintext

wanton walrus
#

my favorite

earnest phoenix
#

nah lets use json for everything

wanton walrus
trail dagger
#
@client.command(pass_context=True)
async def customemote(ctx):
  if ctx.message.author.id == beta:
            #Codestuff

i dont get the IDs in beta = [] to get access to command

519219093878997000, 297025946773356544]```
#

tag me with a suggestions

inner jewel
#

you're checking if an id is equal to a list

#

you need to check if the id is in the list

lusty dew
#

nvm

trail dagger
#

i forgot to say it

#

i already fixed it

lusty dew
#

also my name why

carmine echo
#

It has been over 5 hours now and discordbots.org still has the old profile picture of my bot cached. How do I update it?

inner jewel
#

try editing the bot and saving

carmine echo
#

tried 3 times

lusty dew
#
client.guilds.get(guildID).shard.send(packet)
        send(guildID, packet) {
            if (client.guilds.has(guildID)) return client.guilds.get(guildID).shard.send(packet);
            throw new Error('attempted to send a packet on the wrong shard');
        }
#

I am unsure of how to actually send the packet

#

Bc the npm package I am using uses client.ws.send

#

but in master that doesn't work

#

d.js master*

#
April 6th 2019, 10:51:18 am :: Clap Bot Beta has been put online.
April 6th 2019, 10:51:26 am :: Loaded commands.
April 6th 2019, 10:51:27 am :: Successfully connected to database.
April 6th 2019, 10:51:35 am :: Clap Bot Beta has been put online.
April 6th 2019, 10:51:35 am :: Loaded commands.
2
2
KawaiiPanda#6311 has gadined 2 and 8
(node:11944) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
April 6th 2019, 10:51:36 am :: Successfully connected to database.
10
#

When I do that

#

it restarts the bot

earnest phoenix
#

i get this error: Command raised an exception: TypeError: Object of type Record is not JSON serializable

for this command:

@bot.command(aliases = ["warnings"])
async def warns(ctx, *, user: discord.Member = None):
            warns = await bot.pool.fetch("SELECT * FROM warns WHERE userid = $1 AND guildid = $2", user.id, ctx.guild.id)
            embed=discord.Embed(title='Warnings', colour=discord.Colour.gold(), description=warns, timestamp=datetime.datetime.utcnow())
            embed.set_footer(text='GBot')
            await ctx.send(embed=embed)```
#

well yeah

#

cry

#

;v

#

it's a sql record you cant just throw it into something that takes a string

#

for loop it

mossy vine
#

so in the discord.js docs it says the embed color must be a number but what about things like "CAC232" or "random"?
https://discord.js.org/#/docs/main/stable/class/MessageEmbed?scrollTo=color

marble needle
mossy vine
#

oh

marble needle
#

clearly states that this is just for received embeds, https://discord.js.org/#/docs/main/stable/typedef/ColorResolvable

#

here are the options you have for embed colors and their respective representations

mossy vine
#

thats exactly what i was looking for thanks

#

didnt know there are colors like "PURPLE"

#

i thought its only just hex and random

#

but ye thanks

amber fractal
#

Well it can be any hex string too

#

nice token

mossy vine
#

time to reset

rose sky
#

yea

#

ausdhasuhd

amber fractal
#

may want to regen that

rose sky
#

in that little sec?

#

ok

#

aydsgasd

marble needle
#

define "that little sec"

#

i didn't see it but it was probably deleted

amber fractal
#

It's in bot hell now

marble needle
#

there are logs in bot hell and whatnot

amber fractal
rose sky
#

how do i regenerate?

gleaming tulip
#

on the discord developers page

#

select your application, go to bot, and there should be an option to regenerate the token

lusty dew
#

What is an Illegal return statement?

buoyant wagon
#

return must return a value, and must be used inside a function

lusty dew
#

That is my full code

#

it does return a value

#

This only happened on my beta bot

#

I just tried it on my Real bot

#

and it works fine

buoyant wagon
#

you don't have semicolons

#

or am i mistaken

lusty dew
#

I don't think semi colons are a must have in js

#

or are they?

fiery birch
#

they arent

lusty dew
#

Yea, I thought so.

buoyant wagon
#

ok

lusty dew
#

I don't know why it is erroring though

#

cause like

#

it works on my other bot as I said

#

but when I started to rewrite it into d.js master

#

it started erroring

buoyant wagon
#

whats the error

#

nvm

lusty dew
#

I feel so dumb

#

I got it fixed

#

I forgot to save

#

It was using code from before

#

Lol

west skiff
#

so this isn't technically bot development but its directly related to my bot

#

I've never used oauth2 before, once I have the user's code, can I just use that to authorize api requests?

#

Or wait no it looks like I then have to use the /oauth2/token endpoint to get the token nvm

#

wait maybe

#

wait idk what's going on I'm just going to try it

earnest phoenix
#

you need to exchange the code for an access token

#

an example of which is in discord api docs

west skiff
#

yeah thats why I said nvm

#

I already have it working lol but thanks

broken elm
#

im trying to submit my bot

#

im getting

#

"Detailed description too short"

#

but my description is 351 chars

zealous veldt
#

Then you must make your long description longer

broken elm
#

without spaces

zealous veldt
#

Screenshot?

broken elm
#

of the description?

#

or the rror

#

or what?

zealous veldt
#

Description

broken elm
#

e

zealous veldt
#

That is not a screenshot

broken elm
#

i cant

#

its all in one line

#

there is no way to capture the entire line

zealous veldt
#

Just send a screenshot of the whole page

broken elm
#

sorry that took so long

#

im on linux

#

@zealous veldt

earnest phoenix
#

Anyone able to help me out real quick with giving rewards to someone upon them voting? (nodejs)

opaque eagle
buoyant wagon
#
dbl.hasVoted(message.author).then(voted => {
   //reward
});```
@earnest phoenix
amber fractal
#

"... upon them voting"

#

You'd need a webhook to receive votes as they happen

inner jewel
#

@opaque eagle you can try something like this ```js

class Parent { constructor() { console.log("I'm " + this.proto.constructor.name); } }
undefined
new Parent()
I'm Parent
Parent {}
class Child extends Parent { constructor() { super(); } }
undefined
new Child()
I'm Child
Child {}```

#

not file name but you can just have the classes named the same as the file

short widget
#

there's someone here using simple-youtube-api to search videos on youtube?

#

(JavaScript bot)

buoyant wagon
#

how do u check how many votes your bot has

opaque eagle
#

Ty

earnest phoenix
#
@bot.event
async def on_command_completion(ctx):
        print(f"{ctx.author} used the {ctx.command} command at {ctx.guild.name} ")
        commcompl = await bot.pool.fetch("SELECT * FROM cc")
        await bot.pool.execute("UPDATE cc SET commcompl = commcompl + $1", 1)```

i am trying to keep up with how many times commands are completed, but it doesn't update
opaque eagle
formal agate
#

I’m using enmap for my bot and after a little while as the bot is being used, it then starts spewing this error (node:5956) UnhandledPromiseRejectionWarning: EnmapTypeError: The key "264445053596991498" is not of type "Object" or "Array" in the enmap "guild_data" (key was of type "String")
The key was fine before but idk why its now cause if this error.
Ik what’s wrong tho, the data associated with the key is corrupted over. So any ideas on what’s causing it to corrupt would be greatly appropriated.

bright spear
#

@opaque eagle probably because there's a comma after that?

opaque eagle
#

Wdym

#

What frustrates me is that ...args does contain all the parameters before CommandOptions?

bright spear
#

theres a comma at the end of that line

#

but you can't have a comma after the last one

opaque eagle
#

Wait where?

bright spear
opaque eagle
#
  1. That is valid.
  2. Removing the comma doesn't fix the error... I just tried.
#

You can't have a trailing comma in JSON, but it's valid in JavaScript objects.

bright spear
#

oh weird

opaque eagle
#

It's preferred b/c it saves an extra line of commit if you're adding a new property

jovial harness
#

i want to add bot at discord and make other account when i want to add the bot.but now I can't go to my first account and add bot 😅

#

Any solution

idle basalt
#

that isnt english

#

you can only add bots to your server if you have admin privileges iirc

bright spear
#

you need Manage Server

#

it says it on the oauth page

idle basalt
#

did they change that? i couldve sworn it used to be admin only

bright spear
#

it was always manage server afaik

jovial harness
#

Lol

idle basalt
#

oof didnt know

earnest phoenix
#

oof

#

everyone skipped over me

idle basalt
#

ah sorry i dont know python so cant help

bright spear
#

@earnest phoenix maybe ask in the d.py server?

#

dunno if anyone active here knows py

earnest phoenix
#

i got banned

#

for "copypasta"

#

which is bs

bright spear
#

did u send a chain message

earnest phoenix
#

no

#

Unless other people had a guy named Enter New Name do something to them

#

then....

bright spear
#

?

earnest phoenix
#

what i posted was about this guy named Enter New Name

#

then insta banned

#

Hey, anyone uses Spotify here in Js?

bright spear
#

@earnest phoenix did it say they'll hack you or whatever

#

cuz that'a fake

earnest phoenix
#

Anyone can give reply of my question?

#

I just said don't trust them

#

Leave

#

No U

bright spear
#

@earnest phoenix please dont be rude

#

nobody has responded probably because nobody knows about that

earnest phoenix
#

Hi @bright spear

bright spear
#

wot

earnest phoenix
#

If I add your bot to a server to me, you add mine?

bright spear
#

...

#

no

west spoke
#

@earnest phoenix general please and No aDs

earnest phoenix
#

Okay, sorry for the inconvenience.

coral trellis
#

@earnest phoenix Don't advertise, It's stated in our rules

earnest phoenix
#

I'm not becoming rude bruh, I shut down my laptop that's why I said 'leave'

bright spear
#

what

#

that... makes no sense

#

when you say "leave" like that it means you're telling someone to leave

earnest phoenix
#

Oops

#

ah hes just mad that he was dumb enough to give me his server credentials a couple months back and got his server rm rf'ed

bright spear
#

who

earnest phoenix
#

a trash coder

#

which the name explains it all

bright spear
#

lmao

idle basalt
#

wat

#

tuney, wdym by "uses spotify in js"

earnest phoenix
#

Ahh! Leave it.

upper roost
#

Does anyone know if the "Test Webhook" button is borked on the "Edit Bot" page? It alerts that it succeeded but I've been waiting and my hook hasn't been called.

bright spear
#

@upper roost did you save before testing?

mossy vine
#

so im trying to create an event emitter to communicate between 2 js files but it isnt working and i have no idea why

// main.js
const { EventEmitter } = require('events')

const gameDispatcher = new EventEmitter()

gameDispatcher.on('end', _ => {
    app.quit()
})

module.exports.gameDispatcher = gameDispatcher```

```js
// view/index.js

const { gameDispatcher } = require('../main.js')
gameDispatcher.emit("end")```

it complains about `app` not being defined in `main.js` on a completely unrelated line
#

app is defined and works perfectly in main.js

earnest phoenix
#

!spotify

lusty dew
carmine echo
#

Hello. It's been over 15 hours and DBL still has the old profile picture of my bot cached. Any way to force it to update? I tried editing and saving many times

silver lintel
#

ive got this object [map] and

#

im using discord.js 11.4.2

#

how do i get this:

carmine echo
silver lintel
#

ok thank you

carmine echo
#

yourMap.get('numbers').id

silver lintel
#

what's ('numbers')?

carmine echo
silver lintel
#

but i dont know that

carmine echo
#

So you have a discord.js collection. Do you want to get all the ids as an array or do you want to get a specific one?

silver lintel
#
const users = message.reactions.get("🎉").users;
console.log(users);
#

i want all the ids in an array

#

just the ids

carmine echo
#

yourMap.map(x => x.id)

lusty dew
#
TypeError: this.off is not a function
#

Why would I be getting this?

#

I am trying to host the bot on my vps

slender thistle
#

off is not a function?

lusty dew
#

and I get this error

carmine echo
#

did you at any point try to call this.off

lusty dew
#

no not that I know of

silver lintel
#

BarkingDog what does that do: yourMap.map(x => x.id)

#

im mean what context

lusty dew
#

it maps

#

your map

carmine echo
#

it turns a discord.js collection into an array of ids

lusty dew
#

and gets the id

#

He explained it better

carmine echo
#

=> is a function (sometimes also known as lambada)

slender thistle
#

lambda

lusty dew
#

it is an arrow function

carmine echo
#

yes

lusty dew
#

Still don't know why I am getting this.off is not a function

carmine echo
#

you could also do this

yourMap.map(function(thing) { return thing.id })
silver lintel
#

so like:

var newArray = users.map(x => x.id);
```?
carmine echo
#

more or less, yes.

silver lintel
#

ok thank you

carmine echo
#

You can rename x to whatever you want

silver lintel
#

ok

carmine echo
#

.map() takes a function as it's first parameter

#

then passes the user object as the first parameter to that function and puts back whatever the function returns

silver lintel
#

oh ok

carmine echo
#

you can do this with arrays too

#
[1, 2, 3].map(x => x + 1) // => [2, 3, 4]
silver lintel
#

ok

carmine echo
earnest phoenix
#
msg.channel.createMessage(`If you want to support me then give a vote https://discordbots.org/bot/${client.user.id}/vote`).then(m => m.delete(10000));
``` Why this is not working
spring ember
#

what is delete(10000)

earnest phoenix
#

It's not deleting the message after 10000 interval

lusty dew
#

is that eris?

earnest phoenix
#

Yep!

lusty dew
#

you gotta specify

#

the channel id

#

that you want the message to be sent too

slender thistle
#

msg.channel

spring ember
#

that shouldn't be the issue

carmine echo
#

it's a method on the channel object

lusty dew
#

Oh

#

just noticed that

#

xD

#

Ima go sleep

#

gn guys

spring ember
#

there is no such thing as delete(number)

carmine echo
#

does message even have a delete method hyper_wan

slender thistle
#

Gn

spring ember
#

there is only a delete(reason)

#

just use setTimeout and await on it

carmine echo
#

.then(m => setTimeout(() => m.delete(), 10000))

earnest phoenix
#

thnx

carmine echo
#

might have been a bit too spoonfeedy but ok

lusty dew
#

Mk nvm

#

I need to fix my bot

earnest phoenix
#

It's working

lusty dew
#
1|clap     |     at Function.Module._load (module.js:498:3)
1|clap     |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:27:21)
1|clap     |     at Module._compile (module.js:653:30)
1|clap     |     at Object.Module._extensions..js (module.js:664:10)
1|clap     | TypeError: this.off is not a function
1|clap     |     at WebSocketShard.onReady (/home/kawaii/Clap Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:171:14)
1|clap     |     at Object.onceWrapper (events.js:313:30)
1|clap     |     at emitNone (events.js:111:20)
1|clap     |     at WebSocketShard.emit (events.js:208:7)
1|clap     |     at WebSocketShard.onPacket (/home/kawaii/Clap Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:339:14)
1|clap     |     at WebSocketShard.onMessage (/home/kawaii/Clap Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:264:10)
1|clap     |     at WebSocket.onMessage (/home/kawaii/Clap Bot/node_modules/ws/lib/event-target.js:120:16)
1|clap     |     at emitOne (events.js:116:13)
1|clap     |     at WebSocket.emit (events.js:211:7)
1|clap     |     at Receiver.receiverOnMessage (/home/kawaii/Clap Bot/node_modules/ws/lib/websocket.js:789:20)
#

Full error

#
const { Node } = require('lavalink')
const queue = require("./LavalinkQueueManager.js")
module.exports = (client) => {
    const voice = new Node({
        password: 'kawaiipanda',
        userID: client.user.id,
        hosts: {
            ws: "ws://localhost:2333",
            rest: "http://localhost:2333"
        },
        send(guildID, packet) {
            if (client.guilds.has(guildID)) return client.ws.shards.first().send(packet);
            throw new Error('attempted to send a packet on the wrong shard');
        },
    });
    client.on('raw', pk => {
        if (pk.t === 'VOICE_STATE_UPDATE') voice.voiceStateUpdate(pk.d);
        if (pk.t === 'VOICE_SERVER_UPDATE') voice.voiceServerUpdate(pk.d);
    });
    
    client.music = voice
    queue(client)
}

with code I think the error is originating from

earnest phoenix
#

what

carmine echo
#

password: 'kawaiipanda'

earnest phoenix
#

Oh lavalink

lusty dew
#

Yea

#

Lavalink

#

@carmine echo also yes password is kawaiipanda

#

lol

#

I couldn't think of anything else

earnest phoenix
#

I never used lavalink

lusty dew
#

then don't comment on it?

#

Jkjk

earnest phoenix
#

kk

lusty dew
#

Lavalink is good

earnest phoenix
#

I know

lusty dew
#

You should try it sometime

#

how do you know?

#

You said you never tried it

earnest phoenix
#

Because I used it in Java, the music quality 😍

lusty dew
#

Just gonna say

#

you said ou never used it

#

but anyway

#

#general if we are going to continue this

#

which I am not

#

but you feel free too

earnest phoenix
#

ok sorry

lusty dew
#

anyway

#

back to my problem

#

idk why it says

#

this.off is not a function

idle basalt
#

in what context

#

are you using that in your code? maybe this is being called from an improper place so it has the wrong reference

lusty dew
#

I don't have right node version

#

that is why

idle basalt
lusty dew
#

I am using master

carmine echo
#

meanwhile my problem still stands

lusty dew
#

Wuts your problem?

carmine echo
#

_ It's been over 15 hours and DBL still has the old profile picture of my bot cached. Any way to force it to update? I tried editing and saving many times_

lusty dew
#

erm

#

I guess wait longer?

#

Idk if there is a way to force it

#

I doubt it

carmine echo
#

I've already eliminated the possibilities that it updates every 1, 2, 6 and 12 hours. So I am just hoping that it'll be 24 hours

#

it better not be 72

lusty dew
#

xD

earnest phoenix
#

are you a hundred percent sure it is not your browser cache

short widget
#

Guys since i'm new to pages with reactions i wonder if someone can suggest me something

#

If my bot sends a message with reactions i have to memorize the id of the message so when i get the event "messageReactionAdd" i will check if the id of the message is one of the messages with pages into it?

earnest phoenix
#

yes

#

pretty much how paginators work

short widget
#

should i remove the message id of pages if it's too dated?

#

just to avoid having a long array

earnest phoenix
#

its up to you, i usualy remove it after 30 seconds

#

usually*

short widget
#

If someone doesn't use reactions for 30 seconds?

earnest phoenix
#

yeah

short widget
#

So you do like an Interval?

earnest phoenix
#

well in my case im using c# so im not quite sure of a js equivalent

#

Or just dont have 9999 commands

#

wat

#

I suppose we're talking bout a help command

short widget
#

y

earnest phoenix
#

Or is this some bible bot

#

no

short widget
#

I have to fix my help command

#

cause it sends 6 messages

earnest phoenix
#

Ah

#

How many commands you got?

short widget
#

Not too much

#

It's because i have categories

earnest phoenix
#

Ah

#

So you want it like Auttaja?

#

Or what

short widget
#

And i decided to send 1 message per category

earnest phoenix
#

one simple solution is to have a website for the list of the commands, then simply redirect the user to the website

short widget
#

I can do it with pages or simply send less messages

earnest phoenix
#

Like this?

#

Like Auttaja has got

#

Or what?

short widget
#

Oh

#

That's even better than what i thought

earnest phoenix
#

Oh

#

lol

short widget
#

I thought to use normal pages

earnest phoenix
#

Ah

#

Like purr?

short widget
#

◀ ▶

#

Like this reactions

earnest phoenix
#

Like this?

short widget
#

To go the next page

#

Kinda of, yes

earnest phoenix
#

I see

short widget
#

But that was not the main problem

#

I was wondering how to make it work

#

So, i think i should memorize IDs of messages somewhere

late hill
#

What library are you using

#

If your library has reaction collectors

#

Just use that

short widget
#

And whenever someone adds a reaction to a message in that array it will trigger something

#

discord.js

spring ember
#

Have an array of arrays and which each array being a "page"

late hill
#

discord.js has reaction collectors

#

Check their docs

earnest phoenix
#

ye

short widget
late hill
#

And you can set a timeout for the collector

#

Don't use that

short widget
#

Uhm

#

Gonna check

late hill
short widget
#

oh reaction collector

#

lel

earnest phoenix
#

bruh

short widget
#

ahah

#

Never used collectors btw

trail dagger
late hill
#

You can call createReactionCollector() on the message your bot sends

#

^Fenikku

earnest phoenix
trail dagger
#

huh

#

no

earnest phoenix
#

yes

trail dagger
#

no

earnest phoenix
#

very much yes

trail dagger
short widget
#

Emil i sent you a link that generates for you the embed

trail dagger
#

ik

short widget
#

k then

trail dagger
#

but i dont want author

gleaming tulip
#

no space in between

earnest phoenix
#

congrats you have a space

trail dagger
#

i need it in add_field stuff

short widget
#

Wesley

earnest phoenix
#

owo

trail dagger
#

Didnt see that i could not have a space there

earnest phoenix
#

its markdown

short widget
#
new Discord.ReactionCollector(messagefilteroptions);```
earnest phoenix
#

^^

#

having a space cancels markdown effects since markdown is strictly typed

late hill
#

yes

#

Just await your bots reply

#

And call createReactionCollector() on it

#

Do you need an example 😂

short widget
#

Actually i can't get the whole mechanism

late hill
#

ok dm babe

#

wink

dull bobcat
#

gay ^

pearl kelp
#

someone help me

#

this code

#

(node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

#

of this

earnest phoenix
#

you are using the wrong event

#

userUpdate is for non guild members

pearl kelp
#

What do I change?

golden vector
#

the event

#

not sure what to tho, im not the best at these

pearl kelp
#

I understood nothing

golden vector
#

change userUpdate to the correct event

#

not sure which tho

#

try guildMemberUpdate

#

but im not sure if it works

pearl kelp
#

did not work

golden vector
#

well from rereading it seems the code can't get the server id from oldUser

#

so might need to check in that too

pearl kelp
#

if I remove this line, the bot will get an update from all users

trail dagger
#

Someone know about a cool premium feature for a bot? Tag me

unique nimbus
#

@trail dagger custom command

trail dagger
#

i dont have web dashboard

earnest phoenix
#

make features that are worthy of the price

trail dagger
#

like what

earnest phoenix
#

how would i know, its your bot and your brain 🤷

opaque eagle
#

How would I set default values for a MessageEmbed?

#

Like I'd want a specific color, footer, timestamp, etc, unless otherwise specified.

short widget
#

You can create a method

#

Or a function

#
createEmbed(author, title, color, footer, avatarURL, url, description, thumbnail){
        const embed = new Discord.RichEmbed()

        author ? embed.setAuthor(author) : false
        title ? embed.setTitle(title) : false
        color ? embed.setColor(color) : false
        footer && avatarURL ? embed.setFooter(footer, avatarURL) : false
        footer && !avatarURL ? embed.setFooter(footer) : false
        url ? embed.setURL(url) : false
        description ? embed.setDescription(description) : false
        thumbnail ? embed.setThumbnail(thumbnail) : false
        
        return embed
    }```
#

I do something like this

#

If i don't specify anything it will use the "false" as default

#

But you can change it to fit your needs

opaque eagle
#

Eh it's kinda lame for a solution... I was looking to extend the MessageEmbed class

short widget
#

Oh i see

#

which language?

opaque eagle
#

TypeScript / JavaScript

short widget
#

there is something like prototypes?

#

Do u use discord.js as library?

opaque eagle
#

Yeah

late hill
#

You can put defaults for function parameters

#

By just putting param = default

opaque eagle
#

^

short widget
#

didn't knew

opaque eagle
#

That's kinda what I've resorted to doing rn... I'm extending the MessageEmbed class and using defaults in the constructor

short widget
#

well it was an outdated solution anyway

opaque eagle
#

My solution:```ts
import { MessageEmbed, MessageEmbedOptions, Message } from "discord.js";

export class FeliciaEmbed extends MessageEmbed {

constructor({
    color = // whatever
}: MessageEmbedOptions, message: Message) {
    super(data);

}

};```

short widget
#

I think you can add a custom function to the prototype MessageEmbed class

opaque eagle
#

That's pointless

short widget
#

And it is working?

opaque eagle
#

I have another seemingly dumb question... Can I set properties of process and have it carry over from file to file?

short widget
#

your solution

opaque eagle
#

Yeah atm

dull bobcat
#

@pearl kelp aayyyy, rip x

upper roost
#

@bright spear 🤦 nope, I just saved it and it's working now, thank you!

earnest phoenix
#

hey

#

can someone help me

#

i want to make invite command

#

but idk how to make the link like join

lusty dew
#

big oof

earnest phoenix
#

?

west spoke
#

Language @earnest phoenix?

earnest phoenix
#

js

west spoke
#

K look in the documentation

#

Ig

earnest phoenix
#

?

#

i want

#

like

#

when you click on the

#

maybe invite

fiery birch
#

buddy, stop splitting lines so much, thanks.

earnest phoenix
#

it goes to the link

#

i mean when you click on the text it goes to the link

fiery birch
#

so just make it reply with a message that contains the link?

earnest phoenix
#

maybe

fiery birch
#

absolutely.

earnest phoenix
#

prefix and somethink the reply message is hello you can join our discord click and when you click on the click text it opens the link

mossy vine
#

you can have markup in an embed

earnest phoenix
#

i didnt understand

fiery birch
#

refer to the Links section

earnest phoenix
#

i know html

#

i didnt mean like that ill type a command and you will see what i mean go to testing 1

#

markdown is not html but ok

#

markdown was made to simplify html

#

hm

#

how i can use html in my bot

fiery birch
#

please read the part about links

earnest phoenix
#

yes

fiery birch
#

you can use it just as they did there

earnest phoenix
#

ok

west spoke
#

(text)[link] I think

queen sentinel
#

other way round isn't it?

fiery birch
#

it is

earnest phoenix
#
bot.guild.channels.find(channel => channel.name === "votes").send(`<@!${global.uid}> (${global.uid}) has voted and recieved ${global.vcu} vote crates and ${global.vpu} vote points`)
#

whats wrong here?

west spoke
#

bot.guild.channel

#

I think

earnest phoenix
#

Nope

#

didn't work

west spoke
#

Oh

#

Undefined

#

Well

marble needle
#

client doesn't have a guild property

#

it has one called guilds which is a collection of servers your client is in

earnest phoenix
#
const guild = bot.guilds.get("556648764841000980");
                bot.guild.channel.find(channel => channel.name === "votes").send(`<@!${global.uid}> (${global.uid}) has voted and recieved ${global.vcu} vote crates and ${global.vpu} vote points`)
#

what should I make it?

marble needle
#

remove the botfrom your second line

#

and disregard what lazyneko said

#

its channels

earnest phoenix
#

guild.channels.find

marble needle
#

yes

earnest phoenix
#

ok

west spoke
#

:I

#

Peoples really need to say the lang its in

#

I thought it was py

earnest phoenix
#

@marble needle so it worked

#

but

#

its undefined now

#

because its not in an event

west spoke
#

Is it a constant value

#

Like

#

1

#

Or 5

earnest phoenix
#

right nvm got it

#

it's not constant

west spoke
#

K

earnest phoenix
#

if its not a donator its 1

#

if its a donator its 3

west spoke
#

Ah

earnest phoenix
#

can someone send me the code

#

in js

#

when you click to a text example (here) it opens a link

west spoke
#

No

#

Can't spoon-feed sorrye

#

Just Google it it's legit that simple

fiery birch
#

@earnest phoenix you've been told multiple times already how to do it

earnest phoenix
#

i dşidnt understnad at there

fiery birch
#

take some effort out, and read it so you can understand it a bit

earnest phoenix
#

dude

#

you havent even opened the link you got sent

#

wtf

#

i did

#

done lie

#

dont

#

otherwise you would have seen theres about 10 examples about hyperlinking

fiery birch
#

Then scroll to the damn links section, and read it.

earnest phoenix
#

i dişd

#

there is some github links

fiery birch
#

yea there is

earnest phoenix
#

and html python js

fiery birch
#

and there is also the code shown that lets you see how they did that

earnest phoenix
#

how about not skim reading

#

and html links

#

dont skim read

west spoke
#

^

pallid kraken
west spoke
#

.....?

earnest phoenix
#

Does anyone know if there is anyway to get an invite of a guild the bot is in using code?

#

In python

unique nimbus
#

I don't think that is allowed

earnest phoenix
#

Oof

#

I know my friend did it one time

#

but i don't remember how he did it

slender thistle
#

You better not do it without the users' consent

unique nimbus
#

Yes

viral spade
#

i have a levelbot that can send messages to users on levelup. However both serverowner and user have the option to turn that off and on. By default no messages get sent. The serverowner has to activate it, but a member then by default receives these messages from the respective server until he opts-out (as described in every level up message).

is this bad practice / not allowed / user unfriendly?

buoyant wagon
#

i think it's allowed

carmine echo
#

Ok it has been over 30 hours and dbl still has my bot's old profile picture cached on the website

#

how am I supposed to update it

buoyant wagon
#

update it

#

press edit and then press publish

dull bobcat
#

Why doesn't ctrl + shift + 7 comment something in VS Code?

#

@carmine echo You know, there is one place to update the profile picture and name for the application, though there is one for the bot user too

#

On General Information you just update the application

#

Though on bot you update the bot user

trail dagger
#
async def kick(ctx, member: discord.User, *, reason='No reason was given'):
  if ctx.message.author.server_permissions.kick_members:
    embed = discord.Embed(color=0xffff00)
    channel = client.get_channel(560915918192902145)
    
    embed.set_author(name='Kick')
    embed.add_field(name="User", value="{} ({})".format(member, member.mention), inline=False)
    embed.add_field(name='Kicked by', value=f'{ctx.message.author}', inline=False)

    await client.send_message(channel, embed=embed)
    await client.kick(member)
  else:
    await client.say('You dont have permission to use this command')

Nothing is wrong right? is should send to the channel but still it doesnt

#

hope i am not blind

short widget
#

Guys how to let the bot use custom emojis?

#

He must be into a server that cotains them?

earnest phoenix
#

yes

trail dagger
#

and use everything between <>

#

just do @\ and so the emoji you want to use

earnest phoenix
#

you don't need the at

#

it's not a mention

trail dagger
#

i did that

#

worked fine

earnest phoenix
#

obviously it did lol

short widget
#

thank you cry 😄

trail dagger
#

😮

unique nimbus
#

oof

carmine echo
#

@dull bobcat It does update the bot's profile picture, as it is different now, but perhaps it does not fire some pfp update event or something. I'll try.

twilit rapids
#

wrong channel, sorries

short widget
#

sorry emil

#

thank you ahah

#

i've read the wrong nick

vivid mortar
#

is there a way i can change this color? i tried edting the background but that didnt change it

#

?

#

is there anyway i can change the background color of the description section to match the theme the user has?

lethal sun
#

on embeds? @vivid mortar

vivid mortar
#

?

#

im talking about the site

lethal sun
#

Hello. I currently have a collumn for my inventory system in my SQLite database. It should be filled with a JSON that has the inventory items in it. Right now, I am trying to put like for example, 3 of items and put them into a Discord Embed. How do I do that? I tried using a for loop, but either that's not going to work, or I am just dumb and I don't know how to do that with the loop.

earnest phoenix
#

@bot.event
async def on_message(message):
if message.content.startswith('!goodnight'):
await bot.say
embed = discord.Embed(title="goodnight", description="Sleep well!", color=0x00ff00)
embed.add_field(name="Field1", value="goodnight", inline=False)
embed.add_field(name="Field2", value="goodnight2", inline=False)
await client.send_message(message.channel, embed=embed)
after I used these code it printed log in as doraemon and the bot cilent but then it doesn't respond to any commands

#

Is this wrong code or it's down

carmine echo
#

@vivid mortar css, by using the <style> tag, although I am pretty sure that html and markdown do not like each other in this case, so idk

vivid mortar
#

this is what i did

#

<body bgcolor="292D33">
<font color="BABBBD">

carmine echo
#

no

vivid mortar
#

font color works

#

kinda

carmine echo
#
<style>
body {
    background-color: #292D33;
}
</style>
vivid mortar
#

ok i will test that

carmine echo
#

or just <body style="background-color: #292D33">

vivid mortar
carmine echo
#

ah! That is because that small thing is not the body of the page

#

it's a div

vivid mortar
#

wym

carmine echo
#
<style>
div.longdescription {
    background-color: #292D33 !important
}
</style>
vivid mortar
#

ok

carmine echo
#

div.content maybe?

vivid mortar
#

wait ill try the one one u after u edited

#

nope

carmine echo
vivid mortar
unreal rampart
#

['music', 'member', 'chat', 'channel', 'roles', 'games'] cannot be loaded. [Callback is already a command.]

carmine echo
#

ah I see

.longdescription .content {
    background: #292D33 !important
}
unreal rampart
#

anyone know why tf this happens?

vivid mortar
#

ok brb

#

do i keep the div?

carmine echo
#

no just use this

vivid mortar
#

ok

carmine echo
#

it should work hopefully

#

it worked for me

vivid mortar
#

#292D33

#

ok

#

oof it worked

carmine echo
#

finally

vivid mortar
#

but now

#

the title is not visible

carmine echo
#

learn css

vivid mortar
#

yesyes ill change the font

#

color

unreal rampart
#

yesyes

spring ember
#

Can you send some related code?

#

Or the stack

#

Like traceback stack

unreal rampart
#

waitwaitwait, traceback stack?

spring ember
#

The traceback

unreal rampart
#

['music', 'member', 'chat', 'channel', 'roles', 'games'] cannot be loaded. [Callback is already a command.]

vivid mortar
#

lol fixed it

#

thanks @carmine echo

carmine echo
#

epic

slender thistle
#

Related code please

carmine echo
#

@unreal rampart Provide the code causing this issue or we won't be able to help

vivid mortar
#

nvm i made it darker apparently

unreal rampart
#

I dont know what code is causing the issue, as i got this after i restarted me IDE, and not before, i didnt make any changes

dull bobcat
#

Anything i should add or change?

carmine echo
#

looks epic tbh

unreal rampart
#

nvm i fixed the issue

earnest phoenix
#

it looks unreadable

dull bobcat
#

awww really ^

earnest phoenix
#

i suggest sticking to 2 or 3 colors instead of mixing all of them

slender thistle
#

Purple on black

#

Please

carmine echo
#

very readable to me. although I would not use colors as it's a useless dependency

#

not like I don't have many useless dependencies already though

earnest phoenix
#

this is basically how i set up my logging, i still need to fix a container bug but

carmine echo
#

Oh yes I completely forgot

#

my issue still stands

#

for over 30 hours

#

DBL still has the old version of my bot's pfp cached. how do I force it to update?

rustic axle
#

Are you sure its server side and not client (aka your browser)

carmine echo
#

I tried other devices

#

now it shows up like this

#

and it still has the old profile pic on the bot listing

#

Seems like it tried to update, but gave up in the middle

slender thistle
#

Can you send me the link to your bot page in DMs

earnest phoenix
#

anyone worked here with react?

i have a master component that keeps track of states of other components, it does that for every single one how it's supposed to expect the for the second one; https://i-love.weed.moe/OJdBvmyl.gif

#

nevermind im dumb, i never changed the states in the master component from the child component

#

my b

dull bobcat
#

I need help

#

how do i see if a string includes a dot?

slender thistle
#

Python?

earnest phoenix
#

use contains

dull bobcat
#

@earnest phoenix link to docs?

earnest phoenix
#

javascript, right?

dull bobcat
#

yeah

earnest phoenix
#

its just a simple includes(word) i think

dull bobcat
#

nope

earnest phoenix
#

hm

#

how are you calling it

dull bobcat
#

oh nvm

carmine echo
#

js str.includes(substr)

dull bobcat
#

you told me to use contains and contains is not a thing

#

includes() is a thing

carmine echo
#

you are confusing py with js

dull bobcat
#

how do i see if something dont have a dot then?

earnest phoenix
#

If(!)

#

negate the bool

#

Lol? Yes

dull bobcat
#
if (input == "folders") {
    fs.readdit("./", (err, files) => {
      if (err) return console.error(errString + err);
      let ffiles = files.filter(f => f.includes("."));
      ffiles.forEach((f) => {
        console.log(sysString + f)
      });
    });
  }

I mean, this gets all the files but i want the folders which usually dont contains with a dot in their name, so how do i make ffiles without the dots only?

amber fractal
#
const filter = (reaction, user) => {
  return ["❌"].includes(reaction.emoji.name) && user.id == message.author.id;
}
message.awaitReactions(filter, {
  max: 1,
  time: 1000 * 30,
  errors: ['time']
}).then(async (collected) => {
  let reacion = collected.first()
  console.log(reaction)
  if(reaction.emoji.name == "❌"){
    await message.delete(1000)            
  }
}).catch((e) => {
  console.error(e)
})```is there any reason this wont work? It never logs the reaction either
#

well I see a typo, but I dont know if it would affect much

#

Yeah no difference

amber fractal
#

Not even the example works

#

figured it out

cold niche
#

Hey

#

what lang + lib do you recommend for image generation?

#

I would like to make an API for my bot but all the libs I tried are either leaking or bad for some other reason

west mango
#

i'm trying to git clone chromium but I don't wanna leave my PC on over night cloning 14.8gb of files

#

what can I do

hoary bramble
#

anyone knows how to loop through all users within a specific role? (discord.js)

inner jewel
#

git clone <url> --depth=1 @west mango

#

will only grab the latest commit and source

west mango
#

what does that do

#

omg

inner jewel
#

you won't have the history, but if you don't need it (eg just building it) there's no need

west mango
#

okay

#

tysm

#

it's so much faster

amber fractal
#

Can you not post that here?

coral trellis
bitter sundial
#

haha I remember building chromium as well and I just did that because the repo is too big

short harbor
#

Are there any kind of security things I may need to worry about if I am building a bot that writes things to databases?

inner jewel
#

don't use default passwords

#

or even better, block outside connections on the db port if possible

short harbor
#

I should have specified, I mean databases relating to SQLite3

#

Unless those apply

#

Still noted

bright spear
#

or just \❌

amber fractal
#

I didnt need to tho

#

considering it works with it

#

Like I said, it's fixed

main notch
#

How can I remove this "play station theme thing" (I think you all know what I mean circle , square, ..) from my discordbots.org website ? I dont know much about HTML thats why Im asking

amber fractal
#

I believe the class is "shapes-background"

main notch
#

Ok thanks

thick scaffold
#

How to make a cad system

#

I need one bad for my server

quartz kindle
#

cad? computer assisted design?

stray wasp
#

Computer aided dispatch system I'm guessing for fivem correct?

thick scaffold
#

Is there a link you can send me

stray wasp
#

For?

thick scaffold
#

For gta 5 role playing ps4 for my server

stray wasp
#

If you want a cad that's already made it's called opencad but this isn't the place to ask.

grim aspen
#

this is bot development not server development

thick scaffold
#

Sorry

midnight edge
#

lmao

quartz kindle
#

general development is also accepted here

zealous veldt
#

Yeah

copper wraith
#

hey

#

Does anyone know on how to set the User & server display in total on a python3.6 bot in watching server XX

broken elm
#

So can I send message.guild.iconURL as an attachment in a message.channel.send() function?

#

I’m trying to make a command to show avatars

buoyant wagon
#

i guess

broken elm
#

It isn’t working too well

#

Actually nvm

#

I can just send different embeds instead of messages

buoyant wagon
#

ok

broken elm
#

Also getting the glitch

#

Where my bot is sending two messages instead of one

#

Resetting the token usually fixes that right?

buoyant wagon
#

uh

broken elm
#

Well it didn’t

#

why me

queen sentinel
#

Have you tried turning it off and on again?

broken elm
#

I might be restarting the bot too fast?

#

I’m making anew command as we speak

#

And testing

#

The control Cing the bash terminal

#

Then running node again

#

I’ll just try and make sure the bot goes completely offline before turning it back on again

buoyant wagon
#

ok

west spoke
#

@broken elm restart your computer

#

May fix idk

dull bobcat
#

Yall are wrong bruh

#

The application is running twice

#

Probably one in command prompt and one in yiur text editor

#

But a restart of your pc should fix it

#

And if it doesn't, then just fuckup a part in your code so it errors

#

@broken elm

silver lintel
#

For discord.js 11.4.2, how do you get the name of a user with the tag?

broken elm
#

on linux

#

btw

dull bobcat
#

user.tag @silver lintel

silver lintel
#

ok

#

thank oyu

broken elm
#

because linux is the superior os

dull bobcat
#

@broken elm k, then you run your bot in terminal and your text editor, running same application twice will just make everything twice

broken elm
#

thats not th eproblem