#development
1 messages ยท Page 1154 of 1
I mean, you can still make a custom function in JS so
it's just that Python has it by default
who is shvaco
Array index is an integer
Well, yeah. In order to get a random element, you need a randomized index.
Which happens to be a random number
I feel that
what's randomValue?
so the same as random.choice(list)?
i also need some lmaos
what do you need to do
you can piss off stop wasting peoples time
what do you need?
be serious
just tell me
this ain't a serious answer
randomtext[Math.floor(Math.random() * randomtext.length)]
that will do yes
that will work
"301655085954367490": {
"points": "55000",
"access": true
},
"301655085954367490": {
"points": "55000",
"access": true
}
}```
why no work
idc its json
@earnest phoenix unless you are willing to actually help, please refrain from posting in this channel
thank you
wym why no work
what about it isnt working
just saying why no work doesnt really help
duplicate key
shit
thank you
@slender thistle aight cool

JSONLint is the free online validator and reformatter tool for JSON, a lightweight data-interchange format.
that's pretty helpful
if (['f1', 'f2', 'f3'].includes(args[0]) args[0](bot, msg, args);
// code of functions..
// -> "args[0] is not a function"
what are you even trying to do
if my commands are listed as maps, how would I make them list
and I assume args is an array of strings (Array<String>)
yes
IF6 what language, and do you want the keys, values, or both
imma tryna check if there is a function with the name (args[0])
and then run that function
@sudden geyser my original plan was to use fs to get all the files in each folder
and I use js
If you already have the commands saved in memory using fs is unnecessary
so you want them as something else?
I'd like to list them for my help command
The methods you could need are documented well at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map.
For example, if you wanted to get all the keys in a map, you could use <Map>.keys() then use the spread syntax to convert the iterable to an array of strings ([...someMap.keys()])
Hm so my mongoDb apparently isn't responding.
I don't want that
Your public IP changes a lot
I'd have to ask my ISP for a static public IP lol
But, I'm bothered MongoDB doesn't let me specify my domain that points to my latest IP addr
Because the world ran out of IPv4
Mhmm, I'm aware of that
They don't just give a static ip to a solo dev for a small project
Or you have to pay 
Ig a CIDR range will have to do
iirc, the isp i use now actually wont give static ip's unless you get a business line.
This ^^
which they dont sell to residential homes 
hey guys i have a question
how to create an invtitation on a server by the server id?
why would you want that.
for example make a !createinvite command (the id) and have the bot create an invite on the remote server and reply to my message with invite
why would you want that.
@misty sigil for support
Well this is only possible if the bot is in the other server
Inviting people who weren't allowed in the first place 
so if I know my commands are maps, would I use a collection to specify which folder each command is in?
commands are maps?
i cant seem to be able to send dms to users with my bot, im using
message.author.send("Message");
but it wont work
i get no errors, nothing happens
Do you get an error?
commands are maps?
@warm marsh mines are maps
Do you get an error?
@ebon kelp no
You mean you store in a map?
oh nvm, it works now sry
yes i do
is there a way to include things like discord widgets in github readmes?
.
are you sharding
It's fixed - I ran the wrong file.
i want my bot to send embed message anyone got a code?

im trying to make a leavechannel system thingy thing that uses mongodb where you can edit the leave message and where the message is sent and i cant quite get it, i cant really show my code because i have none ie just been messing around
@rose isle https://dontasktoask.com/
what would be like the target thing in python
but istead of author
like for a ping
<channel>.send({ embed: embed })
@earnest phoenix
thanks
for a avatar command
how can i ping the user
like the person whos avatar would show
I'm looking for some Discord Py help
@client.command()
async def send(ctx, channel, *, content):
channel = client.get_channel(id)
await client.send(content)
AttributeError: 'Bot' object has no attribute 'send'.
Above my code to send a message to a channel which i pick by the ID and below the error message i get after trying
how do i add cmds to my bot?-
channel.send
Error changed to 'NoneType' object has no attribute 'send'
if i were to get the mention of the user or of the name and # of a user
what would i do
like im adding a avatar command
how do i get the user who was pinged
not the author
channel is None
lib?
pyton
meaning the id you passed to get_channel is wrong
i have my avatar command in an embed
yea
if there's even an ID and not literally the id built-in function
im adding that
somewhat sure there's no way to disable channel caching other than clearing the fuck out of client._channels and client.channels
@client.command(aliases= ['avatar', "av"])
async def pfp(ctx, *, member: discord.Member=None):
show_avatar = discord.Embed(
title = "Showing the Users' Avatar:",
color = discord.Colour.green()
)
if not member:
member = ctx.message.author
userAvatar = member.avatar_url
show_avatar.set_image(url='{}'.format(member.avatar_url))
await ctx.send(embed=show_avatar)
but how do i add the person who was mentioned
yea
and other id's too
1 sec
async def avatar(ctx, *, avamember : discord.Member=None):
userAvatarUrl = avamember.avatar_url
userAvatarMention = avamember.mention
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.add_field(name='โ ', value='userAvatarUrl', inline=False)
embed.set_thumbnail(url=f'https://imgur.com/Pe9nY2r.jpg')
embed.set_author(name=f"userAvatarMention", icon_url=f"userAvatarUrl")
embed.set_footer(text=f"{ctx.guild.name}", icon_url=f"{ctx.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
this is mine
is the userAvatarMention correct?
or o
no?
Put it in {}
async def avatar(ctx, *, avamember : discord.Member=None):
userAvatarUrl = avamember.avatar_url
userAvatarMention = avamember.mention
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.add_field(name='โ ', value='userAvatarUrl', inline=False)
embed.set_thumbnail(url=f'https://imgur.com/Pe9nY2r.jpg')
embed.set_author(name=f"{userAvatarMention}", icon_url=f"{userAvatarUrl}")
embed.set_footer(text=f"{ctx.guild.name}", icon_url=f"{ctx.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
ill try this
I need to use a variable while defining an another variable. Is there a way to do it?
Can you elaborate on that, i didn't exactly understand what you meant, like show an example @supple sail
how do i get a ping from a message
im doing a avatar command
and i want it to say the pinged users name as the author
You might wanna have a look around what you can do with ctx.author (it's technically a member object, but since Member subclasses User, all of the attributes still apply)
Hi!
is there a more efficient way to say emoji's?
im using 1k chars(field size limit) in like 80 emoji's
let var1 = 5;
let turn{var1} = "some code here"
Is this possible? @earnest phoenix
with the <a:emojiname:id> stuff
How was the code for it to give you an advertisement so that it waits to use the command again? I forgot someone help me please
oh how was the code? it was great
na jk we don't give out code
@supple sail I think you want to create a function
ok just asking
There is no other way to use custom emojis, libs will just evaluate them to <:name:id> if you do placeholders with like toString and what not
awh
You could list their names, I guess.
That's the only way discord's markdown parser recognizes them
How was the code for it to give you an advertisement so that it waits to use the command again? I forgot someone help me please
@earnest phoenix Could you please elaborate?
is that I want a command not to be used several times and to give the user an advertisement to wait to use that command again
@slender thistle
A command cooldown?
Yes ye
I think this might be helpful. https://discordapp.com/channels/264445053596991498/272764566411149314/743903580104163339
Unless you are not using discord.js, but the general principle stays the same.
Oops thank you really

Anyone hip with Python and the pymongo package, I'm looking for a way to optimize document searches and fetches. Is there a Pythonic way to check the existence of a document and then grab that document without having to index the whole collection a second time?
Right now I use if collection.count_documents({'key': value}, limit = 1) != 0: to find if it exists
The way I usually do it is something like this:
data = bot.database.collection.find_one({"bypass_filter": False})
if data is not None:
# process the document
else:
# document not found```
(I have my database object attached to my bot object, so please don't mind that too much. ๐)
Gotcha. I load off a config and pass that around . . . technically mine is the same way too
So I see, rather than a conditional on the find operation, you set it right away
And that doesn't except if it doesn't find one?
find_one returns None if it doesn't find a document passing your filter, so that's why I'm using ifs. ๐
Ahh nvm I see. Awesome, thanks!
Though, personally I just do if data: to check if anything was returned. Simplicity!
๐
I miss C#'s conditional access

Sometimes I want it to exist in Python, too. But... not everything is meant to happen, I guess
so, just was doing the math. in order to have every ship asset for battleship, on fire and not on fire, with every rotation, i need to cut, rotate, add background color, add fire ontop of 136 emoji's
ahh
so glad ezgif exists
can't you just generate it programmatically
loop through all of the assets and generate all possible combos
I miss C#'s conditional access
@quiet wadi u and me both
There's a pretty solid C# library for Discord too . . . But I just can't get off the addiction to hotfixing via discord.py cogs
It's just that convenient
have you tried mongoengine
OwO
spent 2 hours on something, and i have to trash all of it
sad
anyone want assets that are supposed to be 5x1, 4x1, 3x1 , 2x1, but are actually not?
lmao how did you manage that

someone made battleship assets gave them up for free, but gave them in weird aspect ratios
like 5x2.2
??
are they all the same aspect ratios though?
no

everythings all over the place
I was gonna say you could just slice them if they were
totally fine if your not making battleship
but f
found a game that uses these assets, but the squished all the ships to fit
is your bot like minigames or smth?
yeah, its just me making a bunch of random games @amber fractal
someone challenged me to make battleship a few months back.
finally got around to it.
this isnt really the place to ask.
If you want devs, fiverr or something ๐คทโโ๏ธ
most partnerships imo are just friends, or people who are already interested in the project.
whens the last time you partnered with someone randomly on a server because they asked? it just doesnt happen often imo.
I'm sad, when I was doing cs in school, I made a console version of battleship with cool shit, but they didnt let me retrieve the code
here is the thing
twice with me actually somewhat trying to win
i dont have friends

I did make a minesweeper thing tho
Still have that
It's not exactly minesweeper though, because idk how minesweeper actually reveals the tiles it does when you click lol
https://oliy.is-just-a.dev/nmm6lx_5661.png 1st click :(
i was going to do a minesweeper game, but discord games like that are often coordinate based.
so like f4
but often you accidentally do the wrong thing and that seems really frustrating
coloring rows and columns specific ways would help, but ah, not worth it
well in discord games like that are very hard because rate limits hate people
honestly, the ratelimits are not too bad especially since no one uses the bot 
I made a procedurally generated 2d dungeon crawler that only has 2 enemies and a broken economy system
that seems fun
It wasnt lmao
I had to do it in some garbage app
The thing is fucking 2000 lines long and in some version of js that doesnt have simple stuff
I had to manually build in object.values, array.find and array.findIndex
Which, granted isnt hard, but still
the nice part of not being in any cs classes, can just do what i want
Well it was what I wanted to do, the class was just very basic and I had like 5 years of knowledge in cs, but they didnt let me skip it
And we couldnt work at our own pace so I literally was doing shit I already knew how to do 
isnt that so sad?
plenty of experienced devs probably have taken classes like that.
I mean it was free college credit so I'm really not complaining
just wish I could've learned a new lang that's actually useful instead of learning the same one again
Hey guys question about verification
I wouldn't have minded learning C++
so I verified and everything
but next time I try to verify my bot
Do i have to put my id
again
Shouldnt need to
Common sense says yes, but am I 100%? No.
probably should ask in this server
https://discord.gg/discord-developers
you dont need to put your id again
wait he's big?
If it's in the same team, then you wont need to enter if it isnt u will have to.
So I heard that nekos.life api isn't allowed. Is it only for certain things or all of it and does anyone know replacement(s) for it
for certain images
like the one's that can return minors
iirc
it's against tos/guidelines @timber frost
hmm, do you know which ones exactly or any ones that are accepted?
how do i check if something includes something?
i have a message variable that comes from something (not discord) but message.includes("thing") gives me an error.
javascript btw
hmm, do you know which ones exactly or any ones that are accepted?
@timber frost the nsfw endpoints https://www.npmjs.com/package/nekos.life check here for the sfw'nsfw endpoints
message.includes
doesnt make sense i dont think
message is an object
i think you want the string
message.content.includes
is that in disc.js or
does message.content.includes work everyone or just in discord.js
thx
sorry i meant discord.js
np

it'll lower the total count
lets see
im actually amused rn
i managed to make a...
clears throat
FREE NITRO BOT
worst part is, i wasnt even meaning to
bruh how
why not pass it onto description then?

id be passing message char length
description can hold 2k iirc
shouldnt be that bad with 2 messages
@marsh lava also, was doing a role play command when it kinda turned out to be a free nitro thing unintentionalyl
battleship is pretty fast pace against bot
one would assume it'd be taking turns
or maybe im just skilled ๐ค
that would be a major major bug
no pvp yet
all of it is against the ai
shiet.
couldnt even do it with the 2k char limit
22 chars per emoji.
100 emoji
2200 chars
i wanted to do images, but games can last 50-70 moves, thats 50-70 images which is just way too much.
i might look into the salvo rules of the game to make it shorter, its kindof a long game to play in discord
it still works either way
'doesnt work' doesnt mean it should work
its not a platform for hosting bots
period
yeah but it runs fine
what
yeah but they also ban you for doing that shit
^
theya ggresively go against botting on their servers
use a proper vps
does it look like i have money
dan hosting or something, plenty of free shit out there
just use stuff PROPER for bots
guess i'll ask my friend since it was his idea to do this
you the one who choose to keep at it knowing its shit
i'll ask my friend since
he is the one that is mainly programming the bot
that im making
Confusing, but im not gonna ask
shouldnt they be the one coming here then?
normally i need help
but if he's the one coding the bot...?
i also code the bot too
hmmm aight
you know js at least?
not quite what i meant, but sure
js isnt my main focus however
JavaScript the language in general
if its something lib related we can likely help
whats lib
if its glitch people, just like i did, will prob tell you to mvoe to a proper vps
you said it yourself, discord.js
oh
Javascript is a language, discord.js is a library/wrapper
oh
I am trying to add a serverinfo command but it doesn't give the role and emoji count, can anyone help me with that?
instead of role and emoji count it gives this: [object Object]
try using official discord emojis
I applaud you for ur patience, when dealing with stuff like this @opal plank
probably object because
oh
Something I lack, unfortunately
being a programmer requires patience @earnest phoenix lmao

already used to this

@rancid bramble show us a snippet
np
cya
wdym?
๐
whats the code you trying to run
`const { MessageEmbed } = require("discord.js");
const Discord = require("discord.js");
module.exports = {
name: "serverinfo",
category: "everyone",
usage: "serverinfo",
description: "Sends the server info",
run: async (client, message, args) => {
let embed = new Discord.MessageEmbed()
.setColor(RANDOM)
.setTitle("Server Info")
.addField("Owner", (message.guild.owner))
.addField("Members", (message.guild.memberCount))
.addField("Emojis", (message.guild.emojis))
.addField("Roles", (message.guild.roles))
.setTimestamp()
return message.channel.send(embed)
}
};`
how are you fetching roles and emojis?
emojis is a collection iirc
same for roles
lemem double check
you need to access cache
otherwise you trying to send a map
12.3 came out?
you need to access cache
?
yeah it was, just being silly
cache is a Map()
both roles and emojis return cache
which is what you want to be accessing and checking sizeOf
do you know what a MAP is in js?
iirc
its just .cache on the emoji manager
๐ค
watch as he added that and notices it errors still
they added force fetch
intresting
so itll fetch from discord 100% never from cache if you ask it to
well, reading the docs it looks like they added more caching stuff
im not sure what it actually does
approximate_member_count
@solemn latch it's a change following the privileged intents btw, this will return an approximate member count in the REST request so you don't have to do anything gateway related
Hi
How do i get new member's invite?
like an invite manager
Do I do \n for newline?
yes
Thanks
Is it hard to use mongo?
Like Iโm adding it
But the issue is I wanna add like a module list thing
So I need to check to see if the module is on, and if not then Iโll see what to do
How do i get new member's invite?
like an invite manager
@rain cradle one way is to cache all invites then see which invite has changed, but that can have strain as you have to cache all guild invites.
ok
when I do a mysql query like UPDATE balances SET coins=coins+? WHERE id=? and the coins are like 5 plus 5.05 and for some reason inside the mysql server it gets turned into 10.0500000009
IEEE 754
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
//@match https://discord.com/channels/"id"/"id"(I replaced them)
// @grant none
// ==/UserScript==
(function() {
'use strict';
(document.getElementsByClassName("full-motion theme-dark platform-web").innerHTML === "Annoying person")?document.getElementByClassName("full-motion theme-dark platform-web").innerHTML = "Blocked":null;
})();```
I tried Tampermonkey for fun. ClassName should be the html tag. I tried to replace all innerHtml texts of "Annoying person" with "Blocked". It didnt really work^^ is there a reason for it that it wont work for discord that easy or did I just make a mistake?
i don't think getElementByClassName exists
but getElementsByClassName returns an array so you have to iterate them over, you can't just set or view innerHTML like that
ups, yeah, that is a typo, but ok, it wont work, but maybe this will work.
document.getElementsByTagName("html")
Do I still have to iterate them over?
yes, getElements, s
if you use IDs, it would be getElementById, "element", no s so you can use it as is
yeah, I have never really thought about this, I have always used getElementById in the past
so if food is "toast"
i want to check the toast.images
is there a way to do this
or am i thinking too hard about this
:)
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
//@match https://discord.com/channels/459195345419763713/e323232323232
// @grant none
// ==/UserScript==
(function() {
'use strict';
let const = document.getElementsByTagName("span");
for (let i = 0; i < x.length; i++) {
(x[i].innerHTML === "Agent Mura")?x[i].innerHTML = "Noob":null
}
})();
something like that, right?
it works i just need to like use the quotes as a variable name or something lmao im not sure how to explain it
oh
show the food part
i mean images
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
//@match https://discord.com/channels/459195345419763713/56201953913562e
// @grant none
// ==/UserScript==
(function() {
'use strict';
const x = document.getElementsByTagName("h2");
for (let i = 0; i < x.length; i++) {
(x[i].innerHTML === "Agent Mura")?x[i].innerHTML = "Noob":null
}
})();
this actually should be fine..still aint working
console.log(x), debug
well, that doesnt really work with tampermonkey. Nothing logs in the console. 
try changing x[i].innnerHTML = to document.getElementsByTagName("h2")[i].innerHTML = , just that
it doesnt seem to work :/ meh, would had been nice tho to be able to change discord with tampermonkey
I tried some basic stuff, but nothing worked
I take it back, it works. I had a problem with my browser
hmm, is this actually against the TOS rules? ๐ค
^
Is there a way to make a settings command that is not like one massive file?
Discord.js btw
how do i put a spaceinthe prefix for example
eli help
trim the context after slicing the prefix
Why is it not loading?
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.avatarURL({ dynamic: true, size: 512, format: 'png' })}&text=${text}`)
its music play commands รงal = play
Webhocks 
i dont understand u dude -.-
Try to convert $1 > $0
const queue = client.queue;
// ^^^^^ doesn't exist, so...
// ...
var serverQueue = queue.get(message.guild.id);
// ^^^^^ undefined```
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.avatarURL({ dynamic: true, size: 512, format: 'png' })}&text=${text}`)
``` Why the image is not loading?
that has nothing to do with this problem
i noticed in the image you sent you have the line const queue = new Map();
remove const queue = client.queue; and see what happens
read the error
Change your YouTube api version and discord api version.
@fringe axle does that user have a default avatar

