#development

1 messages · Page 885 of 1

clever arch
#

what is wrong here can you help

knotty steeple
#

well v12 is different from v11 ya know

quartz kindle
opaque seal
#

I guys I would really really need a way to make my bot quit all the guilds he's in, anyone knows how?

knotty steeple
#

loop through guilds and leave each

#

so like a foreach

opaque seal
#

loop through guilds and leave each
@knotty steeple I've tried many times but could't figure out, could you help me?

knotty steeple
#

how are u doing it

opaque seal
#

Wait

#

Can't spam my server there

#
try {
        let toSay = "Bot is under maintenance please KICK HIM FROM THE SERVER and reinvite him later today. Join the discord support server for more info ---> "
        client.guilds.cache.forEach((guild) => { //for each guild the bot is in
            console.log(guild)
                        guild.owner.send('Bot is under maintenance please KICK HIM FROM THE SERVER and reinvite him later today. Join the discord support server for more info ---> ')
          });
        }
      catch (err) {
          console.log(err)
        console.log("Could not send message to a (few) guild(s)!");
    }
quartz kindle
#

``` code here ```

opaque seal
#

I've tried to send a message to each but it aslways errored

knotty steeple
#

```js
code
```

#

pls

quartz kindle
#

you cant send messages using a forEach loop

knotty steeple
#

well ur not actually leaving the guild in that

quartz kindle
#

that will send them all at once and get you rate limited

knotty steeple
#

also what bot makes u remove it when it has maintenance

#

seems weird

opaque seal
#

well ur not actually leaving the guild in that
@knotty steeple yeah ik just trying to send a message but won't work, should it work if I use guild.leave()?

knotty steeple
#

yes

quartz kindle
#

you should still not use a forEach loop

opaque seal
#

Ik but I just launched it on top.gg and I need to fix some thing

#

He's just in 3 server

pale vessel
#

lmao

opaque seal
#

I need to switch database completely

#

you should still not use a forEach loop
@quartz kindle what do I need to use?

quartz kindle
#

a for loop with async/await

knotty steeple
#

for loop

quartz kindle
#
for(let entry of client.guilds.cache) {
  let guild = entry[1];
  await guild.leave()
}
opaque seal
#

Yess

#

Thank you

#

Worked

#

I need to find a solution for this maintenance thing

quartz kindle
#

use 2 versions of your bot

#

1 public version and 1 private/testing version of the same bot, under a different prefix and/or locked to owner only

#

when the private version is good enough, push the code to the public version and restart

opaque seal
#

K thx

#

now I gotta figure out how to install mongoDB on a ubuntu server xD

#

Luckily I think I found a guide

honest perch
#

can yt blacklist your ip for having music commands?

pale vessel
#

maybe

honest perch
#

hmm

earnest phoenix
#

How i can record audio?

iron steeple
#

if you want to record audio from a voice channel i believe that's against the TOS when making a bot

knotty steeple
#

it is yes

iron steeple
#

but correct me if im mistaken

knotty steeple
#

and u already asked that

earnest phoenix
#

Tos?

#

What is tos?

torpid juniper
#

its not if its consentful but otherwise its not allowed

#

terms of service

iron steeple
#

Terms of Service

torpid juniper
#

you agreed to them when you signed up

iron steeple
#

it's a massive breach of privacy to record somebody's audio

clear sky
jovial nexus
earnest phoenix
#

An error message

jovial nexus
#

yeah but what does it mean?

earnest phoenix
#

please send correct error message

#

Or show your code

jovial nexus
#

the console ony logged that

#

my code ```js

  if (message.content.startsWith("k/play")) {
      const voicechannel = message.member.voice.channel;
      if(!voicechannel) return message.channel.send("**Necesitas estar en un canal de voz para usar este comando**");
      try {
        var connection = await voicechannel.join();
      }catch (error) {
        console.error(error);
        return message.channel.send(`Log del error -> ${error}`)
      }
      const dispatcher = await connection.play(ytdl(args[0]))
      console.log(`${message.author.username} [${message.author.id}] Ha puesto la canción ${args} con el comando play | En el canal #${message.channel.name}`)
        dispatcher.on('finish', () => {
          console.log('Canción terminada');
          voicechannel.leave();
        })
        dispatcher.on('error', error => {
          console.error(error);
          return undefined;
        });
        dispatcher.setVolumeLogarithmic(3 / 5)
    } else if (message.content.startsWith("k/stop")) {
      message.member.voice.channel.leave()
      return undefined;
    }
earnest phoenix
#

v12?

jovial nexus
#

yup

earnest phoenix
#

try instead end to finish

jovial nexus
#

like that??

pale vessel
jovial nexus
#

that doesnt help

earnest phoenix
#

tried?

jovial nexus
#

look at the code again, is that good?

earnest phoenix
#

can you try first?

jovial nexus
#

ok

earnest phoenix
#

msg.guild.members.get(args[0]); is not an function help plz

jovial nexus
summer torrent
pale vessel
#

@earnest phoenix are you on v12?

earnest phoenix
#

yeh

jovial nexus
#

?¿

opaque seal
#

Can I join a server throught it's ID?

nocturne dagger
#

No

opaque seal
#

k

mossy vine
#

joining servers through your bot without authorization from someone with relevant permissions is a breach of privacy and against tos

finite plover
#

How do you use fetch_message in discord.py? I've tried casting it to a channel and the Bot object but neither of those work.

modest maple
#

have you tried this thing called: Reading the docs

finite plover
#

I honestly have. In the API reference the function is located in the text channel category, but when I try using fetch_channel to get a channel object and then fetch_message on that channel, it doesn't work.

slender thistle
#

Any errors?

#

Showing your code could help arghEyes

finite plover
#

OK.

#
channel = bot.fetch_channel(channel_id)
    message_id = reaction.message_id
    message = await channel.fetch_message(message_id)
#

This is in an on_raw_reaction_add() function

slender thistle
#

fetch_channel is a coroutine

finite plover
#

Oh.

#

Oops.

#

That worked, thanks!

slender thistle
plucky heart
#

Emoji in my code change to '??' :v

pale vessel
#

because font support

#

it doesn't matter

#

i mean- this is obviously language issue

jovial nexus
restive furnace
#

update to v12

jovial nexus
#

