ted
ted
Explore posts from servers
BABetter Auth
Created by ted on 2/17/2025 in #help
Generating backup codes gives error
Doing:
const { data, error } = await authClient.twoFactor.generateBackupCodes({
password: values.currentPassword,
});
const { data, error } = await authClient.twoFactor.generateBackupCodes({
password: values.currentPassword,
});
and getting:
⨯ [TypeError: The "payload" argument must be of type object. Received null] {
code: 'ERR_INVALID_ARG_TYPE'
}
⨯ [TypeError: The "payload" argument must be of type object. Received null] {
code: 'ERR_INVALID_ARG_TYPE'
}
5 replies
CDCloudflare Developers
Created by ted on 2/9/2025 in #general-help
Workers should stop issuing certificates to me?
I use Total TLS, and as any custom domain will get a new certificate from Total TLS, it is uncesssry for CF to issue another certificate for the worker. Can I disable it?
2 replies
BABetter Auth
Created by ted on 12/22/2024 in #help
Delete User with Token gives error
I'm trying to use:
const { data, error } = await authClient.deleteUser({
token,
callbackURL: "/",
});
const { data, error } = await authClient.deleteUser({
token,
callbackURL: "/",
});
-# (token is 100% defined as a valid string) However, my client gets the error:
"[
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"token"
],
"message": "Required"
}
]"
"[
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"token"
],
"message": "Required"
}
]"
10 replies
BABetter Auth
Created by ted on 12/20/2024 in #help
Is there documentation on running code on a specific event (ie signin)?
I need to run some non blocking code when specific events happen. I feel like I remember this was possible, but can't find anything.
8 replies
BABetter Auth
Created by ted on 12/16/2024 in #help
Convention for getting the session and types?
Hi all. So, firstly, where should I get the session, and if so should I then pass it with props to children components which use it? Or, should I get the session in each component. Secondly, what is the type for the session?
3 replies
DIAdiscord.js - Imagine an app
Created by ted on 10/13/2024 in #djs-voice
After disconnecting once, audio starts audibly buffering
Here is part of my /play command:
const connection = joinVoiceChannel({
channelId: interaction.member.voice.channelId,
guildId: interaction.guildId,
adapterCreator: interaction.member.voice.channel.guild.voiceAdapterCreator,
});

const resource = createAudioResource("an mp3 live link", {
inlineVolume: true,
});

const player = createAudioPlayer();

connection.subscribe(player);
player.play(resource);

player.on("stateChange", async (oldState: any, newState: any) => {
log(`AudioPlayer: ${oldState.status} -> ${newState.status}`, "debug");

switch (newState.status) {
case AudioPlayerStatus.Idle:
log("The player has become idle.", "debug");
const resource = createAudioResource("an mp3 live link", {
inlineVolume: true,
});
player.play(resource);
break;
case AudioPlayerStatus.AutoPaused:
try {
await Promise.race([
entersState(player, AudioPlayerStatus.Idle, 2_000),
entersState(player, AudioPlayerStatus.Buffering, 2_000),
entersState(player, AudioPlayerStatus.Playing, 2_000),
]);
} catch {
connection.disconnect();
}
break;
}
});

connection.on("stateChange", async (oldState: any, newState: any) => {
log(`VoiceConnection: ${oldState.status} -> ${newState.status}`, "debug");

switch (newState.status) {
case VoiceConnectionStatus.Disconnected:
try {
await Promise.race([
entersState(connection, VoiceConnectionStatus.Signalling, 2_000),
entersState(connection, VoiceConnectionStatus.Connecting, 2_000),
]);
} catch (error) {
connection.destroy();
}
break;
case VoiceConnectionStatus.Destroyed:
player.stop();
break;
}
});
const connection = joinVoiceChannel({
channelId: interaction.member.voice.channelId,
guildId: interaction.guildId,
adapterCreator: interaction.member.voice.channel.guild.voiceAdapterCreator,
});

