dimsey
dimsey
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by dimsey on 10/15/2023 in #djs-voice
Is it possible to have 2 bots in voice channels in discord js?
I registered two clients. I attempt to connect each to a voice channel, and after the first bot connects, the second will not connect. Additionally, getVoiceConnection returns a voice connection when the second bot attempts to connect
11 replies
DIAdiscord.js - Imagine an app
Created by dimsey on 9/30/2023 in #djs-voice
Issue w/ Opus -> Ogg recording voice with [email protected] - ERR_REQUIRE_ESM
I was trying to follow this example recording voice demo (https://github.com/discordjs/voice-examples/blob/main/recorder/src/createListeningStream.ts#L19C1-L27C5), but I'm running into the following error:
👂 Listening to dimsey8_0
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/user/Desktop/unicorn/Voice/node_modules/node-crc/lib/lib.js from /Users/user/Desktop/unicorn/Voice/node_modules/prism-media/dist/ogg/OggLogicalBitstream.js not supported.
Instead change the require of lib.js in /Users/user/Desktop/unicorn/Voice/node_modules/prism-media/dist/ogg/OggLogicalBitstream.js to a dynamic import() which is available in all CommonJS modules.
}
👂 Listening to dimsey8_0
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/user/Desktop/unicorn/Voice/node_modules/node-crc/lib/lib.js from /Users/user/Desktop/unicorn/Voice/node_modules/prism-media/dist/ogg/OggLogicalBitstream.js not supported.
Instead change the require of lib.js in /Users/user/Desktop/unicorn/Voice/node_modules/prism-media/dist/ogg/OggLogicalBitstream.js to a dynamic import() which is available in all CommonJS modules.
}
I am using ESM instead of CommonJS (the example link uses CommonJS). As a result, despite prism being ESM compatible, an underlying part of it, e.g., node-crc seems to be using CJS. I'm not sure how to go about fixing this. Any ideas would be great. I was thinking of looking for another stream encoder for Opus -> Ogg but I haven't found any that work yet. Does anyone have advice for me? Thank you in advance. Code will be pasted as a comment.
10 replies
PD🧩 Plasmo Developers
Created by dimsey on 9/27/2023 in #👾extension
Next js 13.2 template
Is it possible to run a server with this?
2 replies
PD🧩 Plasmo Developers
Created by dimsey on 9/27/2023 in #🔰newbie
Custom plasmo css
Does plasmo have custom classes prebuilt in? Like plasmo-fixed or how does that work? Referrring to this (https://github.com/PlasmoHQ/examples/tree/main/with-tailwindcss)
3 replies
PD🧩 Plasmo Developers
Created by dimsey on 9/27/2023 in #👾extension
Tailwinds with content.tsx
// content.tsx
import cssText from "data-text:~style.css"
import type { PlasmoCSConfig } from "plasmo"

export const config: PlasmoCSConfig = {
matches: ["https://www.google.com/*"]
}

export const getStyle = () => {
const style = document.createElement("style")
style.textContent = cssText
return style
}

const PlasmoOverlay = () => {
return (
<div className="w-96 h-96 text-red-500 bg-red-500">
<button className="w-48 h-48 bg-red-300">hello</button>
</div>
)
}

export default PlasmoOverlay
// content.tsx
import cssText from "data-text:~style.css"
import type { PlasmoCSConfig } from "plasmo"

export const config: PlasmoCSConfig = {
matches: ["https://www.google.com/*"]
}

export const getStyle = () => {
const style = document.createElement("style")
style.textContent = cssText
return style
}

const PlasmoOverlay = () => {
return (
<div className="w-96 h-96 text-red-500 bg-red-500">
<button className="w-48 h-48 bg-red-300">hello</button>
</div>
)
}

export default PlasmoOverlay
This doesn't change the CSS at all. What can I do to debug this? This is a fresh project with a content.tsx and tailwinds in style.css. Tailwinds works on the normal popup page but not here. Any help would be greatly appreciated! Thank you!
7 replies