i am in v12

pale vessel
#

clearly we're missing details

topaz fjord
#

it's probably just discord asking for the bot to reconnect

earnest phoenix
#

or u have bad net

jovial nexus
#

probalby

#

thzx

earnest phoenix
#

i record audio with this?

<channel>.createStream

?

modest maple
#

👏 in 👏 what 👏 language 👏

earnest phoenix
#

js

#

11v

golden condor
#

Recording audio is against tos so you can't

pale vessel
#

11 volts

lyric mountain
#

it's against tos if you use a bot for that

#

so, don't

minor valley
#

my bot was accepted :D

earnest phoenix
#

Recording audio is against tos so you can't
@golden condor mee6 can

golden condor
#

no it can't

#

It can play music

#

But not record audio

pale vessel
#

it can record actually

earnest phoenix
#

wait for me

golden condor
#

It can

#

But it shouldn't

#

And won't

finite plover
#

When using discord.py, why will this script not DM someone? Are my server perms messed up?

async def on_raw_reaction_add(reaction):
    message_id = reaction.message_id
    message = await channel.fetch_message(message_id)
    author = message.author
    user = await bot.fetch_user(reaction.user_id)
    if channel_id == 702110928656662528 and str(user.name) != "GeekBot#1601" and reaction.emoji == '✔️':
        author.send(f'{user} will be attending your event!')```
lyric mountain
#

@minor valley thumbs up!

golden condor
#

That's why .setSelfDeaf exists

earnest phoenix
#

it can record actually
@pale vessel ?

pale vessel
#

they have a feature for that is what i meant

golden condor
#

oh what

pale vessel
#

i might remember it wrong

earnest phoenix
#

so i cant?

golden condor
#

I don't remember that

#

No you can't

#

We won't help you to break the ToS

#

But do if you must, you have been warned.

pale vessel
#

yeah !record

knotty steeple
#

u cant record without the user knowing

pale vessel
#

exactly

#

if it's by command it should be fine...unless 😳

slender thistle
earnest phoenix
#

but the command is posible?

golden condor
#

yes

slender thistle
#

str(user) = "CmdrNorthpaw#1716"

earnest phoenix
#

mmm

finite plover
#

Yes, but I need to check if the user name isn't the bot. So that the bot doesn't DM me that it is joining the event.

earnest phoenix
#

always compare ids not usernanes and discrims 👏

finite plover
#

OK.

slender thistle
#

user.bot sounds appropriate

finite plover
#

So and not user.bot?

slender thistle
#

Looks good

finite plover
#

👍

slender thistle
#

Also you might wanna use all

finite plover
#

What does that do?

slender thistle
finite plover
#

So if all(user.bot)?

slender thistle
#

No no no

#

Instead of doing x1 and x2 and x3 you can do all([x1, x2, x3])

#

And use newlines in the arg to make it more readable

all([x1,
     x2,
     x3])```
finite plover
#

Still no DMs from the bot.

slender thistle
#

What's channel_id declared as

finite plover
#

channel_id is reaction.channel_id

plucky heart
#

console always shows 'unknown emoji' :V

torpid juniper
#

\📜

plucky heart
#
{
message.channel.send("test").then(async (message) => {
await message.react("✅").catch(console.error);
});
}
pale vessel
#

hmm?

plucky heart
#

my console shows 'Unknown emoji'

pale vessel
#

are you sure that's the correct tick?

plucky heart
#

yes

pale vessel
#

try js .then(sentMessage => { sentMessage.react("✅").catch(console.error); });

torpid juniper
#

but hey-ho

plucky heart
#
  message: 'Unknown Emoji',
  method: 'put',
  path: '/channels/699656456122794075/messages/702511526288031744/reactions/%3F/@me',
  code: 10014,
  httpStatus: 400
summer torrent
#

"Unknown"

viral flame
#

Well python is too hard for me XD

grizzled raven
#

what db would be best for storing objects like this example for every guild?

{
  required: 3,
  requiredremove: 2,
  blacklisted: ["171823917291871929", "89191029380108273819", "..."],
  whitelisted: ["829199192837371819", "99281928101818372891", "..."],
  roles: [
    {id: "19292891901038191", stars: 25},
    [Object],
    //...
  ],
  bitfield: 128 /* settings bitfield */,
  prefix: "star ",
  emoji: "⭐",
  stars: {
    first: "⭐",
    second: "🌟",
    third: "💫",
    fourth: "✨"
  },
  lbdata: {
    //...
    "738817387173727738": {
      stars: 237,
      downvotes: 7,
      global: 21,
      starboarded: 79
    },
    "828271873871738830": [Object],
    "372636191038371910": [Object],
    //...
  }
}
quartz kindle
#

depends

summer torrent
#

sql or nosql

grizzled raven
#

~~i literally gave you what im storing what do you mean it depends fiteme ~~

mossy vine
#

@summer torrent so a database omegalul

quartz kindle
#

if you need the fields to be independently indexed and accessed, go for nosql
if you will only even access/index the entire object at once, go for sql

summer torrent
#

mongodb BlobOK

quartz kindle
#

for example, if you have a key to index the object, and you only ever access it by this key, you can use whatever db you prefer

grizzled raven
#

what about setting the fields? would any of them need to change the whole object?

#

dont know why but yeah

quartz kindle
#

but if you need to access specific fields in a specific object, then you need a database that supports json indexing, such as mongo

#

if you go for sql, most likely yes, unless its a db with native json functions

grizzled raven
#

hm

#

well it does depend, like for some commands i would just get a field, but for some events i would take the whole object

#

i guess i might stick with nosql actually since the fields arent that deep

quartz kindle
#

in my opinion, the easiest and probably most performant way would be to store the entire object in any kind of db, and keep a cache of loaded objects for accessing specific fields

grizzled raven
#

okay

quartz kindle
#

but i think most nosql databases can be extensively optimized for that

grizzled raven
#

althought the lb fields can be big but

#

you can disable cache in mongo, right?

earnest phoenix
#

is it against the tos to ask for roblox exploits?

#

im making one

#

but i need help

grizzled raven
#

honestly idk

#

but

#

what language?

earnest phoenix
#

c#

#

i need to add antiban and such but yeah i dont know how to and there isnt a guide to be found about this

