#development

1 messages · Page 725 of 1

valid frigate
#

then aggregate then send to the shard that wanted it

quartz kindle
#

@sage bobcat mathematical operations have priority over comparisons

lament meteor
#

u need brackets

valid frigate
#

dv you could learn ipc, because broadcastEval scripts can be kinda big

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

inter process communication

valid frigate
#

dont mathematical operations resolve first before comparisons

#

and yeah

#

if i did 1 + 1 > 1 that would resolve to true

lament meteor
#

ye

valid frigate
#

inter process communication allows you to request anything from shards as long as they receive the right code

slender thistle
#

fsr I thought that was 2 == 1 and went crazy for a while

lament meteor
#

tbh i feel like we are confusing dv more

#

lol shiv

valid frigate
#

LOL

lament meteor
#

i should do some sharding testing shit but so lazy

slender thistle
#

... and somehow I later came to a conclusion that was 1 + False

valid frigate
#

i don't know of any resources on ipc, but just know it's kinda like this

earnest phoenix
#

Several people typing...

lament meteor
#

i only code quantity > quality what i know > quality

#

i dont even code for speed

#

but now im kinda am

sage bobcat
#

One message removed from a suspended account.

valid frigate
#

say 1 shard wants to request data, so it sends something out like

const d = ipc.broadcast("requestShardData")

all other shards recieve that message and send back their data

someIpcClient.on("requestShardData", (f) => { // return shard data })

the variable d contains data from all shards

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

@sage bobcat use your brain pls

valid frigate
#

oh that might be confusing

sage bobcat
#

One message removed from a suspended account.

lament meteor
#

client.shard.broadcastEval("(this.shard.id + '-' + this.ws.ping + '-') + (this.ws.shards.status === 0 ? 'green_heart' : 'broken_heart')")

quartz kindle
valid frigate
#

also

quartz kindle
#

you dont need the first brackets

slender thistle
#

How long is this chat going on about that issue for

valid frigate
#

no clue

#

dv honestly

lament meteor
#

idk shiv

valid frigate
#

do you even need sharding right now

lament meteor
#

dv honestly just use stackoverflow

valid frigate
#

discord bots is so vague that there's nothing specific for it on so

mossy vine
#

@slender thistle a few days

quartz kindle
#

he cant even use this channel, how can he use stackoverflow

slender thistle
#

Isn't SO just "marked as duplicate" spam

mossy vine
#

or closed as off-topic

valid frigate
#

optimist: the glass is half full
pessimist: the glass is half empty
stackoverflow: the glass is stupid, marking as duplicate, you have been banned for asking questions for 8 months

lament meteor
#

SO?

slender thistle
#

StackOverflow

lament meteor
#

o

loud salmon
#

I'll close this as off topic

valid frigate
#

k

lament meteor
#

ok

valid frigate
#

general advice: dont ask questions on SO because youre gonna be attacked

#

just look stuff up cuz whatever you're looking for it's gonna be there

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

wut?

wheat jolt
#

how I can publish a message using d.js

#

?

earnest phoenix
#

publish a message?

wheat jolt
#

yes

earnest phoenix
#

like send a message to a channel?

wheat jolt
#

in news channel

winged osprey
#

Bots aren't able to publish messages in announcement channels

modest maple
#

http://pls-fuck.me/zbDYiGk.png

#

hmmm

distant plank
#

I have this code, which is to send an image with the avatar and text that the author wrote, well, when the text is larger than the background, the text shrinks, but I would like that instead of doing that of a jump line, but I don't know that, I use canvas

#
let fontSize = 70;

                do {
                    ctx.font = `${fontSize -= 10}px sans-serif`;
                    
                } while (ctx.measureText(text).width > canvas.width - 300);     
                return ctx.font;
            };
            const canvas = Canvas.createCanvas(700, 250);
            const ctx = canvas.getContext('2d');

            var bgs = [
                "https://cdn.pixabay.com/photo/2016/10/20/18/35/sunrise-1756274__340.jpg"
              ];
              var bg = bgs[Math.floor(Math.random() * bgs.length)];
            const memetext = args.join(" ")
            if (!memetext) {
                const embed = new Discord.RichEmbed()
                    .setTitle(`${message.author.username}, debes escribir algo`)
                    .setColor("RED");
                message.channel.send(embed);
                return;
            }
            if(memetext.length > 100){
                const embed = new Discord.RichEmbed()
                .setTitle(`${message.author.username}, no puedes usar mas de 100 caracteres`)
                .setColor("RED");
            message.channel.send(embed);
            return;
            }
           
            const background = await Canvas.loadImage(bg);
            ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
            ctx.strokeStyle = '#74037b';
            ctx.strokeRect(0, 0, canvas.width, canvas.height);
            ctx.font = applyText(canvas, memetext);
            ctx.fillStyle = '#ffffff';
        ctx.fillText(memetext, canvas.width / 2.5, canvas.height / 3.5);

 ctx.beginPath();
            ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
            ctx.closePath();
            ctx.clip();
const avatar = await Canvas.loadImage(message.author.avatarURL);
ctx.drawImage(avatar, 25, 25, 200, 200);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'reflection.png');

            message.channel.send(attachment);
      ```
quartz kindle
#

instead of changing the font size, split the text into smaller pieces and measure each line again

winged rapids
#

Does anybody have any idea how I could make it so when I do like !check it goes through all the users in my server and checks when there account was created and if there account was created less then 2 months ago it shows there username and when there account was made?

earnest phoenix
#

loop through every guild on your client

#

in that loop

#

loop through all of the members of the guild and check their account creation date

distant plank
#

@quartz kindle How can I do that?

quartz kindle
#

the same way you did it with the font size

#

just requires more logic

distant plank
#

@quartz kindle I dont know ;-; I copied the code

frozen cedar
#

-staff

#

!!!

modest maple
#

theres ur issue then

frozen cedar
#

How did a copied bot get approved?!

earnest phoenix
#

sometimes it slips

quartz kindle
#

bots only get denied if its a blatant copy of another bot/open source bot

#

a bot built with random copy pasting of random blocks of code from multiple sources wont get denied (which is most likely the case here)

wooden lance
#

Does anyone know how to detect when the client leaves a voice channel? (discord.js)

earnest phoenix
#

why would you need to detect it

#

you're the one in control of your client

wooden lance
#

a music bot but when it get's disconnected from a vc by someone, the bot still thinks the music is playing even though it isn't and it stops people from being able to use the music commands (in that guild until the bot restarts or the music queue ends)

wooden lance
#

thank you! i didnt find it in the docs when i looked lol

distant plank
#

@quartz kindle It is not copied from another bot, I was just looking for how to manipulate images, and I found one of canvas for a welcome, but I modified it so that random text could be written, but I did not know how to do what I told you

quartz kindle
#

its not an easy thing to do

#

take a look at this example

#

this example does the following:

  • split text into words
  • start with one word, measure its length
  • if length is smaller than the canvas width, add another word.
  • measure the length of two words
  • if the length is smaller than the canvas width, add another word.
  • repeat until the length is bigger than the canvas width
  • when the length is bigger, remove the last word, write the text, move to new line, start a new string and add the word there
  • repeat the process until no words are left
distant plank
#

@quartz kindle Thank you! already achieved

topaz sphinx
#

it keeps giving me
{'message': '405: Method Not Allowed', 'code': 0}

#

code:

@staticmethod
    async def get_user_json(access_token):
        url = Oauth.discord_api_url + "/users/@me"
        headers = {
            "Authorization" : "Bearer {}".format(access_token)
        }

        print(url, headers)
        async with aiohttp.ClientSession() as session:
            async with session.post(url, headers = headers) as r:
                return await r.json(content_type=None)
sudden geyser
#

does it not take a get request and not a post?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sterile minnow
#

How can i even shard my bot xD

grim aspen
sterile minnow
#

For who xD

#

I domt know how to make a shard system xD

#

Do one of u know how to check the boosts?

#

From a server

grim aspen
#

afaik not possible

sterile minnow
#

K

valid frigate
#

it is possible

#

usually it would be in the guild object, eg in eris it's subscriptionCount

near ether
#

Are JSON files slow to work with?

west raptor
#

as a database?

#

or storing constants

#

ie tokens

valid frigate
#

store your config in .env if you work with js/ts

lament meteor
#

doesnt py also support .env

valid frigate
#

all languages support multiple config files i guess

near ether
#

As a database

#

I’ve been storing player data in json files and reading/writing but I can feel my bot getting slower and more people use it and more files get added

#

Would MongoDB be better?

slender thistle
#

If you wanna work with JSON, yeah

near ether
#

Ty!

wicked pivot
#

someone would be that she event use us to know when a user joins a voice ?

wooden lance
#

@wicked pivot ???

wicked pivot
#

aie google translate

#

i'm french

wooden lance
#

o

#

can you elaborate on the issue?

#

you want to set up an event to detect when a user joins a voice channel @wicked pivot?

wicked pivot
#

yes

#

someone knows the event who detect when a user join a channel, or leave it

wooden lance
#

what lib?

wicked pivot
#

discord.js

wooden lance
#

ooooo, give me a sec

wicked pivot
#

thx

wooden lance
#

Huh, can't find anything in the discord.js docs. I have no clue how to do that. Wait for someone else to respond. :(

wicked pivot
#

thx you no problem

valid frigate
#

what

slender thistle
#

eh I hope it's the same in master

valid frigate
#

it is

#

in master i think there aren't many changes to the events

wicked pivot
#
const discord = require('discord.js')

module.exports = async (oldMember, newMember) => {

    guild = new.guild
    let newMemberchannel = newMember.voiceChannel
    let oldMemberchannel = oldMember.voiceChannel

    if(oldMemberchannel === undefined && newMemberchannel !== "534738699628576782") {
        let embed = new discord.RichEmbed()
.setTitle('Un membre viens de rejoindre un vocal')
.setDescription(`
User qui à rejoint : " ${newMember.user.username} " 
`)
  .setColor('#E37D00')
  .setTimestamp()
  .setFooter(`Logs serveur ${guild.name}`)
  bot.channels.get("535553754359922705").send(embed)
    }else if(newMemberchannel === undefined) {
        //leave
    }
}``` i did this, but it doesn't work
valid frigate
#

