#development
1 messages Β· Page 1591 of 1
kek
go to my server
i did
I don't store mutes on DB...
I do kekw
If you restart the bot it'll never complete a cycle
doesn't need, it puts a timeout at startup automatically
but it comes again with a new value
could be 3h left
Ah, I see
Cron would still be more reliable tho
maybe
log your body
then(x => x.text()).then(console.log)
i think your API returned an invalid JSON
oh
still yeah
hm
well
hi flaze
i guess you got your answer
if it doesn't log anything means your code is running perfectly but not the way you want
it could be both
make sure you used the correct method and auth, etc.
try checking the status code
so your JSON payload is in the wrong schema
oops, there
check data
can you send it here?
it's userId, no?
this is yours
this is from the schema
the example might be wrong, try using userId instead
pretty sure
What's better:
website.com/blog/blog-post-name
website.com/post/blog-post-name
The latter.
The second one, yes.
Aight, thanks ^^
json
const ownerId = {'id', 'id'}; how can i define 2 people?
Unfortunately it does not work like that π¦
xd
const client = new Discord.Client();
const ownerIds = ['251058655137366017', '366808523692310529'];
client.on("message", async message => {
if (message.author.bot) return false;
if (message.mentions.has(ownerIds)) {
await message.delete();
message.reply(`Du bist eine Dumme hure`);
};
});
Doesnt work :(( @slender thistle
What are you trying to do
I want that you can not mark these 2 ids
you cant use .has(array)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some this probably?
The some() method tests whether
at least oneΒ element in the array passes the test implemented by the provided
function. It returns a Boolean value.
^this
if(ownerIds.includes(message.mentions.members.first().id))
i see u are deutsch haha
oliypls
Ne man wie kommst du drauf?
lol
it will error if there's no mentions too

I'm not gonna spoonfeed
Hmmm so how exactly can I do that?
warum willst du ΓΌberhaupt so ein command machen haha
#general-int for German please
Das ist kein command habe keine lust das man mich markiert xd @earnest phoenix
k
im trying to add a custom prefix to a json file and the following error shows up: File "main.py", line 17, in prefix id = message.server.id AttributeError: 'Message' object has no attribute 'server'
can someone help?
message.server is not a thing

sorry i am rly bad at this
yes
not servers
so message.guild.id?
yes
const client = new Discord.Client();
const ownerId = "251058655137366017";
client.on("message", async message => {
if (message.author.bot) return false;
if (message.mentions.has(ownerId)) {
await message.delete();
message.reply(`Du bist eine Dumme hure`);
};
});```
console.log(console); π³
How can i whitelist people?
Pls help :((
@quartz kindle ?
?
?
So I want when you ping me that the message is deleted but not for everyone
check message.author.id
Like this?:
if(message.author.id === '') return
await message.delete();
message.reply(`Du bist eine Dumme hure`);
}```
depends what you want to do
if you want that only a specific person can use it, then message.author.id !== "id here"
hmmm how can i make it role instead of user
(ROLE ID)
message.member.roles.cache.has(id)
and several roles?
Array
I'm pretty sure it doesn't take an array
Then tell me how it's done :))
[array_of_ids].includes(member.roles.cache.keys())
@earnest phoenix
thats as far as i can take you without spoonfeeding
Use <Array>#some()
best i can do after this is just send u the docs
(node:3200) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined
at FormData._getContentType (C:\Users\Owner\Desktop\jscord\node_modules\form-data\lib\form_data.js:249:29)
at FormData._multiPartHeader (C:\Users\Owner\Desktop\jscord\node_modules\form-data\lib\form_data.js:178:26)
at FormData.append (C:\Users\Owner\Desktop\jscord\node_modules\form-data\lib\form_data.js:70:21)
at createFormMessage (C:\Users\Owner\Desktop\jscord\jscord\src\utils\resolve.js:79:10)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.createMessage (C:\Users\Owner\Desktop\jscord\jscord\src\utils\resolve.js:37:22)
at async Client.<anonymous> (C:\Users\Owner\Desktop\jscord\index.js:13:13)
https://sourceb.in/N71FdMydg3 (error emits from line 7 on this paste)
async function createFormMessage(options = {}) {
const form = new FormData();
form.append("content", options.content);
form.append("nonce", makeid(12));
form.append("tts", options.tts.toString());
form.append("file", await getBuf(options.attachments?.file), options.attachments?.name ?? "file");
form.append("payload_json", JSON.stringify({ "embed": options.embeds, "message_reference": { message_id: options.reference || null }, }), { contentType: "application/json" });
return {
headers: {
"Content-Type": "multipart/form-data"
},
body: form.getHeaders()
};
}
function looks like this currently
options is an empty object
No
it doesnt have attachment property in it unless you send an options opject
Its nott
I logged it legit
debugger
I loggeddd itt
Okay no
that'll give you real time values
add a breakpoint in that line and watch on the left top side
for variable values
if(['776134400198180885', '776134408301182976'].includes(member.roles.cache.keys())) return doesnt work
cannot read roles of undefined right?
yes
define member, i told you, thats as far as i can take you
You're using optional chaining on the code you sent, but not in the one that's in the source bin link @solemn leaf
Source bin β options.attachments.name
New β options.attachments?.name
If you're using optional chaining, it's not possible for it to throw that error
Did you even save your code
No
yes, you are
To hard
stubborn
the same way you're telling them to learn js i could very well tell you to go learn how to debug js
Hey erwin, aren't you using a C# lib for your rich presence
At least I know js
If a server has a private channel, my bot is not able to see this channel. Which permissions (invite link) do I have to specify? Thanks π
VIEW_CHANNEL, CREATE_INSTANT_INVITE for invite link
I've already passed this permission
VIEW_CHANNEL wont matter if its a private channel
the only way to bypass permissions is ADMINISTRATOR
but you shouldnt do that
the owners must add the bot to the channels they want it to be seen by the bot
theres nothing you can do there
ok thx
np
you can still fetch the channel even if your bot cant see it lul
at least you could last time i tested
you can, that's one of the reasons why logging in as a bot is forbidden
in discord.js [v 12.5.1]
I am trying to fetch information from the api package node-internet-radio - On a playing stream link.
On consolelog I get
{
title: `Miami's #1 Hit Music Station - text="Y-100" song_spot="T" MediaBaseId="0" itunesTrackId="0" amgTrackId="0" amgArtistId="0" TAID="0" TPID="0" cartcutId="0" amgArtworkURL="" length="00:00:00" unsID="0" spotInstanceId="-1"`,
fetchsource: 'STREAM',
headers: {
'content-type': 'audio/aac',
'icy-metaint': '16000',
'icy-name': 'Y100'
}
}
Trying to get the headers.icy-name
I get it as undefined
var StationInfo_SN = StationInfo.headers.icy-name
console.log(StationInfo_SN);
//From The DB
var Stream = data.guild.stream_link.alpha;
//Command
internetradio.getStationInfo(Stream, function(error, station) {
var StationInfo = station;
console.log(station);
var StationInfo_SN = StationInfo.headers.icy-name
console.log(StationInfo_SN);
const?
let
let and const
ooh ok
basically
put everything to cost
and change to let when it errors
consts cant be chaged
let can
Thank you it worked
np
Also what can I do to get this values
title: `Miami's #1 Hit Music Station - text="Y-100" song_spot="T" MediaBaseId="0" itunesTrackId="0" amgTrackId="0" amgArtistId="0" TAID="0" TPID="0" cartcutId="0" amgArtworkURL="" length="00:00:00" unsID="0" spotInstanceId="-1"`,
For example
let StationInfo_T = StationInfo.title
console.log(StationInfo_T);```
Undefined
that shouldnt be undefined
also, heres the reason why i told u to use let/const instead
notice how i return a before even declaring it
i get Undefined
and theres no error
console.log(StationInfo)
see if you''re passing the right thing
stationInfo =
{
title: 'Post Malone - text="Circles" song_spot="M" MediaBaseId="2522450" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="30779802" TPID="79727410" cartcutId="3231075001" amgArtworkURL="http://image.iheart.com/bell-ingestion-pipeline-production-umg/full/00602508067150_20190906150338788/19UMGIM78325_T1_cvrart.jpg" length="00:03:41" unsID="-1" spotInstanceId="-1"',
fetchsource: 'STREAM',
headers: {
'content-type': 'audio/aac',
'icy-metaint': '16000',
'icy-name': 'Y100'
}
}
StationsInfo.title =
title: 'Post Malone - text="Circles" song_spot="M" MediaBaseId="2522450" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="30779802" TPID="79727410" cartcutId="3231075001" amgArtworkURL="http://image.iheart.com/bell-ingestion-pipeline-production-umg/full/00602508067150_20190906150338788/19UMGIM78325_T1_cvrart.jpg" length="00:03:41" unsID="-1" spotInstanceId="-1"',
gotta go to market
imagine sending html params in the title field through api 
No , to separate the fields ...
that's an object actually
an object inside a string
actually, someone fckd pretty hard when building that api
I dont seem to find another one
the actual response would be this:
{
title: 'Post Malone',
text: 'Circles',
song_spot: 'M',
MediaBaseId: '2522450',
itunesTrackId: '0',
amgTrackId: '-1',
amgArtistId: '0',
TAID: '30779802',
TPID: '79727410',
cartcutId: '3231075001',
amgArtworkURL: 'http://image.iheart.com/bell-ingestion-pipeline-production-umg/full/00602508067150_20190906150338788/19UMGIM78325_T1_cvrart.jpg',
length: '00:03:41',
unsID: '-1',
spotInstanceId: '-1',
fetchsource: 'STREAM',
headers: {
'content-type': 'audio/aac',
'icy-metaint': '16000',
'icy-name': 'Y100'
}
}
at least that's what it would be if those fields weren't inside a string
the problem is not the api
the problem is the protocol
these are radio streaming protocols, similar to how car radio works
there is only one field that contains information about the song
and they put everything inside that one field
that's gross
the title field is supposed to show the title, like it shows on a radio screen
here they are adding some additional data possibly for some radio streaming app
Any way to get the data like the text, art and etc..
you need to parse that title field
but i think this library is also screwing it up even further
i see they are using split and slice in their code
slice 'n dice
cull the meek

Why are the property names inside the string so messed up you have snake case and camel case
snake case?
oh
kebab-case π³
shiv is swapcase
AlMoStRaNdOm best case
period
Snake case easiest to read
and wtf is self:=defined:=case
camelCaseBestCase
variables yes
iRestMyCase
PascalCaseBestCase
I swear, if I ever see someone use P_a_r_s_e_d I'll prove humans can fly
kebab-case-for-project-names
camelCase - variables
PascalCase - class names / interfaces
kebab-case - project names
ALL_CAPS_SNAKE_CASE - enums / constants
i follow all above except for constants
sWAP - shiv
python devs: visible confusion
I only use all caps snake case for global constants, otherwise camelCase
Any way to go around the npm?
You can parse the string yourself
should i make enums in typescript with classes and static instances of said class?
i mean that's basically how java handles it and it works fine
Like, putting an enum as a static property of a class?
never make stuff static
yeah
I mean sure yeah you can do that
But I just prefer to export the enum from the file in which the class is defined
static sometimes is good
Also you cannot use const enums if you go with static
const enums are so much better than regular enums, too
well that's not exactly a problem at least for me
const enums are good
the thing is that i need enums with properties
wait, are you guys getting more than one type of enum?
All of my enums are const now that I think about it
so that's why im using classes
You probably shouldn't use enums then
like subproperties?
class Category {
public static readonly FUN = new Category('fun', 'Fun');
public static readonly MODERATION = new Category('moderation', 'Moderation');
public static readonly IMAGE = new Category('image', 'Image generation');
public static readonly ECONOMY = new Category('economy', 'Economy');
public static readonly INFO = new Category('info', 'Info');
public static readonly LEVELS = new Category('levels', 'Leveling');
public static readonly OWNER = new Category('owner', 'Owner');
private constructor(
public readonly name: string,
public readonly displayName: string
) {}
}
like, these are our enums
this is more or less how i handle it
they are immutable and static in java
In TS const enums are basically this:
const enum A {
something
}
const b = A.something;
gets compiled to:
const b = 0;
While normal enums get turned to some weird structure
that 0 is probably the index of the enum
which is the reason for enums basically
they...well...enumerate
I think that's better than using an enum
aight
exactly, makes your code faster and cleaner
this is one thing i don't really like about typescript
but it's a thing i also like about typescript
enums?
yeah
enums are love
enums are life
im working on a lib that is js, but has a .d.ts for declarations
they're basically like unique IDs
and i have a big ass object in js
and an equivalent big ass const enum in .d.ts
lol
enums are like bookmarks
the yee yee ass enum
why not just write TS tim
civil war incoming
I respect your opinion but it's wrong
what's it about
nasa stuff
c++ is just c but with dlcs
cool
two dlc's
yes
let's just hope EA doesn't buy c++
C++ is epic
ts is just js++
c# is just java++
does it really though
+ +
+ +
This doesn't really look like a hashtag to me
How to?
it is if you put them more together
cblunt
You can try using regex or you can use .split(" ") and then loop through the array and use .split("="). Regex is probably better, though
systemChannel is null
Oh
Some guilds don't have a system channel set
not all guilds have a system channel enabled
guild.channels.cache.first() BUT that channel may not be a text one
Cound you give me an example
so you should filter before you send
don't you need to sort by rawPosition?
guild.channels.cache.find(channel => channel.type === "text" && channel.permissionsFor(guild.me).has("SEND_MESSAGES"))
Oh
So This? guild.channels.cache.find(channel => channel.type === "text" && channel.permissionsFor(guild.me).has("SEND_MESSAGES")).send(hereEmbed);
you still need to check if a channel is found
Ok
because some guild may invite your bot with no permissions
and only add permissions later
Instead Of Doing This And It Being Long, Is There A Way To Shorten It Out?
if(guild.me.hasPermission([EVERY PERM]))
If I Create A Variable It Would Be Long Too
https://krypton.has-no-bra.in/11XRl3
Where should I put the "Posted:" text? Or is it good like that
admin is every perm
Ok!
do i ask for help with top.gg/servers here?
I would agree with hope for your issue chill, I would use webhooks
but idk how to bruh
@quartz kindle Can I Take Out && channel.permissionsFor(guild.me).has("SEND_MESSAGES") From The Statement?
it works in 1 one of my server but doesnt work in 2kmember servers
If My Bot Has Administrator
i have my website .html and i have a domain (didi-web.tk) can anyone help me get it hosted locally?
did you look into what we discussed yesterday?
yes
i get too confused
it should have covered it
i dont think anyone here will be able to explain it any better
i heard that there were desktop apps for it...
you still have to configure your domain
and port forward
and host it
personally, id also configure cloudflare for it too.
is there a yt video you recomend?
nah, I would use text resources.
https://my.freenom.com/knowledgebase.php?action=displayarticle&id=33 < domain setup
https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/ < serving static content(html files)
https://portforward.com/ < port forward
https://support.cloudflare.com/hc/en-us/articles/205177068-How-does-Cloudflare-work- < cloudflare explained
let StationInfo_T = StationInfo.title //Title Info
let StationInfo_TT = StationInfo_T.split("- ")[0].split("=")[1];
actually, you could just eval that string and get the variable value
since those are theoretically valid variable assignments
Are you telling me?
well yes, but that'd be kinda overkill
still, there's also one thing you could do
Peddle - text="Peddle" song_spot="T" MediaBaseId="0" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="0" TPID="0" cartcutId="9229536001" amgArtworkURL="null" length="00:00:30" unsID="-1" spotInstanceId="94132336"
``` = Console Long
First trying to get text
replace all = with : and put commas on each space after "
then enclose it within brackets and parse it to json
This part
let mess = 'text="Peddle" song_spot="T" MediaBaseId="0" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="0" TPID="0" cartcutId="9229536001" amgArtworkURL="null" length="00:00:30" unsID="-1" spotInstanceId="94132336"';
mess = mess.replace('" ', '", ');
//text="Peddle", song_spot="T", MediaBaseId="0", itunesTrackId="0", amgTrackId="-1", amgArtistId="0", TAID="0", TPID="0", cartcutId="9229536001", amgArtworkURL="null", length="00:00:30" unsID="-1", spotInstanceId="94132336"
mess = mess.replace('=', ':');
//text:"Peddle", song_spot:"T", MediaBaseId:"0", itunesTrackId:"0", amgTrackId:"-1", amgArtistId:"0", TAID:"0", TPID:"0", cartcutId:"9229536001", amgArtworkURL:"null", length:"00:00:30" unsID:"-1", spotInstanceId:"94132336"
mess = '{' + mess + '}';
//{text:"Peddle", song_spot:"T", MediaBaseId:"0", itunesTrackId:"0", amgTrackId:"-1", amgArtistId:"0", TAID:"0", TPID:"0", cartcutId:"9229536001", amgArtworkURL:"null", length:"00:00:30" unsID:"-1", spotInstanceId:"94132336"}
boom, valid json
then just JSON.parse(mess)
#development message this part
just parse it out of it
But what if the title of the song includes a -
no need to make it a 4 liner
actually
hm
let StationInfo_TT = StationInfo_T.split(" - t")[1] + 't';

so much bloat
well, I mean, this is probably the only way without using regex + iterators

What is better regrex or split
const infoText = (StationInfo_T.split(" - t")[1] + 't')
.replace('" ', '", ')
.replace('=', ':');
const infoJSON = JSON.parse('{' + infoText + '}');
regex will take time to compile the pattern, then you'll need to iterate over matches to get your desired value
it'll be big code, and probably slower
this solution above, albeit a bit gross, will do the work with two lines basically
I see
What if the stream doesnt get the title
Also let or const?
const in this case
if the stream is found (and follows a single structure), that'll always work
can i paste a code to here?
use hastebin/sourcebin/whateverbin
idk what is that
click save and send link here
Wait...
you have a dangling }
in where
Find where you have a extra }
actually, you have missing }
how can i fix this code
let Info = station;
let Station = Info.title
const Station_Info = (Station.split(" - t")[1] + 't').replace('" ', '", ').replace('=', ':');
const infoJSON = JSON.parse('{' + infoText + '}');
yes
doesn work
what error?
Cannot read property 'title' of undefined
text, not title
for me
is that code yours?
pretty sure someone said the problem
no. i tried to fix but i couldnt do
dot dot dot
nope its tittle
#development message thats the fix
put 2 } and a )
to where
then replace var with let and remove those 2 variables
where it says its missing it
it doesnt say
of course it does π

