#development
1 messages · Page 1935 of 1
that's known as sql dump or backup
the op
ah wait
yeah, you
nvm, didn't notice u actually answered
then if not i need to connect to somthing ?
you can't connect to a sql dump
i fixed things you said
that's technically a text file
you need to import that data into an actual database
how
first of all, how did you get those files? an assignment?
this is open source code i get in website
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
thid code dont have readme
where did you get that?
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
pls don't use var
Abc is interaction.guild.members.fetch().forEach()
"my car doesn't move"
"try putting gas instead of sausage sauce"
"okay and? anyway"
let's fix it step by step, replace var with let
try setting a fixed width and height and a bright colored background color to see if it's indeed being created (and where)
it does indeed being created
what is supposed to be inside it?
hmm...code inside the div?
since it counts as ads i will remove the url
ah nvm, now I see what u did
does the inner html contain meaningful dimensions?
like width or height?
nah
it might be being created with 0x0 dims
it just ```js
frame.innerHTML = <a href="https://discord.com">Close Christmas theme</a></center>
i put discordcom u know why
oh
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
seçenk?
Turkish word
Meaning options
I tried all ways but still it gives to all users or dont give anyone
biliyorum heralde lmao
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
pagination
check one more time
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");
});
}
});
}
yw
I keep my answer
@lyric mountain does this code any error ?
where did u define seçenek hedef etc
İnteraction options
Yes i noticed
Do you use the filters somewhere or am I blind?
so, albeit slightly different "your code" looks disturbingly similar to this repo here https://github.com/tasslar/school
if my guess is right, you cloned a school project of someone, congratz
yes 😅
oop
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: {
you need application.interactions scope
application.commands?
that
is mariadb pog?/
i need to use that on one of my projects but it's my first time moving away from mongodb
yep
If you wanted an sql DB which has as much throughput potential as possible, probably postgres would be the best option
Not only faster also got rid of tons of issues Oracle doesn’t care about fixing
Postgres is a great option for sure
just post here
I just use a JSON file and datalog database
can you use a discord channel as a form of db ;)
I mean technically
Imagine writing data and trying to stay under ratelimits though lmfao
some people already did it
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
someone did it as a joke I remember
lol
this thingy?
lmfao and its made in go
Thats so weird
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

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
disregard this
also you say it is replying with the nope embed even when there is no error?
just read this.
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
yeah. I got the error out to see if it works but it also doesnt work
I don't really see anything wrong with it
This code isn’t working in v13, right?
yeah
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
oh thanks
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?
Define "bump bots"
I mean, if it's a DM ads bot then the answer is pretty clear I guess.
bruh
oh nvm guys smashing this vase with a hammer made it fit in my suitcase
why when i click to ctr plus enter i dont get anything
Dunno where you defined that but there are interactions like buttons interactions which don’t have a command name.
typescript is just javascript but with a lot of : any
not a single person in existence uses typescript without the any type
anyone that can help me script a command
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
Improvise. Adapt. Overcome.
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
ok that mean except that everything is good?
still same error
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
How do I disable the bot message when someone levels up?
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
not all members have presences
do you have the presences intent enabled?
yes
.fetch({ withPresences: true })
i fixed it like this ```js
let offlineMembers = (await message.guild.members.fetch()).filter(m => m.presence == null)
log(offlineMembers.size)
that will not be accurate
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
]
(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
it worked with that
yes i get member intents and presence intents
do you have them both enabled in the code as well?
Is there a way to make new lines in a <p> tag work properly without using a <pre>?
br
yes ```js
new Client({ intents: 32767 });
doesn't that frick accessibility
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
Use multiple p tags
the accessibility nerd was too stunned to speak
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
This server is not bot support server
are you kidding me
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!

uh microphone to a string?
you mean voice commands like google assistant?
Yeah
you'll need to use a speech recognition API
from google
You'll have to ask in whatever support server the bot has
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 😦
If it's the last error before the console exists then yes
Though im not even sure how that specific error happens
Ah fuck.
- The Node Process still runs(only bot goes offline) for example database is still connected and getting data,
if you catch the error it should not disconnect
catch these 👐
so the error happens inside discord class ,which causes the error? But why is node still running then?
btw I already do it
try{
guilds.members.fetch({}).then(x=>console.log('[BOT] Fetched Members'))
}
catch(err){ console.log(err) }
that wont work
oh how would it be correct ?
try { await guild.members.fetch().then() }
or
guild.members.fetch().then().catch()
try catch only works if its awaited
guilds.members.fetch({}).then(x=>console.log('[BOT] Fetched Members')).catch(x=>console.log(x));
currently using this
yes that will work
hopefully ,there are no bot downtimes anymore, through this fix 👀
dbl-bots 905033107986583592
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}``
-botinfo 905033107986583592
Cryptit is a cryptocurrency simulator. It lets you invest fake money into cryptocurrencies.
905033107986583592
Cryptit
.
106 servers
24 monthly votes
98 total votes
Crypto, cryptocurrency, Currency, Currency Bots, Fun, Roleplay
@crimson spoke
Sorry
is there a way to combine them without the same thing in every line? i'm making a inventory so i'd like to make it like dank memer, it's empty at first and goes adding the items and if the items are not there, it removes it from the inventory
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)
technically :cat: is unicode
also everything is a character
you'd need to experiment differents matchers to find the one which mostly fits your needs
for discord emotes specifically you could use :.+: to match
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.
How about :[^:]+:
cool, works
is there a discord api that tell you who the owner of a bot is?
pretty sure
@proven lantern this one https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
but that's the current bot
not just any bot
mmkay, that's close
so the bot would need to do oauth or the bot owner?
im pretty surebot's dont do oauth
pretty sure there is no way of knowing
is that api endpoint just taunting us?
GET /api/v69/applications/:application_id
would make sense
Any number higher than latest defaults to latest api ver
hacks
you could ship "api v69 support"
umm
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
@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(...)
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
how do i iterate over every character and support unicode?
nvm im stupid i forgot to move my file in the right directory
Discord does fire events for audit log stuff right?
don't think so
you get the data from the audit log
Because some unicode are combinations.
because unicode is annoying
it's that thing you learn well then a week later completely forget about
js needs to give me a functions that lets me iterate over each character thingy
Maybe you want some graphemes library
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
oops wrong channel my bad
a for of... loop works
Well it’s just a character the code parses, not more like a letter
templates 🤮
it's all declarative now
you can have that without templates 🙃
if i use the for loop i need to define stuff outside the render
that's what i dont want
we cant see how string implements its iterator because it shows up as native code, but the spec shows this
so it seems like it checks if the character code is complete or partial, and only returns complete codes
that's nice of it to do
i think this will work best for me
https://www.npmjs.com/package/grapheme-splitter
so i can keep it declarative
if you prefer a third party, sure
i want split to work
i took a look at it, they seem to do everything manually
they have a huge ass list of character codes
hmm
with rules for each of them
i mean, you could just make a function that does for of
you could even hack the prototype
never
i'm going to the next ecma conference with this
lmao
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;
}```
xD
oh wait
[...str] also works
oh
instead of for of
even nicer
xD
they forgot to say sorry. otherwise it looks good
hahah
yeah, it fills up the array or object by running the given variable through an iterator
Huh cool and works for any data type?
data type?
as long as the variable has an iterator
aka its "iterable"
thats all the files in that folder? or are there more files?
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
are you missing an __init__.py file?
i need one?
well idk thats all i know about py
tried stackoverflow?
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

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
why do you want it to be forever?
so every time your bot restarts you have to run the command again?
Once its setup, it won't restart.
trust me it will
Ah lol
What's the even for a button clicked?
I've just been using collectors, dang.
interactionCreate
in a command file too?
no
I use command files.
you dont use a command for that
Not a pure index.js
you use commands to enable/disable and a database to store the status
when the bot starts you use the event and check the database
That's so much work, I'd rather just re run the command 🤣
lol ok
It's hosted on a VPS, so it will run fine.
even if it never crashes, it will restart when you need to update it or change anything
It's just a /verify Command, not that big of a deal, all it is is just re-running a command.
well, if its only for your server and nothing else
Yeah it is.
Make sure you're running it in the same env whatever topggapi installed in
i just did pip3 install topggapi
then imported it
no env or anything
Try comparing the output of pip3 -V and python3 -V
What's the output when you installed it?
what happenS?
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
Ok, are you sure the package topggapi contains topggapi?
.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
Yep

That's what I was asking
Add an extra space behind the uniqotes
What the issue again?
you cannot have 3 in the same line when the image is enabled
but the there is a 3 line
The embed has a fixed width
If your columns extend the width it’s merged into a new line
Different screen size?
Yeah it matters
hmm thats new, never seen 3 in a line with the image enabled
It just uses a defined size (%) of the screen size
ok
If that’s not big enough it’s merged into a new line
then is there a way to make them equally? 2x2 and not 3x1
Yeah
how
2 inline
an empty one - not inline
2 inline
ok
Just ask in general
Maybe someone remembers how to use 2 columns only in the embed with multiple inline fields
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
Nm, I see you're using TS
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...
I didn't even know you could import something like that
I've always used import blah from blah
oh damn
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?
With esm import, it's tricky since you can't have named exports on a cjs module when using esm iirc
I see
You should be routing different interaction types through different functions so that you can Callback-ify buttons and such.
through the same event listener though and split it off there
yea thats what ive done 🙂
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..
You can use catch {}.
huh
try {} catch (e) {}; or try {} catch {};.
Well, it looks like finally is like a catch block, too.
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;
}
new Promise((r) => {
// code that goes in try
r();
})
.catch(() => {})
.finally(() => {
// code that goes in finally
})
¯_(ツ)_/¯
lol
wait you still have to resolve
how about an async function
;(async () => {
// code that goes in try
})()
.catch(() => {})
.finally(() => {
// code that goes in finally
})
should also work i guess
try it for me
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
yeah you can't do that. The only way you can define dynamic color values is by storing the theme color outside of chakra and creating a function that returns a new chakra theme given a color mode which you pass into ChakraProvider to rerender things
very very annoying, but it's the easiest workaround
that's the workaround we had to use for topgg
I see, I didn't think of doing that! But then wouldn't there be a flicker effect when the page gets loaded?
not any different of a flicker you get with regular chakra
alright, that's what I'll do, thanks!
finally still run if no error is thrown tho
it'd be more like ```js
if (finally) runFinally();
if (error) throw error;
ye
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?
100 server and 1 intent
Ah ok
so it's normal?
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
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.
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?
oh no.... why would they change the position of these after like 10 years I'm so sad
Yes, that function use the internet, but fot the internet part it works, for another part (another internet work but different) it doesn't work
probably to put more important things on one side, but still annoying
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
this is how i felt when top gg made the website pink
you can change the color