if so, it will return null
how can i change actually i dont know js i am beginner
and i dont have good english
you should learn the basics of js before continuing
i solved some errors i didnt searching but i dont solve this command ..
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.avatarURL({ dynamic: true, size: 512, format: 'png' })}&text=${text}`)
``` Why the image is not loading?
@fringe axle can i have some context of what the image would look like? also you probably shouldn't include JSON in a url
hey guys give me a nice idea for my bot ping me on your answer
Our bot is offline
i dont know glitch
I think
i am using vds
you should learn the basics of js before continuing
@sonic lodge
glitch memory so trash
Ok send me our package file
..that's not related to their problem
@earnest phoenix can you add me
My dm open so send me
this will be great
@fringe axle can i have some context of what the image would look like? also you probably shouldn't include JSON in a url
@karmic compass Of course, wait.
It should look like this normally.
that's the user's avatar?
hmm
hey guys give me a nice idea for my bot ping me on your answer
@wanton anvil any ideas
what does member.user.avatarURL({ dynamic: true, size: 512, format: 'png' }) return

The avatar of yourself or if you mentioned someone the avatar of the mention.
give me a nice idea for my bot ping me on your answer
async run(message, args) {
let argsC = message.content.split(" ").slice(1);
let text = argsC.slice(1).join(" ");
const member = message.mentions.members.first() || message.member;
const userFlagsA = await member.user.fetchFlags();
const userFlags = userFlagsA.toArray();
const embed = new MessageEmbed()
.setColor('#ea6ef1')
.setTitle(`Floor Text`)
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.avatarURL()}&text=${text}`)
return message.say(embed);
}
};
Full code.
hm
probably
because
in a link you can't have spaces
how do you connect spaces in a link again
%20?
Yeah
Where are spaces in there?
give me a nice idea for my bot ping me on your answer
give me a nice idea for my bot ping me on your answer
oh you're trying to fetch an image from an api
Don't spam @wanton anvil
@sonic lodge can i send my js project could you help me
Don't spam @wanton anvil
@faint prism ok
give me a nice idea for my bot ping me on your answer
hm
@fringe axle nothing is wrong with your code, i believe something is wrong with the api link. where did you find it/find the code for it?
i copied your code, got the same thing, manually filled in some of the api link fields, got an error
Category: economy
The economy part is like ${command.category}
and I cant make it capitalized on the first letter only
how can I do that?
@delicate shore we saw your message, kindly waitt.
Ok
@feral aspen get the first character of the string, convert it to uppercase, then append the rest of the string
Bro
Its not like that
**Category:** ${command.category}
How can I do that..
??
are you trying to convert the first letter to uppercase
Yes.
That is what I am trying to do .,
Am I supposed to create a seperate variable?
let str = 'economy';
// get the first character of the string
let firstCharacter = str[0]; // e
// convert it to uppercase
firstCharacter = firstCharacter.toUpperCase(); // E
// concat the new first character with the remainder of the string
let newStr = firstCharacter + str.substring(1); // "E" + "conomy"
console.log(newStr); // Economy```
Ok Thank you! ๐
@sonic lodge no spoonfeeding code
@delicate shore just make choice array
Lol
Easy
Me waiting for someone to reply
@delicate shore I'll help
If you stop whining
Are you tryna read JSON data and converting it to JS objects?
OOPLED#9848 no spoonfeeding code
@earnest phoenix he's not, he's showing how it works
@delicate shore if you want to read and/or write JSON data then I found this good article online which I'll simplify a little for ya
How to get choices in JSON file
@delicate shore require your json file const json = require(โpathโ))
then json.location.location
but replace location with whatever
so like
โexampleโ: {
โabcโ: โcbaโ,
โBioโ: โyupโ
}
json.example.Bio
=> โyupโ
require("path/to/json.json");
typed on mobile 
well this is my code but is says me this is a owner only command ``` if (message.author.id = "554185890453389322") return message.reply("I m sorry but this is a owner only command")
and i m the owner
= attempts to set a variable
you're assigning it, if you want to compare, use == or ===
ok ty
use === to compare variables
hm okay ty
Eslint says its === so its that
Its ===
@honest perch it's both @swift umbra
``` if (message.author.id === 554185890453389322) return message.reply("I m sorry but this is a owner only command")
if (message.author.id === "554185890453389322") return message.reply("I m sorry but this is a owner only command")
bot not working
Es-lint might say to use === but you can use either.
@golden condor yes but 3 is better
Wrong
Kinda
Ok
=== compare if it is same type AND if it is same value
For examle
1 == "1" //true
1 === "1" //False
bot not working
@weak rain
- does it have errors
- can you show code
== checks if the value matches
=== checks if the value AND datattype matches
i fixed it
k
ty for help
Neither is better. They both function mainly the same except for some cases
^
=== compare if it is same type AND if it is same value
@earnest phoenix we dunno if snowflakes are strings or numbers
Use ==
Nope
We dunno if he's comparing the snowflake to a string or number
#MessageAuthor.id always return string
Not number
But he might compare it to an integer
All of id return by djs is string
Why did you emphasize he?
ive done that once
Why did you emphasize he?
@golden condor because I'm talking about him bruh
Snowflake return by djs is also string
ik
but in his example he used a string to compare it to the snowflake in some other place of his code he might compare a number to it
Why number
dude
read it again
why are you guys arguing about operators
I have no idea so I just left
Oof
How do I count all the members of all the servers my bot is in?
Sharded or no?
You can loop it
You cant with sharding
Yes you can.
he might compare a number to it
example:
if (message.author.id === 34616164346546161) //false because he's comparing a number to a snowflake and the snowflakr is a string
if (message.author.id == 34616164346546161) //trur because we ain't checking for the datatype
am i clear now
js
You have to call shard broadcast @golden condor
Yeah
Isnt looping directly
Or fetchShardValues
@delicate shore you still need help with JSON
totally ignores the fact i never helped him in the first place
k
how does this work again
see
that was the point i was tryna make
let num = 0;
client.guilds.cache.forEach(g => {
num += g.memberCount;
});
@sterile thicket
r e d u c e
Or that lol
because in his code somewhere he might compare the snowflake to a number and it won't work anyways
my internet is so fucking terrible
I'm dying
client.guilds.cache.reduce((x, y) => x + y.memberCount, 1);
what's x and what's y
x is the accumulated value, and y is the current value
That 1 is the initial value
How do I make commands..? Sorry, I'm new to this stuff.
What library
What language
How do I make commands..? Sorry, I'm new to this stuff.
@loud depot there are a million ways to
welp
let num = 0;
client.guilds.cache.forEach(g => {
num += g.memberCount;
});
@earnest phoenix I was getting undefined
but #development message helped
tell us the language/library and we can help
which language do you use mate
me-?
client.guilds.cache.reduce((x, y) => x + y.memberCount, 1);
@pale vessel thanks, it worked
Yes
English and the library is Discord.Net
tf
wait
What i hate about forEach is the the code doesnt wait for it to finish executing it just moves on
English isnโt a programming language?!
by language we mean smth like Python or JavaScript not English
so it's c#