what is new.guild

heavy marsh
#

Language: Discord.js
Code: ```js
if (!message.guild.roles.has(roleName.id))return

**IS it correct?**
wicked pivot
#

newMember sorry

#

there is no error but no message send

#
const discord = require('discord.js')

module.exports = async (oldMember, newMember) => {
    let newMemberchannel = newMember.voiceChannel
    let oldMemberchannel = oldMember.voiceChannel

    if(oldMemberchannel === undefined && newMemberchannel !== "534738699628576782") {
        console.log("join")
    }else if(newMemberchannel === undefined) {
        //leave
    }
}``` even like that, but it doesn't work
west raptor
heavy marsh
#

Thanks for thanks

#

I fixed it but how can i remove this ...
My Code: ```js
if (!message.guild.roles.find(name, roleName))return [utils.timed_msg(utils.cmd_fail(No role found by that name!), 5000)];

const roleID = message.guild.roles.find(name, roleName).id;

**Console Error:** http://ss.danbot.xyz/u/03.00.25-08.11.19.png
#

should i catch the error and ignore?

west raptor
#

find('a', 'b') is deprecated

#

It wants you to do find(a => a.prop == 'value') instead

#

Fucking mobile

#

Hate it

#

@heavy marsh

heavy marsh
#

hmmm oks let me try

west raptor
#

a in this case would be Role

heavy marsh
#

then a.prop

west raptor
#

Uhh

#

prop should be replaced with the property that holds the role name

#

ie name

heavy marsh
#

ooh ok i got it thanks

surreal sage
#
botConfigs.find(ch => ch.name === 'Support')``` Anyone got this but for category's?
#

wait

#

that makes no sense

#

nvm

#

no

#

u see ch.name i need it to be converted

#

(╯°□°)╯︵ ┻━┻

#

coverted to catogery

#

nvm again

#

args are this right?: js !say hi everyone
^^^^^^^^^

unkempt palm
#

hi guys, is there any way to get the Invite code of a Discord server channel without having Manage Channels permission?

#

basically I'm trying to link the data I have (invite link with code) with the discord server where the bot is invited

modest maple
#

Why?

#

If your plan is to join some of the servers your bot is in that is kinda a massive breach of privacy no?

mossy vine
#

yeah it is a massive breach of privacy

raven torrent
#

exactly

mossy vine
#

i dont think you can fetch existing invite codes without perms either

raven torrent
#

u can't fetch but create a new one

wooden radish
#

.

#

Hello

lament meteor
earnest phoenix
sterile minnow
#

@earnest phoenix

earnest phoenix
#

what do you think

#

i think i need to put my dbl bot token

summer torrent
#

yes

west raptor
#

Yes

earnest phoenix
#

so if i put the token then i can see like this in my bot page

grim aspen
#

yes

earnest phoenix
#

i have one problem

#

my main bot is in vps so can i creat a new bot i test in that then i put it in the main bot

west raptor
#

Uh if you want to wait a week for it to be approved?

#

And actually have features

earnest phoenix
#

my main bot is approved

modest maple
#

yh

earnest phoenix
#

but for testing

modest maple
#

ur test bot wont be xD

earnest phoenix
#

ohk

#

thx

#

so i need to put the code in my main file in index.js

grim aspen
#

