#development
1 messages · Page 2064 of 1
every forum post ever from 2009
i see
You'd have to reupload them with SPOILER_ at the start of the filenames
Ty
I already solved it, but can you help me with something else?
I put the messageCreate event in the bot and I put the content of the sent message in the console, but I'm getting it multiple times. as mentioned earlier, each cluster runs a bot instance, can you send it to just one instance?
did you configure the shards for each cluster?
yes
show your config
ok, i will enter the pc
just realized having an in depth description on join actually makes a difference
instantly jumped from ~35 to 46 guilds in one day
hey guys is there a way to display a specific portion from a get request in html
like, i wanna get https://top.gg/api/bots/752236274261426212/stats and only display server_count
well it returns a json response so you can just get server_count from its response
is there a way to get the server counnt without authorization
ofc not
fun. what am I doing wrong lol
var mainContainer = document.getElementById("server-count");
fetch("https://top.gg/api/bots/752236274261426212/stats", {
method: "get",
headers: new Headers({
'Authorization': "redacted"
})})
.then(function (response) {
return response.json();
})
.then(function (data) {
mainContainer.textContent = (data[0] + " Servers");
})
.catch(function (err) {
console.log(err);
});
does it not start at 0 all of a sudden

log what data is
My man don't put the token inside the js code, people can view it and post fake stats for your bots and get you banned
Js is frontend
or data["server_count"] if you really wanted
poifect
gj
is there a way to avoid this mess
(data.server_count + " Servers")
and have it all in one string
i know c# has $("{content} rest of string")
use back ticks
ah
console.log(`${something} asdasd`)
{}
righht
not ()
You could make it a part of your API
otherwise i wouldnt have bothered to use the topgg api in the first place
https://sourceb.in/0nK3DVYoop
how can I compare the content and the given guild_name?
PS: Im using a collector
using an if statement?
I don't question it anymore waffle
the if statement
I don’t think you’re seeing the problem here misty
Waffle i am starting to question now
Look at everything that isn’t the if statement
I am wondering why they are putting a string inside a string idc about any other problems
There was hardly any fucking code to begin with
I think you’re missing the point
Even if the if statement made sense, everything else doesn’t
It wasn't a code
Not js at least
I just realized the what the code looked like
wtf is he doing
async (err, data)
ah yes
I would help but it’s too late and I’m on mobile
hello
How are you going with unity?
Good
I have made a cube
wonderful progress
👍
20 MB incoming...
Why Microsoft GameDVR lags???
Upside-down...
That is
np
betrayal.
?
No
Wasn't that a capsule?
it is
literally spawn a capsule and you got a bean
It's used for first person characters
you know nothing about unity
That isn't even a fucking bean shape
😭
@sharp geyser I was working on this
misty, have you watched any tutorials online about unity
literally everyone will tell you to start with a bean
Not that
this is not a bean shape
@sharp geyser it's called a beam however
it indeed is
Look how did I use it here
I noticed it clips sometimes
perfect
that was it's old name I think
It's called capsule, bean, ...
Mute 👍
even with mutes it still shows up bozo
Then you have to do sth else
yes block the people who do it to be annoying
Shit. dawn explorer crashed... all my folders closed...
Perfect