pale vessel
#

no

#

just no

slender thistle
#

Don't you think you're just violating ToS/community guidelines of another service

proper mist
#

how do you make an economy system with discord.js

nocturne grove
#

Does anyone know why the Discord website says If they (a member) have a nickname there will also be a be a ! after the @. if it's not true? My bot has no nickname (in all guilds) and the mention is still like <@!id>.

earnest phoenix
#

i only use it for personal educational use

slender thistle
#

Does anyone know why the Discord website says If they (a member) have a nickname there will also be a be a ! after the @. if it's not true? My bot has no nickname (in all guilds) and the mention is still like <@!id>.
@nocturne grove Because it used to be like that

#

You can never know what Discord will do with their mention formats

nocturne grove
#

so that is deprecated? What are the new rules?

slender thistle
#

Currently the <@!id> is always used

earnest phoenix
#

^

#

you should still check for with and without the exclamation mark though, better on the safe side

pale vessel
#

^^^^

nocturne grove
#

okay many thanks!

pale vessel
#

this one

nocturne grove
#

it's weird though, as you can still do <@id> which will give @nocturne grove

pale vessel
#

@pale vessel

#

that's on mobile

nocturne grove
#

if you're sending from your mobile?

pale vessel
#

it didn't add ! like it would on desktop

#

yes, add a backslash before a mention

nocturne grove
#

oh really, that's strange. Thanks

#

and nickname doesn't matter anymore I guess

pale vessel
#

can you try mentioning yourself? i want to see what it would output on desktop?

#

nope yeah

nocturne grove
#

yes this is from pc:
@nocturne grove

pale vessel
#

add a backslash

nocturne grove
#

oh sorry didn't understand you

pale vessel
#

nice

nocturne grove
#

@nocturne grove

#

Phone:

pale vessel
#

interesting

nocturne grove
#

@Menno

#

Oh lol wait

pale vessel
#

gotta click it first

nocturne grove
#

@nocturne grove

#

🤔

pale vessel
#

well now it didn't add an extra mark on PC

#

interesting

#

discord being discord as usual

nocturne grove
#

I will use a nickname and try again

#

😂

#

ow I can't 😦

pale vessel
#

use a regex on this one

nocturne grove
#

I will test it really quick and notify you

pale vessel
#

^<@!?id> (^ if you need to make it the first thing in the message)

nocturne grove
#

ohh I did it seperate right now, but that looks cleaner 🤔

#

btw, having a nickname and typing \@mention on pc will give a !

pale vessel
#

it's weird

#

i had no nickname and it still added a !

nocturne grove
#

but I thought console.log(msg.content) gave another result

#

wtf

quartz kindle
#

bots seem to always receive with !

pale vessel
#

interesting

nocturne grove
#

wait no this is scary

#

my bot receives it from pc with ! and phone without !

#

if I'm just doing a real mention

quartz kindle
#

discord being discord

#

nothing new

nocturne grove
#

😅

#

well thanks for your mental support on this one

#

^<@!?id> (^ if you need to make it the first thing in the message)
@pale vessel I should use something like that, like this, right?

else if (message.content.startsWith(/^<@!?${client.user.id}>/)) ...```
but that doesn't work
pale vessel
#

.match

#

it won't work

#

regex needs to be in a variable

#

try new RegExp

nocturne grove
#

okay thanks will try

quartz kindle
#

i just do if(startsWith(<@>)) || startsWith(<!@>)) xd

pale vessel
#

yeah that works too

nocturne grove
#

oh well I had that

quartz kindle
#

more performant than regex

lyric mountain
#

yeah

nocturne grove
#

guess the seperate is cleaner then

#

oh lol okay thanks

earnest phoenix
#

Guys can I find a fast and good vps for 0.99€?

pale vessel
#

you need a little more than that

quartz kindle
#

fast and good? probably not

summer torrent
#

read pins

grizzled raven
#

depends

nocturne grove
#

I see many of 4 euro's, but idk if they're good

earnest phoenix
#

k

quartz kindle
#

however you can find some pretty good stuff for 2.50-3 euros

earnest phoenix
#

kk

grizzled raven
#

like if you wanna have a vps with nothing running, then yes

earnest phoenix
#

can you suggest me a site for buying vps?

pale vessel
#

read pins, again

grizzled raven
#

ping

#

pins

quartz kindle
#

do you need it to be in europe or can it be in usd?

earnest phoenix
#

i'm european

grizzled raven
#

the two most common currencies

earnest phoenix
#

French ?

quartz kindle
#

european servers might be cheaper but they have higher ping, because discord's gateway is in the us

lyric mountain
#

contabo has one for 4 euros

grizzled raven
#

contabo has us servers now

#

iirc

pale vessel
earnest phoenix
#

k

#

thx

surreal wind
#

Quick Question, to separate lines like ctrl+ enter does, apparently i cant use \n, is there anything else i can use besides writing a lot of single message.member.send lines? couldn't find anything on google, they all keep saying use \n

lyric mountain
#

why can't u use \n?

surreal wind
#

it wont display it as a new line in discord

#

it all stays on the same line.

lyric mountain
#

I guess you're using discord.js, right?

surreal wind
#

yep

#

Version 12.2.0

lyric mountain
#

weird then, but try \r\n

surreal wind
#

okay ty

#

weird then, but try \r\n
@lyric mountain Thanks a bunch its \r now

lyric mountain
#

👍

quartz kindle
#

newlines depend on the platform you're developing on

#

\n works on linux

#

windows uses \r or \r\n

#

node.js offers a constant for platform-specific newlines

#

newline = require("os").EOL

knotty steeple
#

bad

earnest phoenix
#

i can speak spanish here?

quartz kindle
#

nope

grizzled raven
earnest phoenix
#

i want help

#

but idk how write my question

#

in english

split hazel
#

You can always put it through translate and we can try help

earnest phoenix
#

How do I do that if the bot exceeds 2000 characters, the message will send it in .txt?

split hazel
#

But try only include the specific parts of the code, and make sure to hide any tokens

earnest phoenix
#

tokens?

#

i mean

#

the bot send in .txt

#

not me

#

Hallo ich brauche Deutsche Hilfe

warm marsh
#

sorry for ping

earnest phoenix
#

how i do a this.toString in 11v?

#

if for the command eval

sudden geyser
#

well what is this

earnest phoenix
#

client :D??

#

when the bots verify ?

knotty steeple
#
  1. wrong channel
#
  1. should take 1-2 weeks
finite plover
#

Why is this DM script not working?

async def on_raw_message_react(reaction):
    channel_id = reaction.channel_id
    channel = await bot.fetch_channel(channel_id)
    message_id = reaction.message_id
    message = await channel.fetch_message(message_id)
    author = message.author
    user = await bot.fetch_user(reaction.user_id)
    author.send(f'{user} will be attending your event!')

What part of thie is wrong?

proven beacon
#

How can I randomly select a few of the users on the list?

finite plover
#

Have you tried python's rand library?

clear wraith
#

I have a question... Lets say... Someone dm'd me wanting to help me with my bot. And They asked for the bot token. would I give it to them? Because I thought the token only ran the bot. so why would they want the token...

proven beacon
#

No, i used js

finite plover
#

@clear wraith Don't give them the token. They can write code and test it with their own token, but if you give them yours they could steal your bot and repurpose it as a spambot.

pale vessel
#

@clear wraith they can use your token and do malicious stuff to the guilds the bot's in

clear wraith
#

Oh boyyy

pale vessel
#

by the way, what's your bot token? let me check for leaks

proven beacon
#

@finite plover I'm using javascript, can you help?

finite plover
proven beacon
#

Oh Okay thx

#

How can I randomly select a few of the users on the list? Please..

pale vessel
#

make a loop and pick a rando

proven beacon
#

The same user can come across

summer torrent
#

.random(3) for example

proven beacon
#

@summer torrent thx but random(args[0] error xd

#

The count must be A number

pale vessel
#

then make it a number?

summer torrent
#

show error

proven beacon
#

Yeah i command:.vks 1

#

args[0] = 1

#

:/

kind quiver
#

whats the discord api endpoint

#

that tells me how many shards i need

earnest phoenix
#

what

#

qh

#

ah

kind quiver
#

/gateway/bot but whats the first bit lmao

#

been like 3 years since i did this

proven beacon
#

I did not understand anything lol

kind quiver
heavy marsh
#
connection.play(ytdl(`${YouTubeLink}`), { volume: 1, filter: 'audioonly' })

connection.on("end", end => { })
``` - This is correct to do something even the video ends in v12.2.0
quartz kindle
#