yes

quartz kindle
#

@earnest phoenix you can make another file and use the same bot token

#

for testing

earnest phoenix
#

i have done now how can i check it@quartz kindle

quartz kindle
#

check what

earnest phoenix
#

i have added the code

west spoke
quartz kindle
#

well, does it work? if not, then you did something wrong

earnest phoenix
#

yaa its works

#

thx a lot

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

master?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

shard.ids[0]

hollow saddle
#

Is your bot in this server?

earnest phoenix
#

yaa

#

@earnest phoenix

#

-bots

gilded plankBOT
hollow saddle
#

Then it should be automatic iirc

earnest phoenix
#

it cant

late hill
#

Because you're seeing a cached value

earnest phoenix
#

when i restart my bot then before restart i saw it was 70k+ members in my bot status after resart it shows me 48+ members in my bot status every time

quartz kindle
#

cached members

earnest phoenix
#

means

#

Hey

#

Who can help me?

south swallow
#

anyone here, just drop off your question

earnest phoenix
#

Okay

#
{
  "discu_chan": [
    {
      "chan_id": "642362119312113702"
    }
  ]
}```

```js
client.on('message', async message => {
    var channn = message.channel.id;
    var chann = db.get("discu_chan").find({ chan_id: channn }).value();
    if(message.channel.id === chann) {
        message.delete()
        createWebhook(message.author.username, message.author.avatarURL).then(async mm => {       
      try { 
      await mm.send(message.content) 
      await mm.delete()
      } catch (e) {        
      await mm.delete()
      }}) 
    }
})```
#

I'm trying to make sure that if the channel id is = to the json file id then it deletes the message and sends it back with a webhook

#

But I can't do it.

#

:/

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

It's a try, but I can't do it.

#

var channn = message.channel.id;

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

I'm trying to make sure that if the channel id is = to the json file id then it deletes the message and sends it back with a webhook

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

plzz help on that

#

Do you know how I could do that?

#

If anyone can help me, ping me

#

TY

late hill
#

what does db.get("discu_chan").find({ chan_id: channn }).value(); return

earnest phoenix
#
var channn = message.channel.id;```
#

Bug i want to use

{
  "discu_chan": [
    {
      "chan_id": "642362119312113702"
    }
  ]
}```
#

This

late hill
#

and please use helpful variable names that explain what the variable is/does

earnest phoenix
#

Oh okay

#

Wait

#
client.on('message', async message => {
    var messageChannelId = message.channel.id;
    var chanIdInDB = db.get("discu_chan").find({ chan_id: messageChannelId }).value();
    if(message.channel.id === chanIdInDB) {
        message.delete()
        createWebhook(message.author.username, message.author.avatarURL).then(async mm => {       
      try { 
      await mm.send(message.content) 
      await mm.delete()
      } catch (e) {        
      await mm.delete()
      }}) 
    }
})```
#

Like that?

late hill
#

people generally use camelCase for javascript

#

soLikeThis

earnest phoenix
#

Ok okay x)

late hill
#

there's also no need for your message channel id variable

#

but whatever

#

what's db

earnest phoenix
#

db.json

#

I use a json file for store the id of the channel

late hill
#

It's just a json file that you required or ..?

mossy vine
#

if db really is a json file what the fuck is that db.get().find().valur

earnest phoenix
#

Just the json file

late hill
#

^^

#

oh

earnest phoenix
#
{
  "discu_chan": [
    {
      "chan_id": "642362119312113702"
    }
  ]
}```
@mossy vine i use lowdb
#

But later I'll use sqlite

mossy vine
#

oh why is this a thing

earnest phoenix
#

Hmm??

#

🤔

#

I didn't understand..

late hill
#

idk lowdb

#

log

#

db.get("discu_chan").find({ chan_id: channn }).value(); to console

#

what does it return

earnest phoenix
#

Okay

#
{ chan_id: '642362119312113702' }
#

I have this in the console

late hill
#

well

#

That's the problem

earnest phoenix
#

This is the good id

#

?

late hill
#

{ chan_id: '642362119312113702' } won't be equal to '642362119312113702'

earnest phoenix
#

Yet it is the id of my channel

#

Oh...

late hill
#

But your logic doesn't rly make sense

earnest phoenix
#

How can this be fixed?

late hill
#

I'd assume that if your search fails

#

As in you used find() but with a different channel id

earnest phoenix
#

Mmmh

late hill
#

it would probably return undefined ?

earnest phoenix
#

Oh

late hill
#

so you could just check the result

#

if there's no result

earnest phoenix
#

With anoter channel i have "undefined" in log console yes

late hill
#

it means it's the wrong channel

earnest phoenix
#

Yes

late hill
#

so you can use that in an if

earnest phoenix
late hill
#

you don't need to compare it with the channel id a second time

earnest phoenix
#

Hmm but how?

late hill
#

let channel = db.get(...
if (channel) { //code }

earnest phoenix
#

Oh okay

#

Why not ty ^^

chrome verge
#

is there any script translator?

quartz kindle
#

script translator?

chrome verge
#

ye

#

like a java get translated to vbs or lua or C++

earnest phoenix
#

Bug he spam bruh...

quartz kindle
#

i mean, the only way that would be remotely possible is if the languages are extremely similar

#

like typescript to javascript

#

but java to C i dont think so

chrome verge
#

Can anyone invent one

earnest phoenix
#

He deletes my message then sends it with a webhook, then it keeps deleting and sending it back @late hill

quartz kindle
#

they are completely different languages with completely different way of working and operating in different environments

earnest phoenix
#
client.on('message', async message => {
    var messageChannelID = message.channel.id;
    console.log(db.get("discu_chan").find({ chan_id: messageChannelID }).value())
    var chanIdInDB = db.get("discu_chan").find({ chan_id: messageChannelID }).value();
    if(chanIdInDB) {
        message.delete()
        await client.channels.find(q => q.name == message.channel.name).createWebhook(message.author.username, message.author.avatarURL).then(async mm => {        
          await mm.send(message.content) 
      }) 
    } else {
        await mm.delete()
    }
})```
#

@chrome verge you can't convert any langage

chrome verge
#

Can a machine learning AI translate to that excate operating

earnest phoenix
#

Good luck for this lol

chrome verge
#

well

#

ima ask google to make it xd

quartz kindle
#

if it were possible, people would have done so

earnest phoenix
#

x)

chrome verge
#

Me lazy to do so

quartz kindle
#

but no, people need to create emulators for that

chrome verge
#

Also making such an AI like this is hard

#

Like you need Tons of data sets for 100language

quartz kindle
#

the problem is not only the languages, but mostly the environment

chrome verge
#

and AI can have a gradient explodion

quartz kindle
#

for example, what good is translating C to javascript for example if javascript can only run inside a javascript engine