I feel your pain
I've got a HDD
you dare doubt me
literally got more pics
this is an older screenshot tho
I'm on a SDD, but my folders and data are in HDD
that is literally fnaf
yeah, my version
For no dawn reason it bugs and crashes
which I made
cap
Good
no way lol
you wish
c# is the language I'm good at
Js is my third maybe fourth language
though I do use it a lot
The entire unity is C#
poor js
Do you know what lang unity was written in?
isn't it cpp?
C++ and C#
What?
below unity 5 also works with JS
Didn't know that...
They used to have a super shit JS scripting api
though I wouldn't downgrade
if you care about dem good graphics
JS isn't a lang meant for a unity game of any decent standard imo
C# just makes more sense
it was also hardly used iirc
you could mix Js with c#
why would you ever wanna do that though
I mean just saying it was possible
so maybe not all that useless
Don't you have a discord bot?
which coffee should I make? rn I only got latte and cappuchino packs
I hardly work on bots
I gotta go shopping
boring
that reminds me
how is your discord v2 going?
I also don't wanna spend my entire life working as a bot dev
that just is too limiting
https://sourceb.in/wXog3drKMv how do i add my price with toLocaleString()?
are you making an economy bot?
I actually wanted to rework my old economy
wonder if I should
kinda
wait is itemList an array
what is itemList, cause if it is an array I do not see how this is working at all
npm start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-06-30T08_31_35_093Z-debug.log
exit status 1
Help plz
start is missing in your scripts portion of package.json
what should i add in my package.json plz provide code
the start script
yep
I was telling you what to add
idk the script how to add xD
i want code line
ok ok
got it
I don't know what it should look like
so I can't really help you
all I can say is you need to add the start script in your package.json
do you need that tho?
you can just remove the entire thing
read the error
invalid character
there is an 1" that isn't needed
it even tells you the character that is not supposed to be there
wait
this actually workeed
well ofc
Hey,
So pretty much I'm trying to log whenever someone get's banned from a server and send it with embed to a modlogs channel, that can be defined by an ID.
I'm having an error with the line 5th line (let auditLog = auditLogs.entries.first()).. returning as TypeError: Cannot read properties of undefined (reading 'first'). Any Idea how to fix this?
client.on("guildBanAdd", (guild, user) => {
let reason = "no reason"
let embed = new Discord.MessageEmbed()
let auditLogs = guild.fetchAuditLogs({type: "MEMBER_BAN_ADD"})
let auditLog = auditLogs.entries.first()
if(auditLog.reason !== null){
reason = auditLog.reason
}
embed.setTitle("User Banned")
embed.setColor("#ff0000")
embed.addField("Username", `${user.tag}`)
embed.addField("Banned User ID", `${user.id}`)
embed.addField("Time Banned", `${user.createdAt}`)
embed.addField("Reason", `${reason}`)
client.channels.cache.get("ID").send(embed)
}
)
do you have permission to view the audit logs?
The bot has administrator permissions, so yes.
try logging both auditLogs and auditLogs.entries to see what they return