then last line maybe hmm 
oh my
^
^
@lyric mountain can i show my screen pls

?
One message removed from a suspended account.
One message removed from a suspended account.
faith halp
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
still need help :/
One message removed from a suspended account.
he showed
i showed
the issue is this:
One message removed from a suspended account.
One message removed from a suspended account.
i need to show my screen to any1
One message removed from a suspended account.
I've got no spoon with me today
One message removed from a suspended account.
@sage bobcat idk :(
his code misses 2 } and 1 ) at the last line
One message removed from a suspended account.
i have an "unexpected token" in last line
One message removed from a suspended account.
One message removed from a suspended account.
we're trying to explain that
man
look, bear with me:
i understood it just when i erased them it still says "un. token"
i did it
1 )
i put them
Because your deleting things you need
One message removed from a suspended account.
One message removed from a suspended account.

One message removed from a suspended account.
no i dont need thx i solved
One message removed from a suspended account.
oh i need that
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
let Station = Info.title
console.log(Station)```
Gives me
```js
Ritt Momney - text="Put Your Records On" song_spot="M" MediaBaseId="2638380" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="31514303" TPID="111470845" cartcutId="0420697001" amgArtworkURL="http://image.iheart.com/ihr-ingestion-pipeline-production-sbmg/A10301A0004458536N_20200916185637999/63447851.20126.jpg" length="00:02:25" unsID="-1" spotInstanceId="0"
One message removed from a suspended account.
One message removed from a suspended account.
yes, after you use the code I've shown u all you gotta do is get text parameter
we've extracted the data that's inside title field, now to get the title you get text from infoJSON
let Station = Info.title
console.log(Station)
const Station_Info = (Station.split(" - t")[1] + 't').replace('" ', '", ').replace('=', ':');
that'll convert the title data to a parseable JSON
this gives me an error
Hello I have a problem, the login page for the oauth reloads endlessly when I try to log in
How I can make voting reward
login page from top.gg?
you need to use the api/webhooks
no from my bot
check if your redirect is set correctly
ah we need a redirection code
const Station_Info = (Station.split(" - t")[1] + 't')
.replace('" ', '", ')
.replace('=', ':');
console.log(Station_Info)
Gives
ext:"My Head & My Heart", song_spot="M" MediaBaseId="2662311" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="32102720" TPID="118060853" cartcutId="3232849001" amgArtworkURL="http://img.iheart.com/sca/imscale?w=195&img=http%3A//assets.iheart.com/default/Default-PlayerAlbumArt.png" length="00:02:56" unsID="-1" spotInstanceId="-1"t```
So I have to make my bot response or set user data by webhook?
JSON.parse() it
ah, btw
Its incorrect right
yes, made a mistake there
const Station_Info = ('t' + Station.split(" - t")[1])
.replaceAll('" ', '", ')
.replaceAll('=', ':');
console.log(Station_Info)
.replaceall
that too
i mean I am not getting the console log
hm
this is an error
('t' + Station.split(" - t")[1])
``` is this correct
i keep getting this error, anyone know why?
hmmm
I am stilling checking what is the error
You could check it by running it, no?
i tried but it didnt work
What is the error?
but in glitch, it doesnt have a red round
@heavy marsh here:
in the logs, i saw a error in here wait
const Station_Info = ('t' + Station.split(" - t")[1])
.replaceAll('" ', '", ')
.replaceAll('=', ':')
.replaceAll(/\w+(?=:")/g, '"$&"');
const infoJSON = JSON.parse('{' + Station_Info + '}');
it shows a logs error in here
this part of the code
did you see anything ? any error?
?
Still get an error
const Station_Info = ('t' + Station.split(" - t")[1])
.replaceAll('" ', '", ')
.replaceAll('=', ':')
.replaceAll(/\w+(?=:)/g, '"$&"');
``` - Here
.replaceAll('" ', '", ') wrong "," ?
try now
who
him
?
just ran the code on the console
then put the result on jsonlint
and it validated successfully
^
... Doesnt work ...
let Info = station;
let Station = Info.title
const Station_Info = ('t' + Station.split(" - t")[1])
.replaceAll('" ', '", ')
.replaceAll('=', ':')
.replaceAll(/\w+(?=:")/g, '"$&"');
const infoJSON = JSON.parse('{' + Station_Info + '}');
console.log(infoJSON)
just to check, you get no error on the console?
I do
what error?
But its a wearied error
TypeError: Cannot read property 'title' of undefined
let Station = Info.title = Vaild
you can't get title from infoJSON
you need to get text
title is a field of Info
oh, wait
what's the line that error pops up?
no, there it's Info.title
I changed it to text
but still gives me TypeError: Cannot read property 'text' of undefined
Info is undefined then
Info is vaild
do console.log(Info)
let Info = station;
console.log(Info)
let Station = Info.title
console.log(Station)
let Station_Text = Info.text
console.log(Station_Text)
I get
{
title: 'Chris Brown / Young Thug - text="Go Crazy" song_spot="M" MediaBaseId="2597601" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="34433815" TPID="101459495" cartcutId="3231705001" amgArtworkURL="http://image.iheart.com/ihr-ingestion-pipeline-production-sbmg/A10301A0004391233W_20200511233023056/62921147.20126.jpg" length="00:02:54" unsID="-1" spotInstanceId="-1"',
fetchsource: 'STREAM',
headers: {
'content-type': 'audio/aac',
'icy-metaint': '16000',
'icy-name': 'Y100'
}
}
Chris Brown / Young Thug - text="Go Crazy" song_spot="M" MediaBaseId="2597601" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="34433815" TPID="101459495" cartcutId="3231705001" amgArtworkURL="http://image.iheart.com/ihr-ingestion-pipeline-production-sbmg/A10301A0004391233W_20200511233023056/62921147.20126.jpg" length="00:02:54" unsID="-1" spotInstanceId="-1"
undefined
GUYSΓΌ
ok ok, bear with me
https://hatebin.com/hasjlfsnep PLS HELP ABOUT THAT
https://hatebin.com/mtksurqwmq with that*
do console.log Station_Info and infoJSON
smh code js```js
const Discord = require('discord.js'); const clinet = new Discord.Clinet(); client.on('ready', async(bot) => {
console.log('ready')
}); clinet.on('message', async(bot, message) => {
let prefix = "owo "
if(message.channel.type === "dm" || message.author.bot || !message.content.startsWith(prefix)) return
});
oh no
format that smh
no
thats the point
i made it only it in one lime but discord succs and screwed it
why one line?
const Discord = require('discord.js');
const clinet = new Discord.Clinet();
client.on('ready', async (bot) => {
console.log('ready')
});
clinet.on('message', async (bot, message) => {
let prefix = "owo "
if (message.channel.type === "dm" || message.author.bot || !message.content.startsWith(prefix)) return
});
see? a lot better
TypeError: Cannot read property 'title' of undefined
at /home/container/commands/Radio/nowplaying.js:32:28
at /home/container/node_modules/node-internet-radio/index.js:45:14
at processTicksAndRejections (internal/process/task_queues.js:93:5)```
new (require('discord.js').Client)().on('ready', () => console.log('ready')).on('message', message => message.channel.type === 'dm' || message.author.bot || !message.content.startWith('owo'));
try let Station = station.title;
yes
It is that
ik, but for some reason your Info variable is undefined
how is my donut
k;double sin()
,cos();main(){float A=
0,B=0,i,j,z[1760];char b[
1760];printf("\x1b[2J");for(;;
){memset(b,32,1760);memset(z,0,7040)
;for(j=0;6.28>j;j+=0.07)for(i=0;6.28
>i;i+=0.02){float c=sin(i),d=cos(j),e=
sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
h*e+f*g+5),l=cos (i),m=cos(B),n=s\
in(B),t=c*h*g-f* e;int x=40+30*D*
(l*h*m-t*n),y= 12+15*D*(l*h*n
+t*m),o=x+80*y, N=8*((f*e-c*d*g
)*m-c*d*e-f*g-l *d*n);if(22>y&&
y>0&&x>0&&80>x&&D>z[o]){z[o]=D;;;b[o]=
".,-~:;=!*#$@"[N>0?N:0];}}/*#****!!-*/
printf("\x1b[H");for(k=0;1761>k;k++)
putchar(k%80?b[k]:10);A+=0.04;B+=
0.02;}}/*****####*******!!=;:~
~::==!!!**********!!!==::-
.,~~;;;========;;;:~-.
..,--------,*/
so tasty huh
delicious
this is called the 'C' donut.
smh code js ```js
const Discord = require('discord.js'); const clinet = new Discord.Client(); clinet.on('ready', () => console.log("ok")); client.on('message', (bot) => let prefix = "owo"; if(message.author.bot || message.channel.type === "dm" || if(message.content.startsWitch(prefix) return)))
clinet
Same
Also Something is wrong here
const Station_Info = ('t' + Station.split(" - t")[1])
.replaceAll('" ', '", ')
.replaceAll('=', ':')
.replaceAll(/\w+(?=:")/g, '"$&"');
console.log(Station_Info)
it's not even reaching that part
"Donut math: how donut.c works" blog post by Andy Sloane:
https://www.a1k0n.net/2011/07/20/donut-math.html
Deobfuscated code: https://bit.ly/2BITbQm
you're erroring when getting the title from Info
Should it be like this
const Station_Info = ('t' + Station.split(" - t")[1])
.replace('" ', '", ')
.replace('=', ':')
.replaceAll(/\w+(?=:")/g, '"$&"');
console.log(Station_Info)
Shall I send you my whole code
probably
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.
don't use var
There is a time and a place to use var. Server sided scripting is not that time or place
I see no error there tho
#development message i very well did
vars get hoisted declaration
they can cause some very annoying bugs
i didnt say that was ur issue, i say this might be another issue as well
you're just cleaning ur code, doesnt mean thats the source of ur problem
for some reason he's getting undefined for Info even tho when console.log(Info) returns the right value
I can't see the error
scopes?
just console.log(station)
ignore the last console.log, it was supposed to be Info.title anyway
yeah, we're stuck there
we know
then whats the issue?
Info.title throws "Can't get property title of undefined"
re: you shouldn't use var.
Web dev
var let const
let const
const Station_Info = (Station.split(" - t")[1] + 't')
.replace('" ', '", ')
.replace('=', ':');
console.log(Station_Info)
``` = Vaild though
but not corretly
log what i said
deving for legacy systems would require var since not all js engines support let or const
be mindful of case sensitive
as ugly as that is
js is case sensitive
and thats precisely why we use ts, which transpile current code to any node flavour
I've started to migrate to ts, yes.
if let/const isnt implement, it literally implements it for you
same for async
if your node target doesnt have async, it literally traspiles an async function to be used
let data = info.title.split(" - ")[1].split('" ').map(x => { let s = x.split('="'); return {[s[0]]: s[1]} })
imagine having to rewrite code cuz you need different targets rather than running tsc
wait what?
yeah
here, let me get example
https://youtu.be/ahCwqrYpIuM?t=151 i put the timestamp
TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be successful using it https://angularfirebase.com/typescript-the-basics/
Deep Dive https://github.com/basarat/typescript-book
TypeScript Docs https://www.typescriptlang.org/
watch this
just the next 30 seconds
he uses async as example, and hes targetting es3
it literally implements async for you
in es3
https://million.is-a.computer/files/UMR29Va4XSOxeCD8.png is there a way to do this in vsc?
I know ts does all that which is why I've started to switch. Having new features in legacy versions is very nice
Also, "statically typed"
reject djs, return to modular interfaces
im recommending Detritus from now on, its a much better discord lib for ts http://detritusjs.com/
I just made my own libs :)
docs....
ik
are you gonna try out discord-rose when berry is done?
or even do basic testing
unless tim uses it, nah
@quartz kindle
detritus is proving to be the best discord lib for js/ts i've seen so far
doubt rose would get even close to how sophisticated detritus is
can you give an example?
command handling is one of them
[
{ text: '9007428_podcast The Office Deep Dive' },
{ song_spot: 'T' },
{ MediaBaseId: '0' },
{ itunesTrackId: '0' },
{ amgTrackId: '-1' },
{ amgArtistId: '0' },
{ TAID: '0' },
{ TPID: '0' },
{ cartcutId: '9007428002' },
{ amgArtworkURL: 'null' },
{ length: '00:00:30' },
{ unsID: '-1' },
{ spotInstanceId: '94080489"' }
]
const Station_Info = Info.title.split(" - ")[1].split('" ').map(x => { let s = x.split('="'); return {[s[0]]: s[1]} })
console.log(Station_Info)
``` - :0
TIM send it
ik
could you explain a bit more?
Shold I do .parse ?
one sec, finding it
instead of an array
loads all commands in the dir?
it reads and subcategorises all ur commands based on folders, and it has deep searching
thats ONE thing
now heres the next
deep searching?
this is the command handler they have
PER command
now, this is options JUST for the commands
ah thats cool
you get options on the handler too
yeah for discord-rose I need to do that manually
never again do shit in d.js
just start your client with the target commands folder
it'll auto import everything for you
no more on.message listeners
no more adding disgusting readfileSync shit on ur code
this does all that internally
what is readFileSync used for huh
wait erwin you use vsc on like 75% zoom?
readFolderSync or some shit like that
i do, yes
my screen is too big to have it on 100%
do you open 2 files at the same time?
oh
I only go on lower zoom when I need to see more files
this is just one of my screens, i usually run it on my 4k tv
ah
but its kind of a pain to keep it stable
i dont have a proper hold for it
so its tilted on the back of a box i have
lul
lmao
How can I link the bot's patreon with the bot itself so Patrons get rewards? The only thing I found was to give special roles to patrons but that's not exactly what I'm looking for
you can use their api to get patreon supporters discord ID
But what if the person supporting doesn't have the discord account linked to patreon
then they should link it
Hello. I have following issue: I started my bot verification process, and there's one field asking me for my bot infrastructure. What does that mean? :D
its where your bot is hosted, what kind of software does it run on, etc...
Thank you!
When is node gonna start sending a signal interrupt to a process which doesn't handle a promise rejection
it's been years

my bot got approved on top.gg like yesterday, and it already reached 250 guilds, but i can't verify it cuz suspicious growth, how much time i need to wait to verify it?
normally a few weeks i think
stylish styling
ex deedeedee
What the hell
mans minifying css from the start 
Tim
I need big brain here
This is more of a how tf do it do it instead of how do I fix
@quartz kindle
check this meme out
d.js ram usage
detritus
its on prod rn, cant even bitch about it
that my error for my music bot
Show the code where the error is
idk when the error is on my code
Turns out Js has a built in stringify function
let number = 3;
number = number+""
for me that's very cursed
You can't do that
u can
You are trying to change a const's value
ah yes bery stoopid
how do i fix this
wut
tim didnt read my msg
im using repl maybe that the problem
i did lmao
thats rss, let me eval heap
eval heap in djs as well if you still have it running
not heap, no, i just log rss
because its quite possible that djs's memory usage is just rss bloat
and that heap is not that much different
i need to figure out why this aint working tho
Alright so, in short, I have a url shrinker, that has an api and sharex integration, I get asked a lot about custom user url integration, and I tried it today, to no avail, my theorised system is to have users set a domain CNAME as [their account id].mydomain.org which did work as it went straight to a plesk default page, now my only issue it that, I have no idea how the fuck to control these domains as all my efforts just send the domain to a default page, I donβt have ssh access to the origin server and I only have user level access to a plesk panel
oooh
i see why
find takes a function
why the heck did my compiler not screech about that?
i have no idea how plesk works
I got this error:
But my code is this.
client.on("guildCreate", guild => {
guild.member.cache.size()
console.log(`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
const newSC = "810687273963225128"
const Discord = require('discord.js')
const newS = new Discord.MessageEmbed()
.setColor('#FF0000')
.setTitle('NEW SERVER JOINED')
.addField('MEMBERS', guild.memberCount)
.addField('NAME', guild.name)
.addField('ID:', guild.id)
.setFooter('Time joined', client.user.displayAvatarURL())
.setTimestamp();
client.channels.cache.get(newSC).send(newS)
});```
wow.
its still going down
.members not .member
is that bad?
no, thats great
oh
d.js was using around 4GB of ram for 400k users and 2k servers
with detritus, its using 810mb
it will end up floating around heaptotal + 50
yes
all metrics have been ported too
had some hiccups on the metrics but not on the bot
Fuck Tim has failed me
but finally, its all back on its full gloriousness
Nice graphs
xd
Grafana?
try adding a wildcard subdomain with the same root dir as the main domain
ty
ye
Tried
I should probably try attempt 32 at setting up grafana at some point
theres even more metrics below tho
it just doesnt fit all in 1 screen
gotta scroll down
Also out of curiosity how are you storing the info the the graphs?
and instead of the root index file it gives you plesk default page?
multiple places, postgres is one of them


