#development
1 messages · Page 1437 of 1
You can clone an array by using const cloneArray = [...originalArray];
@pale vessel
its correct
client:on('messageCreate', function(message)
discordia.extensions()
local client = message.client
local guild = message.guild
local args = message.content:split(" ")
local command = table.remove(args, 1)
local test = "tak"
if command == "?ban" then
local Member = message.member
if Member:hasPermissions("ADMINISTRATOR") == true then
local nick = table.concat(args, " ")
local nicktwo = "test"
if nick and string.match(nick, "<@!%d+>") then
print("Ban ".. string.sub(nick, 4,-2))
nicktwo = string.sub(nick, 4,-2)
elseif nick and string.match(nick, "<@%d+>") then
print("Ban "..string.sub(nick, 3, -2))
nicktwo = string.sub(nick, 3, -2)
elseif nick and string.match(nick, "%d+") then
print("Ban ".. string.match(nick, "%d+"))
nicktwo = string.match(nick, "%d+")
else test = "nie"
end
local User = client:getUser(nicktwo)
local UserTwo = guild:getMember(nicktwo)
User:send('Otrzymujesz bana na serverze nazwa servera')
guild:banUser(nicktwo)
message.channel:send {
content = " " .. nick .. " został zbanowany.",
}
User:send('dostałeś bana!')
end
if test == "nie" then
message.channel:send {
content = "Niepoprawna nazwa użytkownika!",
}
end
else message.channel:send {
content = "Nie posiadasz uprawnień do banów!",
}
end
end
end)
That grabs all elements from the original array and put it inside the new array, creating a clone
If you define it like you did, it only creates a reference to the original array
So if you modify that variable, it also modifies the original one
Since you're basically creating a reference of the original array instead of cloning it
if (message.author.bot) return;
Can someone help me?
with
client:on('messageCreate', function(message)
discordia.extensions()
local client = message.client
local guild = message.guild
local args = message.content:split(" ")
local command = table.remove(args, 1)
local test = "tak"
if command == "?ban" then
local Member = message.member
if Member:hasPermissions("ADMINISTRATOR") == true then
local nick = table.concat(args, " ")
local nicktwo = "test"
if nick and string.match(nick, "<@!%d+>") then
print("Ban ".. string.sub(nick, 4,-2))
nicktwo = string.sub(nick, 4,-2)
elseif nick and string.match(nick, "<@%d+>") then
print("Ban "..string.sub(nick, 3, -2))
nicktwo = string.sub(nick, 3, -2)
elseif nick and string.match(nick, "%d+") then
print("Ban ".. string.match(nick, "%d+"))
nicktwo = string.match(nick, "%d+")
else test = "nie"
end
local User = client:getUser(nicktwo)
local UserTwo = guild:getMember(nicktwo)
User:send('Otrzymujesz bana na serverze nazwa servera')
guild:banUser(nicktwo)
message.channel:send {
content = " " .. nick .. " został zbanowany.",
}
User:send('dostałeś bana!')
end
if test == "nie" then
message.channel:send {
content = "Niepoprawna nazwa użytkownika!",
}
end
else message.channel:send {
content = "Nie posiadasz uprawnień do banów!",
}
end
end
end)
Can you not repost that?
the cmd think it's incorrect
Please be patient
cmd
yes
I NEED HELP OMG
2020-12-09T08:19:10.775375+00:00 app[worker.1]: (node:4) 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: 25) 2020-12-09T08:19:30.511739+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Error: Video unavailable 2020-12-09T08:19:30.511749+00:00 app[worker.1]: at Object.exports.playError (/app/node_modules/ytdl-core/lib/utils.js:116:12) 2020-12-09T08:19:30.511749+00:00 app[worker.1]: at downloadFromInfoCallback (/app/node_modules/ytdl-core/lib/index.js:72:19) 2020-12-09T08:19:30.511753+00:00 app[worker.1]: at /app/node_modules/ytdl-core/lib/index.js:20:5 2020-12-09T08:19:30.511753+00:00 app[worker.1]: at runMicrotasks (<anonymous>)
heroku?
yah
what error
^^^^
smh
this guy sent the error.. but its not the error code that we need
we need the error that showed before that error
if that makes any sense
^^
Anyone knows how to get 10.399999995 to fixed value? Like so it displays 10.40, i tried using .toFixed(2) but that didn't seem to work 🤔
ohh let me try
Never mind, it would have errored
Yeah
Can you show your code?
didnt you mean parseFloat("123.456").toFixed(2); (if your using NodeJS)
Both work
Maybe you can use rounding
never used Number before i prefer just using the specified data types
(Math.round(num * 100) / 100).toFixed(2); this worked
It will probably work
just as long as it's Double#toFixed or Float#toFixed or even Long#toFixed the method should work but if its String#toFixed or Integer#toFixed youll get an error before those methods dont exist for those data types
The method he used with Math.round returns a Long which is why toFixed worked; it's just about getting it to the right data type, which is why we have methods like parseInt parseDouble etc to make things like this easier
When I left the vc, then my bot also left the vc
how to deny it
how to add alltime on vc
js
how can u check how long someone was there in a vc.
i thought of using "voiceStateUpdate" but its called even when a user unmutes and mutes so i can't know if a user is unmuting or leaving
it emits on voice channel joins/leaves too
ye but is there any way to differenciate if a person is join/leaves or muting/unmuting?
or am i doing the tracking completely wrong
if joined the channel on the second voicestate is going to be defined
wdym?
while the channel on the first voice state is going to be null
for leaving it's vice versa
go see the docs for the voicestate object
i did
it probably has a mute property
member.ban(`${reason}`).catch(err => {
message.channel.send('Something went wrong')
console.log(err)
})
when i try this it throws an error
DICT_TYPE_CONVERT: Only dictionaries may be used in a DictType```
if they muted or unmuted, selfmute is going to be inverted
no should i check the selfmute property for the first state or the second state
ik its a boolean
think about why i said that
kk
is there anything i can do to solve my issue
it's either true or false
there is nothing in between, so only two possible states
fuck off @broken sentinel
wow
wrong channel
if they muted or unmuted, the selfmute property is going to be the inverted on the second state @ivory seal
ok so i just noticed something
when i remove the reason from my ban command it works
member.ban().catch(err => {
message.channel.send('Something went wrong')
console.log(err)
})
this works properly
member.ban(`${reason}`).catch(err => {
message.channel.send('Something went wrong')
console.log(err)
})
but this doesn't
What is reason defined as
let reason = args.slice(1).join(" ");
if(!reason) reason = 'Unspecified';
i just did that and i am giving it a try
is there anyway I can dev and test webhook on local enviroment
i know. but Mobile does. and i like this one
i got a lil confused on the docs, is member.roles.highest a V11 thing or is it from V12
oh okay yeah i got this working
{
"resource": "/d:/bot/index.js",
"owner": "typescript",
"code": "1005",
"severity": 8,
"message": "'}' expected.",
"source": "ts",
"startLineNumber": 177,
"startColumn": 73,
"endLineNumber": 177,
"endColumn": 73,
"relatedInformation": [
{
"startLineNumber": 97,
"startColumn": 24,
"endLineNumber": 97,
"endColumn": 25,
"message": "The parser expected to find a '}' to match the '{' token here.",
"resource": "/d:/bot/index.js"
},
{
"startLineNumber": 83,
"startColumn": 27,
"endLineNumber": 83,
"endColumn": 28,
"message": "The parser expected to find a '}' to match the '{' token here.",
"resource": "/d:/bot/index.js"
},
{
"startLineNumber": 9,
"startColumn": 29,
"endLineNumber": 9,
"endColumn": 30,
"message": "The parser expected to find a '}' to match the '{' token here.",
"resource": "/d:/bot/index.js"
}
]
}
why it this proplam?
@past crypt use a code block
{
"resource": "/d:/bot/index.js",
"owner": "typescript",
"code": "1005",
"severity": 8,
"message": "',' expected.",
"source": "ts",
"startLineNumber": 102,
"startColumn": 1,
"endLineNumber": 102,
"endColumn": 2
}
bruh
?
is this a .json file ?
I can't watch like this
I'm highlighting it
{
"resource": "/d:/bot/index.js",
"owner": "typescript",
"code": "1005",
"severity": 8,
"message": "'}' expected.",
"source": "ts",
"startLineNumber": 177,
"startColumn": 73,
"endLineNumber": 177,
"endColumn": 73,
"relatedInformation": [
{
"startLineNumber": 97,
"startColumn": 24,
"endLineNumber": 97,
"endColumn": 25,
"message": "The parser expected to find a '}' to match the '{' token here.",
"resource": "/d:/bot/index.js"
},
{
"startLineNumber": 83,
"startColumn": 27,
"endLineNumber": 83,
"endColumn": 28,
"message": "The parser expected to find a '}' to match the '{' token here.",
"resource": "/d:/bot/index.js"
},
{
"startLineNumber": 9,
"startColumn": 29,
"endLineNumber": 9,
"endColumn": 30,
"message": "The parser expected to find a '}' to match the '{' token here.",
"resource": "/d:/bot/index.js"
}
]
}
That looks like a json file
you know of an API that formats numbers this way
-1000
-1k
There's most likely a package for it, an API for it would be unnecessary
@wicked pivot https://www.npmjs.com/package/approximate-number
u can just make it non-mutable by: const reason = <first part> || 'Unspecified';
just a suggestion
Epic coder moment
anyone ?
You need an actual image URL
The URL you used points to the website
Let me grab the image for you
how do i get message ID in a channel, djs
Get the message first
i cant figure it out in new djs
You can get the id property from a message
Fetch the message
how
channel.messages.fetch(id)
thanks alot ill try now
how did you do it please enlighten me @pale vessel
cache.get won't work Looking at something else
Since you said that it's an old message
It won't be cached
Ah wait
It should be fine
ok so its a message in a channel, how do i get it directly from client on ready
thanks alot really
Show your code
Again, the message isn't cached
It's an old message
It won't find it, you need to fetch it:js const message = await ch.messages.fetch("id"); message.react();
Fetch returns a promise so you need to resolve it using await
oi thank you
await it
await...
if you're doing that way, you dont need var msg lol
ye ik, just testing
skeet
you can also remove async/await from the then
since you aren't doing anything else
there's no point in blocking
but, heres the main problem
modify the lib
listening for reactions on old message
enable partials

tldr
by default djs sends you events only if the entity is in cache
so djs by nature caches everything known to man
ye ye but it doesnt get old message reactions
only new
that's where partials come in
partials allow you to receive the event about the entity even when it isn't in cache (i.e. old messages)
see the doc link
im reading rn
tnx
can someone tell me the error?
oh and i already changed the token
Great job
().toLowerCase
For the record, you can just pull up VSC's problems tab
You're up early
Almost thought you were referring to the anime.
partly because I always end up waking up late and don't have enough time to get ready properly
app.get('/', (req, res) => {what i need to put instead of / so that if someone goes to wrong place it will get like if someone goes at a link on my web that dosent exists

see "how do i handle 404 responses"
what do you mean exactly?
@earnest phoenix can i do send file in this ?
you mean like res.sendFile()
yes
yea
what are you making that requires a file on 404
it literally
just do that on 404 yea
says how to do that
in the doc page
please
if you just took a minute to read it
i am watching yt tutorial @earnest phoenix
🚶♂️
youtube live stream play support requirment?
reading docs is better tbh
that is not a question
wth
i am gonna make blog with express 
what you said has the meaning equivalent of saying something like
ramen chicken noodle soup?
literally makes no sense
lol
F
explain what you're asking for and provide context with your question
easier to use like nextjs or nuxt
or just react or vue
I wouldn't say "easier" lmao
i mean
using SSR for something like a blog makes sense
you get the advantage of easily doing SEO
granted react has pre-renderers
but still not as powerful as SSR'd sites
So I was trying to learn more about sharding, but all I get are articles to databases, how exactly is sharding working for a nodejs project? I am sharding my bot, but I would like to know, how it works.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
as for sharding with your library, you should check out your lib's docs
Use the format objects returned from ytdl.getInfo to download specific streams to combine to fit your needs
means
ytdl-core
yo wasssszzzaaaupp
^^
I agree
the fuck is >>
bitwise shift

it shifts bits to the right
wdym
...what else would i mean
converts the number to binary then moves all bits to the right?
all numbers are actually in binary, but in a nutshell yes
link me an mdn page
it shifts the bits by the amount that you tell it to shift
The right shift operator () shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left. Since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change. Hence the name "s...
why would anyone want to do that tho
performance
Anyone know how to make a bot work 24/7 on mobile?
@earnest phoenix Why do u want it on mobile?
Cuz I am lol...
#support message thats no problem @gilded olive
umm what
when you a are a good deb you use db

Lol
mines work fine

Just wait
which problem did u have?
@tired panther heroku is terrible for bot hosting
You'll see "fine"
nope, when your bot do not have more than 60 glds its perfect
read this
heroku has a ping of 35 ms
what what
oh fuck i pinged matt
but who cares ¯\_(ツ)_/¯
Who’s that?
Lol
🤣
a good dev
But it's not 'free'
Oh
when u use the hobby dyno its free
Yes it is, but you only have 23 days of free hosting without a credit card.
but it works, it is good for private usage
add them
lol
"but it works"
Lol
Yeah but if you go over 1% cpu usage on an intel celeron CPU, heroku will instantly shut down your app
Why would you? If you're using a credit card, why not go for AWS? Google? DigitalOcean?
then you built in an limiter, a good dev can do that
yeah yeah a spacejunk satellite from an alien planet that fell on earth probably still has communication technologies and they work "fine"
Heroku couldn't survive a 100 for loop

If your bot gets big and is handling a lot of requests every second heroku will zap your app instantlt
Maybe even before that
this tbh
then no heroku
👍
Then why heroku?

Why should a mobile dev have a big bot?
Why shouldn’t they?
Replit better 👍
how much guilds?
With a bit of npm i express
Wdym?
disagree
And a lil bit of uptimerrobot
no free host is good
which vps
It's much better than heroku, at last
then u have to sent https: requests, so that its online
i repeat no free host is good
But you have 24/7 hosting.
name
yes, but you need a device, which will ping on the page
Bot designer for discord @earnest phoenix
Understanding bitwise operators (JS): https://www.programiz.com/javascript/bitwise-operators
Using bitwise operators: https://codeburst.io/using-javascript-bitwise-operators-in-real-life-f551a731ff5
Heck, if you're fine reading another language's docs, I think Swift does a good job explaining bitwise operators: https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html
Umm... I could do an infinite loop with replit without my app crashing

I could also read/write at a speed of 500mbps
@tired panther show me ur bot
That's why uptimerobot is a thing
@sudden geyser thank you
whats location of navbar.css in index.js
Then why r u saying that mobile people shouldn’t have big bots @tired panther
its just a test bot
@earnest phoenix sup shin Shan
@carmine summit repl is a testing IDE they literally have to be that else it's pointless
that was a question
heroku is for building space trash
@earnest phoenix not well wbu
repl without hacker plan is completelt trash
do you mean mobile dev? on a mobile
Phone: 8GB ram
Laptop: chilling at 4GB ram
Cuz I can show u my bot if u want @tired panther and it’s builds fully on mobile
@earnest phoenix why not D:? I just watch shin Shan lol
xD
Interesting
do you have some sort of gaming phone then?
noice, I hate mobile developing , because thats triggers me , the small display, no good programms 
Nahhhhhhhhhhhhh
@tired panther lemme show you let’s see
i have pretty decent one and still 3gb
which phone do u have?
flagship 12gb ram smartphones omegalul
lol
@tired panther
@sudden geyser this is development chnnael
help me #development message
I’m iPad 128gb 7th generation @tired panther
then its okay
I hate the web and don't have much experience with express/html & css
@earnest phoenix this is development channel move !1111111111
I thought a cellphone developer xD
Meanwhile on phone:
Comsolw.lof()
Hey am

Lol
Word your question better @earnest phoenix
Also. Having a keyboard that adds a space and after a period sucks
If i sent an invite to my friend to join my team as admin, where may him accept that invite?
email I believe
thats way, I was telling to use herko
probably, there are programms
wait why are you coding on mobile fr 🗿 @earnest phoenix
And touchscreen makes it more difficult
@gilded olive why not works like any bot?
interesting
@valid grotto i want to know that i am doing right or wrong ? <link rel="stylesheet" href="../style/navbar.css"> this line is in index.html
imagine not having a 1080p+ display in $CURRENT_YEAR :omegalul:
It’s like all other bots...
@earnest phoenix stfu
why does it matter
purrte comEda
cry has become a bot
where have you been for the past two years
we don't have tiny ass displays anymore lol
Coding on computer is better than conding on phone
I think
Nah coding on laptop is best
i have 1080p one, and lot of better quality than 720p
Is the same
@earnest phoenix it is but tho it’s almost the same I don’t see any difference
wbu vps ? @carmine summit
ITS NOT SAME
That should be correct
Its more comfortable working on a laptop
The coding programs.
my 24'' display is 1080 so why do I need a 6'' screen that is the same resolution
That's the difference
i bought a thonkpad thinking i'm going to use it for programming on the go
i only use it to watch netflix now
lol
Yea but I mean I don’t think my bot is any different then others @earnest phoenix
Ever heard of a laptop?
i-
i hope you're joking
no
embarrassing
^^^ this bot was made on IPad @earnest phoenix and I made it so what’s the difference LOL?
@earnest phoenix give specs
technique in phones are increasing, thats way dispaly are exploding, so that they no more fit in a pocket 
it's a t14
@earnest phoenix IMAGINE USING IOS
@carmine summit stfu get a life man stop judging other by their devices
@earnest phoenix Which Ide do u have?
LOL
Wha?
Its just that apple don't know how to make a filesystem
devlopment environment, the software to code
Wtf, then how do you think I made that bot..
I wanted to know with which one ?
whats programm is it?

Oh.. BDFD..
Bdfd?
What bdfd?
What’s wrong with that

No shards loll
Lol
@earnest phoenix you know whats shards ?
I thought you're actually coding it.. Oh...
ofc not
That's why you don't code on IOS
Well that's disappointing
@earnest phoenix well yea but idk I call it coding LOL
which language is it?
It's called no-code
really?
@tired panther its not languge lmao
Well that’s what you got on mobile


I can’t afford pc ok?
Well that's certainly very disappointing
** I can’t afford pc ok?**
Of its bot designer
laptop maybe
Is your brain okay? I'm not talking about myself.
@earnest phoenix you have termux too lmao... why using this shit ?
yes thought it
I know it xd, mentioned @Santa Claus#1239
@earnest phoenix haven’t heard of it
lmfao .. you know bdfd but not termux
wow
big brain
But it isn’t in the App Store....
🤦♂️
@earnest phoenix ever seached it ?
Yes I did rn
There are programms in which you can code with js
You should've said it in the first place that you're using a bot maker lol @earnest phoenix
yellow burns my eyes
thats why android are better than ios @earnest phoenix
lmfao
very yellow
Looks good, but I can't stand with bright yellows
same
yes
I agree but unsafe
how
Is this among us discord?
second name of trash is ios
Yea, but I got a android it’s just my phone,
@earnest phoenix does it work on android phones?

Or tablets only?
Yes very yellow '-'
you stfu
Yikes you have a developer emoji on your status, but you're using a bot maker 🤦♂️
LOL
android have better security than ios
K
@valid grotto it’s called nitro
x to doubt
I told that xD
Lmfao
Imagine using a bot maker
xD
Lol

botghost 
lol
It's true that yellow and very bright I'm going to change

maybe some green
Yup and you put the emoji there yourself

@valid grotto so? I just like it what’s the problem innit?
https:// youtube.com/search?q=make bot no coding

this folk here, does not like bot maker programms xD
nobody likes them
I MADE THIS BOT
When did I say that...
bitch you ain't making anything you're a script kiddie
Why y’all getting pissed
(that wasn't directed at you, but people using bot makers in general)
@earnest phoenix 1. Be friendly and respectful to everyone
you're annoying
Downside of making a bot by a bot builder:
You cannot make a game like Snake using discord.js
cry on a speedrun
what is that @earnest phoenix
we all
@earnest phoenix
you lose the freedom
Looks so much better!
the whole point of programming is to... make anything you want
be free, it's your world
@valid grotto so how does this termux work?
Thanks ^^
No problem with that at all, you do you my man. But calling yourself a developer while using a bot maker 
how was that disrespectful?
so cringe
that's not disrespectful at all
yes its fine
you'll call yourself a developer after using a bot maker?
don't make me laugh dude come on now lol
Backseat moderating? Kinda cringe my g @earnest phoenix
would you agree with someone who calls themselves a doctor just because they managed to complete Operation without triggering the buzz?
@earnest phoenix It's alright man, I'm guilty myself of using no-code applications, but you gotta learn how to properly code if you want to call yourself a developer.
@gilded olive dude what’s the raging for? It’s not like it’s prebuilt I have to kinda make a puzzle it’s not like it’s already in there
app.get("*", (req, res) => {
res.redirect("https://discord . gg/qc4b3qpZtk");
});
i get a This page redirected you too many times error when I try to visit the website and the URL becomes literally just <root>/discord.gg/discord.gg/discord.gg and so on
that
U aint
how so?
@mods emote spam bean bean bean
@valid grotto how do I learn coding on iPad LOL? Specially on ios
@quartz kindle pls halp
@gilded olive what’s that?
Sure....
You should use a laptop/desktop if you want to code.
he can't afford one( what he said)
That isn't a drawback, but a laptop is definitely better.
auger has left the chat
@gilded olive so how Do I connect my bot with the coding?
ah yes, auger
no idea
jail break and install android
you really need a laptop
or get an android
try redirecting with the 301 code
redirect(301, uri)
use desktop version of site
Programming on android's not going to be any better of an experience.
ok
still painful
iirc by default the code is 302
they are js programms
coding on mobile in general is not a pleasant experience
You have many more proper tools and an experience than coding on a mobile.
What, does your Android app include auto-completion? maybe, maybe not.
does it still happen when you redirect to something like google
i included the http protocol in it too
haven't tried yet
@tired panther you literally leaked a google travker
I do not code on mobile, but know that it works
learn a programming language first, python or javascript (if you are going for bot dev)
then move on
what?
in bing you do not become yt ads
It may work, but it's not going to be a good experience. It's like writing your code by hand then transferring it over to your files. No one does it because it's not a good experience, unless those employers are trying to see how much you can suffer while solving problems like fizzbuzz
And the only part saved was when i forgot to include the http protocol so it defaulted to a relative path
true
There's a reason you don't find support for code editors and IDEs like Emacs, VSC, IntelliJ, etc.
wdum?
not only that but libs were not designed for and are not optimized to run on ARM
@tired panther little bit of your computer browser data is sent in every google search URL
IK
that's why you should always remove every single url query except the q
fortunately for you, google tracks way more than that!!
google knows all
you could stare at a plant for 5 seconds and I guarantee you'll get ads for plant pots
data is the most valuable resource
🤷♂️
you're fooling yourself if you're thinking you have any sort of privacy nowadays
I recent research showed , that google saves 250 gb of your self, and when you have an android mobile, all pictures ./ files are public , when you brute force on the link
you can view them
is function(data), same as data.function()?
how does it work?
the former is a method that takes a parameter, the latter is a method that takes no parameters and it is on an object
ah that makes more sense now
How can I restrict a command to Patreon supporters only in Python?
btw when using function(data1, data2) can it be interchangable?
nope
you would have to save that data in a database
no
Fuck!
Dbs confuse me

Like idk how to call it and all that
SELECT <> FROM <>
i'd rather slam my tongue in a car door than try to use patreon's api again
Is there another API I can use for a premium command?
You can use json files to save premiums guild @hasty mulch
that makes 0 sense
why would another api expose sensitive data about some other site
Oof, not familiar with JSON
inb4 your JSON file gets corrupted while you are sleeping and everything is gone
#support message what does that mean? @earnest phoenix
why can nobody spell maintenance properly
maybe be not a native english speaker

congrajlashins
you can just google the word and you'll get the definition
which language do u speak?
my mother tongue is croatian
oo cool
kako si
ik, what maintaince means
🤣
uwu
delete message
which one?
is arr[1]++; gonna work?
if arr[1] is a number yes
alright thanks
@earnest phoenix
bc no docs
It's back sorry. My keyboard oofed up
ik I just turned on the API
the count now shows
yap
(The count is live :D)
@earnest phoenix do u make websites for other persons?, your ones looks very good!
I love thread designs
I recently started.
I want one xD
.gitignore
you can forget sometimes
electron-builder and the rest are dev deps (typescript, babel, eslint etc)
gitignore node_modules is like the first thing i do when creating a project
uh you can use an extension if you are using visual studio code
auto generates one for you
Which do you prefer? Reactions of up/down/left/right or WASD but player has to press enter everytime
reactions
mouse clicking intensifies
why do I got
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
on message.clear_reactions() just now? (discord-py)
ill just do both
ratelimits 
show the full traceback
hmm
please
because you don't have permissions
check for permissions for every action before you actually do it
if you get rate limited in discord.py it would not give you missing permissions.
if(message.member.roles.highest > member.roles.highest) {
``` would something like this work?
i was talking to cwickks
oh my b
i think you have to compare the position property
or whatever it is in djs
oh okay
ye, highest gives you a full role
so would that work?
mm I can edit the message just fine, only clearing reactions got issue
and previously it works
i was agreeing with cry
show full traceback @sick sluice
oh right
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/adi/Python/radio-id-bot/app/misc.py", line 92, in _stats
await msg.clear_reactions()
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/message.py", line 1096, in clear_reactions
await self._state.http.clear_reactions(self.channel.id, self.id)
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/http.py", line 241, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/client.py", line 333, in _run_event
await coro(*args, **kwargs)
File "main.py", line 40, in on_command_error
raise error
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/adi/Python/radio-id-bot/venv/lib/python3.6/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
it's kinda long and complicated, but the core of this function is:
- split long text into serveral pages
- then use reaction to navigate each page
should be something like this:
# bot send msg
msg = await ctx.send("Page 1 of message")
await msg.add_reaction('⏪')
await msg.add_reaction('⏩')
# then i wait for reaction
reaction, _ = await self.bot.wait_for('reaction_add', timeout=5.0)
await msg.clear_reactions() # here i clear the msg reaction <- this line throw 403 error
await msg.edit(content="Page X of message")
await self.page_reaction(msg, total_page, current_page) # then i re-add the reacion
How do I make something like m.react(😄, 🙂, ❤️)
If I comment await msg.clear_reactions() then it won't throw any error @gilded olive
no I mean
^
ReferenceError: MessageEmbed is not defined``` anyone coding in js know why this wont work? it worked wayy before when i started making my bot but it just gives me an error now. it may just be a simple fix but im still a little new to coding srry
multiple emojis
does the bot have permissions? @sick sluice
what kind of permission?
it's discord.MessageEmbed()
the only way to do it is loop and add reaction one by one
new discord.MessageEmbed()
@thin crag
manage reactions
Add reactions*
hes' getting a 403 to clear reactions
this one?
yes
hold on
ok ty it worked
oh i see, it works now
np
lol
it can edit it's own message without this permission tho
Yep
discord and their permissions
xD

thank you @earnest phoenix @gilded olive

uoh how to stop everyone from viewing specific channel when creating js
if you are using discord.py
you can overwrite the permissions with PermissionOverwrite
then pass the overrides kwarg in await guild.create_text_channel
ill get you an example wait a sec > @earnest phoenix
guild = ctx.guild
overrides = {
guild.owner: PermissionOverwrite(send_messages=True),
guild.me: PermissionOverwrite(send_messages=True),
guild.default_role: PermissionOverwrite(send_messages=False, read_messages=True)
}
return await guild.create_text_channel(name="name-here", overwrites=overrides)```
i have this
fuck a me
that looks so weird
i feel for you
lol
i should stop assuming people are using python
most discord.js 