I do not understand js well. But if you returned users' info, what else could be remained?
you can't fetch the moderator, time or reason without audit logs
which is quite stupid imo
I've figured it out,
client.on("guildBanAdd", async (guild, user) => {
let reason = "no reason"
let embed = new Discord.MessageEmbed()
const auditLogs = await guild.fetchAuditLogs({
limit: 1,
type: 'MEMBER_BAN_ADD',
});
let auditLog = auditLogs.entries.first()
if(auditLog.reason !== null){
reason = auditLog.reason
}
embed.setTitle("User Banned")
embed.setColor("#ff0000")
embed.addField("Username", `${user.tag}`)
embed.addField("Banned User ID", `${user.id}`)
embed.addField("Time Banned", `${user.createdAt}`)
embed.addField("Reason", `${reason}`)
client.channels.cache.get("ID").send(embed)
}
)
it can be done this way
guild.fetchAuditLogs returns a promise so you need to use await
nvm
❤️
(async function() {
const fetch = await message.guild.fetchAuditLogs({ type: "MEMBER_BAN_ADD" });
let audit = fetch;
audit = audit.entries.map(e => e);
return audit[0];
})();
they already figured it out
You really sensitive about replying...
const fetchAudit = function(auditFetchNr) {
const fetch = await message.guild.fetchAuditLogs({ type: "MEMBER_BAN_ADD" });
const audit = audit.entries.map(e => e);
return audit[auditFetchNr];
};
wtf
I think it is stupid you need to do .map(e => e)
I mean you can do Array.from(audit.values()) to get an array without using .map so that is cool
didn't know Array.from was a thing
forgot about this 🤣
https://sourceb.in/JrJVWxelm6, how do i push an item on array object?
array.push(...)?
$push for mongodb
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! clan_bot@11.0.0 start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the clan_bot@11.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-06-30T14_02_51_825Z-debug.log
exit status 1
node ./index.js
internal/modules/cjs/loader.js:818
throw err;
node index.js
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'node:events'
Require stack:
- /home/runner/Multipurpose-discord-bot/node_modules/discord.js/src/client/BaseClient.js
- /home/runner/Multipurpose-discord-bot/node_modules/discord.js/src/index.js
help plz
i m on replit then how
hmm i got that
npx
npx node .
node:internal/modules/cjs/loader:1170
throw err;
^
SyntaxError: /home/runner/Multipurpose-discord-bot-1/botconfig/config.json: Unexpected token ] in JSON at position 182
at parse (<anonymous>)
at Object.Module._extensions..json (node:internal/modules/cjs/loader:1167:22)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/runner/Multipurpose-discord-bot-1/index.js:43:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
exit status 1
then this error
your config.json file is broken
how to check custom emoji in form reaction.emoji.name
the name only gives the name. You also need the id
custom emojis are
<:name:id>
animated custom emojis are
<a:name:id>
for reacting to a message, you can use name:id
if you only have the id, you can do _:id
let item1 = ""
StoreList.find({gemType: "1000 Gems"}).count(function (err, count) {
if (!err && count === 0) {
item1 = "1000 Gems aren't available at this moment"
}
});
console.log(item1)
so what could be the reason the item1 is coming out empty
even after i attach something to it
i am pretty sure i am doing something wrong here but can't figure out yet
anything that depends on the value of count must go inside the callback
look up how promises and callbacks work
u are right didn't give too much attention to that
Oki so i passed it through functions
item1 = "1000 Gems aren't available at this moment"
siteRender(item1)
@woeful pike was this a good approach?
I would rather pass nothing into count, make it return a promise and use async/await instead
oh
there must be an async counterpart to that method
lmao yes Mongo
callbacks are a very outdated approach
If I create a volume for a container and mount it etc. If I have e.g. a NodeJS app do I have to specifiy something to save into the volume or can I access the file system as usually?
if its accessible from the filesystem, then its also accessible from node
node can access anything that the operating system can
but is it like persistent
(except like root/admin stuff and you dont run node as root/admin)
that's the point of volumes
its all up to how you set it up
node doesnt play a part in that
ye it was an example. If I have a volume and I mount it to a container. How do I access/write/read the volume from the app itself
you want to add a volume to the same container as the node app? or in a separate container?
just any container doesn't matter. I run a new container and mount a volume to it.
if you're just asking how to add volumes to containers in general, you'd need to check the docker guides/docs
I know how. I am wondering how they really work. Like how do you access the stuff from the volume in your app 😅
docker is like a mini operating system by itself
anything you run inside docker thinks docker is the operating system
so if you configure docker to mount xyz, then your app will also see xyz mounted inside this containerized operating system
using regular fs tools
okay that was the question. If I can usually access it with normal file read if I have mounted the volume to my container
basically yeah you should, depending on how you configure it
since it can be read-only, temp/ram fs, etc
everything is configurable
yeah thanks man
Successfully passing AuthProtectYT function
logs the variable data
Logging the variable activeChat
but as a result it returns status 903 and Access Denied (in catch block)
Is it usual or necessary to have two servers one for authorization and the other one for the whole data? (Like shown below)
not needed, just extra security
alright 👍
executing catch block even though there is no error
does it log activechat.livechatid?
no i changed this part for that (195-199)
what is the error that is logged before the 903 ?
the console log before on the same line
when I do it this way it returns Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client in catch block
and status 903 Access Denied
no
console.log the full error
remove the text hata var yigen
so it shows the stack trace
When I do if(){} else{} it returns Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client in catch block
status 903
but it should return 908 and can't do this
tauri best rust + js combo for desktop apps
I used to a problem 1 times
there is a big delete button on your discord bot page
if u scroll down a little
ye
if(existing_item?.Name != shop_item) {
await economy.updateOne({
memberID: message.author.id
},
{
$push: {inventory: items},
$set: {cash: final_amount}
})
} else {
return console.log(false)
}``` how do i get the name only?
and why do i have an extra object?
what do you mean?
Maybe you created by mistake 👀, you can delete it
Hey, how can I test my application commands with different languages? I tried changing the Discord client's language, but that didn't change it.
Docs:
Locale is determined by looking at the
X-Discord-Localeheader, then theAccept-Languageheader if not present, then lastly the user settings locale.
What are those first two and how can I change my locale?
IDK if djs already have that
but normally it'd trake some time to implement that
It’s still not fully released yet
You need a beta client of discord to test it
Oh that went easy. Thank you!
Now I have to figure out how I can obtain the name_ and description_localizations of my commands. A fetch method doesn't return them as it states in the docs
Do you have an idea? @boreal iron
Yes there’s an option to fetch with localizations
👍
Hmm that is not working it seems
When adding locale: 'nl' it is giving me the correct descriptionLocalized, but when adding withLocalizations: true ...Localizations and ...Localized are all null
Looks like that is only working for global commands and not for guild specific commands
Did you register and/or update the commands accordingly?
Hmm it's working now but I have no idea what happened.
I had 1 registered guild command, I did have localizations on that one (saw them when typing the command) but they didn't show with withLocalizations: true.
Deleted that one, made a global one in the same way, for that one it worked. Undid that and added the guild command back and the localizations were there
Yeah updating commands sometimes is fucked up
I'll just continue now as if nothing happened 😁
Aye, best method 
xD
I mean issues are expected as this is still in development
as the entire discord platform
Well you're right
issues are expected even if they aren't still in development
Nailed it
It looks like the localizations aren't available after restarting the bot. Could that be correct or is that an issue?
Do you eventually register the commands on each startup?
afaik I don't, I will investigate
well that sounds like I don't know what I'm doing: no
Why do I keep getting No 'Access-Control-Allow-Origin' header is present on the requested resource.? But when I put the url into my address bar, it just works just fine.
because CORS
also, this is not my api so I cant just go there and type in Access-Control-Allow-Origin: "*"
well, what is the api for?
Is it possible it depends on my npm version of discord.js? I'm using 13.8.1 right now (npm ls --depth=0)
well, okay, this is the order I do that:
restart
Register command
Console.log(... withLocalizations: true ...): _localizations are present
restart
Console.log: _localizations are not present
Also, when using locale: 'lan' in the exact same context, it does give me _localized
See also #992410763924885544 message
oh that was linking to DDevs, but they see the word discord.js and they say "go to bla bla for Discord.js support"
Well im not in any of those servers
But I remember I had that issue in the beginning when I started working with localizations, too
Well no problem. I'll see if I can solve this and I hope I can, as I don't like to continue with step 2 while the command handler doesn't fully work yet
Understandable
I somehow don’t run into this issue anymore
After deleting the commands then register them once again with localizations this issue disappeared
This was my question, so you say it's "no"?
Is it intended that you can still access
name_localizedanddescription_localizedafter a bot restart usinglocal: 'lan', but at the same time that it's not possible forname_localizationsanddescription_localizationsusingwith_localizations: true?
(Replace_lwithL)
Also when editing commands make sure to include the localizations as well, when missing them the command localizations will be overwritten with null
Great to hear that, will write a simple code to fully check it soon
I'll be back soon, thanks tho
await client.application.commands.fetch({ guildId: bot.guild.id, locale: 'nl' })```
locale was what I meant
And nl got registered as locale with the command?
Yes, and that was giving nameLocalized and descriptionLocalized
yes they're default
Hmm that’s weird
If I have like priorities for e.g. roles. And I put a role in higher priority in my DB (MySQL). How can I decrease every priority lower than this in the db? Like change the priority of my role and the other roles all automatically decrease priority by one in the DB?
Before:
1. Admin
2. xyz
3. abc
After I changed abc to second priority change xyz automatically to 3.
1. Admin
2. abc
3. xyz
afaik roles are like in discord, they're ordered by priority
so if u move a role to 3, the one in 3 goes up
yes I want to make it similar. But how do I do that? Do I have to map through every role and change the priority? Or can I do something like that in the DB query/strucutre idk?
u can make a move_role() procedure
roles are stored in the database (if it's similar to postgres)
like what?
You have to write the queries on your own
You can however create a dynamic flow to insert/edit a role and update all others of the same category for example by increasing their priority field or reducing it depending on the inserted priority
Yess. I will write a code and show it
but then I have to map over every other role first check if I even need to change the priority and if yes then increase it etc.
For example when inserted priority >= stored priorities increase them by one then insert my new role or edit an existing one
Not really you can use the CASE WHEN … and WHERE clause to do the job for you
As I explained in my example
Like insert or update with a case when any other role of this category has the same priority then increase them all by 1 before inserting
UPDATE roles
SET priority = priority + IF(oldPrio > newPrio, -1, 1)
WHERE priority <= newPrio
AND id <> my_role_id
ig?
Why would any role need a -1
if you're moving down
You only need to increase all roles which have the exact same priority or above
nope, that's just for one way
if you move up you'd still increase all priorities
if you're moving down, increase others
if you're moving up, decrease others
thanks I will take a look at this <3
Yeah when updating a role
Not when inserting one
they explicity say "moving"
heyy
is there a way to create a bot status page on a website
like what are some methods?
make a webserver on your bot with a simple /ping endpoint
if it returns status 2xx it's online, else it's offline
like express?
yes
for that allow ?shard=<number> parameter on that endpoint, then retrieve shard status from your shardmanager
ohh alright
Or simply report the app statistics to a database you query periodically and cache the results on your website
That’s usually what I do for simple stats ^
Dunno why things need to be more complicated than necessary
ohh true
but do i make a new document (using mongodb) for every shard?
or have all of them in the same document
However you like
I mean it depends on the amount of data you store per shard
If it’s just the guild size and or member count then throw anything into one document
Or simply keep it separate
hey how would i be able to get these values?
Because due to their - it sees the 2 keys as different things
you would do items["item-name"] instead of items.item-name
Interesting. Thank you!
how would i actually clear specific intervals?
I have a command that starts an interval, its defined using ```js
let interval;
interval = setInterval....
however, the command can be used multiple times.
so the clearinterval wouldn't work anymore right?
no clue what this is tbh
If you wanna kill the timers, define a global var as array pushing the intervals into the array when running the command
ah, just got the question
Iterating through the array can then kill every interval
this ^^
Or use an object instead of an array to specify specific key names for your interval you can kill separately
Or a map
I vote for map, it allows u to get an interval without needing to iterate
@boreal iron as promised, I wrote a simplified version of my code and I'm experiencing the same issue regarding localizations:
const Discord = require('discord.js');
const { bot } = require('./secrets.json');
// "GUILDS", "GUILD_MESSAGES"
const client = new Discord.Client({ intents: bot.intents });
client.login(bot.token);
client.once('ready', async () => {
const object = {
name: 'ping',
description: 'pong',
nameLocalizations: { 'de': 'pingde' },
descriptionLocalizations: { 'de': 'pongde' },
dm_permission: true,
type: 1,
};
// await client.application.commands.create(object, bot.guild.id);
console.log(await client.application.commands.fetch({ guildId: bot.guild.id }));
});
/* logs (line 18 commented, uncommented, commented):
Collection(0) [Map] {},
*nameLocalizations and descriptionLocalizations are present*,
*nameLocalizations and descriptionLocalizations are null*
*/```
I hope you can spot a mistake
that looks correct to me
The code, the output or both?
You’re not supposed to register commands on any startup
Registering is a one time process
Overwriting commands over and over causes trouble
@sharp geyser what about the output? Do you know what you would have / what it should be?
@boreal iron oh don't get me wrong, only the second execution of my code line 18 was uncommented. But as you can see, the restart after that, the localizations are null
If you are fetching a command that has been created then it shouldn't be an empty collection
lol
Also FakE aren't they already registering once? Or are you talking about they should be checking if it is already registered?
You also don't understand it. I executed the code thrice, the first time with line 18 commented, so no command has been created after the first execution
Hm does it help if I screenshot it for you?
Well using a service like sourcebin helps
sure
Hmm you’re immediately fetching the commands
Is the issue that the commands just aren't registering or?
I am new to the situation at hand
That could be an issue after registering them but if you comment this out on a second run, then the result shouldn’t be null
no, I will show you
@sharp geyser ^
To be clear: the total result isn't null, only the localizations fields are. Or is that what you meant?
Oh oops, forgot that in this example. I hope I didn't some hours ago when I talked to you 😂
well specified, just no locale at all
👀
also with this line 19 the same result:
console.log(await client.application.commands.fetch({ guildId: bot.guild.id, withLocalizations: true }));
I haven't fucked with localizations before
I will try another command name now, as I've been using ping all the time and because of this ^
this is all new to me
ohh
Not much of a big deal tbh
oh?
But it’s still a non-released feature
ah
You simply add a few fields to your command registration
Yea I know that much
I assume that the localization shows up for the user depending on their language settings tho
right?
no it isn't working 😦
yes
The rest is internal handling in your code by getting the guild or user locale executing your command and return a response in the associated language
yea figured as much
imagine if discord just added a fckin horizontal scroll bar for codeblocks
and disabled word wrap
am I just outdated on the discord news or smth
Maybe there's something wrong with (my version of) Discord.js as I don't see any sign that withLocalizations is working. It doesn't make a difference after startup and during the same runtime as when you registered the command, it also doesn't make a difference (the fields are there anyway)
yes community servers iirc
Or FUCKING syntax highlighting or line numbers
Wouldn’t be discord
Yes by default
I haven’t found a way of changing them but they all have
better discord ye ikr
there are for some langs, like js and...well, js
Might be the djs version
I think it requires the v10 gateway version
but highlighting doesn't help when they fuckin wrap the code
Not sure if the stable djs is already on v10
True but still isn’t a thing on the iOS client which usually is far better developed and up to date than the android one
actually no stable is only using v9 still
Thanks! Parts of them work tho, so I expect for everything to work, I need v10
@boreal iron @sharp geyser
I will join the d.js server and ask how I can use v10, will come back here
In this section, may I know where the topgg_auth is located, so where is the auth url?
(node:97) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/home/runner/Gage/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/home/runner/Gage/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
at Interface.<anonymous> (/home/runner/Gage/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)
at Interface.emit (events.js:326:22)
at Interface.close (readline.js:416:8)
at Socket.onend (readline.js:194:10)
at Socket.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:97) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:97) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I get this error when using my image command.
Allowing you to search an image.
Source code:
const img = require('images-scraper')
const google = new img({
puppeteer : {
headless : true,
}
})
module.exports = {
name: 'image',
aliases: ['img'],
category: '😂 Fun',
memberpermissions: [],
cooldown: 5,
description: 'Searches an image on google!',
usage: 'image <what image you want to search>',name : 'image',
run : async(client, message, args) => {
const query = args.join(" ")
if(!query) return message.channel.send('Please enter a search query')
const results = await google.scrape(query, 1)
message.channel.send(results[0].url);
}
}
try setting headless to false maybe?
everything I saw online says setting it to false should get rid of that
@sharp geyser @boreal iron about the localizations: I found a conversation with the same problem in the D.js Discord server from 8th June. I've asked if there's any news there
I have to get my /embed command restricted for admin guilds. Bit since I use slash commands from rapptz/discord.py, I cannot put @has_permissions. I mean I can put that and it works. But I cannot catch its error
did you used error handlers?
did nothing.
and slash commands requires another type of handler @midnight marsh
mmmm
what type?
yes. try and except
ishandlered or sth else it could be
....
totally it didn't work
read dpy docs
okay thanks
the backrooms
moms basement
CIA's secret moon base
topgg development channel moment
who the fuck would host shit on mars
yeah with literally 187k ping on a good day and 1.3 million ping on a bad day
cheap and affordable
key words man
That’s as far away as you can get from Discord’s servers lmao, watch bots get 5892329292ms ping
pluto?
you can get further
just not in human lifespan
that metric makes zero sense
so fast
that is what you say makes no sense?
mars-powered discord hosting
Lmao