@proven beacon .random(3) doesnt exist in js

#

you need to put your list in an array or similar, then do array[Math.floor(Math.random(array.length))]

proven beacon
#

I want to attract as many users as I write in args

restive furnace
#

@kind quiver find it out from other libraries whats has sharding, eg. discord.py or discord.js

kind quiver
#

too late i figured it out

#

thanks tho

quartz kindle
#

@proven beacon show code

heavy marsh
#
connection.on("end", end => { })``` - Should this fire when the music ends?
proven beacon
#

@quartz kindle dm?

earnest phoenix
#

why say .send undefined?

#
if(command === 'setsuggest'){
  let canal = await sugerencias.obtener(message.guild.id);
  let channel = client.channels.get(canal)
  let mencion = message.mentions.channels.first();
  sugerencias.establecer(message.guild.id, mencion);
  channel.send(`${message.author} ...`)
}
pale vessel
quartz kindle
#

for collections, he said list of args

#

from what i understood lol

earnest phoenix
#

help?

pale vessel
#

okay, what do you need help with?

quartz kindle
#

what is undefined?

earnest phoenix
#

send

quartz kindle
#

@proven beacon vk1ses is a channel, there is no channel.members afaik

proven beacon
#

😒

#

No its work xd

#

Wait

quartz kindle
#

wait there is

#

wtf

#

ah of course, members who can see the channel

grizzled raven
#

smh

quartz kindle
#

@earnest phoenix you mean "cannot read .send of undefined"?

earnest phoenix
#

yes

quartz kindle
#

that means channel is undefined

earnest phoenix
#
TypeError: Cannot read property 'send' of undefined
quartz kindle
#

channel was not found

#

yes

earnest phoenix
#

let channel

quartz kindle
#

that means channel is undefined

earnest phoenix
#

i put let channel

quartz kindle
#

yes but there is no channel

earnest phoenix
#

oh

quartz kindle
#

which means the channel was not found

grizzled raven
#

what version of discord.js

earnest phoenix
#

oh

#

11v

proven beacon
#

Yes Tim? 🤔

quartz kindle
#

@proven beacon do like you did before with .random, but make args[0] a number

#

Number(args[0])

proven beacon
#

Yes yes

#

But is not work xd

quartz kindle
#

then args[0] is not a number?

proven beacon
#

Error : count has be A number

#

Sprry

#

Sorry

#

The count must be a number

#

its error xd

quartz kindle
#

i know

#

args[0] is not a number

proven beacon
#

Why

quartz kindle
#

you did console.log, what does the console say?

proven beacon
#

Yes

quartz kindle
#

for args[0]

proven beacon
#

Args[0] = 1

#

i command::.vks 1

quartz kindle
#

did you make it a number?

#

Number(args[0])

#

because args are strings

proven beacon
#

No

#

Number(args[0])

#

i test... Okay

pale vessel
#

i'd probably use parseInt instead

copper cradle
#

lmao

kind quiver
#

can i get number of guilds without websocket connection?

#

i know i can hit /gateway/bot to get an estimated number / 1000

mossy vine
#

uhh i dont think so

topaz fjord
#

you can't

#

wait

kind quiver
#

thats a shame ;l

topaz fjord
#

technically if you post to dbots you can get it from there

kind quiver
#

so if i post "i dont know my guild count" to dbots they'll send me the actual count back yeah?

#

😉

topaz fjord
#

oh I thought you already knew your guild count and wanted to find a way to do it without the bot being online

kind quiver
#

yeah i get you

#

i want to find the exact count without starting 400 websocket connections

royal portal
#

welp

#

I got a discord message

#

about verification

restive furnace
#

@kind quiver you lib dev, or just bot dev that doesnt use libraries?

#

(i mean like discord.js)

knotty steeple
#

he most likely knows what a lib is

#

@royal portal ok?

royal portal
#

its the worst thing

knotty steeple
#

what does that have to do about development tho

#

why did u have to say here

restive furnace
#

go to discord developers discord

royal portal
#

because I just got the message

knotty steeple
#

yea but why here?

royal portal
#

i wont be able to add 100 servers

knotty steeple
#

@earnest phoenix

#

what lib

#

@royal portal thats only enforced in octuber

#

also i asked why u posted here

earnest phoenix
#

My bot rebooting by itself and if an error occured (even if unnecessary), it rebooting. And it responds a little bit.
Lib: discord.js
discord.js version: 11.5.1

knotty steeple
#

stop avoiding the question

#

do u use pm2?

earnest phoenix
#

I?

knotty steeple
#

yes

#

do u

#

use pm2

earnest phoenix
#

What is pm2?

proper drum
#

U have marriage bot?

royal portal
#

process manager

knotty steeple
#

ok nvm

#

how do u start ur bot

earnest phoenix
#

No

knotty steeple
#

cringe

#

ok

earnest phoenix
#

😦

knotty steeple
#

glitch restarts on error

#

so fix ur errors

earnest phoenix
#

But error is unnecessary

#

I am using since 2 years

knotty steeple
#

read the errors then

earnest phoenix
#

I've never met anything like this before

#

Cannot send messages to this user is error

restive furnace
#

discord just updated thr api

#

update to v12

#

thats the fix

knotty steeple
#

no?

restive furnace
#

or 11.6

knotty steeple
#

if u update to v12 ur getting urself into more shit

earnest phoenix
#

Don't worry I know discord.js

#

I found the error

#

Uncaught Promise Error: TypeError: Cannot read property 'id' of undefined

#

in ${channel.guild.id}

restive furnace
#

guild != exists

earnest loom
pale vessel
#

no

earnest phoenix
late hill
pale vessel
#

this is common in that

#

don't work?

#

what do you mean by that?

late hill
#

Returns empty array

#

One of my commands basically stopped working out of nowhere because it used that

#

I've even tried using those methods on another bot, they just simply don't work anymore

earnest phoenix
#

Bot was accepted today. But it seemed to have done something regarding my code. I am using V11.5.1 and so It makes my life easier and I used the code.

client.on("ready", () => {
    console.log(`Hi, ${client.user.username} is now online!`);

    client.user.setPresence({
        status: "dnd",
        game: {
            name: `${prefix}Help overhaul complete | ${version}`,
            type: "STREAMING"
        }
    }); 
});

But now the bot will NOT display itself as DND anymore.

pale vessel
#

@late hill getMessageReaction() worked for me. it could be your code. for instance, did you provide a string (like the docs stated) instead of a number?

serene cliff
#

is it possible for bot to check attached file size?

late hill
#

oh

quartz kindle
late hill
#

It just doesn't work with custom emojis

pale vessel
#

11.5.1

serene cliff
#

ty

late hill
#

Do custom emojis work for you

pale vessel
#

i'll try

quartz kindle
#

@earnest phoenix status sometimes doesnt work for many people and nobody knows why

earnest phoenix
#

Worked fine all the time before the acceptance.

#

And my other version of the same bot is still displaying the same message fine.

#

🤔 Doesn't it have to do with the website linked to the bot or is that me being an idiot.

#

And it's back nvm.

#

Just a hard restart worked.

pale vessel
#

@late hill

late hill
#

wth

pale vessel
#

worked on the second try. first try returned an empty array.

late hill
#

oh

pale vessel
#

figured it out?

late hill
#

I see, it works the second time for me too

pale vessel
#

ah, nice

late hill
#

but why megu

pale vessel
#

who knows

#

eris is interesting

late hill
#

It's only started doing this today/yesterday night

#

Always worked fine before that

pale vessel
#

it'll probably fixed by itself eventually

late hill
#

Maybe it's a discord issue?

pale vessel
#

perhaps

#

find the issue in gh

#

try asking about that in their server

marsh rover
#
    at JSON.parse (<anonymous>)
at Object.<anonymous> (/app/index.js:5:15)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)```
#

