#development
1 messages · Page 1793 of 1
yes
although there is another bot with the same name
which has nothing to do with mine
?
yes
what are arabic parts?
ancient arabic astrologers had a system of mathematical objects that were calculated from combining the positions of 3 other objects
for example you combine sun moon and mercury in a specific way, and you obtain the position of an abstract point that was assumed to have a certain significance
ooook...
Tim has knowledge beyond us
there are a hundred something objects calculated this way that became known as arabic parts or arabic lots
the most famous one being the "part of fortune" which is a combination of sun moon and ascendant
supposedly indicates how a person can achieve his idea of fortune
too confusing
fortune in the sense of luck, not money
to have good fortune
it is indeed very confusing
hence why one needs a couple years of study and experience to understand these things
however people are quite quick to dismiss it and troll it without even understanding it
ig i'm more of an astronomy guy, never really understood how astrology works
ye i used to be too
but once i started understanding it, it became quite fascinating
and i accidentally learned a shit ton of astronomy because of it
lul
Hello, I have an app in express and I want to know how to know if the image embed was opened by discord and not in the browser? Example of "image embed":
the world's defacto planetary calculation library in C was written by two dudes with PHD in astrophysics
reading is just staring at a piece of dead wood for hours and hallucinating
i dont think you can

their code is a mess tho, 25 year old standards
well, there IS a way
but are you really willing to travel that path?
reading code written by scientists is like reading code written by NASA, you dont understand shit
discord needs to access the url to retrieve the image
you want to know if your image was visualized/downloaded?
you can technically find the request made by disc and handle it
ye
doesnt the cnd cache it past cloudflare?
visualized
you'd realistically only get 1 time, no?
probably
discord will likely cache it
you'd need to use some query param to bypass cache
like https://url.tld?p=123
and chance p for every request
does discord cache it server side tho? that sounds stupidly inefficient
they should cache it client side
the client should fetch the url
cloudflare does if it's a frequently accessed page

if u dont know what user agent is, you got a long way to go
and this will likely be above ur skill level rn
Ignore const file = i'm testing the embed preview
so you can literally log req.headers
Yes
and it will give you all the information about who/what is accessing
that may include:
- your ip
- the lotto numbers
- your social security number
- you grandfathers name
- your location
- the reason why detritus is better than djs
- some funky russian text
xd
you forgot the meaning of life
Well sometimes that can be empty
the default option is "vodka" tho
it'll be empty if you're poor
So, the user-agent is always this?
no
a
user-agent is what was used to access it
Beer all the way
just check if it contains discordapp.com
unless it still comes from the old domain
to be safe, also check for discord.com
might just check for discord
But I am talking about whether it is the same when you see the preview of the image
it'll only trigger once per user
MAYBE

because it's when discord accesses the image for showing
it won't make a request after it's been loaded

access the image from both browser discord and discord app
and see if there is a difference
thats what you wanted to know right?
if there is a difference, then yes, its possible, if there is no difference, then no its not possible
like, there's not really an easy path for such stuff
that's why I asked this
I tried it on the web and it gave me different

