#development
1 messages Β· Page 700 of 1
https://oliy.is-just-a.dev/i1icm_1468.png something like this is probably what you want
just in an if
obviously
any idea how to fix my issue? Basically trying to use the data from inside the code block and use a RichEmbed to display the javascript output
Wait how is that true?
isNaN
how would i use the nodejs cluster module to cluster a discord bot via ShardingManager, or am i required to use my own sharding manager?
@tacit stag explain more?
Oh bruh
wait nvm
yeah, twoost recommended a try catch, which in theory makes sense, just don't understand how to implement.
cool
try{
//code
}
catch (error) {
message .channel.send(error)
}
like that if im not wrong π€
replace is a promise so it would go inside the try i think
yes thats what I did, but it doesn't work. when i cut the data down to the pure code, and run it through try, it won't output
let me try that
@valid frigate I think kurasuta uses Cluster for it's sharding, maybe look at that?
@modern elm no, inserting the replace's into the try doesn't do anything
ok
yeah that's good
i would help more but im not in pc
im back
do args need to be an int
@pure crateroost, I mentioned you up a bit, the try catch doesnt output, but I think its because arg is a string
you call it on not a string
@tacit stag ur not pinging twoost
for example -code console.log('hello world')
ur pinging tw
I saw
you would extract "console.log('hello world')"
and then you would do
try {
new Function (stringExtracted)
}
catch {
<THE CODE HAD SYNTAX ERRORS HERE>
}```
I always forget new Function() is a thing
yis
the funny thing is I think I use that in eval
but I've had the same eval command for 10 months
lol
ah okay, i thought i had an error but i typed function with a lowercase 'f' in habit
still doesn't seem to output to terminal
ok, reiterate what you want to do full
btw isn't it js try { } catch (e) { } // was missing the actual error above
my understanding is that you wanted to check a string to see if it was valid js
and @broken shale the error is not neccesary but yes that is correct too
Pretty much. I want to extract the code between a code block, then display the javascript output (in a RichEmbed)
if you're trying to extract between a code block
you can easily get between the 3 backticks
javascript atm, so that console.log("hello world") would output "hello world", on the embed and console.log(4 + 5) outputs 9 on the embed.
@amber fractal yes i got the string out of the code blocks already
running it is the other issue
let me test
I wouldnt eval
is this a owner restricted command
eval did work
but is it restricted
no my eval command is public
this isnt an eval command
i assumed this would be a private command
it's a js validator
except for the fact that you can make an eval command by not connecting to the web
I built a working prototype of your command
strange, my text editor said that new Function(arg) was an eval function, and that didn't work. Actually, it is public, but I am trying to take the eval() output and pasting the output into a RichEmbed
Never have an open eval
a) if the command is public it will not be listed here
b) if its public people can do malicious things
hmm how to do this then?
Wipes whole computer with eval
wait why not just use substring
^
to remove the backticks
lolll
Why
lets just remove that
why would you delete that
I told him the problems of having an open eval and the cautions
I wont (because I am on linux). Is there a way to say let output = eval(arg); message.channel.send(output);
Though like @fair hare you can make a fail proof eval
but I guess that running console.log('hello world')
would not output the string "hello world " in an eval. How do do both this, and something like ``` console.log(4 + 4) //Output 8
so just: ```try {
return arg;
}
catch(err) {
console.log("[Error]");
}
ur right thats just a string
Im just saying if they do a console.log() and you want it to output what the console outputs
can you explain
i think at this point you need to think about the problem and how eval works
okay, ill do a little work. I just havent worked with eval a whole lot, so trying to figure it out
read the docs and see what the return value of eval is
okay im gonna test some things.
I guess the issue is that I want to check the code for syntax errors, but also run the code as javascript until I reach console.log(). I see that eval(console.log()) can be harmful, so is there a way to take the eval output and instead of returning it to the console, I want to use that data to send the member the output
Anyone else had the issue where you tried to clone a github repo via vsc to push changes from there directly to git and it say repo doesnt exist yet it does?
wait i mightve figured something out
yep that works flawlessly. You know that feeling when you go out of your way for something really simple? Me right now.
Now Im just gonna find a way to pass that value through a RichEmbed, but thats a lot easier. let you know how it goes
easy peasy
π
@modern elm @eternal mesa @amber fractal Thanks!
no problem :) i tried my best anyway lol
I actually created a variable earlier in the code, and used replace(βconsole.logβ, β[myVar] =β). Then i could pass it thru to an embed. I guess it was safely using eval so it didnt output to console was my issue. Thanks though π
I just used a default rich embed
I could name one input and pass the input in
which i probably will do
At least it shows the output. Thanks π
Sorry for rambling, all of you helped so much
π
alright so what's the idea behind how voting streaks work
Possibly dumb question. Using Python, is there anyway to make this not case sensitive?
The '.Hello" part exactly
I should probably just make it lowercase anyway.
message.content.lower().startsWith() .lower() turns it to lower case
check the docs if u use the () cause iirc u do
y(e)s
I keep on getting this error message, can someone help me out?
if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection){
^
TypeError: Cannot read property 'join' of undefined
Discord.js, tryna set up an if channel id is this, do this statement
How does one go about verifying which channel the message is in?
@pliant needle wdym "verifying which channel the message is in" couldnt you do that with ids?
Basically my question is how do I call upon verifying if the command was run in CHANNEL_ID?
@pliant needle an if statement...
bruh
how do you set if(message.content == <anything>)
@pliant needle from the message you access the channel so -> message.channel and once you have the channel you access its ID message.channel.id doing a simple console.log(message) will output you big info in ur console, from there u can see how its structurized
@earnest phoenix you pretty much nailed it, just that <anything> should be in quotes any of the 3 quoting option will work or ' or "`
If you previously define that anything with for example let text = '123'; then you don't put quotes around that anything but just its defining text
How do I let my bot send a message when someone voted?
u can use the webhook
Hello, ive seen people have self assign bots in a message with emotes. Ive been trying to do that but i cant figure it out.
what do you mean?
roles?
Yes
and do you mean reactions?
Yes sorry
reaction added event -> get the emoji -> add the corresponding role to the emoji to the user who reacted
Thank you
cool
Do you need to use a webhook to use py @commands.Cog.listener() async def on_dbl_vote(self, data): logger.info('Received an upvote') print(data)?
Yes, dblpy webhook system uses the on_dbl_x events
ah ok thanks
sorry i've not used webhooks n stuff like this before that's why i asked
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
})
})
Wht it doesnt overwrite the permissions?
Djs?
@dusky mist
If so, DJS uses an Array for denying permissions like js channel.overwritePermissions({ permissionOverwrites: [ id: muterole.id, deny: ["SEND_MESSAGES", "ADD_REACTIONS"] ], reason: "Mute Role" });
on master, yes, not on stable
Would be helpful if they sent language and version.
is there anyway to optimize replies and msg reading/ parsing ?
i'm trying to make a bot reply to another bot's message as quickly as possible
you cant get any faster than the network delay
reading/parsing is usually done in less than 1 millisecond, while the network round trip can go over 100 milliseconds
btw does anyone know a js library that compiles c code ?
could be fun to have a discord bot compile c code for you
not sure i follow
there's also node-gyp, which is what node uses to compile and statically link C code
@earnest phoenix never let anyone but yourself use it tho
@earnest phoenix if you're using node.js, you have access to child_process, which lets node fire and execute external processes and commands
the rule of thumb is to never trust user input, no matter how filtered and checked it is. code just makes it worse
would it help if it's hosted externally and not my pc xd ?
can someone help me with discord.js on making the commands folder and making the commands still work because it breaks when i try
what error(s) do you get
@earnest phoenix it doesnt matter, everything can be achieved
are the commands actually being loaded or not
no
put some sort of debugging upstream then, ie. in your command loader, try to work out if it's finishing or where it gets up to
i mean like
it doesnt work at all
i cant get it to work so i just have to have all my commands stuffed in index.js
then you did it wrong
or show us your code
how do i make a commands folder
mine never works when i link it up
what lang
JavaScript
Use the fs module to read the directory, require your files and work from there
You can likely find an example on an idiots guide
is message.mentions.users.last() a thing?
Yes and next time look at docs please
i did
but it turns out to be undefined
when i tried to get the displayAvatarURL
did the message contain a user mention
nvm its fixed
Hey, anyone knows why it says "not well formed url" when i put a tenor url in?
it worked before
nvm im stupid sorry
how do i check new message inside a for loop ?
do i need to call another " client.on "message" " inside the loop ?
what do you want to do
i want to stop a loop when a specific msg is written in chat
If you just want to collect a message inside a command use a message collector
docs
and if you collect a message just check if it is this one and then just return
can't i use this
bot.on('message', message => {})```
i need help
message.mentions.users.first()
message.mentions.users.last() is the same thing
so basicially
message.mentions.users.first() is the first user mention if you have multiple
there's only one mention in the message
if you use mesage.mentions.users.last() it searches for the last one in the message if you have multiple
if you have only one mention both are the same
@earnest phoenix
i had 2 mentions
Then ur d.js is broken bc it should work ._.
lemme try it
wait
here's the code i tried to use
module.exports.run = async (client, message, args) => {
const canvas = Canvas.createCanvas(768, 574)
const ctx = canvas.getContext('2d')
const user = message.mentions.users.first()
const user1 = message.mentions.users.last()
const background = await Canvas.loadImage('https://www.verywellmind.com/thmb/ww8drf5Q9efuk0I8uUSUBMQpONk=/768x0/filters:no_upscale():max_bytes(150000):strip_icc()/GettyImages-471932267-58bc89565f9b58af5ca9d09d.jpg')
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
const avatar = await Canvas.loadImage(user.displayAvatarURL);
ctx.drawImage(avatar, 350, 25, 150, 150);
const avatar1 = await Canvas.loadImage(user1.displayAvatarURL);
ctx.drawImage(avatar, 200, 25, 150, 150);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');
message.channel.send(attachment)
}
it should work ._.
@earnest phoenix
@earnest phoenix no you cant, unless you wanna destroy your bot lol
^
the message listener is active until end
so
it wont stop
< im having trouble understanding how to set the msg collector up
wtf
@earnest phoenix what are you trying to do?
we might be able to help if you post your code
i even tried reinstalling discord.js it's still like that
thats awesome tho
uhm, how to explain this
we have this bot ish challenge game on a server
@earnest phoenix
there is a bot that writes a msg and our bots have to reply
sometimes the reply "fails"
and our bot has to reply again
Oh lol
ty
basically keep trying till the bot announces someone has succeeded
so i guess this code would fit as a filter for the msg collector ?
you dont need a for loop
await message.channel.send();
await channel.awaitMessages(filter,options)```
can my bot still send messages and await at the same time ?
yes
it will halt inside that context only
Could someone help me making an event which sends a message when someone voted?
I did but I don't really understand it, if someone would like to help me?
did you see the example code ?
u just need to insert ur own apikey
how to get the category and Voice channel Size?
only replace yourDBLTokenHere with my api key?
@glacial mango to Console
So I can change console.log() to msg.channel.send() ?
oh wait you
pasted the example code
unless you want to deal with webhooks, you shouldnt use the webhook example code
?
he does need webhooks to receive vote events
and no, you cant simply replace console.log with message.channel.send
you dont have any message to reply to in that context
you need to specify which channel it should be sent to
can someone give me a command handler that i can use, all of mine are outdated / dont work
But it is possible to send the message to a channel instead of console?
oh right, if you want to send the msg instantly after some1 votes, i guess
was thinking of
yes @glacial mango
but u also need to setup a server to catch webhooks from dbl, if i remember correctly
How to write with the bot
a message ?
i just use hasVoted because you can get that directly
dbl sets up the server for you, but you need to configure your server's address in your dbl bot settings in the website
@earnest phoenix you asked about await, do you know what a promise is?
yeah kinda, not an expert though @quartz kindle
you can handle promises in two ways, async/await or .then().catch()
sending messages returns promises, as does any operation that requires connecting to the api
so if you await sending a message, you ensure the rest of the code only runs after the message is successfully sent
channel.awaitMessages is a message collector in promise form, so you can also await it
Hmm... how can I get JavaScript to recognize those two values as equal? 9.999999999999999e-19 1e-18
Right now, my tests are failing cuz JS thinks those two values are different
please can someone help me with a command handler?
what lang
javascript
what lib
wdym
djs (if that means discord.js)
i cant get any working through videos because they're all outdated
i see
so there are two very good examples
the one is maintained
the other was just for like playing around
gimme a sec
the bottom one is not maintained
but that's like how you could go over making a command handler
thanks
no problemo
i dont get that at all ill just search up a YT that works but thx anyway
Wait do you use commando or normal d.js?
normal
https://discordjs.guide @earnest phoenix
A guide made by the community of discord.js for its users.
Didn't he just say he didn't want outdated videos lol
isn't she doin vids still
i still dont get that because its different code for me and my brain is like a pea
;-;
What version of Discord.js are you using?
latest
As a rule of thumb, stay away from video tutorials
The Server Icon is a Gif, how can i display it in an Embed?
Just like you would display a static image
Discordjs.guide is always kept up-to-date
that rule of thumb does make sense, but you mostly get into a topic by watching em
@slender thistle message.guild.iconURL?
Yeah
Why stay away from idiotsguide?
I mean look at those page titles... they just foster imposter syndrome
Details
Plus they just offer large-ass codeblocks that ppl just copy-paste and expect to work, without reading the explanation underneath the codeblock
π
Huh they do Day-Month-Year
I thought Evie was from Canada... Canada does Year-Month-Day
it isnt maintained by her anymore
oh
who is me
none im just bored
oh
discordjs.guide
Read the guide
When you get far enough you'll understand it actually does show you how to write a command handler
(don't go to that page and copy-paste... actually read the guide from page 1.... it's the only tutorial you need)
If you follow some rando YT tutorial, hours later you'll come back asking really dumb questions that if you had been given a solid foundation (which is what the guide does), you wouldn't have asked
my brain doesnt rlly work like that
erm what
im dumb.
If you follow a YouTube bot tutorial, you'll be asking questions such as
hey guys how do i fix this error Can't find x of undefined or Unexpected token }
yea but i dont get just reading it
Nah don't just read it
Do the exercises as you read it
guide on one side, code editor on the other
it still makes no sense because i cant rlly translate things because i used bot. and they used client.
yeah but still its all different plus i have way more code in mine so i get confused af
lemme guess... you have lots of code from some outdated youtube tutorial...
can i see what u have so far
It's just best to start from the basics and follow that guide...
Start reading from this page: https://discordjs.guide/command-handling/#individual-command-files
(it picks up roughly where you left off in the videos)
idk i might just give up
idk, you do you man
axios > node-fetch?
I liked it for like 6 hours until I noticed it can't return a page's html
import fetch from 'node-fetch';
fetch('url-here')
.then(res => res.text())
.then(console.log)```
res.text π€
works
but now I'm really loving axios/node-fetch over request and snekfetch (deprecated so had to upgrade deps yesterday)
Idk what's the appealing part about axios and request
I prefer node-fetch since it's exactly like window.fetch
And I don't like committing unwanted things into memory... why know two things (window.fetch and axios/request) when you can just know one syntax
well axios you don't need to chain, saves a bit of time and the nuance
oh
is request even still maintained
i just use http/https.request
node-fetch 
How to check if users are Online, dnd, idle or offline?
<user>.presence.status
axios > node-fetch > snekfetch (deprecated, me sad) > request @knotty steeple
request is 4mb
how do you make an http lib 4 mb
the lib itself doesnt appear to be near a megabyte wtf
read error
i dont understand
also send code with ur error
so many have one tho
are you using a guide or tutorial
guide
Send your code with err
which one
o h n o
so you are copying and pasting code without understanding what it does?
well its outdated
yup
i dont have time to learn rn so im testing stuff out
id
well, the result of your search ends up as undefined
the way he is trying to find is depreciated
?
yes, that way of using find is deprecated too
wdym by that
its basically outdated
"thing", thingeeee should be something like a => a.thing === "thingeeee"
you need to use a function now
how can i get the shard of the current client in eris
sounds pretty retarded but yeah idk how 
i mean
get a shard
im coming from djs so
can someone tell me how to host my bot in dms
so basically what i'm doing is updating all clients' activities every 120 seconds
one of the messages is shard (x) where x is the current shard id
and i have no idea if that's necessary
e
well then another question
does having the shard id for each client even matter at all since it looks like eris handles it
const role = message.guild.roles.get("583431602970034177")
role.permissions.toArray().join(" β’ ")
ERR => role.permissions.toArray
i want to list all permissions from this role
hmm
it exists
which means that the role isn't being gotten
wait
what's the error in the first place
Are you sure the role exists
Hey guys. My VPS provider just got shut down. Are there any affordable VPS hosts you can recommend?
check pins
DO, GG
also what provider was it?
SkySilk, DigitalOcean, https://discordapp.com/channels/264445053596991498/272764566411149314/576818380498010112
how do i retrieve the first n items of a map ?
i'm trying to make my bot reply with a list of the servers it's in
but i suspect the list surpass discord's char limit
what ? why
because that's a privacy violation
it has to be restricted to owner or opt in by guild
with it defaulted to opting out
why would it be included in the api
That's not the point
It's a privacy violation of you to give out your users' information
the when you create an application on discord you're legally bound by the terms
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
2.4 and 2.5
I'm actually getting fucking strained writing about the history of computers than actually coding
Fuck this APCSP class
If you make an agreement which they have to sign before to use your bot that your name, guild will be recorded then it should be fine
however idk
if you have their permission it's fine
but you have to get their permission, you can't imply it
even just guild name ?
yes
can't i parse message content either without perms ?
A user using a command is them giving you permission
otherwise they wouldnt use the command
what is this conversation even
but in order to know a message contains a cmd i have to parse it
from what i'm seeing they're only providing a list of guilds the bot is in
which is entirely fine
if they started sharing data about who the owner is, it would be slight violation but no one would really care
also sec 2.4 refers to the SDK not the API
oh okay
so it's fine ?
and yeah as cry said, im just making my bot reply with a list of guilds it's in
dbl is making up their own rules - which is probably because they don't go over discord's TOS properly
Just use at own risk ig Β―_(γ)_/Β―
wait, it's okay if it's only me that can use it ?
it's okay even if everyone else can use it
it's not private data
if they started sharing data about permissions, roles, other members in the guild then it would be violation
Either ways idk why members would need to know what servers it was in
true, unnecessary command other than for the owner
though the owner also generally wouldn't care which guilds it is in, rather the amount of it
I usually just use it to quickly grab server id then view info about the guild in the db if the user has server configuration problems
Anyway
What about my question t.t
doesn't discord.js have something to automatically split the message if it goes over the char limit
How can I make a variable set to args[0] be optional?
Like they donβt have to provide anything just use a tag like -users
And the variable set to args[0] is looking for a number btw
Thatβs why I want it to be optional
Not sure if its the right channel to ask, but how come the widget for amount of servers shows "undefined" for my bot? Or rather, how do I get it not to be undefined?
post your stats to the dbl api
ah
@lusty dew check if its undefined with an if satetemn
Hm
What's the name of the function?
if they didnt provide an argument, it will be undefined
Cause the variable will always get something
No
My command is sensing that when I donβt provide a number for args it takes the tag as a number and then the command errors
-bpurge 100 -users //This wonβt error
-bpurge -users //This will because it thinks I want -users to be args[0]
parseInt args[0] then
It still errors
let num = args[0];
if(!num){
num = 1
}
const parse = Number.isNaN(parseInt(num))
How do I automatically split a message if it's over char limit ?
second parameter of send takes in MessageOptions
set split to true
Oh, very cool
Had no idea
So send(msg,split)?
no
MessageOptions is an object with declarative properties
Isnβt it an object?
.send(message,{option1:value1,option2:value2})
.send(msg,{split:true}) ?
oh yeah, took a look and default options looks fine
oof, how do i make my bot leave all the racist servers ?
How can a bot become certified 
guild.leave()
@earnest phoenix https://discordbots.org/certification
Just the guild object
Way to check number of servers the bot is on (discord.js)?
<your bot instance>.guilds.size
your bot instance is w/e you defined your bot with, if its by the books of d.js it should be client
if you're on d.js master, then idk, stable its that
where do i see all the properties connect to i.e. guilds.map ?
not sure where in d.js doc i have to look
Selam
nvm
it's just this right ? https://discord.js.org/#/docs/main/stable/class/Guild
What is this..
TR
** if (!message.content.startsWith(ayarlar.prefix)) return;** Bunu KullanΔ±yorum . Bunu
**if (!message.content.startsWith(ayarlar.prefix) || !message.content.startsWith(client.user.username) return; ** YaptΔ±m . Δ°Εe YaramΔ±yor .
Eng
** if (!message.content.startsWith(ayarlar.prefix)) return;** I Use This . **if (!message.content.startsWith(ayarlar.prefix) || !message.content.startsWith(client.user.username) return; ** It Does Not Work .
what is your name, and what do you mean
Its Wolfy.. And i mean what is this place. Is this like to point out bugs or something? Cause i have a problem with adding bots to my server
@earnest phoenix you should use code blocks (three back ticks before and after code)
Where we ask questions
what are you trying to do
im trying to invite a bot to my server. But it says i have no servers to add it to
this channel is for getting help/helping ppl develop bots
@analog vessel do you have admin or server manager perm
im the owner of the server
in the developer page, did you set the scope to bot? not sure if thats the issue but Im pretty sure its needed
the link that i get sent when i do the bot command invite
@analog vessel that happens when you're not logged in correctly
how.. Do i log in correctly?
when you invite a bot, you do it through a web browser, not through the discord application
the web browser account is not always the same
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
go to the discord website and logout from whatever account you have there
and login properly, in the website
then try again
How do i log in if it automatically puts in the wrong account
log out
okay
Do you need help setting up the rest of the bot too?
Im on my phone
kinda hard to develop a bot on a phone
and i trying to log on with this account but it keeps loging in as my other accout i dont use
try using another browser i.e. edge
uhh..
ur on mobile `?
How would you make a vote only command in JavaScript?
Yes
the same way you would do it in any other language
check if the user has voted using the dbl api
dbl.hasVoted
thats not java
Alright!
they're the same right lel
Thanks!
they are not the same
Im just gonna add my other account and try it that way ._.
java and javascript are completely different things
its not best lol
In my opinion it is
why are u using java if you think javascript is better
why would they name it the same if they have nothing in common 
technically they are not named the same
javascript's technical name is ECMAScript
they labeled it javascript because java was popular at the time and they wanted to bandwagon it
kinda
lol wtf
theres is a better explanation in its wikipedia page
any1 wanna learn bitcoinGoogleAppleScript
The 6th edition, initially known as ECMAScript 6 (ES6) then and later renamed to ECMAScript 2015
you can just read it on wikipedia lol
ECMAScript (or ES)
is a scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262. It was created to standardize JavaScript, so as to foster multiple independent implementations. JavaScript has remained the best-known implementation of...
it was largely abandoned for so long, then they suddenly decided to give it new updates every year
perfection.
Question
I'm trying to make a ticket Command for my bot but I dont know how to set it up to make it open a whole ticket channel for a ticket can someone help me?
what lib
Like the other ticket bots opens a new ticket but I cant get mine to do that
explain?
I just did above
you mean like create a new channel?
What library
you'll need a database to store which channel is linked to which user, whether the ticket is resolved etc
what you want is really vague
they want a ticket system you see in bots like Tickety
How do I do that @earnest phoenix
with magic
buuuuut yeah there's your summary
do your research
lmfao ily cry
I've got a struggle, on my bot I'm saving the prefix for each server in a database, however that's to lower case as i've set it up, when I fetch the prefix from the database, I can't seem to make it to lower case and it ends up being case sensitive, I want it to be to lower case whenever it reads it up how do I proceed with that? lib is discord.js, here's code around the prefix
bot.db.query(`SELECT prefix FROM serverInfo WHERE serverID = ${message.guild.id}`, (err, rows) => {
if (err) throw err;
let prefix = rows[0].prefix;
if(!message.content.startsWith(prefix)) return;
let args = message.content.slice(prefix.length).split(/ +/);
let cmdName = args.shift().toLowerCase();
let option = message.content.slice(prefix.length+cmdName.length).split(/-+/);
if(!commands.has(cmdName)) return;
let cmd = commands.get(cmdName);
});```
ily2
My bad for trying to get help πππ
you need to learn the line between asking for help and asking for line by line instructions on how to do something
you need to make it lowercase when you're saving it to the db
@hollow prawn just make it lower case?
yeah lmao
I am, however when you do FL. instead of fl.
@earnest phoenix I was just asking how to start it that way I didnt mess it up
it doesnt recognize it as the prefix
when I'm saving it to the db, it is to lower case
that's the issue, idk where to i do it
first time dealing with this thing
i told you how, then you more than likely wanted me to tell you how to do everything instead of you using your brain, by the time you whined here you could've already searched for "<my language> how to interact with a database"
learn π how π to π do π research π for π yourself π
I've tried prefix.toLowerCase() at let prefix = rows[0].prefix; and at if(!message.content.startsWith(prefix)) return;
make the message content lower case too
if you dont need any upper case commands or arguments
yeah I stay away from those, you right, the content, so message.content.toLowerCase().startsWith(prefix) ?
yeha, that's the one
starts with lower case prefix as well
just tried it out, it works
without lowercase for prefix, because when changing the prefix I already make it to lower case, even if you tried to set it to upper case
so I think i'd end up being pointless to have to lower case on prefix in starts with
as long as you're sure its already lower case, thats fine
yeah, tested setting the prefix to upper case, didn't do it, it set it to lower case
I'm trying to add my bot to discord for other people to use and I use the characters after the discord .gg part and its saying invalid server input do I half to put the full link or did I not input it rifht?
Right*^
discord.gg links are links to server invites
you can't use them for bots
use abal's tool https://discordapi.com/permissions.html
A small calculator that generates Discord OAuth invite links
Idk what to do for that after I put the client I'd in @earnest phoenix
I hit the link and it said unknown error
Is there anyone I can send these screenshots too in dms?
Who here makes games and uses Unity? If so where do you guys recommend I get started off with
like starting off with games?
A simple ping pong game could be a cool starter project
@abstract crow depending what game you wanna make, I did yt tutorials for a bit, on a simple clicker game just to experiment, might be bad idea but tbh I usually just start with yt tutorials
Nothing beats scratch clicker games
@hollow prawn ok. Because I want to do unity and game development I just didnβt really know where to start. I tried some brackets tutorials but imo they werenβt really good so Iβll try some others. Thanks!
lol. trying to get into unity too so imma listen in
Lol
@abstract crow brackeys yt channel series is gud
@hollow prawn Should I try learning through him again? https://www.youtube.com/watch?v=j48LtUkZRjU&list=PLPV2KyIb3jR53Jce9hP7G5xC4O9AgnOuL cc @cursive dagger
Want to make a video game but don't know where to start? This video should help point you in the right direction! β₯ Support my videos on Patreon: http://patr...
Yeah brackeys does very good tutorials
But is the one I linked outdated?
Not really, it still has very useful information
Not much has changed in unity since that vid
Ok. I'll give it another shot. Thanks π
I am assuming in C# you can't do this? public float leftRightSpeed = 500f; leftRightSpeed = leftRightSpeed * Time.deltaTime;
No I mean I have it in my class and stuff
I just took that snippet out of my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public Rigidbody rb;
public float forwardSpeed = 2000f;
public float leftRightSpeed = 500f;
leftRightSpeed = leftRightSpeed * Time.deltaTime;
void FixedUpdate()
{
rb.AddForce(0, 0, forwardSpeed * Time.deltaTime);
if(Input.GetKey("d"))
{
rb.AddForce(leftRightSpeed, 0, 0);
}
if(Input.GetKey("a"))
{
rb.AddForce(-leftRightSpeed, 0, 0);
}
}
}
code belongs inside methods
Oh so I need to do this in the void Start() method
(node:18912) UnhandledPromiseRejectionWarning: RangeError: Invalid permission string or number.
at Function.resolve (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\node_modules\discord.js\src\util\Permissions.js:195:65)
at Permissions.has (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\node_modules\discord.js\src\util\Permissions.js:62:35)
at Role.hasPermission (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\node_modules\discord.js\src\structures\Role.js:171:46)
at roles.some.r (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\node_modules\discord.js\src\structures\GuildMember.js:321:35)
at Map.some (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\node_modules\discord.js\src\util\Collection.js:357:11)
at GuildMember.hasPermission (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\node_modules\discord.js\src\structures\GuildMember.js:321:23)
at checkUserPermission (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\commands\info\whois.js:19:24)
at Object.run (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\commands\info\whois.js:102:13)
at Client.client.on (C:\Users\Aidyj418\Desktop\boss-bot\boss-bot-v2\index.js:49:17)
at Client.emit (events.js:193:13)
(node:18912) 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(). (rejection id: 1)
(node:18912) [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.
Why am I getting this? (Code: https://hatebin.com/djryjqfrps)
It worked when I run it on myself, but this error occurs when I run it on another user.
if (member.hasPermission('MANAGE_MESSAGES')) { arrayOfPerms.push('Manage Messages') Correct?
Hm?
@abstract crow seems promising, i didnt invest much into games tho
lol ok. I am doing it rn
I had hasPermissions, and the console said it was deprecated
Oh damn
What else can I use?
https://nobody-loves.me/i/rg79.png
This doesn't seem deprecated.
hasPermissions is deprecated while hasPermission is not
You can use an array in hasPermission canβt you
I mean it half works.
Not understanding why when I run it on another user it does that, but on myself it works fine
What are you trying to do
It takes an array or permission resolvable
@lusty dew A whois command.
Oh
!whois, or !whois @ember atlas
And why do you need permissions for this?
Seems like a command that would be open to everyone imo
You dont need permissions for it.
Then what are you checking permissions for?
For a section of the whois called Key Permissions
Show code?
Has permissions is deprecated
Vinnie I dont use hasPermissions
Vinnie is slow 
But yet that doesnt show on the docs
Wtf
hasPermission is NOT deprecated
Lol
Oh no wait
Lol
what version is that
ya the one you are on checks if a user has that perm
That says .hasPermission
Ooh
no deprecation warning
Lol
Still doesnt explain why this command only works for me
aPerms = void 0;
if (member.hasPermission('MANAGE_MESSAGES')) {
aPerms = 'Server Moderator'
``` Is this using the deprecated one?
never seen void in js 
Ya ok, so anyone running whois on me works, it works when I run it, but doesn't when other people run it unless its on me
What the hell
(node:18912) UnhandledPromiseRejectionWarning: RangeError: Invalid permission string or number.
But what invalid permission string or number
code?
MANAGE_MESSAGE
you can just do member.permissions.toArray()
For which line?
Well that will list of all their permissions, no?
member.permissions.toArray() will return the user's permissions in array form already
But won't that use all of their permissions they have?
Like even create instant invite, etc
yes
Sorry I gtg I feel really sick today
its fine this just annoys me
@broken shale @abstract crow Thanks for the help. I had a few permissions wrong, I had Administrator instead of ADMINISTRATOR, and VIEW_AUDIT_LOGS instead of VIEW_AUDIT_LOG
how do i get the amount of guilds/users one shard can see in eris
@ember atlas console.log(member.permissions.toArray())
do that and you will see which permissions it returns so you can confirm it for yourself, its up to u how u wanna have it tho
hasPermissions that is deprecated could still work, might have errors/issues tho
what I use is member.permissions.has
https://hatebin.com/zrgvjlyhpa
why doesnt this kick
But still a permission array is a permissionresolvable too
are you sure this is correct syntax
stripIndents is a function/method id assume, you're missing a parentheses?
you have a return statement before your bot actually kicks the user
oh
where would i need to put that lol
oh
so before the return block
lmao
statement*
also use await member.kick()
there would be no point in making the function async without an await statement
you normally don't wanna return at the beginning of a if statement 
ye u can do await member.kick() and afterwards return <ur message stuff>
Fuck I can't keep using Visual Studio. Too many oh install this DLL oh and can you install that one too? While we are at it, lets not fucking give you intellisense like you are supposed to. Rider it is!
@eternal mesa yea why?
That is exactly how you should use it in the pic
Okay give me a sec
k
f
one sec
How did i get unblocled
Hello i have a question
can you tell me that it methods with nodejs (more precisely discord.js) you use to know the ram used and the total ram that the bot uses please ??
Please mention me if you have the response
`${(...heapUsed / 1024 / 1024).toFixed(2)} MB`
For total freeram, you'll need to access the os require('os'), and follow the similar concept.
Thanks and does it work on glitch
That's for you to find out brother.