Anyone Help

#

Thats The Code

pale vessel
#

maybe an unnecessary colon somewhere?

#

also, is that a json database? doesn't look very good

marsh rover
kind quiver
#

@restive furnace libraries don't do what I need

marsh rover
#

db.json

pale vessel
#

not downloading that

#

good luck

still lily
#

how do you code currency, like a counter with discord.js

#

so java script

late hill
#

So I just manually used a get request and got the same issue

#

No result on the first request

icy crane
#

@still lily you use a db

still lily
#

@icy crane no

icy crane
#

Yes

#

use a db to store how much each user has

quartz kindle
#

@late hill try fetching the message first, then fetch its reactions

split hazel
#

Please don't tag people to help you, someone will get to you if they are aware of the issue/want to help

heavy marsh
#
connection.play(ytdl(`${song.url}`), { volume: 1, filter: 'audioonly' })
message.channel.send(embed);

connection.on("end", end => { })
``` - Will this work for v12.2.0 discord.js?
pale vessel
#

change end to finish

heavy marsh
#

ooh ok

#

Thank you

heavy marsh
#
connection.play(ytdl(`${song.url}`), { volume: 1, filter: 'audioonly' })
message.channel.send(embed);

connection.on('finish', finish => {  })
#

But it doesnt work

#

Also no error

summer loom
#

d

versed narwhal
#
.addField("**Guild Owner:**", `${message.guild.owner}`, true)
    .addField("**Role Count:**", `${message.guild.cache.roles.size}`, true)
#

discord

#

cmon

icy crane
#

can you send a bit more

#

whats css lol

quartz kindle
#

what is the problem?

icy crane
#

why

versed narwhal
#

want the whole command? THONK

icy crane
#

yes pls

quartz kindle
#

you didnt even say what is wrong?

icy crane
#

sorry

versed narwhal
#
const Discord = require("discord.js")

module.exports.run = async (bot, message, client, args) => {
    console.log(message.author.tag, 'used the serverinfo command.')
    let sEmbed = new Discord.MessageEmbed()
    .setColor()
    .setThumbnail(message.guild.iconURL)
    .setAuthor(`${message.guild.name} Info`, message.guild.iconURL)
    .addField("**Guild Name:**", `${message.guild.name}`, true)
    .addField("**Guild Owner:**", `${message.guild.owner}`, true)
    .addField("**Member Count:**", `${message.guild.memberCount}`, true)
    .addField("**Role Count:**", `${message.guild.cache.roles.size}`, true)
    .setTimestamp()
    .setFooter(`darkness`, bot.user.displayAvatarURL);
    message.channel.send({embed: sEmbed});
}
icy crane
#

out of context to you guys

quartz kindle
#

btw message.guild.roles.cache.size

icy crane
#

well, iconURL is a function now

#

btw

quartz kindle
#

and guild.owner may be null

versed narwhal
#

im migrating from v11

#

so im literally lost

icy crane
#

yes, iconURL is a function now

quartz kindle
#

displayAvatarURL is also a function

icy crane
#

same with avatarURL

versed narwhal
#

guild.owner is indeed null

icy crane
#

yeah, youll have to fetch the owner by ID in that case

versed narwhal
#

do i need to specify id

icy crane
#

yes, but it can be done with <guild>.ownerID

#

uh

#

wrong channel

versed narwhal
icy crane
#

well is guild defined?

versed narwhal
#

no, again hyperhaHAA

icy crane
#

we use <guild> because it can be defined as whatever

versed narwhal
#

idk in what to define guild

#

dk!serverinfo

icy crane
#

what did you do for the other ones

#

wrong channel

#

bots cant speak here

versed narwhal
#

cannot read property fetch of undef

#

hm

#

for the other ones

icy crane
#

hm

versed narwhal
#

was just

#

message.guild.owner and message.guild.roles.size

icy crane
#

yes exactly

versed narwhal
#

ohhhh

#

so

#

const message = guild?

icy crane
#

no

versed narwhal
#

or misunderstanding

icy crane
#

misunderstanding

blazing portal
#

last row should also be message.channel.send(sEmbed);

versed narwhal
#

i know

#

i did a cleanse

#

from v11 traces

#

not done

icy crane
#

send code again

versed narwhal
#

xD

#
const Discord = require("discord.js")

module.exports.run = async (bot, message, client, args) => {
    console.log(message.author.tag, 'used the serverinfo command.')
    let sEmbed = new Discord.MessageEmbed()
    .setColor()
    .setThumbnail(message.guild.iconURL)
    .setAuthor(`${message.guild.name} Info`, message.guild.iconURL)
    .addField("**Guild Name:**", `${message.guild.name}`, true)
    .addField("**Guild Owner:**", `${client.users.fetch(guild.ownerID)}`, true)
    .addField("**Member Count:**", `${message.guild.memberCount}`, true)
    .addField("**Role Count:**", `${message.guild.cache.roles.size}`, true)
    .setTimestamp()
    .setFooter(`darkness`, bot.user.displayAvatarURL);
    message.channel.send({embed: sEmbed});
}
icy crane
#

change iconURL into a function

#

same with displayAvatarURL

#

also, I dont THINK memberCount is a thing anymore in v12

versed narwhal
#

it is

#

sec

icy crane
#

ah yeah

#

it is

versed narwhal
#

just reverted everything back

icy crane
#

so, for the owner, you need to fetch it by their ID

#

oh

#

@versed narwhal

#

I just realize

#

d

#

when you tried to fetch

#

in the code you send above

#

you used client

#

when you pass in bot

#

so

ocean wigeon
#

Hello im triyng to host my bot in Vultr, but i can not unstall discord.js in the server does anyone knows what im could be doing wrong?

icy crane
#

ah yes, thank you lavalink, very cool Something broke when playing the track.

versed narwhal
#

back

#

im not really getting on how to define this lma

icy crane
#

well first of all

#

you used client

#

when you passed in bot

versed narwhal
#

yeah and now

#

i tried to set it with client

#

to make it usable

#

and it outputs the same as without

icy crane
#

just change it to bot

versed narwhal
#

guild is not defined

#

hmm

#

ok

#

1 sec

icy crane
#

thats what you defined it as

#

in the cmd handler

versed narwhal
#

oh

#

so

#

i was even already defining bot

#

and had client in

#

that wasnt a thing in v11 i suppose

earnest phoenix
#

&stop

#

@glad prism stop

icy crane
#

wrong channel

earnest phoenix
#

oh

#

sry

versed narwhal
#

iconURL not defined

icy crane
#

wut

#

its a function now

versed narwhal
#

so, bot.guild.iconURL?

icy crane
#

no, its a function

versed narwhal
#

uhhh

icy crane
#

do you know how to call functions you make yourself

versed narwhal
#

not really, kinda rusty on this

icy crane
#
function myfunction(a, b) {
  //do stuff
}

myfunction(a, b)
versed narwhal
#

been a while since i opened the project again

icy crane
#

so, how would you turn the iconURL into a function

#

with that info i just gave you

grave mesa
#

could I use here <style> tag?

modest maple
#

yes

#

html and css is supported

junior arrow
modest maple
#

holy fuck that is hard to read

junior arrow
#

Yeah

#

Can I Also Change That Invite Button Font

#

?

grave mesa
#

and like, how can I personalize my bot's page?

junior arrow
#

I also want

#

Did You Know??@modest maple

modest maple
#

get the css tag for the those tags and set the font-family tag

fresh kestrel
#

Hey how to get the Memory Usage and CPU Usages?

vernal basin
#

is generalization for all servers a very hard task? currently I've only written bots that have been programmed for a single server, with all the IDs essentially hardcoded. Does anyone have any recommendations for tutorials on generalizing bots to more than just one server?

earnest phoenix
#

is generalization for all servers a very hard task? currently I've only written bots that have been programmed for a single server, with all the IDs essentially hardcoded. Does anyone have any recommendations for tutorials on generalizing bots to more than just one server?
@vernal basin
I mean, have you tried databases?
If a coin system is only for one server for example, a db can make it multi-guild

vernal basin
#

oh yeah databases

#

i tried that once

#

it got ugly quick xd

iron steeple
#

@fresh kestrel what language?

earnest phoenix
#

@vernal basin just use an easier one then
Quick.db works fine for me

knotty steeple
#

no

#

dont

#

its sqlite with extra dependencies

amber fractal
#

^ I can't recommended anything less than that

knotty steeple
#

if someone wants a small easy db i always recommend sqlite

#

or my friend's pocket.db but idk about that mmulu

true tundra
#

Can anyone help me with repl

knotty steeple
#

depends

#

just say what u want

fresh kestrel
#

Its fine now.

knotty steeple
#

ok

true tundra
#

I want to know how to add when the bot is streaming

knotty steeple
#

huh

#

add streaming to ur bot status?

true tundra
#

Yea

knotty steeple
#

what library

true tundra
#

wdym

knotty steeple
#

how do u have a bot and not know what a library is

#

did u just watch a yt tutorial and copy code

true tundra
#

No

knotty steeple
#

then what do u use

true tundra
#

I just forgot what that means

iron steeple
#

Coding language dude

#

And therefore the library that is used for discord

true tundra
#

python

knotty steeple
#

oh

#

god

iron steeple
knotty steeple
#

well idk about python lmao

true tundra
#

yee

iron steeple
#

Have you searched the question on the official discord.py docs?

true tundra
#

No

iron steeple
#

It’s all you will ever need

#

Lol

true tundra
#

Okay

knotty steeple
true tundra
#

for what

candid hill
#

I'm working on a bot that uses its own mention as its command prefix. This sometimes runs into the issue of people pinging the bot's permissions role instead of the bot because permissions roles have the same name as their bot by default. Would having the bot also respond to the mention of its permissions role (disabled by default, enabled by role input via command) be violating the bot behavior guidelines?

iron steeple
#

It shouldn’t do because that role can’t be assigned to anyone else iirc

#

Lots of people use this type of thing so it should be fine

candid hill
#

Good to know, thanks!

true tundra
#

Still confuse

iron steeple
#

Alright what did you find so far @true tundra

true tundra
#

I found this
activity=discord.Streaming(*, name, url, **extra)

iron steeple
#

Yes good so did you look up the Streaming types?

true tundra
#

yea

iron steeple
#

And...

true tundra
modest maple
#

Look on the actual API reference

#

Not using the search bar

true tundra
#

Ok

#

the table of contents?

modest maple
topaz fjord
#

@knotty steeple url checks out

knotty steeple
#

lul

true tundra
#

Okay so i go to streaming then

modest maple
regal jacinth
#

ammm i am hosting my bot in heroku but it doesn't support json files unless I pay ||which I can't offerd|| so I heard I can host the json files on google sheets , but I have 0 knowledge about google sheets , soo any yt videos recommendation

knotty steeple
#

what the fuck no

#

dont do that

regal jacinth
#

??

#

w-why?

knotty steeple
#

its google sheets

#

for json files

#

why would u

regal jacinth
#

oh then its a bad idea ?

#

smh

#

sigh Ian lost now T^T

knotty steeple
#

yes it is

regal jacinth
#

then what should I do

knotty steeple
#

uh dont use heroku

regal jacinth
#

hmmmm then what other websites that support json files for free there ?

knotty steeple
#

idk

#

glitch

#

but pls try to get an actual cheap vps

regal jacinth
#

ok

#

ty

earnest phoenix
#

i want transfer my bot to an team, but i have this error : This action cannot be performed because the application is verified. Please contact support.

knotty steeple
#

do what it says

#

contact support

#

go in like the discord devs server

true tundra
#

Its not working

#

it keeps saying invalid syntax

iron steeple
#

Same problem @true tundra ?

true tundra
#

yea

iron steeple
#

What have you tried so far

#

Try something like this: discord.Streaming(name="My Stream", url=my_twitch_url))

true tundra
#

await bot.change_presence(activity=discord.Streaming(*, YouTube, http://youtube.com/demoniceagleyt)

slender thistle
#

Why's the asterisk there

iron steeple
#

Don’t use *

#

Yeah lol

true tundra
#

ok

iron steeple
#

Try my example

slender thistle
#

Wrap stuff around quotation marks if you want them to be strings

true tundra
#

Ok

slender thistle
#

Also you need a Twitch link, not YT one

true tundra
#

Try my example
@iron steeple it says its not defined

iron steeple
#

Lol because you don’t actually use my_twitch_url

#

Use a proper URL

slender thistle
#

A proper Twitch URL

true tundra
#

I did

iron steeple
#

await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))

#

Incase it wasn’t clear enough

slender thistle
#

Don't go spoonfeeding too much 👀

iron steeple
#

🤭

true tundra
#

not working

iron steeple
#

Did you get an error?

true tundra
#

yee

#

it says invalid synthx

slender thistle
#

Poooost stacktracee please

iron steeple
#

This works perfectly fine for me

true tundra
#

??

iron steeple
#

Post the whole error

true tundra
#

ok

iron steeple
#

Just the important bit

true tundra
#
    await bot.change_presence(activity=discord.Streaming(name="
My Stream", url=https://www.twitch.tv/nexor_lazorak_yt))(name=f
"c!help | {len(bot.guilds)} Servers", url="www.$do1.com"))
                                                               
                     ^
SyntaxError: invalid syntax```
modest maple
#

