#development

1 messages · Page 1935 of 1

earnest phoenix
#

me?

lyric mountain
#

that's known as sql dump or backup

lyric mountain
#

ah wait

#

yeah, you

#

nvm, didn't notice u actually answered

solemn jolt
lyric mountain
#

you can't connect to a sql dump

earnest phoenix
#

i fixed things you said

lyric mountain
#

that's technically a text file

#

you need to import that data into an actual database

lyric mountain
#

first of all, how did you get those files? an assignment?

solemn jolt
#

this is open source code i get in website

lyric mountain
#

that's not good, internet is not a free code buffet

#

you need to understand what you're copying/cloning

#

also, most open source repos will have setup instructions on the readme

solemn jolt
#

thid code dont have readme

lyric mountain
#

where did you get that?

royal herald
#
var frame = document.createElement("div");
frame.innerHTML = `hi`
    frame.style.position = 'fixed';
    frame.style.border = 'none';
    frame.style.boxShadow = '0 20px 32px -8px rgba(9,20,66,0.25)';
    frame.style.zIndex = '9999';
    frame.style.transition = 'left 1s ease, bottom 1s ease, right 1s ease';
document.body.appendChild(frame)
``` this wont show up
royal herald
#

anyways

#

why doesnt it show up doe

earnest phoenix
#

Abc is interaction.guild.members.fetch().forEach()

lyric mountain
royal herald
#

and i didint make that code lmao

lyric mountain
#

let's fix it step by step, replace var with let

royal herald
#

i did

#

i wanna show a opt out button from the new theme i made

lyric mountain
#

try setting a fixed width and height and a bright colored background color to see if it's indeed being created (and where)

royal herald
#

it does indeed being created

lyric mountain
#

what is supposed to be inside it?

royal herald
#

an html

#

code of opting out

lyric mountain
#

hmm...code inside the div?

royal herald
#

since it counts as ads i will remove the url

lyric mountain
#

ah nvm, now I see what u did

#

does the inner html contain meaningful dimensions?

#

like width or height?

royal herald
#

nah

lyric mountain
#

it might be being created with 0x0 dims

royal herald
#

it just ```js
frame.innerHTML = <a href="https://discord.com">Close Christmas theme</a></center>

#

i put discordcom u know why

royal herald
lament rock
#

if (false) return
else if (true) addRoles()

if there is an else if to a chain, it goes to the next conditional statement until something is true or all conditionals are false or reaches an else

earnest phoenix
#

Okay i know it

#

And else if(seçenk == ver) it will return true

royal herald
#

seçenk?

earnest phoenix
#

Turkish word

#

Meaning options

#

I tried all ways but still it gives to all users or dont give anyone

royal herald
earnest phoenix
#

is there a way to divide this in parts of 100? because when 100+ servers it surpasses the embed's addfield limit and someday it'll pass description too so i want it to send many embeds dividing it or i use like <prefi>guilds part2/2

#
client.guilds.cache.map(r => r.name).join(". \n\n")
#

this

royal herald
#

ah

#

use lodash

earnest phoenix
#
        const members = await i.guild.members.fetch();
        const bots = members.filter(a => a.bot);
        const users = members.filter(a => !a.bot);

        await i.reply("Hello")

            if(hedef === "bots")
            {
                bots.map(async(bot) => {

                    console.log(bot.tag);

                    if(seçenek === "ver") 
                    {
                        console.log("+")
                            await bot.roles.add(role)
                            .then(() => console.log("Sucsess"))
                            .catch(() => {
                                i.deferReply("Birşeyler ters gitti. Botun izinlerini kontrol et");
                            });
                    }

                    else if(seçenek === "al")
                    {
                        console.log("-")
                            await bot.roles.remove(role)
                            .then(() => console.log("Sucsess"))
                            .catch(() => {
                                i.deferReply("Birşeyler ters gitti. Botun izinlerini kontrol et");
                            });
                    }
                });
            }
royal herald
#

yo i made it

#

@lyric mountain ty

lyric mountain
#

yw

lyric mountain
earnest phoenix
#

@lyric mountain does this code any error ?

royal herald
#

where did u define seçenek hedef etc

earnest phoenix
#

İnteraction options

boreal iron
#

Well on mobile… it looks better than before

#

A lot of issues are gone

earnest phoenix
#

Yes i noticed

boreal iron
#

Do you use the filters somewhere or am I blind?

earnest phoenix
#

I used

#

For filter bots

#

Ohhh

#

I noticed

#

a.user

#

Not a

#

Finally i did

lyric mountain
#

if my guess is right, you cloned a school project of someone, congratz

cinder patio
#

oop

earnest phoenix
#

moved to v13 rn and "copied" a tutorial's slash command system where you need to deploy them and they aren't added from the start