chrome verge
#

Like for example if the AI finds a int function(){}
he translate it to local function()end

#

example ^^^^

quartz kindle
#

yes, but that only works if the languages are extremely similar

#

and run in the same environment

chrome verge
#

can i give it a try?

quartz kindle
#

sure

chrome verge
#

or bad idea

earnest phoenix
#

when i restart my bot then before restart i saw it was 70k+ members in my bot status after resart it shows me 48+ members in my bot status every time

quartz kindle
#

bad idea imo

#

but go ahead

chrome verge
#

ok

earnest phoenix
#

@chrome verge you can convert c# to vb.net for example

quartz kindle
#

@earnest phoenix i already told you, its because of caching

earnest phoenix
#

i dont understand that

late hill
#

yeh @earnest phoenix because it replies to it's own

chrome verge
#

I will start with python to lua

earnest phoenix
#

caching

#

??

late hill
#

The message sent by the webhook

earnest phoenix
#

🤔

#

Yes

late hill
#

will fire the event again

earnest phoenix
#

Oh yes

late hill
#

so that'll keep going forever

earnest phoenix
#

MMmh

quartz kindle
#

@chrome verge what will you do when the code requires importing something?

earnest phoenix
#

means

chrome verge
#

Ahhh

#

Translate that import too

#

🤔

quartz kindle
#

lmao

earnest phoenix
#

but it is in my bot status

quartz kindle
#

what if the import is a native python module

chrome verge
#

it will translate it to nil

quartz kindle
#

lmao

chrome verge
#

or a list

earnest phoenix
#

:/

#

How to block webhook in this event?

chrome verge
#

anyways something None or null

late hill
#

I'm pretty sure if (message.author.bot) return; would get webhooks

quartz kindle
#

@earnest phoenix your bot never stores ALL members, because it takes too much memory

earnest phoenix
#

Ty

quartz kindle
#

it stores members as it needs them

earnest phoenix
#

@quartz kindle so how i store more thay that

quartz kindle
#

if you want to get an accurate member count, dont use users.size

#

use guild.memberCount

earnest phoenix
#

but it happens when i restart the bot

late hill
#

You should also consider caching that channel id

#

Because currently your bot will be fetching that from your "db" on every single message

earnest phoenix
#

its showing me guild id not define

late hill
#

You can't randomly use "guild"

#

If you wish to get the memberCount of a specific guild you'll have to get it's guild object

#

guilds are stored in client.guilds

earnest phoenix
#

example

late hill
#

you can grab one from there or what you probably want to do, go through them all and add up their member count

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

its their

quartz kindle
#

@earnest phoenix there is client, and client has guilds, and each guild has memberCount

#

so you need to use client.guilds and loop over all guilds and get the memberCount for each one

earnest phoenix
#

client.guilds.memberCount

#

like this

quartz kindle
#

you can use a for loop, or you can use .forEach() or you can use .reduce()

#

no

#

client.guilds.forEach(do something here with each guild)

amber fractal
#

Reduce would be the most compact, the for loops are easier to read and make.

earnest phoenix
#
var chan = args[0].replace(/\D/g,"")
    
    if (chan < 1) return message.channel.send("**:x: | Merci d'indiquer un channel.**")```

`Merci d'indiquer un channel = Please indicate a channel`

var chan = args[0].replace(/\D/g,"")
TypeError: Cannot read property 'replace' of undefined

Why he not return the message??
amber fractal
#

Why are you checking if a string is lessthan 1

mossy vine
#

args[0] undefined

amber fractal
#

Oh I didnt even see the error mmulu

earnest phoenix
#

@amber fractal for don't make crash the bot

amber fractal
#

But what cyber said

earnest phoenix
#

Yes but

#

I want if the value is undefined it returns an error message

amber fractal
#

Check if it's undefined

west spoke
#

try:
(Code)
except TypeError:
(ErrorCode)

amber fractal
#

Uh

earnest phoenix
#

@vernal willow i know but wait

west spoke
#

or before the replace

quartz kindle
#

thats not even js

#

lmao

amber fractal
#

That's not how js works

west spoke
#

I thought it was py

amber fractal
#

Worng language

west spoke
#

It looks like a py error aight?

earnest phoenix
#
var chan = args[0].replace(/\D/g,"")

    if (!chan) return message.channel.send("**:x: | Merci d'indiquer un channel.**")```

var chan = args[0].replace(/\D/g,"")
TypeError: Cannot read property 'replace' of undefined
quartz kindle
#

if(!args[0])

amber fractal
#

That will error anyways, you need to check args

earnest phoenix
#

Nope

#

I have test

modest maple
#

sure it would be easier to just do try; catch

earnest phoenix
#

@modest maple no

#

@vernal willow no i have already tested this...

vernal willow
#

then you're doing something wrong, checking for the args before anything else is correct

earnest phoenix
#
client.on('message', message => {
    if (message.content.startsWith(`${prefix}del-chan`)) {
        if (!message.member.permissions.has("MANAGE_MESSAGES")) {
        message.channel.send('Désolé tu n\'a pas la permission d\'utiliser la commande de add-chan.[MANAGE_MESSAGES] :x:');
        return;
    }
    let args = message.content.split(' ').slice(1);
    var chan = args[0].replace(/\D/g,"")

    if (!chan) return message.channel.send("**:x: | Merci d'indiquer un channel.**")
        //rest of the code
}});```
#

Mmmh

#

Okay

#

Already the same error

#
client.on('message', message => {
    if (message.content.startsWith(`${prefix}del-chan`)) {
        if (!message.member.permissions.has("MANAGE_MESSAGES")) {
        message.channel.send('Désolé tu n\'a pas la permission d\'utiliser la commande de add-chan.[MANAGE_MESSAGES] :x:');
        return;
    }
    let args = message.content.split(' ').slice(1);
    if (!args[0]) return message.channel.send("**:x: | Merci d'indiquer un channel.**")
    var chan = args[0].replace(/\D/g,"")

        //rest of code
        
    }
});```
#

Resolved ty

chrome verge
#

is there soemthing like loadstring() but in python??

#

No json.loads

#

loadstring

frozen cedar
#
if (!args.length) return message.channel.send(`You didn't pass any command to reload, ${message.author}!`);
const commandName = args[0].toLowerCase();
const command = message.client.commands.get(commandName)
    || message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));

