LukeZ
LukeZ
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by LukeZ on 11/14/2024 in #djs-questions
How to handle unhandled rejections?
My app usually crashes when a very weird unhandled rejection occurs, usually when it's an event where I don't have a general error handler. So how can I catch unhandled rejections effectively? (Maybe even do something with it like send it with a Webhook or log it)
36 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 11/13/2024 in #djs-questions
Why are my embeds not sent but Files are?
No description
32 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 11/12/2024 in #djs-questions
Is the promise rejected when a REST.post request fails?
I'm doing something like this and I'm wondering in which case the promise is rejected (when the body and all stuff is correct). Is the promise rejected when the HTTP status code is not 2xx ? Is there a Type I can use?
try {
await client.rest.post(Routes.channelMessages(postId), {
body: {
// ...
},
files: files
});
} catch (error) {
// ??
}
try {
await client.rest.post(Routes.channelMessages(postId), {
body: {
// ...
},
files: files
});
} catch (error) {
// ??
}
7 replies
CDCloudflare Developers
Created by LukeZ on 10/28/2024 in #pages-help
Tailwind CSS not working with SvelteKit
I am using Tailwind CSS but by site doesn't work completely. It is partially working but some things are missing. Could it be, because tailwind is a devDependency?
Page: https://burningdezibelz.pages.dev/ Account ID: 92d72ac72fb811275ce6e8d5263a9816 Deployment ID: 553b1d7e-c978-4bb7-8bb7-bfc980ae05ee
9 replies
CDCloudflare Developers
Created by LukeZ on 10/28/2024 in #pages-help
Where to put a 404 page when having an SPA?
I want to deploy my site but I wanted to add a 404 page somewhere. I'm using SvelteKit and don't know if I even have to make a 404 page and if yes, does it need to be a .html or can it be a .svelte? How do I have to do this?
Page (if finished): burningdezibelz.pages.dev
1 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 10/13/2024 in #djs-questions
How to handle HTTP errors?
https://discordjs.guide/popular-topics/errors I've read this and still don't know how to properly handle HTTP errors. I don't really know how to handle a 403 (FORBIDDEN) error for example. How can I do this? Update: Can I just do this?
import { DiscordAPIError, RESTJSONErrorCodes } from "discord.js";

try {
} catch (err) {
// Handle HTTP errors
if (err instanceof DiscordAPIError) {
// Handle here
}

// JSON error codes
if (err.code === RESTJSONErrorCodes.Unauthorized) {
// Handle here
}
}
import { DiscordAPIError, RESTJSONErrorCodes } from "discord.js";

try {
} catch (err) {
// Handle HTTP errors
if (err instanceof DiscordAPIError) {
// Handle here
}

// JSON error codes
if (err.code === RESTJSONErrorCodes.Unauthorized) {
// Handle here
}
}
33 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 10/10/2024 in #djs-questions
.getMember() with Typescript
No description
21 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 10/9/2024 in #djs-questions
How to send a file/attachment from an Attachment option on SlashCommand?
I've looked up that topic the the guide but can't find anything on how to send an attachment/file that I get from a slash command.
12 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 10/5/2024 in #djs-questions
How to differentiate between the possible errors when DMing a user?
I want to do send a DM to a user and handle the errors. I know that there is more than one possible error, but not how to handle it. There is the one if the user has DMs disabled and one if user doesn't share any servers with the bot and one for Unknown user and also one for "Cannot send messages to this user". How can I differentiate between those errors and what is even possible?
21 replies
CDCloudflare Developers
Created by LukeZ on 9/25/2024 in #general-help
SSL on my VPS with SSL certificate from CF
How do I automatically renew the certificate issued by CF on my VPS? Does it even need to be the same?
11 replies
CDCloudflare Developers
Created by LukeZ on 9/22/2024 in #general-help
SSL certificates via CF on my Webserver
I don't really get how SSL certificates work in combination with AAAA records or respectively, how they generally work. I have my website running with a CNAME record www for Google sites running and this does work with the free SSL certificate CF offers. But now I want an AAAA record api also to be secured with an SSL certificate. Do I need to do something on my server or just something in the CF dashboard?
4 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 9/17/2024 in #djs-questions
When listening to a rest request, can I use an async function?
I just read this: https://discordjs.guide/additional-info/changes-in-v14.html#apirequest And now I want to implement my own logger and may have to use an await statement - is this possible?
6 replies
CDCloudflare Developers
Created by LukeZ on 9/4/2024 in #general-help
Redirect rule not working
No description
10 replies
CDCloudflare Developers
Created by LukeZ on 8/20/2024 in #general-help
Public Nameservers for another Domain Registrar
I wanna register a domain at another provider but I wanna use the cloudflare nameservers. Is there any way to do this by using a domain and not an IP address?
27 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 8/12/2024 in #djs-questions
How to setup constants/variables outside of module.exports ?
No description
6 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 7/14/2024 in #djs-questions
TS Error: The property "isReady" / "token" is not available for the "myClient" type.
I've made my own TS Client class which extends djs' Client class but it keeps giving me an error which has to do with the Client class from djs I suppose. Any ideas how to fix this?
import { Client } from "@discordjs/core";

export class myClient extends Client {
async myFunction(...) {
if (!(this.isReady() || this.token))
// The property "isReady" / "token" is not available for the "myClient" type.
}
}
import { Client } from "@discordjs/core";

export class myClient extends Client {
async myFunction(...) {
if (!(this.isReady() || this.token))
// The property "isReady" / "token" is not available for the "myClient" type.
}
}
27 replies
DIAdiscord.js - Imagine an app
Created by LukeZ on 6/7/2024 in #djs-questions
Why can't I import (require) something from discord.js ?
No description
3 replies
CDCloudflare Developers
Created by LukeZ on 4/24/2024 in #general-help
Registrant E-Mail buggy
I transferred my domain over to CF but now the E-Mails don't work. It's always displaying this:
Please query the WHOIS server of the owning registrar identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
Please query the WHOIS server of the owning registrar identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
Anybody know how to fix this?
5 replies
CDCloudflare Developers
Created by LukeZ on 2/20/2024 in #general-help
Redirect Rules not working
No description
29 replies
CDCloudflare Developers
Created by LukeZ on 7/6/2023 in #general-help
How to use the Dynmaic Redicts?
24 replies