#
/home/runner/NodeJS-16/node_modules/discord.js/src/rest/RequestHandler.js:349
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Missing Access
    at RequestHandler.execute (/home/runner/NodeJS-16/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/runner/NodeJS-16/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
    at async GuildApplicationCommandManager.set (/home/runner/NodeJS-16/node_modules/discord.js/src/managers/ApplicationCommandManager.js:146:18) {
  method: 'put',
  path: '/applications/859126712432197654/guilds/859123414395256892/commands',
  code: 50001,
  httpStatus: 403,
  requestData: {
lyric mountain
earnest phoenix
#

how i get that

earnest phoenix
lyric mountain
#

that

slender wagon
#

is mariadb pog?/

#

i need to use that on one of my projects but it's my first time moving away from mongodb

spark flint
#

i use mariadb

#

its the same as mysql

#

its easy to understand

lament rock
#

Maria is faster than MySQL

#

it's a compatible fork

spark flint
#

yep

lament rock
#

If you wanted an sql DB which has as much throughput potential as possible, probably postgres would be the best option

boreal iron
#

Not only faster also got rid of tons of issues Oracle doesn’t care about fixing

rose warren
#

Postgres is a great option for sure

quartz kindle
#

just post here

sudden geyser
earnest phoenix
wheat mesa
#

I mean technically

#

Imagine writing data and trying to stay under ratelimits though lmfao

quartz kindle
#

its on github

#

discord-db or discord-fs

#

i dont remember

#

i think someone made a whole remote disk that syncs with discord lmao

#

those projects are old tho, doubt they still work

sudden geyser
#

someone did it as a joke I remember

earnest phoenix
sudden geyser
#

but people took it seriously and unironically used it

#

lonely soul

earnest phoenix
#

lol

earnest phoenix
#

this thingy?

#

lmfao and its made in go

quartz kindle
#

yes lmao

#

the readme is also golden

earnest phoenix
#

Thats so weird

quaint wasp
#

ayo

#

umm

#

does anyone know how to fix this error?

#
 [antiCrash] :: Uncaught Exception/Catch (MONITOR)
TypeError: this.options.embeds?.map is not a function

 origin:

 unhandledRejection
 [antiCrash] :: Uncaught Exception/Catch
TypeError: this.options.embeds?.map is not a function
    at MessagePayload.resolveData (C:\My Projects\ella\v13-ella-main\v13-ella-main\node_modules\discord.js\src\structures\MessagePayload.js:184:36)
    at TextChannel.send (C:\My Projects\ella\v13-ella-main\v13-ella-main\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:168:61)
    at Object.execute (C:\My Projects\ella\v13-ella-main\v13-ella-main\commands\premium\premiumStats.js:20:36)
    at Client.<anonymous> (C:\My Projects\ella\v13-ella-main\v13-ella-main\index.js:624:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) unhandledRejection
#

index line 624: ```js
command.execute(client, message, args, eco, db);

#

line 20: ```js
return message.channel.send({ embeds: supportYe })

#

the embed: ```js
const supportYe = new Discord.MessageEmbed()
.setTitle('Premium Status')
.setDescription('This is the support server. It is obviously premium')
.setFooter('Thanks for being here. :)')

#

ohhhh

#

waittt

#

I need to make the embeds an array

wheat mesa
quaint wasp
#

F

#
const Discord = require('discord.js')
        const quiz = require('../../jsons/quiziz/weather-quiz.json');
module.exports = {
    name: "weather-quiz",
    aliases: ["w-q", "w-quiz"],
    category: "quiz",
    description: "Get quized!",
    usage: "animal-quiz",
    execute(client, message, args) {

    const item = quiz[Math.floor(Math.random() * quiz.length)];

message.channel.send({ content: item.question }).then(() => {

    const filter = response => {
    return item.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
};

    message.channel.awaitMessages({ filter, max: 1, time: 30000 }) //, errors: ['time'] 
        .then(collected => {
            const yep = new Discord.MessageEmbed()
            .setTitle('Correct!')
            .addField('Question:', item.question)
            .addField('Question ID', item.number)
            .addField('Winner:', collected.first().author)
            .setFooter('Cograts! Any questions or think something isnt right? Head over the to the support server and ask it with the question number!')
            message.channel.send({ embeds: [yep] });
        })
        .catch(collected => {
            const nope = new Discord.MessageEmbed()
            .setTitle('Oops')
            .setDescription(`Looks like no one got the answer this time. \n Question ID: ${item.number}`)
            .setFooter('Think something is wrong here? Go ask in our support server with the question number!')
            message.channel.send({ embeds: [nope] });
        });
});

    }
}```
#

hey

#

when I do the command

#

in v12, it works fine

#

but.. now it replies with the nope embed even when its correct

#

can I know what changed and what I got to do?

#

ping in replies

quaint wasp
#

??

#

it isnt stopping it

earnest phoenix
#

also you say it is replying with the nope embed even when there is no error?

quaint wasp
#

yea

#

even if its correct it imideatly says the nope embed and not the yep

earnest phoenix
#

you need to give it an error

#

errors: ['time']

#

iirc

#

o

earnest phoenix
#

I am not entirely sure what could be causing this but I still feel like it is an issue of not supplying it an errors thing cause i see nothing wrong here

quaint wasp
#

yeah. I got the error out to see if it works but it also doesnt work

earnest phoenix
#

I don't really see anything wrong with it

boreal iron
quaint wasp
#

yeah

boreal iron
#

You may wanna read the docs then

#

There’s no filter anymore

#

That’s just a valid parameter if you use createMessageCollector

#

There’s no time option for awaitMessages as well

#

Just a limit

quaint wasp
#

oh thanks

earnest phoenix
#

Anyone know if Bump Bots are 100% against Dev ToS?

I hear it's okay if you are not like selling "auto-bumps" features etc.

But I also hear that any Verified Bump Bots will get Unverified, is that true?

lyric mountain
#

Define "bump bots"

boreal iron
#

Glad you asked…
Thought it’s just me old brick don’t know what that means

lyric mountain
#

I mean, if it's a DM ads bot then the answer is pretty clear I guess.

cinder patio
#

bruh

woeful pike
#

oh nvm guys smashing this vase with a hammer made it fit in my suitcase

solemn jolt
#

why when i click to ctr plus enter i dont get anything

boreal iron
#

Dunno where you defined that but there are interactions like buttons interactions which don’t have a command name.

earnest phoenix
#

typescript is just javascript but with a lot of : any

#

not a single person in existence uses typescript without the any type

earnest phoenix
#

anyone that can help me script a command

pearl trail
earnest phoenix
#

okay

#

@bot.command()
async def tarot(ctx):
responses (["...."])
await ctx.send(f"{random.choice(responses)}")

#

i want to make it so if i say draw (1-10) it draws 10 of the responses

pale vessel
#

Improvise. Adapt. Overcome.

earnest phoenix
#

or f.ex draw 5 and it draws 5

#
client.on('message', async message => {
    if(message.content === '!setup'){
        if (message.author.id !== '852930681985171506') { return message.reply({content:'This Command Is Owner Only Command'}) }
        const row = new MessageActionRow()
        .addComponents(
            new MessageButton()
            .setCustomId('primary')
            .setLabel("Verify")
            .setStyle("PRIMARY")
        )

        const embed = new discord.MessageEmbed()
        .setTitle('VERIFICATION')
        .setDescription('Click on `Verify` Button To Get Verified')
        .setColor('RED')

        message.channel.send({
            embeds : [embed],
            components : [row]
        })
        
    }

})```
#

can someone help

#

Message event became messageCreate in v13

earnest phoenix
earnest phoenix
#

and

#

You defined discord.js as message button and messageactionrow and then you defined it as discord

#

like

#

const { MessageActionRow, MessageButton } = require('discord.js');

#

and const discord = require('discord.js');

#

just use const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');

#

also if you are going to give a role or anything after clicking the button you should set up a collector

indigo magnet
#

How do I disable the bot message when someone levels up?

vast cedar
#
let offlineMembers = (await message.guild.members.fetch()).map(m => m.presence.status)
log(offlineMembers)

Why it say TypeError: Cannot read properties of null (reading 'status')

The presence object is like this

Presence {
    userId: '837297268704280598',
    guild: [Guild],
    status: 'dnd',
    activities: [],
    clientStatus: [Object]
  },

So i dont understand why it does not work

quartz kindle
#

do you have the presences intent enabled?

vast cedar
#

yes

quartz kindle
#

.fetch({ withPresences: true })

vast cedar
#

i fixed it like this ```js
let offlineMembers = (await message.guild.members.fetch()).filter(m => m.presence == null)
log(offlineMembers.size)

vast cedar
#

i tried .fetch({ withPresences: true }) but it always say TypeError: Cannot read properties of null (reading 'status')

#

The presence array look like this

  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  Presence {
    userId: '674983221645148220',
    guild: Guild {
      id: '815022775174744596',
      name: 'Night Club 🍸',
      icon: '00687e7b0e7da41fb3a974b2aa053560',
      features: [Array],
      commands: [GuildApplicationCommandManager],
      members: [GuildMemberManager],
      channels: [GuildChannelManager],
      bans: [GuildBanManager],
      roles: [RoleManager],
      presences: PresenceManager {},
      voiceStates: [VoiceStateManager],
      stageInstances: [StageInstanceManager],
      invites: [GuildInviteManager],
      deleted: false,
      available: true,
      shardId: 0,
      splash: null,
      banner: null,
      description: 'GIF SERVER',
      verificationLevel: 'LOW',
      vanityURLCode: null,
      nsfwLevel: 'DEFAULT',
      discoverySplash: null,
      memberCount: 181300,
      large: true,
      applicationId: null,
      afkTimeout: 300,
      afkChannelId: null,
      systemChannelId: '915888064268730398',
      premiumTier: 'TIER_1',
      premiumSubscriptionCount: 2,
      explicitContentFilter: 'ALL_MEMBERS',
      mfaLevel: 'NONE',
      joinedTimestamp: 1638975038461,
      defaultMessageNotifications: 'ONLY_MENTIONS',
      systemChannelFlags: [SystemChannelFlags],
      maximumMembers: 250000,
      maximumPresences: null,
      approximateMemberCount: null,
      approximatePresenceCount: null,
      vanityURLUses: null,
      rulesChannelId: null,
      publicUpdatesChannelId: null,
      preferredLocale: 'en-US',
      ownerId: '822894865187733524',
      emojis: [GuildEmojiManager],
      stickers: [GuildStickerManager]
    },
    status: 'idle',
    activities: [],
    clientStatus: { desktop: 'idle' }
  },
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  null,
  ... 181200 more items
]
quartz kindle
#

(await message.guild.members.fetch({ withPresences: true })).filter(m => !m.presence || m.presence.status === "offline")

#

are you sure you have the presences intent enabled tho? you should not have so many null presences with it enabled

vast cedar
quartz kindle
#

do you have them both enabled in the code as well?

earnest phoenix
#

Is there a way to make new lines in a <p> tag work properly without using a <pre>?

lyric mountain
#

br

vast cedar
earnest phoenix
lyric mountain
#

afaik <br> is rendered into CRLF, so screen readers wouldn't read it

#

you cant have id with url

#

they are mutually exclusive

#

you could also have read it on the error

#

translate the error then

earnest phoenix
#

alr no accessibility errors

#

I hope I didn't do anything dumb

earnest phoenix
cinder patio
#

how would that make the page less accessible? Putting it in another p tag or using CSS to make space is better than using pre or br

earnest phoenix
#

are you kidding me

eternal osprey
#

Hey, how would I actually catch input from my microphone and put it into a string.

#

Any way to do this?

#

Maybe a certain node package that already does this!

earnest phoenix
earnest phoenix
#

you mean voice commands like google assistant?

eternal osprey
#

Yeah

cinder patio
#

you'll need to use a speech recognition API

earnest phoenix
#

from google

main trench
earnest phoenix
#
Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.
    at Timeout._onTimeout (/root/cb/node_modules/discord.js/src/managers/GuildMemberManager.js:435:16)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7) {
  [Symbol(code)]: 'GUILD_MEMBERS_TIMEOUT'
}

Does this cause a bot disconnection?
Since it is the last error I get after my bot goes offline 😦

main trench
#

If it's the last error before the console exists then yes

#

Though im not even sure how that specific error happens

eternal osprey
earnest phoenix
quartz kindle
#

if you catch the error it should not disconnect

split hazel
#

catch these 👐

earnest phoenix
earnest phoenix
earnest phoenix
#

oh how would it be correct ?

quartz kindle
#

try { await guild.members.fetch().then() }
or
guild.members.fetch().then().catch()

#

try catch only works if its awaited

earnest phoenix
#

guilds.members.fetch({}).then(x=>console.log('[BOT] Fetched Members')).catch(x=>console.log(x));
currently using this

quartz kindle
#

yes that will work

earnest phoenix
#

hopefully ,there are no bot downtimes anymore, through this fix 👀

crimson spoke
#

dbl-bots 905033107986583592

earnest phoenix
#

this is the same thing over and over right? ```js
let msg = "No chests..."
if(silver >= 1) msg = Here are your chest stats!\n\n**:silver: Silver chests** - \${silver}`if(golden >= 1) msg =Here are your chest stats!\n\n**:golden: Golden chests** - `${golden}`if(crates >= 1) msg =Here are your chest stats!\n\n**:crate: Gold crates** - `${crates}`if(epicchest >= 1) msg =Here are your chest stats!\n\n**:epic: Epic chests** - `${epicchest}`if(legchest >= 1) msg =Here are your chest stats!\n\n**:legend: Legendary chests** - `${legchest}``

if(silver >= 1 && golden >= 1) msg = Here are your chest stats!\n\n**:silver: Silver chests** - \${silver}`\n**:golden: Golden chests** - `${golden}``

crimson spoke
#

-botinfo 905033107986583592

earnest phoenix
gilded plankBOT
#

Cryptit is a cryptocurrency simulator. It lets you invest fake money into cryptocurrencies.

ID

905033107986583592

Username

Cryptit

Prefix

.

Server Count

106 servers

Monthly Votes

24 monthly votes

Total Votes

98 total votes

Tags

Crypto, cryptocurrency, Currency, Currency Bots, Fun, Roleplay

Owners

@crimson spoke

crimson spoke
earnest phoenix
tired panther
#

Is there a good regex for removing emojis and non-characters from a string?
It should also remove emojis such as :cat: (which are not a unicode)

lyric mountain
#

technically :cat: is unicode

vivid fulcrum
#

also everything is a character

lyric mountain
#

you'd need to experiment differents matchers to find the one which mostly fits your needs

vivid fulcrum
#

if it wasn't a character it wouldn't be able to exist in the string

#

this ^^

lyric mountain
#

for discord emotes specifically you could use :.+: to match

tired panther
#

I am using this poor made one. /(?=:).*(?<=:)/gi
But It matches the whole String on :cat: TestName :cat:. It actually should just remove the chars between the dots.

tired panther
proven lantern
#

is there a discord api that tell you who the owner of a bot is?

sudden geyser
#

pretty sure

#

but that's the current bot

#

not just any bot

proven lantern
#

mmkay, that's close

#

so the bot would need to do oauth or the bot owner?

#

im pretty surebot's dont do oauth

quartz kindle
#

pretty sure there is no way of knowing

proven lantern
#

is that api endpoint just taunting us?

lament rock
#

GET /api/v69/applications/:application_id
would make sense

proven lantern
#

v69 huh?

#

i'll start waiting

lament rock
#

Any number higher than latest defaults to latest api ver

proven lantern
#

hacks

lament rock
#

you could ship "api v69 support"

proven lantern
#

im sure discord will not have any breaking api change until v69

#

should be safe

earnest phoenix
#
let msg = `Here are your chest stats!\n\n**:silver: Silver chests** - \`${silver}\`\n**:golden: Golden chests** - \`${golden}\`\n**:crate: Gold crates** - \`${crates}\`\n**:epic: Epic chests** - \`${epicchest}\`\n**:legend: Legendary chests** - \`${legchest}\``

if(silver <= 0){ 
msg.replace(`**:silver: Silver chests** - \`${silver}\`\n`,"")
} 

if(golden <= 0){
  msg.replace(`**:golden: Golden chests** - \`${golden}\`\n`, "")
}

if(crates <= 0){
  msg.replace(`**:crate: Gold crates** - \`${crates}\`\n`, "")
}

if(epicchest <= 0){
  msg.replace(`**:epic: Epic chests** - \`${epicchest}\`\n`, "")
}

if(legchest <= 0){
  msg.replace(`**:legend: Legendary chests** - \`${legchest}\``, "")
}
``` this time i used this method but didn't work, it didn't replace a thing
#

D E A D chat

sudden geyser
#

@earnest phoenix that's because strings are immutable

#

aka they don't change

#

so using .replace returns a new string

#

rather than changing msg

#

You could assign the value to msg

#

Like msg = msg.replace(...)

earnest phoenix
#

ok

#

nah now is like this

#

it looked like worked but now it's stopped there and crates doesn't go

#

nope my error, i put masg instead of msg

#

it worked

earnest mural
#

iara_AAA i forgor

proven lantern
#

how do i iterate over every character and support unicode?

earnest mural
rustic nova
#

Discord does fire events for audit log stuff right?

spark flint
#

you get the data from the audit log

rustic nova
#

No?

#

Fair enough thanks

proven lantern
#

why is unicode being difficult

#

why are they separated!

round cove
#

Because some unicode are combinations.

sudden geyser
#

because unicode is annoying

#

it's that thing you learn well then a week later completely forget about

proven lantern
#

js needs to give me a functions that lets me iterate over each character thingy

sudden geyser
#

Maybe you want some graphemes library

proven lantern
#

that looks right

#

Enter the grapheme-splitter.js library. It can be used to properly split JavaScript strings into what a human user would call separate letters
i am human

#

this is for me

earnest mural
#

oops wrong channel my bad

proven lantern
#

why does that work

#

wtf

boreal iron
#

Well it’s just a character the code parses, not more like a letter

proven lantern
#

this is going to break my beautiful code

sudden geyser
#

templates 🤮

proven lantern
#

template strings are great

#

i dont want to do iterative stuff

sudden geyser
#

but you are doing iterative stuff

#

like leaderboard map li ...

proven lantern
#

it's all declarative now

sudden geyser
#

you can have that without templates 🙃

proven lantern
#

if i use the for loop i need to define stuff outside the render

#

that's what i dont want

quartz kindle
#

so it seems like it checks if the character code is complete or partial, and only returns complete codes

proven lantern
#

that's nice of it to do

#

so i can keep it declarative

quartz kindle
#

if you prefer a third party, sure

proven lantern
#

i want split to work

quartz kindle
#

i took a look at it, they seem to do everything manually

#

they have a huge ass list of character codes

proven lantern
#

hmm

quartz kindle
#

with rules for each of them

proven lantern
#

237 kB

#

dang

#

kinda big

#

not too bad i guess

quartz kindle
#

i mean, you could just make a function that does for of

proven lantern
#

oh yeah

#

that'd be easy enough

quartz kindle
#

you could even hack the prototype

proven lantern
#

never

quartz kindle
#

String.prototype.betterSplit = function() { ... }

#

xD

proven lantern
#

i'm going to the next ecma conference with this

quartz kindle
#

lmao

proven lantern
#

i'll be outside with a picket sign

#

this was a lot of work

#
const betterSplit = str => {
    const result = [];
    for (const letter of str) {
        result.push(letter);
    }
    return result;
}```
quartz kindle
#

xD

quartz kindle
#

[...str] also works

proven lantern
#

oh

quartz kindle
#

instead of for of

proven lantern
#

even nicer

quartz kindle
#

xD

proven lantern
#

for of is a code smell

#

always good to remove it

quartz kindle
#

its even explained in the string.length docs

proven lantern
#

they forgot to say sorry. otherwise it looks good

quartz kindle
#

hahah

boreal iron
#

[…x] turns it into an array?

#

Never saw that before lol

proven lantern
quartz kindle
boreal iron
#

Huh cool and works for any data type?

proven lantern
#

data type?

quartz kindle
#

as long as the variable has an iterator

earnest mural
#

brain go dum rn

quartz kindle
#

aka its "iterable"

boreal iron
#

Good to know

#

Yeah

quartz kindle
earnest mural
#

i have those

quartz kindle
#

check if thats an actual uppercase i and not a lowercase L? idk

#

i know py has issues if you have files with the same names as folders, but that doesnt seem to be the case

earnest mural
#

its an i

#

upper

quartz kindle
#

are you missing an __init__.py file?

earnest mural
#

i need one?

quartz kindle
#

according to some you do, according to others you dont

#

¯_(ツ)_/¯

earnest mural
#

but im just running it off from my main.py file

quartz kindle
#

well idk thats all i know about py

earnest mural
#

welp

#

then im here like a sitting duck

quartz kindle
#

tried stackoverflow?

earnest mural
#

i should try it

#

tried renaming my main.py to init.py

#

but its being dum

#

okay i got it working

#

i simply removed the tools folder

#

and let dataIO.py be in the same folder as init.py

#

and changed to that

earnest phoenix
#

How do I make a collector stay forever without a filter, time:5000 I mean time:5000

#

Can I just remove time:5000, or would that set it to 0?

#

dont give it a time

#

just dont supply it

quartz kindle
#

why do you want it to be forever?

earnest phoenix
#

It's a verification message.

#

So users need to click it to get a role.

quartz kindle
#

dont use a collector for that

#

use the event

earnest phoenix
#

Why?

#

It's in a Command File.

quartz kindle
#

so every time your bot restarts you have to run the command again?

earnest phoenix
#

Once its setup, it won't restart.

quartz kindle
#

trust me it will

earnest phoenix
#

Ah lol

#

What's the even for a button clicked?

#

I've just been using collectors, dang.

quartz kindle
#

interactionCreate

earnest phoenix
#

in a command file too?

quartz kindle
#

no

earnest phoenix
#

I use command files.

quartz kindle
#

you dont use a command for that

earnest phoenix
#

Not a pure index.js

quartz kindle
#

you use commands to enable/disable and a database to store the status

earnest phoenix
#

Whaaat.

#

That doesn't make much sense.

quartz kindle
#

when the bot starts you use the event and check the database

earnest phoenix
#

That's so much work, I'd rather just re run the command 🤣

quartz kindle
#

lol ok

earnest phoenix
#

It's hosted on a VPS, so it will run fine.

quartz kindle
#

even if it never crashes, it will restart when you need to update it or change anything

earnest phoenix
#

It's just a /verify Command, not that big of a deal, all it is is just re-running a command.

quartz kindle
#

well, if its only for your server and nothing else

earnest phoenix
#

Yeah it is.

spark flint
#

just installed a module but it says the module was not found

earnest phoenix
#

Make sure you're running it in the same env whatever topggapi installed in

spark flint
#

then imported it

#

no env or anything

earnest phoenix
#

Try comparing the output of pip3 -V and python3 -V

spark flint
earnest phoenix
#

What's the output when you installed it?

spark flint
earnest phoenix
#

why this happens?

spark flint
#

what happenS?

earnest phoenix
#

i want "Vote me!" and "Website" to be like the upper part

#

"Vote me!" joins above so i put a blank addfield but it results this

earnest phoenix
spark flint
#

yep

#

I made it so I'm not sure where I've gone wrong hmm

earnest phoenix
#
.addField("\u200B", "\u200B", true)
``` blank addfield
#

and... ```js
undefined:1
{

SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (/home/runner/Clash-Chest/node_modules/dblapi.js/src/index.js:114:91)
at IncomingMessage.emit (events.js:326:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

#

The module isn't always the same name as the package name

#

Brr bad internet

#

Err, I gtg, cya in a few hours if it's still not resolved

spark flint
#

oh fuck i think i know

#

so from topgg

earnest phoenix
#

Yep

spark flint
earnest phoenix
#

That's what I was asking

spark flint
#

smh

#

idk why i didn't work that out sooner

boreal iron
earnest phoenix
#

ok

#

same

boreal iron
#

What the issue again?

quartz kindle
boreal iron
#

Oh that’s what he wants…

#

Thought he wanna have an empty line between

earnest phoenix
boreal iron
#

The embed has a fixed width

earnest phoenix
#

then explain this

#

wait a sec

boreal iron
#

If your columns extend the width it’s merged into a new line

earnest phoenix
#

now explain this

boreal iron
#

Different screen size?

earnest phoenix
#

yes

#

pc

#

but it's the embed is like this, right? Screen size matters?

boreal iron
#

Yeah it matters

quartz kindle
#

hmm thats new, never seen 3 in a line with the image enabled

earnest phoenix
#

it's v12

#

idk

boreal iron
#

It just uses a defined size (%) of the screen size

earnest phoenix
#

ok

boreal iron
#

If that’s not big enough it’s merged into a new line

earnest phoenix
#

then is there a way to make them equally? 2x2 and not 3x1

boreal iron
#

Yeah

earnest phoenix
#

how

boreal iron
#

2 inline
an empty one - not inline
2 inline

earnest phoenix
#

ok

boreal iron
#

Err yeah then idk, there was a way

#

I’m doing it, too

#

But can’t tell you atm

earnest phoenix
#

ok

boreal iron
#

Just ask in general

#

Maybe someone remembers how to use 2 columns only in the embed with multiple inline fields

earnest phoenix
#

done

#

so like my embed occupies 3 lines so i added a blank addfield in the end of the 2 lines

#
.addField("Invitation", `[Click here](${link})`, true)
.addField("Support server",`[Click here](https://discord.gg/X87c7HzpVY)`, true)
  .addField("\u200B", "\u200B", true)
  .addField("Vote me",`[Top.gg](https://top.gg/bot/866770269023240223/vote)`, true)
.addField("Website","Soon...", true)
.addField("\u200B", "\u200B", true)
#

before i only added the first blank addfields but now with 2 it worked

boreal iron
#

Yee like I said there’s a way

#

Just couldn’t remember how to

pale vessel
#

Why are you using ESM with CJS?

#

Try logging session

pale vessel
quartz kindle
#

why not import { EndSession } from "./file"

#

you are not supposed to use module at all

#

export abc is the same thing as exporting { abc }

#

just export abc; export xyz; etc...

earnest phoenix
#

I didn't even know you could import something like that

#

I've always used import blah from blah

sly sierra
#

oh damn

neat ingot
#
client.on('interactionCreate', interaction => {
    if (!interaction.isButton()) return;
    console.log(interaction);
});```
this `interactionCreate` event now has to handle the new button elements as well as commands? i cant create a button within my command reply and then listen for that buttons event?
lament rock
earnest phoenix
#

I see

lament rock
#

big headache hours

#

export default :((

lament rock
#

through the same event listener though and split it off there

neat ingot
#

yea thats what ive done 🙂

earnest phoenix
#

why will you not catch errors

#

also you need catch (error) or it wont work

feral aspen
#

I have a try-finally block as the following:

try { ... } finally { ... }; // I want it so if it fails, it would just skip the catch block, so adding a catch { false; } would fix but that would jump out of the try catch block..
feral aspen
earnest phoenix
#

huh

feral aspen
#

try {} catch (e) {}; or try {} catch {};.

#

Well, it looks like finally is like a catch block, too.

quartz kindle
#

its not, the error will still happen

#

finally just executes before the error is thrown

#

its basically something like ```js
if(error) {
if(finally) runFinally()
throw error;
}

earnest phoenix
#
new Promise((r) => {
  // code that goes in try

  r();
})
.catch(() => {})
.finally(() => {
  // code that goes in finally
})
#

¯_(ツ)_/¯

quartz kindle
#

lol

earnest phoenix
#

wait you still have to resolve

#

how about an async function

#
;(async () => {
  // code that goes in try
})()
.catch(() => {})
.finally(() => {
  // code that goes in finally
})
quartz kindle
#

should also work i guess

earnest phoenix
#

try it for me

cinder patio
#

omg why are themes so messy in chakra-ui 😭 they call dark/light theme "color modes" and the word "theme" is used to describe sizes, fonts, colors etc.

#

All I want to do is use charka's built-in color mode script but it's very hard because I have no clue how to define different colors for different color modes

#

And the docs are very not helpful

#

I don't get it, why aren't they letting us use make for the colors property?? Why only global

woeful pike
#

very very annoying, but it's the easiest workaround

#

that's the workaround we had to use for topgg

cinder patio
#

I see, I didn't think of doing that! But then wouldn't there be a flicker effect when the page gets loaded?

woeful pike
#

not any different of a flicker you get with regular chakra

cinder patio
#

alright, that's what I'll do, thanks!

lyric mountain
#

it'd be more like ```js
if (finally) runFinally();
if (error) throw error;

quartz kindle
#

ye

teal plaza
#

Does anyone know if it's possible that during the withelist verification period of discord the bot in question loses some functionality by maybe not being able to make some requests to discord?

spark flint
#

What are you waiting for

#

100 server verification or just intent verification

teal plaza
#

100 server and 1 intent

spark flint
#

Ah ok

teal plaza
#

so it's normal?

spark flint
#

You should be able to keep the bot as it for now

#

Unless discord explicitly says no for the intent

#

There is no way for it to join more than 100 without verification

teal plaza
#

The thing is that the bot has been in 100 servers for 2 days, about 2 weeks ago I sent the request while it was in 75 servers.
Until 5h ago that particular function worked, now it doesn't.
Also I tried with a test bot to see if it was doing something wrong and everything was working, I also tried restarting the bot, but nothing.

quartz kindle
#

if that specific function requires the intent, its possible you lost the ability to use it, even if temporarily, however if that would be the case, you would be receiving an error about forbidden intents being enabled

#

what does the function in question do? how does it "not work"? does it produce any errors or logs?

#

did you try debugging it?

woeful pike
#

oh no.... why would they change the position of these after like 10 years I'm so sad

teal plaza
sudden geyser
#

and damn we can categorize stars now

#

finally

#

this is a crime

#

why show the stats here when they're already up there

#

AND THEY MOVED THE STARS ON PROFILES

split hazel
delicate zephyr
split hazel
#

can you?

delicate zephyr
#

yes

#

click on your profile picture icon area

#

and you can change the color scheme

#

@woeful pike might be worth making this more clear or something

split hazel
#

oh i can change the colour

#

i wasnt feeling the femboy vibe

delicate zephyr
#

there lol

#

tmyk

woeful pike
#

seems like a design problem not engineering skill issue

boreal iron
#

lmao

cinder patio
#

React-icons is 44 MB :sheeeesh:

spark flint
#

how can I show markdown in html

cinder patio
#

marked

spark flint
#

kinda

#

i need to be able to embed/render html inside html

#

oh i found something

#

i'm using ejs so i did <%- data.desc %>

split hazel
#

ejs as a client side framework when

#

i really like the simplicity of it

#

react feels too bloated unless you like all of the extra features that come with it

spark flint
#

another issue now lol

#

because i use tailwind, it ignores the fact that i used <h1> and <h2> tags

sudden geyser
#

tags like h1, i, b, strong, etc. aren't usually relied on for their styles

#

but rather their semantics

#

unless I misunderstood

spark flint
#

ah ok

sudden geyser
#

so tailwind is trying to do you a favor by resetting the look the browser provides

#

so you can style it yourself with the class names tailwind has

cinder patio
#

ewwwww ejs

sudden geyser
#

ew templating in general

split hazel
#

scrap making designs by typing code with some less than and larger than signs make designs with guis

cinder patio
#

JSX/TSX is much nicer than ejs

sudden geyser
#

ew

sudden geyser
# split hazel confusing

Basically, HTML tags are used to say "here's what this section means". You could have a bunch of divs to describe an article page, or you could use the article tag instead.

split hazel
#

why cant there be one way to do things

sudden geyser
#

because html is hard

#

but css is cancerous

#

I prefer the declarative modifier approach more frameworks are taking

#

unfortunately they're not present in browsers

split hazel
#

css is not cancer

sudden geyser
#

more common on other platforms, such as SwiftUI, Jetpack Compose, etc.

split hazel
#

its a neurotoxin

cinder patio
#

speaking of css

#

Why isn't the SVG aligned with the text 😭

sudden geyser
#

the parent container probably isn't aligning it

split hazel
#

its bringing back bad memories

#

i also have a question

#

if you were to align the svg with like "margin-top: 1em" or something would it scale across different displays

#

specifically using em

cinder patio
#

I fixed it by using verticalAlign 🆒

#

:coolcry:

#

omg why does this happen

#

It says I can use the emoji but then it removes it from my message

woeful pike
split hazel
#

no one likes flexbox

#

all my homies use grid

quartz kindle
#

i dont like grid

#

every time i tried using grid, i found out it needed weird js hacks to get it to do what i wanted it to do

#

usually stuff that involves responsiveness

split hazel
#

skill issue tbh

boreal iron
#

I still use display table, cell, table-row etc.

#

Fuck CSS3

quartz kindle
#

lmao

#

i mostly use divs with inline block

boreal iron
#

Also, yeah

sudden geyser
#

Did you enable the message intent on the developer portal?

#

And that didn't resolve the issue?

#

Can you share your code in the message create event then (and make sure it's running of course)

#

it seems so

quartz kindle
#

what is the issue?

#

and what happens?

#

nothing at all or an error?

#

does console.log(message) show anything?

#

and if you send a normal non-dm message, does it show?

#

now try to dm again, still nothing?

simple stump
#

Would it be possible to get the message ID of the embed upon clicking the “Make a Suggestion” button? I’m attempting to add a “Discuss this suggestion” button that will create a thread for the embed.

quartz kindle
#

add this to your code, right after the new Discord.Client() line:

client.on("raw", p => {
  if(p.t === "MESSAGE_CREATE") console.log(p.d);
})
#

restart your bot and see if that logs dms

quartz kindle
simple stump
quartz kindle
quartz kindle
#

when someone clicks the button, the interaction event you receive should have information about the message the button belongs to

simple stump
#

Ah. Mb I didn’t notice that. Thanks!

spark flint
#
Command raised an exception: ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''snowflakes' SET 'bal' = '106' WHERE 'userid' = '471409054594498561'' at line 1```
#

what went wrong here

#

sql = f"UPDATE 'snowflakes' SET 'bal' = '{newbal}' WHERE 'userid' = '{ctx.author.id}' "

sudden geyser
#

should there be quotes around the table fields (snowflakes, bal, and userid)?

#

also I wouldn't recommend using python's string formatting

#

though you probably won't run into issues since I assume it's calculated, it may be susceptible to SQL injection

spark flint
sudden geyser
#

then you'll probably be fine

tacit valley
#

Hi I have concerned

woeful pike
spark flint
#

Ahh ok

#

I’ll fix in the morning lol

#

The other day it just didn’t output any errors and just didn’t update the database

neat ingot
#

using discord js v13, whats the approach for creating a command only i can use?

#

is there some way to like, set the default permissions to only allow me?

#

slash commands*

sudden geyser
#

I think it's to check it at runtime

oak cliff
#

i dont believe there is a way to do so with built in slash permissions

neat ingot
#

but then the /admin command is still going to appear for everyone, no?

oak cliff
#

correct

neat ingot
#

i';d much rather that be not shown

oak cliff
#

there is no current way to hide commands

neat ingot
#

wth really?

oak cliff
#

really really

neat ingot
#

😐

#

abandonslife

oak cliff
#

its in the roadmap but not released

#

for the whole of discord api not just discord.js

neat ingot
#

oh fml

oak cliff
#

what i recommend doing is you can make the command but with mention prefix and then you can use message.content

#

my eval command for example, i do @paper bluff eval stuff

#

oop sorry for ping owo

neat ingot
#

yea but then i need to listen for message events and parse that content too

oak cliff
#

yeah you would need to

#

but then people cant see it in the slash commands list

neat ingot
#

my bot uses like 2.5gb of ram 😐

oak cliff
#

theres pros and cons

sudden geyser
#

You could also bite the bullet and just expose it

oak cliff
#

people are gonna try and run it but they cant do anything with it so its not too big of a deal

neat ingot
#

im trying to reduce the data im having to recieve from discord by updating to the slash command structure and then not listening for messages lol

oak cliff
#

or you could make it guild specific

neat ingot
#

yea im thinking i may just expose it

#

hmm

oak cliff
#

make it a guild command for your support server and then its only exposed there

neat ingot
#

thats a fair idea

oak cliff
#

and you can only run it there iara_shrug

#

or a personal server for just you and the bot WeSmart

neat ingot
#

highfives

#

that sucks though that there is no way to hide them

#

so even if i was to change permissions at runtime, those without would still be able to actually see the command anyway?

oak cliff
#

correct

neat ingot
#

sheer balderdashery

#

guess a support server command that checks for my id is the way to go then lol

oak cliff
neat ingot
#

hey wait

#

how come you have a little crown for your role?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

oak cliff
#

Im a Community Manager here

neat ingot
#

wth? when did they add that?

oak cliff
#

month or two ago i believe

neat ingot
#

thats neat!

#

im guessing the server needs to be level 2+ or something?

oak cliff
#

yep

neat ingot
#

thats really cool tho 😄

#

where to complain that bot dev's dont have one?! 💔

spark flint
#

Well boosters need one first lol

neat ingot
#

i guess thats fair lol

drowsy flume
earnest phoenix
#

Can I update a Bot Clients name just by doing !setname <bots_new_name>?

unreal sun
#

how can i make like that ?

earnest phoenix
earnest phoenix
boreal iron
#

Global user name changes for your app can only be done for unverified bots as norizon already said.

#

(in the developer portal)

neat ingot
#

so you know how these slash commands can have like, choices... is it possible for a choice to appear only if the choice before it was xx?

scarlet furnace
#

hi

#

can someone help me?

earnest phoenix
scarlet furnace
#

I wanted to paint a specific image on the canvas and keep everything else intact, does anyone know how?

boreal iron
#

But any interaction like the choice you click on can result in simply changing the message oder sending a new reply to the user, including you new message components (your new choices based the previous user selection)

#

The slash command is the start point showing the first components, then you have to watch the button- or component interaction

#

Those can edit the original response or simply send a new message with the new components as I mentioned

earnest phoenix
#

Slash commands can't have autocomplete options?

boreal iron
#

Huh idk

#

Is it already available?

pale vessel
#

It is?

earnest phoenix
#

Did I misunderstand them? Thought they're asking about it

boreal iron
#

Didn’t Tim say he tested it just for fun a few days ago?

pale vessel
#

...it is

boreal iron
#

I can’t fucking remember

pale vessel
#

For more than a month now?

worn sonnet
#

Hello

#

Any ideas why I'm getting this error?

boreal iron
#

Based on the previous selections

#

But yeah autocomplete is absolutely what he needs in that case

pale vessel
#

Ah

#

You meant options, not choice values

boreal iron
#

Yeah - Which need to be registered of course

earnest phoenix
neat ingot
#

anyone happen to know the rate limit for creating applications/bots on the discord developer portal? ~ im trying to get the perfect discriminator 😄

#

~or a way to change my bots discriminator? seems less likely 😦

earnest phoenix
#

I think its like 100 bots is the limit. maybe less

#

and you can't change your bots discrim

neat ingot
#

i made like 8 or so before i got rate limited lol

earnest phoenix
#

you just get what ya get

earnest phoenix
neat ingot
#

yea, im like, making an application, then a bot, and if the descriminator sucks deleting it

earnest phoenix
#

Yea I dont think you can make too many bot applications at once

neat ingot
#

yea 😦

earnest phoenix
#

I don't know the exact limit but there is def one

#

they dont really specify exact ratelimits

neat ingot
#

im guessing its probably hourly, hopefully not daily 😄

earnest phoenix
#

depends if you keep hitting it

#

they might ban ya from creating em for a day or two

neat ingot
#

savages

split hazel
#

the rate limits aren't that extreme

earnest phoenix
#

I know they can change your token and then at some point api ban temporarily

cinder patio
#

your odds are 1 in 9999, gl

earnest phoenix
#

I see

copper cradle
sly sierra
#

true

#

"discord-mass-ban"

#

doesn't sound very legal now does it

earnest phoenix
#

in scss how do i match an element .emoji-* where * can be anything

#

ig i can do this with the class attribute

cinder patio
#

uuuuh I don't think that's doable? scss compiles to css

earnest phoenix
#

css is valid scss?

cinder patio
#

yes

earnest phoenix
#

I should probably use ^= instead

#
li[class^="emoji-"] {
  // ...
}
delicate shore
#

Hey guys

#

I need a bit help with c#

#

I started learning it yesterday

#

was making a simple script that saves data to a json file

#

well it pushes the data to the file

#
        public void SaveData()
        {
            string json = $"{{\"name\":\"{this.Name}\",\"age\":{this.Age},\"birthdate\":\"{this.Birthdate.ToString("dd.MM.yyyy")}\"}}";
            System.IO.File.AppendAllText("data.json", json);
        }
#

this is how I am saving the data

#

but it causes a problem

#

the data.json file becomes

#

BEFORE

[
{}
]

AFTER

[
{}
]
{}```
#

I want to save the {} part before the last ]

#
          string text = System.IO.File.ReadAllText(@"data.json");
          string json = $",{{\"name\":\"{this.Name}\",\"age\":{this.Age},\"birthdate\":\"{this.Birthdate.ToString("dd.MM.yyyy")}\"}}]";
          
          // Remove last character from "text" and add "json" to it
            text = text.Remove(text.Length - 1);
            text += json;
          System.IO.File.AppendAllText("data.json", text);

Can something like this work?

woeful pike
#

json isn't as ubiquitous in languages other than js (since json literally stands for javascript object notation). It's not a good format to be storing data either. Something like sqlite + entity framework makes life infinitely easier compared to what you're trying to do

delicate shore
#

Thanks, I had no idea that there were libs for this, I will look into it!

earnest phoenix
delicate shore
#

Also, I had another question.
How can I use custom libs for c# in VSC and not VS
I tried finding ways online but couldnt find and was only able to find solutions for VS.
I understood that I had to install them but referencing them is the thing I am not able to understand.

earnest phoenix
#

vscode just isn't good for dotnet

#

use vs

humble gyro
# delicate shore ```js public void SaveData() { string json = $"{{\"n...
public record User {
  public string Name { get; set; }
  public int Age { get; set; }
  public DateTime BirthDate { get; set; }
}

string json = File.ReadAllText(@"data.json");
List<User> collection = JsonConvert.Deserialize<List<User>>(json);

collection.Add(newUser);

(save and overwrite your file here)
woeful pike
humble gyro
#

C# has really strong JSON support, I would recommend modelling your data after a type and then serializing it using the dotnet lib

humble gyro
#

keep in mind this solution is not threadsafe

#

you might want to use a lock

#

e.g.

earnest phoenix
#

what is thread safety

spark flint
#

what is life

delicate shore
#

what is thread

earnest phoenix
#

what are threads in js

spark flint
#

and threads

#

what are they

humble gyro
#

Native programs run concurrently and not on an event queue (like js)

spark flint
#

i'm weird and just use python and a bit of js

humble gyro
#

if you use something like Discord.Net you might get issues when it comes to multiple threads trying to write to your file

#

Overall recommendation is to use Sqlite instead

#

Yea it's a specialized editor for C#

#

you can use anything related to C# in vscodce though

#

Download the C# support extension

delicate shore
#

I did

humble gyro
#

make sure your files are {name}.cs

delicate shore
#

But I still cannot figure out referencing for libraries

humble gyro
#

Ah

#

use the dotnet cli tool

#

dotnet add Moq

delicate shore
#

I have it installed

#

but

humble gyro
#

is C#'s version of npm i jest

delicate shore
#

but if I wanted to add a custom library.

humble gyro
#

yea

#

dotnet add is what visual studio basically does for you when you use the nuget panel

delicate shore
#

ah

#

brb I will mess a bit around

#

Thanks for your help

humble gyro
#

Np

lyric mountain
#

the confusion comes because both have "visual studio" in the name

hollow adder
#

helo

lyric mountain
#

but vsc is nothing more than a fancy text editor with plugin support

#

while vs is a full ide

lyric mountain
#

it's like making a cake

#

in js/py one person handles it all

earnest phoenix
#

I'm thinking of switching to rust/asp.NET from nodejs

lyric mountain
#

while in other langs you'd have multiple cooks doing different parts of the cake

earnest phoenix
earnest phoenix
#

...is a lie

spark flint
#

i-

earnest phoenix
#

that's clearly plastic

spark flint
#

jokes on you, its ar

delicate shore
#

wait how big is VS

lyric mountain
#

enough to require an entire HD for itself

delicate shore
#

idk if my laptop will be able to handle it

#

its lagging just from installing

lyric mountain
#

well, vs is known for being...thicc

#

you could use resharper or rider instead

#

both are jetbrains ides, iirc rider is standalone

delicate shore
#

god

#

I am waiting for mac to install it

#

once it does

#

I will see if it affects A LOT

#

whafasf what

#

1.4GB

cinder patio
#

VS is pretty bad for everything to be fair

#

but it's the best free tool for C#

earnest phoenix
#

Can i get a help?

#

with updating buttons on interaction collection

cobalt junco
earnest phoenix
earnest phoenix
#

?

#

Yes

earnest phoenix
#

Yes

earnest phoenix
#

@earnest phoenix i dmed you

earnest phoenix
#

how do i make my bot send an image?

solemn latch
#

depends, in an embed? in content? in a url? from local filesystem?

#

lib and language?

earnest phoenix
earnest phoenix
#

country access restriction issue

earnest phoenix
#

So whats your problem

#

What you did and this error came

spark flint
#
        sql = "INSERT INTO snowflakes (userid, bal) VALUES (%s, %s)"
        val = (ctx.author.id, newbal)
        mycursor.execute(sql, val)```
#

why is this not inserting

earnest phoenix
spark flint
#

i fixed it KEKW

#

forgot to do mydb.commit()

#

blame w3schools

earnest phoenix
#

Oh welp

#

I hope it's not an async app though cuz it looks blocking

spark flint
#

it was inserting my userid as the balance too KEKW fixed that now

spark flint
#

so yeah its async

earnest phoenix
#

Ok you're screwed up

solemn latch
#

🤔 whats a zodError

delicate shore
#

God

#

Guys I need help with C# and reactJS

#
  "browserslist": [
    "defaults"
  ],```
#

this is my json file

#

When I run npm run build

#

I get : ```
? We're unable to detect target browsers.

Would you like to add the defaults to your package.json? Yes
Failed to compile.

As of react-scripts >=2 you must specify targeted browsers.
Please add a browserslist key to your package.json.```

solemn latch
earnest phoenix
earnest phoenix
#

@bot.command(pass_context=True)
async def rules(ctx):
await ctx.send(file=discord.File('paste.png'))

#

i did the script

#

but its not doing anything

solemn latch
#

Looks like you need to include the path, not just the file name

#

Or may need to, not quite sure not a py user.

cinder aspen
#

.

stoic nexus
#

searching for a coding help. I pay

lyric mountain
#

no context

  • no error
  • no code

no help

earnest phoenix
#

why no work

lyric mountain
#

👐🧴
🤝🤝

full basalt
lyric mountain
#

what browser?

earnest phoenix
#

safari

#

kekw

lyric mountain
#

mmulu I don't doubt

earnest phoenix
vast cedar
#

I'm making custom bots for a project and i'm trying to connect multiple tokens with differents clients so i can manage every clients one by one

My actual code is

const tokens = ['token_1', 'token_2']
const { Client } = require('discord.js');

for(const token of tokens) {
const client = new Client();

client.on('ready', () => {
console.log(client.user.id)
});

client.login(token)
} 

But imagine i want the second bot to send a message in a channel, how do i do this ?

Because if i put the channel.send in the for it will send the message with every bot, and i just want one bot, and i think client[0] does not work, if somebody can help it would be very cool

lyric mountain
#

sir, I'm afraid to ask

#

but why do you have multiple tokens in ur code?

#

like, the purpose

vast cedar
#

I need 3 same bot, for my community server but i don't want to duplicate the code, so for optimisation im trying to make all in one

solemn latch
#

this actually might be less optimized all being in one