Missing a )

regal jacinth
#

amm how do I get API links for action commands like !hug !pat , I tried giphy , tenor and gifycat and I don't understand what they want

modest maple
#

Tho I can't read that on mobile

knotty steeple
#

{len(bot.guilds)}

true tundra
#

I put that it doesnt work

#

Is it because i put the prefix?

slender thistle
#

Do you have any idea what you are doing rn

modest maple
#

Why have you set up and name twicr

knotty steeple
#

await bot.change_presence(activity=discord.Streaming(name="My Stream", url=https://www.twitch.tv/nexor_lazorak_yt))(name=f"c!help | {len(bot.guilds)} Servers", url="www.$do1.com"))

modest maple
#

And no he hasnt

knotty steeple
#

can u read that

modest maple
#

You're setting name and URL twicr

#

Which makes zero sense

true tundra
#

?

iron steeple
#

🤦

slender thistle
#

You can only do change_presence(name=x, url=y) once

regal jacinth
#

;-;

slender thistle
#

You can't do change_presence(name=x, url=y)(name=z, url=j)

modest maple
#

kms I'm going to sleep. Night y'all and good luck with this one

regal jacinth
#

gn

true tundra
#
    await bot.change_presence(activity=discord.Streaming(name="
My Stream", url=https://www.twitch.tv/nexor_lazorak_yt))(name=f
"c!help | {len(bot.guilds)} Servers", url="www.$do1.com"))
                                                               
                     ^
SyntaxError: invalid syntax```
iron steeple
#

DUDE

modest maple
regal jacinth
#

don't use name and url twice

slender thistle
#

I'll ask you again

#

Do you have any slight clue what you are doing

iron steeple
#

I’ll answer it for him

slender thistle
#

or any clue of how Python works

iron steeple
#

NO

#

Sorry lol

regal jacinth
#

XD

#

if u want to change the status of ur bbot do a loop

true tundra
#

Like this
await bot.change_presence(activity=discord.Streaming("My Stream", https://www.twitch.tv/nexor_lazorak_yt))

modest maple
#

Dear lord

regal jacinth
#

bruh

iron steeple
#

Closer!

regal jacinth
#

wtf

slender thistle
#

That's half the issue

knotty steeple
#

even i cant be this bad in py lmao

modest maple
#

Learn the basics of python

#

Please god

#

This is too hard to watch

regal jacinth
#

I said don't use it twice not don't use it at all

modest maple
#

Atleast learn what a string, int, float is

slender thistle
#

Maybe you should stop commenting and help or just stay silent please

regal jacinth
#

ok ;-;

slender thistle
#

Not you personally

knotty steeple
#

ok

true tundra
#

Idk what else

regal jacinth
#

smh

slender thistle
#

You need to use kwargs like you did before

modest maple
#

When making a discord bot before even attempting it you need to atleast a fundamental knowledge down

regal jacinth
#

put the name and url back

iron steeple
#

You need to literally just remove the repeat in the first example

regal jacinth
#

but don't double it

modest maple
#

E.g just pasting a URL is gonna be interpreted as code not a string because there is no quote marks

regal jacinth
#

name='ur name', url='any thing '

#

like this

knotty steeple
#

how do i make gui apps in node besides electron

true tundra
#

SyntaxError: unmatched ')'

modest maple
#

Find some sort of C and CPP wrapper for a GUI ig

knotty steeple
#

gay

iron steeple
#

This channel is for bot development Sammy-ette

regal jacinth
#

amm how do I get API links for action commands like !hug !pat , I tried giphy , tenor and gifycat and I don't understand what they want
@regal jacinth

modest maple
#

What most languages that want a GUI use

knotty steeple
#

the bot is in brackets

#

unless they told u its bot dev specifically

iron steeple
#

Yeah.... so that means it’s for bot development lmao

knotty steeple
#

mhm

modest maple
#

I mean meh

#

It's development related

knotty steeple
#

so

#

i have another problem

regal jacinth
#

;-;

knotty steeple
#

wait

modest maple
#

@regal jacinth are you using their actual APIs or what?

true tundra
#
My Stream', url='https://www.twitch.tv/nexor_lazorak_yt'))(name
=f"/mhelp | {len(bot.guilds)} Servers", url="www.$do1.com"))```
modest maple
#

How

knotty steeple
regal jacinth
#

I didn't use anythinf

#

bruh

modest maple
#

Ah

regal jacinth
#

back to square 1

modest maple
#

Have a look for some images apis

knotty steeple
#

giphy has their own api

modest maple
#

That have endpoints direct to the image

#

And yeah

slender thistle
#

@true tundra remove the last part with name and url

limpid pulsar
#

I made my logo circular, but how can I get rid of the white line?

knotty steeple
#

css

modest maple
#

Box shadow iirc

regal jacinth
#

hmmm

modest maple
#

With css

limpid pulsar
#

Yeah, I know

#

But I don't know what does it

knotty steeple
#

yea its box shadow

iron steeple
#

@true tundra I seriously recommend relearning the basics of python

limpid pulsar
#

I need to find which class does it

true tundra
#

@true tundra remove the last part with name and url
@slender thistle for the prefix?

modest maple
#

Box shadow

limpid pulsar
#

Oh alright

slender thistle
#

Prefix of what?

modest maple
#

Best thing to do is use a live CSS editor

limpid pulsar
#

I'll try, thanks 🙂

#

I am using a live css editor

modest maple
#

Ye

limpid pulsar
#

But I don't have like the whole thing

modest maple
#

Normally they have a inspect tool with them to just click

limpid pulsar
#

I only have the code for the description

knotty steeple
#
#bot-details-page .bot-img {
  box-shadow: none !important;
}
limpid pulsar
#

I'm inspecting too

turbid bough
#

@knotty steeple ive checked the sql code, and it works for me.

true tundra
#

remove the name and url for whar

knotty steeple
#

did u run that exact code

turbid bough
#

yep, or within my database with my variables

modest maple
#

We're back at square one with this guy oof

slender thistle
#

What you are doing is function()() which is wrong

turbid bough
#

though im using postgres

modest maple
#

Postgres best db

limpid pulsar
#

weird

modest maple
#

Other than datomic

limpid pulsar
#
.bot-img {
    border: none;
    border-radius: 50%;
    box-shadow: none;
  }

this didnt work

modest maple
#

Because no overrides and proper pathing

limpid pulsar
#

maybe it's not overriding

#
  1. How do I override?
  2. Proper Pathing?
modest maple
#

Look at the difference between what u have and what Sammy posted

#

It makes a difference

true tundra
#

Idk who is talking to me jst ping

limpid pulsar
#

So !important?

knotty steeple
#

no

slender thistle
#

What you are doing is function()() which is wrong
@true tundra

knotty steeple
#

also whenever i try to log rows i only get 1 result

true tundra
#

So what i do

slender thistle
#

Remove the second name and url

limpid pulsar
#

!important didn't work

slender thistle
#

So that you have Activity(name=..., url=...)

true tundra
#

I did it didnt work

knotty steeple
#

look at what i posted again

limpid pulsar
#

Is it the #bot-details-page?

knotty steeple
#

yes

#

and if that doesnt work idk

turbid bough
#

why need #bot-details-page?

#

.bot-img should just work fine wouldnt it?

limpid pulsar
#

worked 🙂

#

Thanks

#

so I'm allowed to change anything on my page?

slender thistle
#

.class .somediv overrides .somediv

knotty steeple
modest maple
#

CsS pathing be like

#

And yes

knotty steeple
#

only 1 result