but i see that the discord request has less properties than when i open the link
so you see, there is a difference
therefore, yes, you can know if it was opened in a browser or in the app
that would return undefined
you are undefined
your whole life is undefined
If the cheese directory has an index file domain.com/cheese will load that.
I'm using the command to add some roles.
and I'm saving the information in the database.
And after a while, I'm running a function to remove the information I saved in the database, but for some reason the excecute MySQL delete command isn't working.
Looks like it worked. But when i go checks the database, the information still there.
python
Anything in your logs?
Are you sure your query is actually running properly
try:
delete_query = f"DELETE FROM `d_roles` WHERE `id_roles`='{role_id}' AND `discord_id`='{user_id}'"
cursor.execute(delete_query)
db.commit()
print('Deleted Rows:', cursor.rowcount)
except pymysql.connect.Error as error:
print(f"Failed to delete record from table: {error}")
finally:
cursor.close()
db.close()
print("connection terminated.")```
no error message. Nothing
F-strings with SQL queries ok
sorry, what?
Does pymysql support prepared statements?
That and what happens if you except Exception instead of handling just one exception type?
sorry I didn't understand, what do you mean.
is it to remove the exception?
It means to do
except Exception as e
Aka
Handle ANY raised exception
Instead of pymysql.connect.Error
@spice hearth I never used mysql in PY, only PHP and JS, but, are you're role_id and user_id actually outputting something??
yes,
thanks i will try
Is that how shit is in MySQL actually
🤣
Do you wrap those names in apostrophes
If they're strings yeah
Table name? Column name?
Oh those aren't necessary but it'll work regardless
I was using it without, but then I put it on to see if it would make a difference and it still doesn't delete
Oh I see
it gets even crazier if I tell you the following.
I took the SQL code to delete it directly in mysql php admin, and guess what?
did not delete anything.
Did you get any error message doing it that way?
0 lines affected. (Query took 0.0005 seconds).
Are you sure you don't need the database name in front of the table name? For example DELETE FROM mydb.mytable WHERE...
When using the DELETE query you already need to have the database you want to use selected.
You use the USE <databasename> query for that but in phpmyadmin you can just click the database in the left column and then select the query tab.
goooooood, I'll check it out.
yes, of course, but I need the bot to do that.
Thanks
Yes you have to select the database first then using the USE query.
epicness
can someone help me out
im looking to buy a raspberry pi to host my bot
but idk what one
can someone help me out
it will be to host a music / general bot
Same thing, 0 lines affected.
What if you select instead? Does it return anything?
It might be in your table structure. Are discord_id and id_roles both stored as string values or integers?
both are int.
and only return "0 lines affected"
hi
That's the problem then
let quoteSample = "3 blind mice.";
let myRegex = /[^a-z0-9]/gi; // Change this line
let result = quoteSample.match(myRegex); // Change this line
console.log(result);
This also returns spaces??
They shouldn't be int
I'm contacting the hosting database support to see what they say. I come back to tell you what the problem was. Sure it's silly stuff.
Try removing the apostrophes
i will try. Ty ty
You're storing as int but searching for a string
you talking to me?
I'd recommend storing as a string
No
changed to delete as str and as int
and nothing has changed. same problem.
Thanks everyone for trying to help. I will wait for a response from the host.
is this something pre-built or does everyone use the same template?
i got help command template of google but everthing els is mine
everything *
and it's a completely generic bot
meaning pretty much nobody will use it
there are bots that do exactly what you do, but better
bots need to be innovative
in order to have a successful product, you first need to have a proper problem you want to solve with your product
im at a summer business camp right now and this is exactly what we're covering
why you can't be generic and how to beat your competition
Wow still
tbh, there are bots i review and get a dm from the owner 5 minutes later and dont remember the bot(so generic).
even doing something a tiny bit different helps a ton with making users want to use your bot.
found out it was
While the hosting support staff did not assist me, I started testing.
Until I finally looked more closely and saw my serious mistake.
i was trying to use a discord role id to delete an id from the primary table.
In other words, it would never work.
Since I should use role_id and not id_roles.
before:
DELETE FROM u629748736_temproles.d_roles WHERE discord_id=136933432973459457 AND id_roles=809936049781473290
now:
DELETE FROM u629748736_temproles.d_roles WHERE discord_id=136933432973459457 AND role_id=809936049781473290
Thanks anyway, guys.
🤣
kekw
I literally started typing a message asking if you had spelled your column and table names correctly but deleted it to reply to another message you'd sent in the meantime 😂
Also, you were trying to delete a string in a column of integers though so at least we noticed that 😅
html, body
{
margin: 0;
padding: 0;
height: 100%;
}
Also it’s not needed to display a div as block
Is already a block
Your “stockyheader” will not be sticky if that’s supposed to
It won’t be fixed at the top.
If your content is larger than the viewport and you scroll down, it’s gone.
header
{
height: 50px;
position: fixed;
top: 0;
left: 0;
right: 0;
}
The content “below” will be behind the header since it’s in the foreground
It’s required to push your content down, exact the same as the header height
content
{
padding-top: 50px
}
Or margin-top
Depends on your structure
You could export it in the same file.
Or just make a separate file for it
You can't have two files with the same name, however.
What library are you using? You could keep a collection of template embeds (embeds with pre-built form) and require/import them as a base. For example:
// Note: Untested!
// index.js
module.exports = {
embeds: {
default: () => new Discord.MessageEmbed()
.setTitle("Yeah")
}
}
// commands/ping.js
const index = require("../index.js")
module.exports = (message) => {
let embed = index.embeds.default()
.setDescription("Pong!")
.setColor("#FFFFFF");
message.channel.send(embed);
}
Or are you trying to split the design of the embed away from doing it in the runner? Am I confused and missing something?
Except discord.js uses mutable classes, so you would be modified the default reference ;)
Yeah I assumed that would be the issue
damn it mutable state
hold on magic trick
bam
Yeah that would work.
Could anyone tell me how I solve this error? I've tried everything and it didn't work out this error occurs when I type some commands doesn't occur with everyone
You tried requiring a file outside the correct context (or that didn't exist).
Assuming config.json sits in your project root directory and you tried requiring it from ./commands/autorole.js, you have an extra ../ that you don't need.
TIL Rust defines variables under interpretation as a constant value unless you're allowing a mut mutation operator to be passed
const voiceChannel = client.channels.cache.get('858158182882213920')
const connection = await voiceChannel.join();```
```js
TypeError: voiceChannel.join is not a function```
how do i fix this?
That's one of the fundamentals. Are you new to the language/recently learning it?
it's possible that the channel you got from the cache wasn't actually a voice channel.
Unless you're using Discord.js master, in which case, they removed built in support for voice
So, whenever I loop through a dictionary variable, so like an array but with keys. and values, anyways how can I loop through it to get the key, and the value of the key?
What language are you using?
https://srcb.in/HdFjaX4g7X
Error : when I react to any emoji its giving me cannot send an empty message
Javascript.
How do I learn to reduce numbers?
Example: 1560 => 1.56k
Why not just use a switch (heck, there are even shorter, efficient ways )
Object.entries is your friend.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
What if I have no friends? 😔
You're trying to send/edit a message while attaching no content, so it probably has to do with the embed you modify then send a request to edit the message with the new embed.
make some
Well its working before the djs update
The technology to physically make friends hasn't been invented yet?
And what is the shorter way?
You're concerned about how to format the number to be more user-friendly. There are many ways to do it depending on the language, but I recommend looking for a locale-aware answer.
javascript
Either:
- Replacing it with a
switch. - Matching the emojis to a value to search for when calling
getcmds(...).
As for your issue at hand, you should be concerned about what the value of embed is before sending it. Just a simple console.log would show you what's empty or not.
When I console it its giving me all category value
Are the answers here useful? https://stackoverflow.com/q/10599933/14695788
When you logged it, what did you get
anybody know what <*>: means?
any?
When I do console.log(cmd[0].value)
I get this :
Nevermind, I didnt read the thing
You're supposed to be logging embed before you send it.