if (!command) return message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`);
delete require.cache[require.resolve(`./${commandName}.js`)];
try {
    const newCommand = require(`./${commandName}.js`);
    message.client.commands.set(newCommand.name, newCommand);
    message.channel.send(`Command \`${commandName}\` was reloaded!`);

} catch (error) {
    console.log(error);
    message.channel.send(`There was an error while reloading a command \`${commandName}\`:\n\`${error.message}\``);
}```
#

Why does it always return Enmap require keys to be strings or numbers.?

#

Nvm, got it.

mossy vine
#

@chrome verge are you trying to read a file?

chrome verge
#

?

#

No

#

Like

#

In lua

#

loadstring("x=10 print(10)")

#

I want like that

#

but in python

mossy vine
#

what does that function do?

chrome verge
thorny turret
#

is there any bot that connect pinterest and discord

chrome verge
#

you can make one using requests

#

are u a dev tho

#

if not i can tell u how

#

@mossy vine It turns a string into a chunk of code

#

or compiles and run a string

thorny turret
#

pls tech me how

#

sir

chrome verge
#

what langauge you use?

mossy vine
#

@thorny turret doubt

#

@chrome verge eval()

chrome verge
#

ty so much!

solemn harness
#

hello

#

i wanna add user count too there

boreal yarrow
#

client.shard.broadcastEval(':busts_in_silhouette: Users:', client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString())

#

that is the total users count

solemn harness
#

ok

earnest phoenix
solemn harness
#

really

#

it's not spoonfeed

#

i just getting help

#

ok

amber fractal
#

Giving code directly relating to the exact solution of a problem is spoonfeeding

solemn harness
#

oh

sage bobcat
#

One message removed from a suspended account.

solemn harness
#

@boreal yarrow
Error [SyntaxError]: Unexpected token :
at Client._eval (C:\Users\ZaidYt\Desktop\Discord Bot\node_modules\discord.js\src\client\Client.js:507:17)
at ShardClientUtil._handleMessage (C:\Users\ZaidYt\Desktop\Discord Bot\node_modules\discord.js\src\sharding\ShardClientUtil.js:111:76)
at process.emit (events.js:208:15)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
name: 'SyntaxError'
}

#

GOT THIS ERROR

earnest phoenix
#

lol

#

Erase "👥 Users:"

#

@solemn harness ^

solemn harness
#

wait

earnest phoenix
#

Ok I'll waiting.

solemn harness
#

uff

#

i can't do this

earnest phoenix
#

OoF

#

can't do what?

#

client.shard.broadcastEval('client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString()')
Try

#

this is what happens when people spoon feed lol

amber fractal
#

You mean to tell me that when you give someone code they don't understand it and it errors? No way!

#

Almost like that's why spoonfeeding is bad

sudden geyser
#

will that even work

amber fractal
#

It wouldn't finish the job no

#

also I believe broadcastEval is already in respect to client

#

fetchClientValues() would be easier too

opaque eagle
#

Is there a way to un-electronify an app? I want to use electron apps without all the bloatware that comes with them

valid frigate
#

electron is tightly knit into applications that use it so idk man

#

have you googled yet

mossy vine
#

likely nof

#

not*

#

electron is basically chromium with access to system apis

#

and not having access to those system apis will likely fuck everything up

sand pivot
#

ce

quartz kindle
#

electron is basically node with an UI

frozen cedar
#

no!

thin quartz
#

How long does it generally take to have your bot reviewed for approval?
Been 8 days figure I'd ask to get an idea

west raptor
#

-faq 2 -c

gilded plankBOT
west raptor
#

@thin quartz

#

queue has been extremely big recently

#

so it will take longer

thin quartz
#

@west raptor thank you ! I appreciate the input. I'm not being pushy just asking for a typical idea of time frame

earnest phoenix
#

does

  member.guild.channels.get('638541831663124480').send("Welcome"); 
});```
only work on real users, and not bot?
#

I have a hard time testing if it actually work or not

summer torrent
#

Both

earnest phoenix
#

Because i have tried inviting bots to see if it work or not and it didn't do anything

#

damnit

viral plover
#