can you?
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
seems like a design problem not engineering skill issue
lmao
React-icons is 44 MB :sheeeesh:
how can I show markdown in html
like turn markdown into html? There are a ton of libs which do that
marked
well
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 %>
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
another issue now lol
because i use tailwind, it ignores the fact that i used <h1> and <h2> tags
tags like h1, i, b, strong, etc. aren't usually relied on for their styles
but rather their semantics
unless I misunderstood
ah ok
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
confusing
ewwwww ejs
ew templating in general
scrap making designs by typing code with some less than and larger than signs make designs with guis
JSX/TSX is much nicer than ejs
ew
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.
why cant there be one way to do things
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
css is not cancer
more common on other platforms, such as SwiftUI, Jetpack Compose, etc.
its a neurotoxin
the parent container probably isn't aligning it
this hurts to look at please stop
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
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
nitro issue

display: flex, align-items: center the parent
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
skill issue tbh
Also, yeah
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
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?
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.
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
message component interactions have a .message property
Isn’t it .fetchReply? But isn’t that for slash commands and not buttons?
thats when you respond to them, the message your bot sends in response
thank you i can fix it
when someone clicks the button, the interaction event you receive should have information about the message the button belongs to
Ah. Mb I didn’t notice that. Thanks!
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}' "
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
The only thing that is entered is a set number
then you'll probably be fine
Hi I have concerned
single quotes are strings, double quotes are column/table names
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
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*
I think it's to check it at runtime
check if interaction.user.id is your userID
i dont believe there is a way to do so with built in slash permissions
but then the /admin command is still going to appear for everyone, no?
correct
i';d much rather that be not shown
there is no current way to hide commands
wth really?
really really
oh fml
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 
yea but then i need to listen for message events and parse that content too
my bot uses like 2.5gb of ram 😐
theres pros and cons
You could also bite the bullet and just expose it
people are gonna try and run it but they cant do anything with it so its not too big of a deal
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
or you could make it guild specific
make it a guild command for your support server and then its only exposed there
thats a fair idea
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?
correct
sheer balderdashery
guess a support server command that checks for my id is the way to go then lol