ty
its a bad idea to have your image a discord avatar url because every time you change your avatar you would need to change it
Can someone help me out with the Gson for Event_District_Points https://www.thebluealliance.com/apidocs/v3
I'm not sure how to do the <*> because its not going to be a specific value
wait what extension is that for that minecraft text 
I need discord.py support for. 30 mint anyone can do help please come vc i need help 👍
Okay, I'll check, thank you
how do I save cooldowns and make em work even after my bot goes offline?
a database
ik that but how
Google "database tutorial in X programming language"
dude ik how to work with dbs
smh
but you don't know how to save cooldowns into a db?
no
how do u send an image to an express server? I used res.sendFile(path) but it returns undefined when I fetch it
check the database when you start the process, and start a cooldown based on the remaining time
something like
"creating cooldown"
cooldown => save the end date to the db
"after restarting the process"
check the database => start a cooldown that ends on that date
let me rephrase that, how do you use an image from an express server as I'm trying to put 127.0.0.1:port/users/icon/id in an embed thumbnail, but it's not working
store cooldowns into your db, when the bot starts read them and store them in a map and run the usual timeout from the map
or use redis so you dont need the map and timeouts
hey
I can define the first mention with message.mentions.members.first
but
how to define the second and third mention in the command?
cool
okie
has anyone used canvas npm?
i used it for rendering graphs
I used it for some cool cards
const args0 = "employee";
// Consider this object as the database.
const object = {
jobs: [
{
id: "employee"
};
];
};
I'm trying to check if the job the user tried to buy is already bought and already in the jobs array of objects.
Anyone got what I mean?
what database?
did you have different subobjects in jobs?
Yes.. there are other objects that have ids like employee, doctor, etc.. but when the user tries buying a job, I don't want him to have two objects with ids of employee.. so I want an if statement to avoid that.
jobs.$.id would be the path you want to use for the query i guess
$ is a wildcard for Array keys so instead of jobs[0].id you just use the wildcard
Yes.
work.jobs.$.id
Work document, the jobs array, $ which is the wild card for array keys, and .id
work is your collection name or a object inside your document?
.. the collection name.
then it wont work this way
Wait..
It's like defining this...
const work = await Work.findOne({ userID: message.author.id });
Sorry, I forgot what you call that.
thats a query
I messed up.
im looking for a raspberry pi to host my discord bot
and suggestions
its got around these stats
Can I do this, guys? if (work.jobs.$.includes(args0))
No, that's only for queries
you have to use array.find()
Use that for the query and if it doesn't return null, then the element exists
You just have to find it manually from the result
you could do
const work = await Work.findOne({ userID: message.author.id, "jobs.id": "workId" });
check if its exist
^
Could you show me an example, please, but for a seperate example?
this
const work = await Work.findOne({ userID: message.author.id, "jobs.id": "workId" });
if (!work) return;
work.jobs.find(({ id }) => id === "workId");```
it returns the full object
So you need to get the value manually since the query is only for filtering
But we're dealing with array of objects not only objects.
const object = {
jobs: [
{
id: "employee"
};
];
};
I only see one array
Array of objects?
Is the object inside an array of objects?
It's not since that's from Work.findOne()
Yes.
findOne() returns that object?
#development message Like the last line?
Do getters get removed when spreading objects?
No
Sorry I meant Yes for Flazepe, wrong response.
Yes.. so...
Okay so you're using const work = await Work.findOne({ userID: message.author.id, "jobs.id": "workId" }); right?
No.
What are you using?
Normal.
Work.findOne({
userID: message.author.id
}, async (err, work) => {
if (err) console.log(err);
if (!work) {
return;
} else {
}
});
What are you trying to find?
Let's consider work as the object right?
Yup, object is work.
.. exactly.
We have a job property which is an array of objects that contains an id (example) employee, which is a job I bought.
.. now suppose I accidentally bought it again, there would be two objects inside the jobs array with the same ID of employee.
did you already have one?
if no go for a Pi4
if you want to go fancy, look into Turing Pi
So you want to make sure the job doesn't exist in the DB before letting the user buy?
so the structure is like
{
userID,
jobs: Array<{
id: string,
..andOther
}>,
...andOtherThings
}
right?
have you tried this
You can use that. If it returns null, then the job is not in the array
I haven't.. but let's take another example.
const work = {
jobs: [
{
id: "employee"
};
{
id: "doctor"
};
{
id: "youtuber"
};
];
};
you can query an array like this in mongodb
Someone buys employee again, there is already an employee, but I want it to return since there is already one.
okay thanks
yes but i sold it
the PI4 comes with a faster Processor and more Ram, so its a no Brainer
yea
how much does it cost
so in ex
i have an array
{
"keyword": [
"a",
"b",
"c"
]
}
i can query that with {keyword: "b"}
depends on your country
uk
Oh..
same work with object
its a british company that makes them, so it should be not this expensive
okay nice
they start at 35$
because rn im hosting it on my old laptop and i wanna use that for school
so im gonna buy that and just have it up
If it wasn't an array of objects, i would use Object.keys
depending on how much Growth you expect the 4GB model should work for a while
i mean the music feature is used often
or you spend the money more and get the 8GB model
Anyone know a way to do this
Have someone react to a specific message, then have a bot post a pre-written message in a different text channel containing their discord userid
ben hit this specific reaction on a specific message
In another text channel: ben reacted to that message, their user ID is 488733804
I'm looking for like a public bot to do that. Not sure if this is the right text channel for that but I'm sure someone here will correct me if needed
Could you elaborate on that? Maybe I just don’t understand but I just don’t get it
.
^
this is ltierally 2 lines
okay, maybe i exagerrated, but its absurdly easy
but no, idk any bot that do that, but this isnt the place to searchf ro bots
use the search function in the website
Bot post in a text channel: react to this message with this emoji ❤️
Same bot, different text channel: Ben hit the heart button, user ID is 49596849e0
if u wanna MAKE a bot that does that, heres the right place
i understand what you want
oh thats very easy
this is not the place for it tho
unless you wanna MAKE a bot, then i can give u instructions on how to
Well if someone makes a simple bot doesn't it need to be hosted online, idk
it does
Well what's a good host for a very basic discord bot idk
u can host on ur pc, mobile, some free website, a paid vps, anywhere
^^
for something that basic, just use repl or heroku
..
Which free websites would let you host a simple basic discord bot
Oh. Repl or heroku
If you host on heroku it will only be active 3/4 of a month I think.
550 hours without credit card and 1000 hours with credit card
Oh alright
If you create One More App In Heroku Then You Can Host It 24/7
Like In The First App If The Time Has Reached Its Limit Then You Use Second App Which You Created And Host It
Your per-month hours are shared between all apps, no?
No
They Are Not Shared

Why the fuck would you have 1000 hours for an app in a month

multiple workers
we arent asking the real questions
the real question is: Why We Talking With Every Word UppperCased?
Its A Hype
MY COMPUTER'S WORKING AGAIN
@quartz kindle tytytytytyty
i can now boot into windows 7 but ubuntu's entire /dev/sda4 partition is corrupted and/or the file system is unknown for some reason

im calling the police
you can try recovering it if you have important stuff in there
testdisk is one of the best programs for that
otherwise just format and reinstall
Host on Qovery (They say it's free 24/7) ||terms apply||
does anyone know what version of the api the latest v11 of djs uses ?
isnt v11 of djs super old?
"super old"
nah
it's not super old
it is deprecated but it's not "super old" x))
Looking at the code it is super old
v11 uses api v6 i believe
and also I dont think it will even work now
uff ok
well, that is what i was wondering about x)
https://discord.com/developers/docs/reference
discord only maintains api v>7
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
yeah ik, all of my bots are in v12
that's not the issue x)
then why are you worried about v11
i was just wondering if djs 11 still could work
and v13 is here (beta though)
v11 as it is pretty much insta crashes because of stage channels
but if you modify it a bit, it will work more or less
yup i've seen this
is it possible to put a user banner on a bot?
I don't believe so.
holy sh-
node_modules
fuck react
vue > react
no but ok
wait 1220 ? mine has like 1600 (with router and node-sass)
then answer them
not a big deal
Brother my English is not good
Google translate is there for everything
Bhie samj nhi a raha kya bolu
Come to #general-int
Hello, I am reporting a bad moment that I am having with the html code that I want to edit for my bot's invitation site.
I've added a <button onclick="function()">Sample Text</button> on my code and onclick a fuction to toggle the picture everytime you click on the button.
The problem is that in my test topgg.html file it works perfect but in the top.gg website the function is not working (or maybe the <script></script> is not read)
What it is going on?
you're not allowed tu use js
don't think ur allowed to js
Ok, I see, js is not allowed. Thxu for the respond @copper cradle @earnest phoenix
You can host the site somewhere else and embed it in top.gg via the iframe tag
Eyyow
Is this the best way to check if "employee" is already there?
!!work.jobs.find(val => val.id === "employee")
const work = {
jobs: [
{
id: "employee"
}
]
};
!! returns a boolean.
It works, yes.
The !! really depends on you though.
An object truthfully evaluates to true.
So, depending on where/how you're using the object, you may not need to forcefully transform it to a boolean.
But if you just want a boolean, just use .some instead of .find
That would work, you can also just use Array.prototype.some() as it returns a boolean primitive value
God damnit Lite
Stole your thunder 
work.jobs.some(val => val.id === "employee"); // returns true || false
You don't need the two logical NOT operators (!!) as a prefix as Array.prototype.some() already returns a boolean
yes
Thanks!
Mmmm racist
use hyper::{Body, Request, Response, Server};
async fn handle(_: Request<Body>) -> Result<Response<Body>, Infallible> {
Ok(Response::new("This is a test response".into()))
}
Would this be a sound method for HTTP requests in Rust?
It doesn't involve unsafe, so yes, it is sound (assuming the calls to the libraries don't end up producing unsound code).
Though I've only used actix-web and not hyper.
maybe look at the transpiled file?
does anyone know how to write something in pygame with interlines? like if i have \n in pygame it anyway write it all on the same line
any good strongpoints to actix-web over hyper?
i originally was using deprecated rust-http before i moved over
I just use it since it's the de facto in the community and one of the fastest frameworks (behind C++ dragoon)
also i thought unsafe wasn't really a big thing unless it had to be strictly typed
gotcha
i'm a php major trying to move to rust
because i'm coding the top-gg/rust-sdk for shits and giggles for @humble gyro 
Though actix had a bit of controversy with its use of unsafe
since he's had the repo existent for years and never wrote code
unsafe i don't think is too big a thing
just seems to be a big no-no in the rust dev community
It's really how it's used and why.
🤫 don't tell the elites but i'm pretty sure unsafe rust is free and isn't bad
although that's my very amateur opinion
wdym free
joking as in freedom
like it's completely okay
you could probably make everything unsafe
ah
yeah unsafe is like that
it's all sunshine and rainbows until it's used incorrectly
the standard library is full of unsafe
Nah you like undefined behavior 🙃
this is the kind of stuff i'll write and then later regret my actions for
wait
i shall wait
there is code in the rust-sdk repo
but it hasn't been touched in 7 months and it's not complete
so go on 
you could build off of it though, doesn't seem like it has much going on
yeah
json input:
[
{
"city": "New London",
"country": "USA",
"key": "frc500",
"name": "U.S. Coast Guard Academy, USCG Foundation, USCG Alumni Association & Local Supporters & Grosso Regional Vocational Technical High School & Local Home School Community & New London Magnet High School & Westerly, RI High School",
"nickname": "Team 500/Team USA",
"state_prov": "CT",
"team_number": 500
},
{
"city": "Manchester",
"country": "USA",
"key": "frc501",
"name": "AC Trust/Stu, Sam & Lexxie/Louis P. Cote Inc./Geneia/Liberty Utilities/New Hampshire Stamping Co&4-H&Goffstown High School&Manchester High School-West",
"nickname": "The PowerKnights",
"state_prov": "New Hampshire",
"team_number": 501
},
// more objects...
]
java:
public Team_Simple[] getTeamsByPageNumberAsSimple(int pageNumber) throws IOException {
Request req = new Request.Builder().url(url+pageNumber+"/simple").addHeader(readAuthTokenId, readAuthToken).addHeader("Last-Modified", lastModified).build();
Response rsp = client.newCall(req).execute();
Team_Simple[] teams = new Gson().fromJson(rsp.body().string(), Team_Simple[].class);
lastModified = rsp.headers().get("Last-Modified");
return teams;
}
err:
Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:944)
at com.google.gson.Gson.fromJson(Gson.java:897)
at com.google.gson.Gson.fromJson(Gson.java:846)
at com.google.gson.Gson.fromJson(Gson.java:817)
at com.github.daflamingfox.api.TBAApi$List.getTeamsByPageNumberAsSimple(TBAApi.java:80)
at com.github.daflamingfox.Test.main(Test.java:13)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:349)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70)
at com.google.gson.Gson.fromJson(Gson.java:932)
... 5 more
so i see that yes; there is an object 1:2, but that should be fine? Im trying to get an array of Team_Simple objects
you...wh....fjaw...man
start crying
gson
well, so the issue is that you're trying to convert an array to json obj
you cant
getMatchKeysForTeamAtEvent
im not
it should be converting an array of json objects to an array of objects in java
that's an array
yes
you cant
omg
Team_Simple[] teams = new Gson().fromJson(rsp.body().string(), Team_Simple[].class);
this should be asking for an array of Team_Simple objects
which is what the json is
yes?
no
there are many issues with what you're doing
but lets say...its not like that
Idk how to fix this
It's npm install discord.js not npm install dicord.js
both represent the same thing
check your spelling
i have an array and i am using the .some() method, sometimes it says cannot read property ... of null, how can i check if there is values in the array
the array is defined as lol
just check the length of the array
...
why would you call some on lol before even making sure it's not empty
just check if the length is 0, if it is not do the thing,
Make sure it's not null. If so, just do if (lol && ...)
cannot read property length of null
^
or if(Array.isArray(lol) &&)
if you want to strictly check if its an array and nothing else
the diff is that one is wrapped and the other isn't
but ye, barely any lib nowadays use arrays
or use ?.length but node version >14 is needed
@lyric mountain your wrong; I had the wrong url lol; it was returning an object
so yes I was trying to deserialize an object, but my test json was working fine
you still need to review your method
you shouldnt create more than 1 gson instance
does anyone know how to write something in pygame with interlines? like if i have \n in pygame it anyway write it all on the same line
you right
but Ill fix that later
for now this works
also
public Map<String, Team_Event_Status> getTeamEventStatusForYear(String teamKey, int year) throws IOException {
Request req = new Request.Builder().url(url+"team/"+teamKey+"/events/"+year+"/statuses").addHeader(readAuthTokenId, readAuthToken).addHeader("Last-Modified", lastModified).build();
Response rsp = client.newCall(req).execute();
Type tesMapType = new TypeToken<Map<String, Team_Event_Status>>() {}.getType();
Map<String, Team_Event_Status> keys = new Gson().fromJson(rsp.body().string(), tesMapType);
lastModified = rsp.headers().get("Last-Modified");
return keys;
}
ew
thats alot of yucky long lines
please, use proper naming 
how so
int thisIsAVariable
class ThisClass
project my-own-project
yes ik; the schemas were snake cassed
so I just coppied it; I will change
but with vscode its easy just press f2, so im just gonna get it working now
also you dont need long method names, like
yes
yes
it saves time typing it later on
ok
btw
what tf would you change that to
did u just start using gson or is that a rooted dependency?
hm?
like
<dependencies>
<!-- OkHttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.0.1</version>
</dependency>
<!-- Google JSON -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.7</version>
</dependency>
</dependencies>
it's forked from the gson repo and was heavily optimized
ok
(and reduced a ton of boilerplate)
but I like gson
well, ok
lol
I dont know what that is so I think were clear
that's what everyone says
until they need them
later on it becomes hell to switch libs
not my problem 😆
for now
how do i set bot pfp on message embed thumbnail
depends on the library you're using
if (guild.member(memberId)) {
^
TypeError: Cannot read property 'member' of undefined```
```js
client.on('guildMemberAdd', member => {
let guild = client.guilds.cache.get('828686676355973190');
memberId = member.id;
if(member.guild.id === "854035267399712788"){
if (guild.member(memberId)) {
console.log('hi')
}
else{
member.kick()
}
}
})``` I'm trying to check if that user is in a certain server. But it doesn't work?
guild is undefined
So that means the guild you are trying to get doesn't exist in the cache or even at all