const shard = shardsManager.shards.first();
const [uptimeValue, uptimeErr] = await shard.fetchClientValue('uptime');
const uptime = uptimeErr ? null : uptimeValue;
I get: TypeError: (intermediate value) is not iterable
Why?
On await shard.fetchClientValue
how do I remove a specific reaction from a message?
Have you tried logging your variables
[uptimeValue, uptimeErr] means that it's an array
with two first elements being uptimeValue and uptimeErr
The error is on the await method
client.on("messageReactionAdd", (messageReaction, user) => {
messageReaction.remove();
})
```apparently removes ALL the reactions on the message
Just log it
console.log(await shard.fetchClientValue('uptime')) after you define shard
#console is gay// rule set+|true
But await should always return an array of two values
Send the console output
It gives me the righe value @pale vessel
@quartz kindle I need help
//console output(//gay%#gibberish^
But shouldn't await always return 2 values in an array
Just curious to see
It logs 676
What's the difference sorry?
So the principle that it returns the .then() value and .catch value is wrong?
((Gayness/\value**over9000-true:/
Dude stop please
fetchClientValues() fetches values from each shard, with an array as output for each shard.
fetchClientValue() is for shard where it returns the value for the current client
Ok
I think fetchClientValues() returns a promise
Both do, yea
const handle = (promise) => {
return promise
.then(data => ([data, undefined]))
.catch(error => Promise.resolve([undefined, error]));
}
async function userProfile() {
let [user, userErr] = await handle(getUser());
if(userErr) throw new Error('Could not fetch user details');
}```
My bad I've read this code wrongly
So I just need to use try catch
client.on("messageReactionAdd", (messageReaction, user) => {
messageReaction.remove();
})
```apparently removes ALL the reactions on the message. I need it to only remove the reaction that was added
deny: ["SEND_MESSAGES"]
When I left the vc, then my bot also left the vc
but everyone can still view it
i wanna deny specific role to view channel
let rankingA = message.member.roles.highest.position;
let rankingB = member.roles.highest.position;
if(rankingA === rankingB){
``` would this be a good way to get through the problem i had earlier?
>=
check everyone role have read perms?
It would error if it's higher or same position
history*
not really i handled that i think
if(rankingA > rankingB) {
if(rankingA < rankingB) {
Not sure what this is for in the first place but I guess so (use === for the next one)
already used that in the first one
it is for a ban command
checking the role ranking
Lower ranks can ban higher ranks if the bot have the highest rank amongst them.
How do i give my bot a status, its made using dsharpplus (C#)
Ive been looking at the documentation but theres nothing of use
did someone here has an idea why this returns undefined```js
await Guild.findOne({guildID: guild.id}).exec( (err, doc) => {
if(err) console.log(err);
console.log(doc);
});
message.guild.users.cache.get(args[0])``` why if i use this it says that cache is not defined
guild.users is not a thing
bruh
you probably meant guild.members
first ir worked
okay
i will try
const canva = require('canvacord');
const Discord = require('discord.js')
module.exports = {
name: "wasted",
description: "You are wasted",
async run (client, message, args) {
const member = message.mentions.users.first() || message.guild.members.cache.get(args[0]) || message.author;
let avatar = member.displayAvatarURL({dynamic: false, format: "png"});
let image = await canva.Canvas.wasted(avatar);
let wasted = new Discord.MessageAttachment(image)
message.channel.send(wasted);
}
}```if i use this it says `member.displayAvatarURL` is not a function or is not defined
@sudden geyser
Help Me Error : node 409

Me ?
no
-_-
ECONNREFUSED means the API banned/blocked your IP...
Or cloudflare did.
WTH
¯_(ツ)_/¯
If you look into the docs, you'll see a GuildMember doesn't have the displayAvatarURL method: https://discord.js.org/#/docs/main/stable/class/GuildMember
You'll see a User instance does: https://discord.js.org/#/docs/main/stable/class/User?scrollTo=displayAvatarURL
I also don't know why you're trying to juggle two types with your member variable
are you not using like intellisense @timber fractal
You should read what I said, because it gives enough insight: a GuildMember (message.guild.members.cache.get(...)) doesn't have a displayAvatarURL method, yet a User (message.mentions.users.first() & message.author) does.
The docs explain everything.
but
you can use .user on the guildmember to get the User
You can get the User instance by doing .user on a GuildMember
how can i do it with a member ID than?
what
message.author = User
message.member = Member
message.member.user = User
i want it so u can do like h!ban {ID}
everything you asked about is in the docs
-__






