CC8
CC8
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by CC8 on 1/15/2024 in #djs-questions
restart command
I know there is a client.destroy how can I make a restart command with it and do i need to do new Client mmLol
15 replies
SSolidJS
Created by CC8 on 1/13/2024 in #support
Basic Router
Hey there I want to have a simple Router component that I can use. Problem I'm curently facing is that it doesn't rerender on path change.
import { createSignal, onCleanup } from 'solid-js'

import Home from '../pages/Home'
import Dashboard from '../pages/Dashboard'
import NotFound from '../pages/404'

export default function Router() {
const [path, setPath] = createSignal(window.location.pathname)

const checkPath = () => {
console.log('Checking path')
const currentPath = window.location.pathname
if (path() !== currentPath) {
setPath(currentPath)
}
}

window.addEventListener('popstate', checkPath)

onCleanup(() => {
window.removeEventListener('popstate', checkPath)
})

const navigate = (to) => {
history.pushState({}, '', to)
setPath(to)
console.log('Navigating to', path())
}

switch (path()) {
case '/':
return <Home />
case '/dashboard':
return <Dashboard />
default:
return (
<>
<button onClick={() => navigate('/')}>Home</button>
</>
)
}
}
import { createSignal, onCleanup } from 'solid-js'

import Home from '../pages/Home'
import Dashboard from '../pages/Dashboard'
import NotFound from '../pages/404'

export default function Router() {
const [path, setPath] = createSignal(window.location.pathname)

const checkPath = () => {
console.log('Checking path')
const currentPath = window.location.pathname
if (path() !== currentPath) {
setPath(currentPath)
}
}

window.addEventListener('popstate', checkPath)

onCleanup(() => {
window.removeEventListener('popstate', checkPath)
})

const navigate = (to) => {
history.pushState({}, '', to)
setPath(to)
console.log('Navigating to', path())
}

switch (path()) {
case '/':
return <Home />
case '/dashboard':
return <Dashboard />
default:
return (
<>
<button onClick={() => navigate('/')}>Home</button>
</>
)
}
}
10 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 6/2/2023 in #djs-questions
Check if token valid
How can I check if a token is valid before trying to login? or maybe using the login function if that return a good error idk
16 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 6/1/2023 in #djs-questions
Failed to compileModule not found: Can't resolve 'zlib-sync'
getting this error when just doing
import { Client, GatewayIntentBits } from 'discord.js'
import { Client, GatewayIntentBits } from 'discord.js'
which is weird cause i thought zlib is an optional package
3 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 3/25/2023 in #djs-questions
is there any way to fetch an interaction by it's id?
is there any way to fetch an interaction by it's id? cause i want to fetch it and do editReply() on it at a later date
27 replies
CC#
Created by CC8 on 1/10/2023 in #help
❔ limit network usage of a process
is it posible to limit the network usage of a certain process? and if it is how can it be done?
11 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 1/10/2023 in #djs-questions
forum posts closing
how can I lock & close a forum post?
4 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 1/10/2023 in #djs-questions
how do i get the channel where a slash command has been executed?
^
2 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 1/10/2023 in #djs-questions
how can I lock & close a forum post?
^
2 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 1/9/2023 in #djs-questions
set the tags of a forum channel
how can I set the tags of a forum channel?
5 replies
DIAdiscord.js - Imagine an app
Created by CC8 on 7/8/2022 in #djs-questions
Button send to channel
Is there any way I can make a button send a user to a channel?
8 replies