Hey, I'm working on a Discord bot in Javascript and there's three different variables I'm passing between two different functions.
Despite both functions changing the variables, the values of them keep resetting.
Two of the variables (one string, one integer) are declared using let outside of the two functions (in different functions that aren't being called multiple times) and the other variable (string) is global.
How do I get them to retain their values?

earnest phoenix
#

@earnest phoenix you can make it lol

earnest phoenix
#

Your explanation is flimsy, please visualize

viral plover
#

Does this help?

Function0() {
    let variable1 = 10;
    Function1(variable1);
}

Function1(variable1) {
    variable1--;
    Function2(variable1);
}

Function2(variable1) {
    if (variable1 == 5) {
        FunctionEnd();
    }
    else {
        Function1(variable1);
    }
}
copper cradle
#

you can't name your functions like that

#

lol

#

you can't have variable/function names as numbers

viral plover
#

It's an example.

valid frigate
#

what is with the whole jumping around functions for

#

just curious

oak imp
#

...I suppose the question I would ask is, exactly what are you trying to accomplish here?

viral plover
#

I guess the example was so simple that it's more confusing than helpful.

I'm trying to make something that allows for typos.
So there's a lot of comparing what the user inputted and the correct answer.
"Function1" edits their response a little and sends it to "Function2" when the first letters match.
If it doesn't match, "Function1" calls itself.
The integer mentioned earlier is how many typos they're allowed.

oak imp
#

You could accomplish that in a while loop..

#
while (number of typos left is greater than 0){
    do things
    typos allowed - 1
    if ( check things ){
        actions
    else
        stuff
}
viral plover
#

Yep, it uses a while loop.

oak imp
#

- squints at your example -

viral plover
#

The example was very simple. >.>

oak imp
#

Okay maybe I'm blind, but I don't see a while loop in there..

viral plover
#

The problem I presented was variables not retaining their value so I didn't include it. >.>

oak imp
#

Well, lemme give ya some advice lolz...

viral plover
#

Be more detailed?

oak imp
#

When asking for help from other developers, it's best to either include your actual code, or example code that's, yanno, very close to the actual thing.

#

For all we know, the variable value retention issue could be somewhere not at all related to your recursive functions

#

But as far as any of us can see, your code is quite literally three functions

#

And nothing else.

viral plover
#

There's so much I thought it would just be a bother. >.>
I'll post it in a moment since you're so willing to help~

oak imp
#

Eh... I personally am actually about to hop off, but this server is filled with alot of talented devs.. even if it's not me that helps, I'm sure someone can at least point ya in the right direction.

viral plover
#

I'll probably reformat my question and post the appropriate code in the future then.
I changed a little thing (after giving up after hours of fiddling earlier) and got it to work a bit for the first time.
So with hope I won't need to repost the question.

oak imp
#

One last pointer for ya as well; it would be a good thing to troubleshoot your code yourself first too. console.log() can be your best friend, printing out the current variable values as it loops through your functions.

viral plover
#

Yep!
It's helped a lot.

oak imp
#

lolz... it's honestly my best way to troubleshoot my own code, when I modify things with my own bots.

I would suggest, if you end up needing to, have each function itself print out variable values, along with individual counter variable values each time it loops through a function.

#

That might help you track down the bug faster.

#

Anywho I'm off

viral plover
#

I haven't implemented a counter since it's just been looping infinitely until I stop it, but I might give it a try.

#

Bye~
Thanks for the help~

oak imp
frozen cedar
#

Alright, so I have a function that runs on a for each and in each loop it checks if a condition is met. Here is a hypothetical scenario (very plausible with my bot):

On loop 1-15 (a random number) of the for each loop, the required condition is met and the user will get/keep a prespecified role

On loop 15 (again a random number) of the for each loop, the required condition is not met and the user has the role removed

How can I fix this so that if the condition is met just once, the role will persist throughout the for each loop regardless of other condition meets/nonmeets? I don't want to break/return out of the loop. This is nodejs.

unkempt palm
#

hi guys, does a bot need any permissions to do this? guild.owner.send("MSG"); is there any scenario where it could fail and return error? thanks

mossy vine
#

if the guild owner has blocked the bot or has DMs closed

unkempt palm
#

may I show you the code?

mossy vine
#

is there anything else thats relevant?

unkempt palm
#

thanks, actually I had no idea how to check if bot is blocked or DM closed 🙂

#

will google, thx again

earnest phoenix
#

thanks to discord the only way to check is to send a message to the user

mossy vine
#

oh yeah

#

@unkempt palm ^

unkempt palm
#

I read about it, you can only use a .catch but pretty useless in my case 🙂

#

still would be much better to have checks instead of attempts 🙂

mossy vine
#

blame discord

outer moon
#

hello

#

is there a minimum server requirement to reveal that widget??

quartz kindle
#

no

#

you need to post it yourself

earnest phoenix
#

@outer moon u need to code it in ur main bot filr

outer moon
#

add ${client.guilds.size} or?

#

sir

twilit rapids
#

If you have any questions about it you can ask them in #topgg-api

outer moon
#

really thanks @twilit rapids

twilit rapids
#

No problem

earnest phoenix
#

Can you use localhost ( MongoDB) as well?

late hill
#

what

mossy vine
#

what

sterile minnow
#

Has someone a idea how to check the Voice connections from a bot with the normal discord.js api?

#

Should be the newest version

mossy vine
#

stable or master? @sterile minnow

sterile minnow
#

Wdym?

#

Should be stable

mossy vine
#

Client#voiceConnections

sterile minnow
#

The newest official

mossy vine
#

its voiceConnections

#

also 'of undefined'

#

so theres probably more fucky shit going on

late hill
#

It's also better not to send error messages to the end user like that

mossy vine
#

oh you are straight up doing Client.voiceConnections arent you

sterile minnow
#

this.client.voiceConnections

#

@late hill wdym?

late hill
#

I assume if the command has an error, it displays the error as in your screenshot

mossy vine
#

then this.client is undefined

sterile minnow
#

Jep

late hill
#

A regular user shouldn't see errors like that

sterile minnow
#

I think only !e see that

#

The Bot is in Alpha there are errors normal

#

.array is shitier

late hill
#

Anyway, if you need help with the code to resolve the client undefined, you're gonna have to post the code wuahh

sterile minnow
#

I have admin handy cause I dont have a pc here

#

Hand*

#

But why ist this not going?

late hill
#

Because this isn't your client I guess

sterile minnow
#

Wait

#

Ah

late hill
#

this is probably nothing or an empty object in there

sterile minnow
#

I have it

late hill
#

👀

sterile minnow
#

Thx

#

But the Problem is he loggs the Voice connections from this Instance but he has 3 (Main, Radio, Music) how do he loggs every connection?

late hill
#

Fetch the amount of connections from the other instances

sterile minnow
#

And how?

late hill
#

idk how you split them up

#

Did you create 3 different clients or ?

sterile minnow
#

Yeah all inctances are logged in in Pika but Music and Radio are in a other hoster

late hill
#

oh like that

sterile minnow
#

Cause main hoster has Traffic Limit

#

But main hoster is better

#

But cannot stream something

late hill
#

well you'd need some form of connection between them

sterile minnow
#

And how?

quartz kindle
#

if you have processes running on separate machines, you need to communicate via network

#

you have to make some sort of API

sterile minnow
#

I have a API for my database to watch the stuff on web

#

But Pascal (a other dev from pika) has coded this

#

But i dont know how to make thia lol

quartz kindle
#

have each instance run an http server

#

and then send requests to each other's ip addresses

runic grotto
#

@earnest phoenix @thick cipher

earnest phoenix
#

@earnest phoenix

earnest phoenix
#

@outer moon noo not that

#

client.guilds.size is for bot not dbl api

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#
- client.shard.broadcastEval("(this.shard.id + '-' + this.ws.ping + '-') + (this.ws.shards.status === 0 ? '💚' : '💔') console.log('hi')")
+ client.shard.broadcastEval("(this.shard.id + '-' + this.ws.ping + '-') + (this.ws.shards.status === 0 ? '💚' : '💔'); console.log('hi')")
summer torrent
#

; ?

late hill
#

yes

#

If you're putting multiple statements on 1 line you'll have to use ;

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

if you have 3 shards that makes sense

late hill
#

^^

sage bobcat
#

One message removed from a suspended account.

late hill
#

what

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

late hill
#

?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

yeah

#

thats how it should work

sage bobcat
#

One message removed from a suspended account.

mossy vine
#
script = "code here"
client.shard ? client.shard.broadcastEval(script) : eval(script)```
#

at least i think that will work

sterile minnow
#

Can someone help me?

#

(The pictures)

mossy vine
#

log is undefined

#

also bot.channels.get is gonna return undefined, as its outside of the ready event, which is emitted when channels are cached

sterile minnow
#

F*ck

#

Then i can forget it

mossy vine
#

??

#

i told you how to fix it

#

well sort of

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

oh god what

#

show your whole code

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

missing a closing ) on line 2

late hill
#

bruh

#

you meant to put the script in script, no?

sage bobcat
#

One message removed from a suspended account.

late hill
#

so just the string..?

sage bobcat
#

One message removed from a suspended account.

mossy vine
#
- script = client.shard.broadcastEval("(this.shard.id + '-' + this.ws.ping + '-') + (this.ws.shards.status === 0 ? '💚' : '💔'); console.log('hi')"
+ script = client.shard.broadcastEval("(this.shard.id + '-' + this.ws.ping + '-') + (this.ws.shards.status === 0 ? '💚' : '💔'); console.log('hi')")```
#

oh

#

let script =

#

i keep forgetting what language im supposed to be writing

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

huh what

late hill
#

Pretty sure you meant to do this

let script = "script here"
client.shard ? client.shard.broadcastEval(script) : eval(script)```
#

you're already doing the broadcasteval

#

which will make script a promise

sage bobcat
#

One message removed from a suspended account.

late hill
#

so you're just sending a promise to broadcastEval/eval

mossy vine
#

also send your current code pls

#

cuz just errors is pretty useless

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

wat

mossy vine
#

escape all 's in the string

late hill
#

..

#

I still don't know what you're trying to achieve

mossy vine
#

wait what

late hill
#

But that right there could still broadcastEval a broadcastEval

mossy vine
#

^

late hill
#

And that probably aint it

mossy vine
#

yeah i just noticed

#

im blind sorry

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#
module.exports.run = async (client, message, args) => {
  const script = "(this.shard.id + '-' + this.ws.ping + '-') + (this.ws.shards.status === 0 ? '💚' : '💔'); console.log(\"hi\")"
  client.shard ? client.shard.broadcastEval(script) : eval(script)
}

module.exports.info = {
  name: 'shards',
  aliases: ['shardstats']
}```
earnest phoenix
#

Why it normal evaling?

mossy vine
#

simpler than repeating yourself

#

user input never touches eval input, so it is considered safe

sage bobcat
#

One message removed from a suspended account.

late hill
#

this is probably just {}

#

In the case of regular evaling

sage bobcat
#

One message removed from a suspended account.

late hill
#

You're trying to get stats of shard 0 without having shards?

#

You mean like

#

Your bot isn't sharded

sage bobcat
#

One message removed from a suspended account.

late hill
#

then just use stuff like client.ping or something

#

??

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

late hill
#

🤷

#

I use eris

sage bobcat
#

One message removed from a suspended account.

late hill
#

where client always has shards

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

the way discord.net handles it is basically wraps multiple clients into one

#

sharded client -> collection of discord client with separate shard ids

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

also you probably shouldn't look at nadeko for a reference to discord.net

#

nadeko is a clusterfuck and kwoth is stubborn

sick cloud
#

are there any common reasons why express doesn't get any form data from a post

#

all it gets is {}

mossy vine
#

first reason i can think of is there is actually no data being sent

sick cloud
#

do the fields need a property to be detected maybe

#

i've set an id to them all but idk

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

@fossil oxide can you help

#

me?

loud salmon
#

@earnest phoenix dont ping him facepalm

earnest phoenix
#

iam sorry

#

error found : TypeError: Cannot read property 'botName' of undefined

quartz kindle
#

why are you using request and fetch? why are you requesting it twice?

#

you return the body outside of the promise, so body doesnt exist

split hazel
#

if an error like
DiscordAPIError: Unknown Member

gets spammed, could it lead to a 429 ip ban?

#

since its making alot of failed requests to the api

earnest phoenix
#

yes

#

429 is a ratelimit status code

#

hitting too many 429, 404 and something else will load to an api ban

#

also it depends whether the request is a rest request or not

slender thistle
#

Wasn't it 401, 403, and 429?

earnest phoenix
#

ah yeah

#

my bad

earnest phoenix
#
if ('1' == true) {
    console.log('true')
    //logs true
}
#

wait how does this work?

#

how that works? well, everything that's not 0, null, "" or anything like that is considered true

split hazel
#

Is there any return limit in reaction.users.fetch

#

or does it return all the users that reacted

earnest phoenix
#

uhm... I think all

#

Is there a way that I can make user specific variables? I tried making a variable called "${member}Type" but that did not work.

frozen cedar
#
        var persist = JSON.parse(persist1);

SyntaxError: Unexpected token o in JSON at position 1

Uh, what is wrong with this?

earnest phoenix
#

JSON.parse expects a string

#

you gave it an json object, the correct way to do it would just be var persist = persist1;

frozen cedar
#

Thanks

late hill
#

should be 100 @split hazel

split hazel
#

so it only returns a max of 100 reacted users?

late hill
#

the limit defaults to 100

#

But I'm pretty sure you can only decrease it

#

if you need more than 100 you could use the before/after option

#

and fetch them using multiple calls

earnest phoenix
#

top.gg ignored my javascript in the detailed description of my bot, now how am I gonna make a server count for my bot and show it in the description?

#

well, I already have an url in which it automatically stores the server count, but how am I gonna link that to my description?

#

anchor tags exist

slender thistle
#

You can just send a POST request and the server count will be shown

#

Why would you need it in the desc

earnest phoenix
#

idk, it looks kinda empty

#

and anchor tags ain't what I'm looking for

quartz kindle
#

javascript in the description is only available for certified bots

earnest phoenix
#

oof

#

k

quartz kindle
#

you can show your server count with an iframe or even have your url return an image of the count and place it in an img tag lol

quartz kindle
#

also, you have the dbl widget after your bot is approved, which you can also post in the description

split hazel
#

question is it possible to return data from a function without using "return"

#

kind of like eval()

modest maple
#

Use global variables

#

Only other way I believe

mossy vine
#

actually it is possible

#

wait no nvm

#

@split hazel why wouldnt you want to use return anyways

split hazel
#

i want it to work like eval but asynchronously

#

eval((async() => {code}))

mossy vine
#

so why not just promisify eval? wouldnt that work?

split hazel
#

if only i was told this existed earlier

mossy vine
#

?

split hazel
#

oh sorry i misunderstood what you said

#

and what do you mean by that

near ether
#

How can I use a single mongodb connection in my entire program across multiple files?

mossy vine
#

so you want the eval function to be asynchronous?

#

as in, return a promise?

#

or execute async code?

split hazel
#

yes, so you can also use await

#

without using retunr pretty much

mossy vine
#

@near ether pass the connection object between the functions

near ether
#

Does that work for u?

mossy vine
#

yes

#

working perfectly

near ether
#

You’re passing what exactly, the “mongoclient.connect” part?

mossy vine
#

no

#

are you using regular mongodb node driver or mongoose

near ether
#

Regular driver

mossy vine
#

uhh gimme a sec then, i dont know if its the same

near ether
#

Would you recommend mongoose over the driver?

mossy vine
#

depends on your use case

#

there isnt much difference

near ether
#

Honestly if it makes passing around a single connection easier, then I’m all for it lol

#

Because I don’t think creating a new connection every time I need to access the database is the right move

#

Probably very inefficient

mossy vine
#

yeah its not the best idea

near ether
#

Thanks my dude

mossy vine
#

okay i have no idea what its called (or if it even exists in regular driver)

#

okay i think i got it

split hazel
#

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type Function. Received type string

#

when i try run
util.promisify(code)

mossy vine
#

what is code

split hazel
#

something like
"1 + 1"

mossy vine
#

util.promisify is not eval

#

it is used to promisify a function

near ether
#

Yo Cyber, what are you passing around in mongoose?

#

For connection

mossy vine
#

hold up, i got what you need

#

<MongoClient>.connect(bla, bla, async (err, data) => {
someVariableDefinedOutsideOfCallback = await data.db('coolDatabase')
//pass that variable to other functions
})

near ether
#

yknow, thats exactly what ive been trying for a while now

mossy vine
#

oh

near ether
#

lmao

#

yea using the driver is a PITA if you wanna pass around a single connection, so im probably gonna join mongoose gang

earnest phoenix
#

Hello

mossy vine
#

tbf i dont take advantage of most features mongoose offers

#

i simply dont need them

earnest phoenix
#

hi who would do a reboot command please

mossy vine
#

using mongoose the connection will just be mongoose.connection

#

@earnest phoenix we dont spoonfeed here

#

if you are using a process manager that restarts your bot when it stops, simply stopping the process is enough

near ether
#

ah gotcha

#

tyty

mossy vine
#

here is an example from my current project in case it doesnt work for you

#
const mongoose = require('mongoose')
const db = mongoose.connection
mongoose.connect('mongodb://localhost:27017/AAAAAAAAAAAAAAAAAAAAA', { useNewUrlParser: true, useUnifiedTopology: true })```
near ether
#

AAAAAAAAAAAAAA

#

Lmao thanks man

#

Appreciate it 🙏

earnest phoenix
#

@mossy vineI know but I would like to commende

mossy vine
#

order what? a pizza?

earnest phoenix
#

In command with the <commands> folder

#

Sorry if my english is not terrible

#

@mossy vine

#

mongoose bad driver good

solar wraith
#

can i make a discord bot using C# and XML?

#

just a question?

earnest phoenix
#

if a language can make api calls

#

you can make a bot with it

valid frigate
#

people choose node because of its non blocking io meaning it doesnt wait for a request to finish on a thread

#

in basic terms it's a good candidate for applications like discord bots, however it's your choice

solar wraith
#

Feck i keep gettin the boot from discord api since its complaining my fricking token is invalid

#

But it is valid

#

I regened it several times

mossy vine
#

@solar wraith are you sure you are getting the token and not client secret

solar wraith
#

Yes

mossy vine
#

also making a bot with xml???

solar wraith
#

no just storing the key there

#

But not calling it and just havin it in the code

#

so in the main file

modest maple
#

Don't store the token in XML file or any file without remembering to remove the \n from jt

#

When it gets read it automatically has a \n at the end to show new line

fickle anvil
#
const taggedUser = message.mentions.users.first();
taggedUser.setNickname(NewName,'Request via §rename by ' + message.author.username);```

Why does it tell me, that taggedUser.setNickname is not a valid function ?
#

taggedUser.avatarURL works

earnest phoenix
#

because setNickname is located on a GuildMember

fickle anvil
#

how can I fetch it then? message.mentions.guildmember.first(); ?

amber fractal
#

how about some docs

fickle anvil
#

Well, how about closing the channel with a pinned message with a link to docs, then no one asks...

amber fractal
#

because some people need more help

#

this is one word change

#

if you need more help on that then idk

fickle anvil
#

If it is that easy, whyraging that much about someone that doesn't know everything inside out instead of saying that one word together with the link and something like "read more about it here" instead of that... <.<

earnest phoenix
#

because if you do it yourself it will more likely stick with you

#

and it encourages doing research by yourself

fickle anvil
#

Because you know if I didn't already try around with that for an hour or not. Please don't be so highnosey. If the question is unworthy, just don't answer. Not everyone is a super duper pro.

sudden geyser
#

It's one mistyping you can find on the docs how to fix. Just look through the properties and you'll see it

amber fractal
#

It's literally one word

#

located on the docs I send

#

and says member in the description

fickle anvil
#

My text was not against the link per se but against the rest of the text from him. Worked now and could finish what I tried. Thanks.

earnest phoenix
#

Hey, i got my Raspberry PI 3B+ few days ago. I am setting an website (www) but it won't work...
I have my local ip (that the page is working) and raspberry ip (static) but it's not working.
Any help?

west spoke
#

rpi IP isn't static. The local IP needs to be static, you should run that through your internet company @earnest phoenix

#
ports = serial.tools.list_ports_windows.iterate_comports()

print(list(ports))```
ight am trying to just at this point list out the connected drives, or usb stuff, idk if I'm using the right thing, but the only thing it outputs is `[]`
earnest phoenix
#

@west spoke can you Tell me how?

west spoke
#

google

#

you need to talk to your provider

#

and I believe a static IP costs more

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

Anyone here use Discord development bot in phone?

loud salmon
#

@earnest phoenix yes, some people have. but its comparable to using your toilet bowl as a cereal bowl

lapis merlin
sinful lotus
#

do you know js

lapis merlin
#

r e a d

loud salmon
#

he asked you a question

#

to clarify it

valid frigate
#

lol wait

loud salmon
#

also, did you read the error?

#

its a simple one

lapis merlin
#

hmmm

valid frigate
#

"unexpected identifier"

low wasp
#

Restart you editor if you can't see text

valid frigate
#

what kind of advice is that

lapis merlin
#

okay

#

@lapis merlin What

#

My nick

#

:,(

sinful lotus
#

you clearly dont know js

#

thats why I asked you

#

with basic knowledge of js you wont get that error

lapis merlin
#

:)

#

Read the code, then read the error @sinful lotus

sinful lotus
#

how about you read the code then read the error

lapis merlin
#

okay

sinful lotus
#

or better dont use glitch

lapis merlin
#

yep

sinful lotus
#

and host it on something like 2 dollars vps

#

either your code is bad or glitch is bugging

earnest phoenix
#

glitch has a lot of bugs

#

so

low wasp
#

Using glitch for what looks like a music bot (ytdl-core, youtube-api) will be horrible

lapis merlin
#

yep

#

:/

sinful lotus
#

go code it on a proper editor, then deploy it on a vps

#

if that fixed your problem

#

then glitch bad

#

if not then code bad

earnest phoenix
#

what glitch's editor isn't a proper editor ???

sinful lotus
#

yes

#

I hate it

earnest phoenix
#

Glitch's editor completely breaks code sometimes

lapis merlin
#

Going back to VS code...

valid frigate
#

glitch is not a reliable hosting platform so if you're testing your bot, use your local machine

#

you control the process, and you can keep it it on for as long as you want instead of having the bot shut off every what 30 minutes

lapis merlin
#

okay

valid frigate
#

k 👌

lapis merlin
sudden geyser
#

if (err) undefined; that doesn't do anything.

lapis merlin
#

lol

#

yep

west raptor
#

Ngl I used to have the same thought process

lapis merlin
#

hmmm

#

@west raptor Before you ask me, Yes I am new to programming

west raptor
#

I wasn't..?

lapis merlin
#

I can do some wrong things because I'm still learning and I can make some mistakes

west raptor
#

I mean yeah..?