tim you draw the lines in very weird places my friend
physically putting stuff there is a lot more feasable than somehow creating speeds 12x84600 times the literal speed of light
Okay
I feel like if anyone could do it elon could
after all he got a bunch of idiots to invest in doge coin

Tim do you know anything about Monte Carlo, perchance?
24h latency
Just a common latency over here

x86_64 of course
Nobody actually wants ARM
As long as developers and companies don’t mutate stuff over to this platform
x86_64
who the fuck still uses powerpc
Trusted and working piece of technology even after 15y
Imagine stuff nowadays would last 15y
Haaa!
if you wanna run old shit sure
but its basically not compatible with anything
powerpc based macs were a piece of shit because they couldnt run any modern osx app
couldnt be updated, couldnt do shit
_Windows XP users of today _
windows 11 users wondering why they need to upgrade their whole motherboard and cpu just to run windows
windows 7 users:
And suffer the consequences of all the hardcoded shit even win 10 could get around by manipulating the system
As well as the useless tpm requirement you can still get around
microsoft stopped focusing on actual optimization and started relying on newer hardware
any osdev person will tell you thats a bad move
not necessarily for the marketing
its just bad 😭
windows 7 is probably as light as you'll get nowadays
from there on it kinda went to shit
I mean the effort it took to make windows 10 work on like any system around the world costs a lot of money I guess
not like any microsoft products are particularly light
it is hard making an os work on all hardware
impossible actually
you can only really get most
you have to rely on people writing drivers
The coverage of windows or windows server as light version is really good
microsoft dont have time to write drivers for everything
tpm is the most useless requirement ever
only really newer motherboards have a satisfactory version of it
that's their goal
can't complain about unoptimized os for low end pcs when you don't support low end 
Or just modify the .iso
Real chad moment
that's what i did
There’s still no advantage of using v11
Not at all
At least for users doing more on their pc than probably 99% does
It’s 50/50 in here
50% trolling and 50% serious answers