One message removed from a suspended account.
One message removed from a suspended account.
Im a Community Manager here
wth? when did they add that?
month or two ago i believe
yep
i guess thats fair lol
Hey, so does this happen to anyone else when trying to verify their bot?
https://gyazo.com/2465bb838495d766c287db8700778023
Can I update a Bot Clients name just by doing !setname <bots_new_name>?
how can i make like that ?
Not if it's verified
Refer to the timestamp section https://discord.com/developers/docs/reference#message-formatting
If it's not how would I do it then?
it's worked thx man
Sure, a guild specific nickname can be changed at any time as long as the bot has the permission to change his own nickname in the guild.
Global user name changes for your app can only be done for unverified bots as norizon already said.
(in the developer portal)
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?
Implied that you can't do that programmatically 
I wanted to paint a specific image on the canvas and keep everything else intact, does anyone know how?
Err no, slash commands and their options (which a choice is) need to be registered and can not be dynamically in the a way you need it - except guild commands.
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
Slash commands can't have autocomplete options?
It is?
Did I misunderstand them? Thought they're asking about it
Idk I think it is
Didn’t Tim say he tested it just for fun a few days ago?
...it is
I can’t fucking remember
For more than a month now?
Cuz this confuses me lmao
Yeah I thought he means step by step choices
Based on the previous selections
But yeah autocomplete is absolutely what he needs in that case
Yeah - Which need to be registered of course
You (the owner of the bot) likely need to enable 2FA on your account
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 😦
I think its like 100 bots is the limit. maybe less
and you can't change your bots discrim
i made like 8 or so before i got rate limited lol
you just get what ya get
ah I thought you said limit I cant read today
yea, im like, making an application, then a bot, and if the descriminator sucks deleting it
Yea I dont think you can make too many bot applications at once
yea 😦
I don't know the exact limit but there is def one
they dont really specify exact ratelimits
im guessing its probably hourly, hopefully not daily 😄
depends if you keep hitting it
they might ban ya from creating em for a day or two
savages
the rate limits aren't that extreme
yea I didn't know if it was like logging in with bots and such
I know they can change your token and then at some point api ban temporarily
your odds are 1 in 9999, gl
I see
I'm a bit concerned about the name of that project
in scss how do i match an element .emoji-* where * can be anything
ig i can do this with the class attribute
uuuuh I don't think that's doable? scss compiles to css
css is valid scss?
yes
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?
there are libraries that can automatically serialize and deserialize data structures for you in C#. You should never be doing something like this
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
Thanks, I had no idea that there were libs for this, I will look into it!
"but it's just for testing"
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.
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)
testing my patience 
C# has really strong JSON support, I would recommend modelling your data after a type and then serializing it using the dotnet lib
Thanks 
what is thread safety
what is life
what is thread
what are threads in js
Native programs run concurrently and not on an event queue (like js)
i'm weird and just use python and a bit of js
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
I did
make sure your files are {name}.cs
But I still cannot figure out referencing for libraries
is C#'s version of npm i jest
but if I wanted to add a custom library.
yea
dotnet add is what visual studio basically does for you when you use the nuget panel
Np
the confusion comes because both have "visual studio" in the name
helo
but vsc is nothing more than a fancy text editor with plugin support
while vs is a full ide
ironically, two languages which don't support multithreading
it's like making a cake
in js/py one person handles it all
two languages which don't support being good
I'm thinking of switching to rust/asp.NET from nodejs
while in other langs you'd have multiple cooks doing different parts of the cake
not really useful for a cake unless it's like idk a cake factory
the cake
...is a lie
i-
that's clearly plastic
jokes on you, its ar
wait how big is VS
enough to require an entire HD for itself
well, vs is known for being...thicc
you could use resharper or rider instead
both are jetbrains ides, iirc rider is standalone
god
I am waiting for mac to install it
once it does
I will see if it affects A LOT
whafasf what
1.4GB
Try sending the error and what you want to do here
i.deferUpdate()
@earnest phoenix i dmed you
https://pastecode.io/s/9juh3o5q
@earnest phoenix help with updating the buttons [Djs v13]
code link : 👆 or https://pastebin.com/uyp7VuKV
Buttons does not update on interaction || Please help , if u need interactionCreate.js code i can share
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I cant acsess pastebin
how do i make my bot send an image?
depends, in an embed? in content? in a url? from local filesystem?
lib and language?
u can i guess try this link https://pastebin.com/uyp7VuKV
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
country access restriction issue
throwbin?
So whats your problem
What you did and this error came
sql = "INSERT INTO snowflakes (userid, bal) VALUES (%s, %s)"
val = (ctx.author.id, newbal)
mycursor.execute(sql, val)```
why is this not inserting
Maybe you wanna provide more context, e.g., what driver, etc
it was inserting my userid as the balance too
fixed that now
its a discord bot 
so yeah its async
Ok you're screwed up
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.```
turns out the zoderror was caused by capital letters in the name of a slash command.
nice
button not getting updated
embed i think
@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
Looks like you need to include the path, not just the file name
Or may need to, not quite sure not a py user.
.
searching for a coding help. I pay
no context
- no error
- no code
no help
consol.log"Hello World!");
why no work
what browser?
I don't doubt
did you mean unity "support"?
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
sir, I'm afraid to ask
but why do you have multiple tokens in ur code?
like, the purpose
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
this actually might be less optimized all being in one

i forgor