whats even the point of that script
of the line guild.member
you already have the member object
and fyi it's going to be removed in v13 if it wasnt already
is there a way that i can make a automatically make a channel if the sever does not have one
without running a command it will do it by it self
when the bot joins a server?
yea
you still need help?
you cant just randomly try stuff like that
you should look at the documentation on how to create roles.
trying random stuff like "Guild#createRole" makes no sense when they provide all that information to you
You gotta go through the manage now iirc
nahI got it; thanks tho
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i thought i fixed it but it did not work
😭
Didn’t work doesn’t help anyone help you
??
He's trying to say saying "didn't work" won't help us either since we wouldn't know what the problem is
So be more helpful
so i'm trying to make a advance mute command. If the sever does not have a mute role the bot will make the role. so i added this
guild.roles.create({
data: {
name: 'Muted',
color: 'GREY',
},
reason: 'Server Does not have arole
'
})
.then(console.log)
.catch(console.error);
from the dj website and it was showing guild is not defined
added
const guild = message.guild.name
then it was like can not read property of create is not defined and don't know how to fix that
guild isn't defined
which means that guild does not have a value
so guild needs to come from something
you really should learn javascript before making a bot
@sudden geyser would it be better to use a Box<String> instead of Vec<String> if I want to store a long array of Strings when converting JSON?
Box<String> is for storing data on the heap in certain occasions. Strings are already stored on the heap to my knowledge.
If you want to store a list of strings, Vec<String> is the standard.
There are other sequential data structures like VecDeque and LinkedList, but Vec is probably the appropriate option (https://doc.rust-lang.org/std/collections/index.html).
Well so far I'm using a union for multiple types and then going impl for the struct
Since JSON can do string, bool, float and int
Or Is there an easier way of just doing that?
The union type?
Or a type that acts as a union (e.g. an enum containing all the types allowed)
Type
Is there a type that acts like one though?
Idk if I can nest types with Vec
Can you do Vec<String, u64, f32, bool>?
Are you trying to write your own variant of the serde library?
Nah
But I don't wanna use serde personally
Although if there's a good solution with it, I'm down to hear
Consider me very amateur rust dev 
Nah you're pretty good for a beginner
Ahh thank you 😊
Been studying the rust docs on all of this
Fuckin christ you didn't even blink @scenic kelp
huh
the reason to use a popular library is because it's popular (as you can infer). For example, serde already has serialization and deserialization for most data types people can think of (and yes, JSON).
Though, about your Vec<String, u64, f32, bool> concern, you can't use Vec like that since it takes a single type. I'm a bit confused on what you want to do. Do you want Vec to accept any of those four types in the collection? If so, you can use an enum to represent the suitable types. If you want a struct with those four types, just define a struct with the appropriate fields.
Yeah
In python there is a Union[] type which does this
I want to do the same but in rust
Is it possible to make a music bot that can sit in the afk channel of a server and play music from a youtube 24/7 stream? If so, does anyone know of an open source one that already exists? (I don't have much programming knowledge lol)
Then I recommend the enum approach
So you're looking for a radio bot. How about this?
https://github.com/DriesCode/radiobot
To understand it, you should stimulate your programming experience
Would I just set it up as like this?
pub enum JSON
{
b: Vec<bool>,
s: Vec<String>,
u: Vec<u64>
}
And then do like
pub struct JSON
{
value: JSON
}
Sorry enums use consts I think
But the main premise?
It would look more like this:
enum Value {
Null,
Bool(bool),
Number(Number),
String(String),
Array(Vec<Value>),
Object(Map<String, Value>),
}
In this example, Value represents any value in a JSON that would be associated with a key. The premise is correct.
I see
And i can just refer to the enum base in the struct
Since I don't need to specify an enum value from it itself
yes
Pog, ok I think i understand it now
Thank you, I will look into it.
Is it possible to write something in about me in bot? 
not released for Bots yet. Its only for users now
maybe in future you can, not sure
I believe it’s possible
you believe is wrong
lol
its not, both banners and about me are not accesible with bot tokens
sad
take it as a "CUSTOM_PRESENCE" thing
Like why not
cuz knowing people well(like me), they will definitively abuse it

any ideas on how to fix high ping
ignore ram btw i run 3 bots on 1 vps
ignroe cpu also
Get better internet
Then your vps provider is dreadful 
well
im only person that gets it
lol
outta everyone ik that uses galaxygate
they are all py tho
Where is your server located?
LA
And where are you located? It will depend on the distance between the data center your guild is using and the server for your bot.
im in canada
ontario to be more direct
also i just looked again
my vps server is in new york
so im only like
less then 2 hours away
drive ofc
where tf is your VPS hosted? i usually get these kind of ping if i run the bot of my PC while downloading games
i said where it is
new york
lol i get a Better ping from Helsinki, Norway and the API Server is in San Francisco
idk why its like that
no one ik is getting the issue
it just randomly started
no errors on vps or in bot log
maybe shitty host, or a noisy neighbor
it just jumped from av 40 - 100 to av 1k plus
well everyone else ik is fine
with av 40 - 100
2 are same base in new york
possible that you are on a Host with one other guy who decides to run Plex on his VPS and decides to stream 4k videos all day long
did you asked the Support of your hoster bcs of this?
they maybe can help you
or they are just shit and overprovisioned the hell out of the Hardware/Aviable Bandwith
but as been perm fxed
it was a cloudflare issue with them
for a bit
but it was fixed like 4+ weeks ago
lol no
only reason i moved to a proper vps is because i wanted to uise a db
but i stooped using it anyways
lol you just used it wrong
it was for a eco thing but i gave up dealing with mongoose
if it crashes bcs of a DB, you either do bad queries, or dont handle errors properly
it would be find for like 3 months
then mongoose would just
crah my bot
over and over again
for no reason
yea sounds like query issues
lol
like ive used MongoDB for ~6Months and had like 1 or 2 Crashes bcs of bad error handling
i gave up on mongo
then use Postgres
worst db i have ever used
lol
i have already deleted everything for my eco stuff
mongo is fine, just the docs are special
so is waht it is
lol if you want to go overkill use Cassandra
not really a nightmare, but overkill for most small projects
I might look into it
Currently I use postgres and while the project isn't big I hope it becomes big 
discord uses Cassandra bcs MongoDB where unable to handle the load
it worked for the first 1-2 years tho
idk never used Cassandra
WHats the regex expression for the character*?
Escape it
escape it

not the place for that
ask in #general
keyscape is used for replication
unless you scaling, you wont need it
This is not working for my bot, what I need to do?
Like I want to change it;s status to "watching rofrosam" but it aint working.
ok
what if I want to
toying around with the new @discordjs/voice package
hello, im trying to make a bot in python thats multi files. is there any easy way of doing that?
because everything i try doesnt seem to work
Do you use discord.py extensions?
wdym
(node:22855) [DEP0128] DeprecationWarning: Invalid 'main' field in '/app/package.json' of 'node index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
?
@slender thistle imma look at extensions
They're just classes containing commands and listeners
ya
tfw you have to use a library to easily use multiple files in python
Not that you can't without a lib
Can you delete messages through console.log ?
print ansi escape stuff
Why would you want to do that?
sometimes, I need logs just temporary, like Clients Heartbeat, which is no more valid after 2 minutes...
While you probably could, you should let the console serve its purpose of logging stuff. I'd rather use log levels to tell the logger what kind of messages to log, but that's not the same as what you're asking for.
console can be an input
but yeah, really you should be building something separate if you need to access your program like that.
import gang
Toxic
dont comment on things u "think" are right, do research first.
if you dont know, dont answer
dont just randomly give guests

What's the purpose of a <lang>.typed file? The ones I've seen are literally empty and I've never actually seen any explanation of them
I dont have any important data on it so i want to reinstall ubuntu
Here's what shows up in gparted from the usb
just initialize it as a new partition and format it
How?
I hope i selected the correct file system
yes ext4 is fine for linux
cool
Lang? I don't think it's a general thing, not that I'm aware of. But refer to this https://www.python.org/dev/peps/pep-0561/
you can also boot from the ubuntu installer and have ubuntu format it for you with whatever file system it prefers
which is probably gonna be ext4 anyway
tried and failed because i cannot switch mouse buttons from the ubuntu installer
Hm, I could swear I also saw a js/ts typed somewhere. Might be wrong though. ty
My left click button is broken
Anyways do I need to rename the partition?
just name it anything you want
id rather keep it as sda4
@solar cave type \:emoji: in your discord server and then copy what it shows
btfrs or xfs 
my friends usb might melt
how can i send that emoji using discord.py
i have tried this
@solar cave put the copied text inside your message
ctx.channel.send(str(emoji))
why would you convert a string to string
lets say one custom emoji name in my server is "emoji_14"
and the bot is in my server
i can grab that emoji id too
say emoji.id="XXXXXXXXX"
type :emoji: in your server
copy what it shows
then ctx.channel.send("(copied text) rest of the message")
what about different server?
You'll need use external emojis permission
then?
You can use the emoji after that
@quartz kindle
This error also popped up when i tried to create a new partition directly from the installer
use gparted
Already did the partition stuff
Now it's giving me an error when im installing
uwu whats this
@earnest phoenixbro i tried this
@client.command(pass_context=True)
async def emoji(ctx):
await ctx.channel.send(":3809discordhypesquad:")
why did you remove the <>
select the first
done
i invited bot to other server which emoji is not there

localhost