But in order to get any answer you need to provide some code and accurate error message
Of course without leaking your credentials
Is this normal when creating an array object?
if it is an array of objects then looks like it
What were yyou expecting it to look like?
Those numbers in front of your objects are your array keys
While the objects are the values
erm, theres no additional empty omjects
ah every items generated with the same id's?
Is there a way to connect mongodb to nextjs project
The array keys are unique
To get an item you gotta iterate the entire array and search it by its name
Which isn’t really effective
So saving the inventory as object with item names as keys will make things a lot easier for you
How do I hide my first object? here's how I code my inventory command: https://sourceb.in/1VQcIe9ayh
a better question would be WHY it's undefined
idk when i create the account, there's an additional empty object
how are u creating it?
Schema:
inventory: { type: Array, default: undefined, required: true },```
Command:
inventory: [{}],```
According to your screenshot the first item isn’t undefined but has no Name and Value properties
Should i remove the inv on my command?
ngl I thought that first object was the entrie's ID but ig I am just dumb
yeah
same here tho
u still need to remove already present entries
already did
show current code
just put the relevant code
Hello! So I'm trying to add Vote Rewards to my bot, I have the required packages installed via NPM because i'm using javascript but I have an issue can anyone help?
just an fwi you can set default values in a mongoose schema iirc
so anywhere you set as 0 or an empty array or smth you can set as default and when you create an entry it uses those defaults
are u supposed to set default as undefined?
it saves on writing code
I am more confused on why he sets defaults but doesn't allow it to use em
ohhh, gonna keep that on my mind
just searched it awhile ago
he is overwriting what the defaults are
let me change it
Like I send a test via the webhook I've setuped and have listed, and I'm hosting locally which I have my IP as the URL in the "Webhook URL" settings on the Top.gg settings page which is http://<my ip>:3000/bot/vote and I have a POST request and a GET request.
what's the issue
do you mean, even i dont put the value on my command, it will automatically going to be defaults value?
Locally on your PC in your home network?
you can:
//Schema
const mongoose = require('mongoose');
const newAccount = new mongoose.Schema({
nickname: { type: String },
memberID: { type: String },
health: { type: Number },
max_health: {type: Number },
min_damage: { type: Number },
max_damage: { type: Number},
guildStatus: { type: Boolean },
guildName: { type: String },
spouseStatus: { type: Boolean },
spouse: { type: String },
inventory: { type: Array, default: [], required: true },
level: { type: Number, default: 1 },
exp: { type: Number, default: 0 },
limit_exp: {type: Number},
cash: { type: String, default: 0 },
bank: { type: String, default: 0 },
warning: { type: Number, default: 0 },
report: { type: Number, default: 0 }
});
module.exports = mongoose.model("accounts", newAccount);
//Command
new economy({
nickname: game_name,
health: 100,
max_health: 100,
min_damage: 1,
max_damage: 50,
guildStatus: false,
guildName: null,
spouseStatus: false,
spouse: null,
limit_exp: 100,
memberID: author.id,
}).save();
You can also set any values you want to default to a specific boolean e,g guildStatus you might want to be false by default until it is changed in code or smth
When I send a test to the webhook UI have, it doesn't respond with anything in the console which I told it to log the vote property to return the info of the test result.
When you set defaults in the schema, they are used when creating a new entry
ohhh
so you don't have to set them again in the new economy({})
actually all of those can be set to default
except nickname and memberID
wasn't sure what he wanted default so I just did the most obv ones