yknow what ima just figure this out on my own- sorry for being annoying lmfao
welp i won't be able to help with C# so better ask someone else
๐ค
why not client.users.cache.length
yknow what ima just figure this out on my own- sorry-
@loud depot don't go wait a little and someone might be able to help
why not client.users.cache.length
@earnest phoenix not length it's size
hh okay
I've just seen someone use a reduce function, I'm not sure how it works, can someone explain to me or send an mdn article? Thanks, I've never used one.
^^^^^^^^^^^^^^^^^^
What's the problem?
ask Grape Boi
btw do I need some fancy computer to do this or can I use my chromebook
any computer works
Any computer that can install dotnet
as long as it can run the code
i think i can download it
o
Iโd doubt, as youโre on chromebook
fixing what?
such as
What is redundant about your code? Can you give an example
I have a settings command but its just a switch statement for each setting. This goes for 300 lines
Is funny how nuxt kept failing
You could make functions for the same things?
Hmm
I have a fs thing but its like a command handler but for settings
Its kinda stupid
Hi
I am developing a bot using python but the only problem that I am facing is that when I runs the code for connecting to server it fails
connecting to what server
To discord
what is your error?
no
does adding an underscore to the name of a variable do anything
no
smh
it gives the variable a certain feeling
it's just a naming convention
lmao wut
what
nvm the joke doesn't make sense
dash =/= underscore
dash !== underscore
bruh
=/= is not equal to
i ain't talking about dashes aka hypens
If Iโm correct
oohh yeah, real life is a thing
Is it possible to use svg stuff from the D3 library to create profile and rank cards stuff?
i am searching a nitro code developer bot there is an bot or not
@spare robin that'll get you banned made
/\
A
;V
bruh
they're useful
so people vote them
Is it possible to use svg stuff from the D3 library to create profile and rank cards stuff?
halp
Probably
Probably yes but i'd recommend you use canvas (also on npm), it functions almost the same as html canvas, it has a toBuffer method, you can send the buffer with discordjs as attachment
I'll use svg because i don't want pixelated stuff and i won't use it for THAT complex stuff anyways
im trying to install nodejs with curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs but its outputing
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--rcfile
--restricted
--verbose
--version
Shell options:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option```
@cosmic robin you should use nvm
whats the command?
I can show you
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
source ~/.bashrc
@coral trellis nsfw avatar
@cosmic robin https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04 works on any vps
Not just do
ite thx
np
@cosmic robin use the step that says nvm, it's the best one as it means you can install a new version using that whenver
o you know : how to remove unix time in module "ms" ?
Wdym?
can you speak symply beacause i'm french ^^'
or you can talk in french in #memes-and-media
okay
Does someone know how to map all members from a server?
or you can talk in french in #memes-and-media
you didn't have to be that rude
@loud nebula discord.js?
yes
<Guild>.members.cache.map(m => m);```
you didn't have to be that rude
@rancid bramble I'm not rude
or you can talk in french in #memes-and-media
isnโt that basically calling french shit?
you could have said #general
anyway does not have anything to do with me ig
bruh
@rancid bramble you can't speak French in #general . #memes-and-media is the place to speak other languages.
shitpost allows other languages
offtopic doesnโt
still seems rude but ig you canโt expect more
shitpost used to be called off topic afaik
^
So I have my index.ts and package.json and I'm logged in to my npm acc but what next?
my bot keeps getting the "connected to discord to much in a short time, we reggenerated your token" error for my bot
do you know if its hosting or code?
(this is the bots code: https://github.com/LevelObjective/Cooldown)
itโll be code probs
my bot keeps getting the "connected to discord to much in a short time, we reggenerated your token" error for my bot
do you know if its hosting or code?
(this is the bots code: https://github.com/LevelObjective/Cooldown)
@kindred musk did you run too many instances
Or did you login more than 1000 times in 24 hours
the 1000 ain't an exaggeration it is the actual limit set by discord
I can't download the quick.db module
help me please
read the npm page
it has install instructions
Looking for a "Suggestion command"
@client.command()
async def suggest(ctx, *, channel, message):
member = ctx.message.author
message = ctx.message.content
channel = client.get_channel(741284150970941522)
embed = discord.Embed(
title = "Suggested by:",
description = {member.name},
color= discord.Colour.green()
)
userAvatar = member.avatar_url
embed.set_thumbnail(url='{}'.format(member.avatar_url))
embed.add_field(name="Suggestion:", value={message.content}, inline=False)
await channel.send(embed=embed)
my only error is "Type error: suggest() missing 1 required key word-only argument: 'message'. Where do i have to include that
which line
You can't do *, arg1, arg2
d.py will convert the rest of the message and pass into an argument, so there can only be one argument after *,
I see, so i cut the * out of it and leave ctx, channel, message ?
I think what you need is channel, *, message
Hello
and tbh, do you need the channel argument still?
I want to make a logs channel for everyone else, but i need some help since its not working
at'all
well i have
channel = client.get_channel(741284150970941522)
``` for example
python?
Yeah, you have a variable with the same name. You're not relying on user input for the channel
snake cases? ah, yes, python
So why not just take the message as input and use it
Yup, there's the commands extension that simplifies creating commands
It's not there to just exist tbh
does anyone know how to see how many servers your bots in?
framework
I've seen it used very widely and it's actually very helpful
djs with command handler when
@earnest phoenix its called discord.js-commando
I don't see why d.js doesn't have its own built-in commands extension equivalent
@kindred musk did you run too many instances
@earnest phoenix wdym i just ran it on glitch (and added the glitch start command)
Isn't that mostly because there's many tutorials for it, though? 
does anyone know how to see how many servers your bots in?
how is your bot coded
@strange raven framework?
What's a library your bot uses?

?
@timber frost