const resource = createAudioResource("an mp3 live link", {
inlineVolume: true,
});

const player = createAudioPlayer();

connection.subscribe(player);
player.play(resource);

player.on("stateChange", async (oldState: any, newState: any) => {
log(`AudioPlayer: ${oldState.status} -> ${newState.status}`, "debug");

switch (newState.status) {
case AudioPlayerStatus.Idle:
log("The player has become idle.", "debug");
const resource = createAudioResource("an mp3 live link", {
inlineVolume: true,
});
player.play(resource);
break;
case AudioPlayerStatus.AutoPaused:
try {
await Promise.race([
entersState(player, AudioPlayerStatus.Idle, 2_000),
entersState(player, AudioPlayerStatus.Buffering, 2_000),
entersState(player, AudioPlayerStatus.Playing, 2_000),
]);
} catch {
connection.disconnect();
}
break;
}
});

connection.on("stateChange", async (oldState: any, newState: any) => {
log(`VoiceConnection: ${oldState.status} -> ${newState.status}`, "debug");

switch (newState.status) {
case VoiceConnectionStatus.Disconnected:
try {
await Promise.race([
entersState(connection, VoiceConnectionStatus.Signalling, 2_000),
entersState(connection, VoiceConnectionStatus.Connecting, 2_000),
]);
} catch (error) {
connection.destroy();
}
break;
case VoiceConnectionStatus.Destroyed:
player.stop();
break;
}
});
Now, this works flawlessly. But, when I initiate a connection.disconnect() - in a seperate command - it does indeed leave the voice channel. But when I run /play again, while it does play, it is very buffery. I believe what is happening is the old player hasn't been destroyed, and my computer is trying to play 2 streams? Maybe not? - GuildVoiceStates intent is enabled - Here is my dependencies:
Core Dependencies
- @discordjs/voice: 0.17.0
- prism-media: 1.3.5
Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: 0.1.1
Encryption Libraries
- sodium-native: not found
- sodium: 3.0.2
- libsodium-wrappers: 0.7.15
- tweetnacl: 1.0.3
FFmpeg
- version: 6.0-essentials_build-www.gyan.dev
- libopus: yes
Core Dependencies
- @discordjs/voice: 0.17.0
- prism-media: 1.3.5
Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: 0.1.1
Encryption Libraries
- sodium-native: not found
- sodium: 3.0.2
- libsodium-wrappers: 0.7.15
- tweetnacl: 1.0.3
FFmpeg
- version: 6.0-essentials_build-www.gyan.dev
- libopus: yes
14 replies
CDCloudflare Developers
Created by ted on 7/29/2024 in #general-help
Being DDoSed
I've got a friend to DDoS me, but my site is still going donw. Security level is on high, all dns are proxied? Why is thhis?
8 replies
PPrisma
Created by ted on 7/26/2024 in #help-and-questions
prisma enum types as argument type?
i've got this function:
export async function log(arg1) {
// logic
}
export async function log(arg1) {
// logic
}
i also have the enum logType with Prisma. how can I set the type for arg1 by using the enum logType?
4 replies
CDCloudflare Developers
Created by ted on 7/23/2024 in #general-help
Cloudflare Zero Trust Access Help
I am using service tokens to authenticate an automation system with an application. But, it only lets me through the login portal when I'm on the root domain, or in one level deep paths. I need to get to a two level deep path for the API, but, even with the valid service token in headers, it won't allow me into the two level deep opath.
5 replies
CDCloudflare Developers
Created by ted on 10/11/2023 in #general-help
1.1.1.1 Connection issue
My macbook used to work fine connecting, but now it only connected 1/100 times and stays on establishing connection
1 replies
CDCloudflare Developers
Created by ted on 8/29/2023 in #general-help
Cloudflare Email Query
We use Google Workspace for company emails which has the MX records on the root domain. On our product we are introducing a new feature where we would like to be able to use the cloudflare email system, yet we also want these emails to be on the root domain. Any tips?
1 replies