it works
so, it doesn't output anything?
Hosting at home requires a public IPv4 (no DS lite tunnel) as well as port forwarding in your router to the local PC ad well as a proper firewall setup to allow incoming requests
yeah basically.
damn, i always do defaults with value on my command with my past project bots lmao
thanks for the info tho
you can do what kuuhaku said and set everything except memberId and nickname as default values
and if you wanna overwrite those default values you can supply the value in the creation of the entry ofc
yes yes thanks for the info
I have that, http://<my IPv4 address>:3000/bot/vote
If one on this list is missing you won’t get any request
brb in 2 mins
const { Webhook } = require("@top-gg/sdk")
const bot = require(`../bot`);
const Log = require("../Structures/utils/log");
const express = require(`express`);
const app = express();
const webhook = new Webhook("somestupidpasswordgoeshere");
app.post("/bot/vote", webhook.listener(vote => console.log(vote)));
app.get("/bot/vote", (req, res) => res.redirect(`https://top.gg/bot/982887627181158440/vote`));
app.listen(3000, () => Log.info(`API is now officially live on http://localhost:3000!`, "express"));
this is my code.
Make sure anything is done I mentioned
check your firewall if it's blocking the 3000 port
It doesn’t block a port in that range by default
But it doesn’t allow incoming requests on that port
do you use windows?
yes
Yeah, it's my primary OS.
One last question, how do I return if my inventory array is empty?
looks like if(!data) aint working
i cannot help if you're using windows, I don't know what is the equivalent of ufw command on windows
so i need to do the opposite way?
print the array to see if it's empty
Before doing step 2, make sure your router allows port forwarding
Without forwarding your port 3000 to your local device nothing will pass the router in the first place
Also consider to test and run the webhook listener on a server
worked, strict operators did the work !== === thanks again
If not you need to adjust the port forwarding rules if the LAN devices have a dynamic IP (which they have be default) as well as update your IP on topgg as it changes frequently
do check tho, if it's indeed an array or a collection
and if length returns anything
remember js won't throw errors if u try to access an invalid property
let prefix = await db.fetch(`prefix_${message.guild.id}`)
^
TypeError: db.fetch is not a function
idk why it is saying that
what is db?
quick.db
[] === [] is false
same with ==
They're different pointers
now it's saying db.get is not a function
then your db variable is not quickdb
hello! I'm fairly new to bot making but I was wondering if possible how to make a bot that can only speak in a single channel, but respond to messages from any channel
you can send messages to specific channels using the channel id
regardless of which channel you receive it from
oh! I'll look into that right now thank you so much
How do i get the User part? its on collected.on, i.author?.User didnt work tho
even .length
or using [index]
collected is likely a collection of multiple items
not a single item
collected.first() or collected.find() or collected.get(), depending on what you want
my goal is to compare the i.content to message.author.id
Can I nest those on collected.on?
collector.on('collect', async (i) => {
// try {
// return console.log(i)
// } catch (err) {
// return console.log(err)
// }
if (i.author.User.id === message.author.id) {
const embed = new MessageEmbed()
.setDescription("Are you going to marry yourself?")
.setColor('RANDOM')
.setTimestamp()
message.channel.send({
embeds: [embed]
})
}
})``` this is the current
ah fak
wait
it seems like what you want is i.author.id
wait wat
what the f-
i thought
i need to include the User
thanks
Anyone familiar with the npm Discord-Player? How to fix this error?
show code?
if (i.content === client.user.id) {
const embed = new MessageEmbed()
.setDescription("Are you going to marry a bot?")
.setColor('RANDOM')
.setTimestamp()
message.channel.send({
embeds: [embed]
})
}```
it return as `log(false)`
what is i.content
pinged bot
const new_content = i.content.slice(2, -1) I used these when <@ includes, it still return as false
like wt
let me change the position
wait
well that isn't how you wanna do it
Use a regular expression to extract the ID
or
IDs aren't a fixed length
if they are using djs they can grab the mentionable
assuming i is a message
i.mentions.members.first()
returns a member object
or null
if it isn't cached yes
alternatively though since they just wanna compare ids they can do i.mentions.users.first() which iirc doesn't return null but the user object
im using collection
I haven't looked at the docs
so yeah
they just said they were using mentions my guy
Is it actually required for there to be mentions though. General users aren't the dev
client.user.id but this is the every bots id right?

