Jerimiah
Jerimiah
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/8/2024 in #djs-questions
Message to embed
Let's say user runs the command providing:
{
description: 'example'
}
{
description: 'example'
}
4 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 1/31/2023 in #djs-questions
Creating a class for events
Also a more cleaner implementation:
export default class Event<T extends keyof ClientEvents> {
public constructor (
public name: T,
public run: (client: client, ...event: ClientEvents[T]) => void | Promise<void>
) { }
}
export default class Event<T extends keyof ClientEvents> {
public constructor (
public name: T,
public run: (client: client, ...event: ClientEvents[T]) => void | Promise<void>
) { }
}
11 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 1/31/2023 in #djs-questions
Creating a class for events
I made that adjustment thanks for the input
11 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 1/31/2023 in #djs-questions
Creating a class for events
As in like when the event is imported?
11 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 1/31/2023 in #djs-questions
Creating a class for events
export default class Event<T extends keyof ClientEvents> {
public name: T
public run: (client: Client, ...event: ClientEvents[T]) => void

public constructor (name: Event<T>['name'], run: Event<T>['run']) {
this.name = name
this.run = run
client.on(this.name, (...args: ClientEvents[T]) => { this.run(client, ...args) })
}
}
export default class Event<T extends keyof ClientEvents> {
public name: T
public run: (client: Client, ...event: ClientEvents[T]) => void

public constructor (name: Event<T>['name'], run: Event<T>['run']) {
this.name = name
this.run = run
client.on(this.name, (...args: ClientEvents[T]) => { this.run(client, ...args) })
}
}
11 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 1/31/2023 in #djs-questions
Creating a class for events
Sorry for not updating I have resolved this issue
11 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 1/31/2023 in #djs-questions
Creating a class for events
I made this that doesn't give me any errors but doesn't function how I would like it to
export default class Event {
name: Events
run: (client: client, ...event: ClientEvents[]) => Promise<void>
}
export default class Event {
name: Events
run: (client: client, ...event: ClientEvents[]) => Promise<void>
}
11 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/29/2022 in #djs-questions
Can buttons and action row be created as objects?
Alright got it working thanks alot!
15 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/29/2022 in #djs-questions
Can buttons and action row be created as objects?
setting the type to ButtonComponent
15 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/29/2022 in #djs-questions
Can buttons and action row be created as objects?
D:\discord bots\hawk-bot\node_modules\discord.js\src\util\Components.js:114
throw new Error(`Found unknown component type: ${data.type}`);
^
Error: Found unknown component type: undefined
at createComponentBuilder (D:\discord bots\hawk-bot\node_modules\discord.js\src\util\Components.js:114:13)
at D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\ActionRowBuilder.js:15:77
at Array.map (<anonymous>)
at new ActionRowBuilder (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\ActionRowBuilder.js:15:31)
at D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\MessagePayload.js:137:84
at Array.map (<anonymous>)
at MessagePayload.resolveBody (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\MessagePayload.js:137:49)
at DMChannel.send (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:61)
at User.send (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:163:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
D:\discord bots\hawk-bot\node_modules\discord.js\src\util\Components.js:114
throw new Error(`Found unknown component type: ${data.type}`);
^
Error: Found unknown component type: undefined
at createComponentBuilder (D:\discord bots\hawk-bot\node_modules\discord.js\src\util\Components.js:114:13)
at D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\ActionRowBuilder.js:15:77
at Array.map (<anonymous>)
at new ActionRowBuilder (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\ActionRowBuilder.js:15:31)
at D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\MessagePayload.js:137:84
at Array.map (<anonymous>)
at MessagePayload.resolveBody (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\MessagePayload.js:137:49)
at DMChannel.send (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:61)
at User.send (D:\discord bots\hawk-bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:163:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
15 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/29/2022 in #djs-questions
Can buttons and action row be created as objects?
ah okay
15 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/29/2022 in #djs-questions
Can buttons and action row be created as objects?
something like this
15 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 9/29/2022 in #djs-questions
Can buttons and action row be created as objects?
const row = {
components: [
{
id: ...
},
]
};
const row = {
components: [
{
id: ...
},
]
};
15 replies
DIAdiscord.js - Imagine an app
Created by Jerimiah on 7/22/2022 in #djs-questions
Bot Permissions Vs Intents
so it's nothing to worry about while using discord.js
8 replies