that is the bot's id yes
strange asf
not really
i mean
const new_content = i.content.slice(2, -1)
client.user.id === new_content```
return as false
!action <user>
can be done as:
!action @sharp geyser
!action Misty
!action 957347862314905610
!action Insert Misty's Nickname Here
i also use i.content.includes("<@") for new_content
It could also be <@!
isnt @! deprecated
The opposite I think?
no I am pretty sure they deprecated it
waiting on v6 and v7 to die
Doesnt resolve on iOS
@scarlet kestrel
Desktop?
we just did
Oh lul
same with bot tho
5head
Also you can do many things to also get around this
The yellow highlight is very faint with dark AMOLED
i think all of devs knows this-
What I was highlighting was that if there are no checks for if the user is actually inputting a mention, then trying to access first mentioned members will give null
well yea
client is the bot
strange
client.user.id is your bots id. Message.author.id is the instigator for the message create
I assume i is an interaction so i.user.id would return the id of the user who used the interaction
ik
I forgot interactions exist
lol
content doesnt exist on interactions
message based interactions have a message property attached iirc
context menu commands dont tho
am I dumb? or is chrome messing with my arrays?
open the (2)
looks like it is creating a 2D array in some places unless my eyes are playing tricks on me
The entire array is a 3D array
lets try with <@!




