Kay
Kay
Explore posts from servers
DIAdiscord.js - Imagine a bot
Created by Kay on 6/29/2024 in #djs-questions
Cannot use 'in' operator to search for 'code' in undefined
is there a way to debug or fix this?
4 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Cannot get params from url
nvm sorry im just blind
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Cannot get params from url
i also could just be blind tho
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Cannot get params from url
it dosnt say anything abb that. it just explains how to use it when using token type 'code'
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Cannot get params from url
No description
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Oauth2 category of discordjs.guide not up to date. need help with new stuff
ohh nvm i found it thx
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Oauth2 category of discordjs.guide not up to date. need help with new stuff
No description
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 12/21/2023 in #djs-questions
Oauth2 category of discordjs.guide not up to date. need help with new stuff
oh oops. how do i do that tho? dont realy get it. is it something in the api, discord developer panel or while handling the request?
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 11/7/2023 in #djs-questions
GuildAuditLogEntryCreate does not provide a guild
oh thx. yhea i missed that. it also seems that i set once to true in the event. prob cous i copied the ready event. this fixed it. thx
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 11/7/2023 in #djs-questions
GuildAuditLogEntryCreate does not provide a guild
exactly what you would expect
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 11/7/2023 in #djs-questions
GuildAuditLogEntryCreate does not provide a guild
async events(): Promise<void> {
for (const entry of walkSync(this.client.root + "\\src\\events", {includeDirs: false, exts: [".ts"]})) {
const file = await import("file://" + entry.path);
const event: Event = new file.default();
if (event.once == true) this.client.once(event.event, (...args: any[]) => {event.execute(this.client, args)});
else this.client.on(event.event, (...args: any[]) => {event.execute(this.client, ...args)});
}
}
async events(): Promise<void> {
for (const entry of walkSync(this.client.root + "\\src\\events", {includeDirs: false, exts: [".ts"]})) {
const file = await import("file://" + entry.path);
const event: Event = new file.default();
if (event.once == true) this.client.once(event.event, (...args: any[]) => {event.execute(this.client, args)});
else this.client.on(event.event, (...args: any[]) => {event.execute(this.client, ...args)});
}
}
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 11/7/2023 in #djs-questions
GuildAuditLogEntryCreate does not provide a guild
undefined
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 11/7/2023 in #djs-questions
GuildAuditLogEntryCreate does not provide a guild
code:
import DiscordClient from "../utils/client.ts";
import Database from "../utils/database.ts";
import Event from "../utils/structures/Event.ts"
import { Events, Guild, GuildAuditLogsEntry } from "npm:discord.js";

export default class ReadyEvent extends Event {

constructor() {
super(Events.GuildAuditLogEntryCreate, true);
}

async execute(client: DiscordClient, entry: GuildAuditLogsEntry, guild: Guild): Promise<void> {

console.log(entry) // logs the Entry
console.log(guild) // Logs 'undefined'

// const db = new Database("database.db")

// const dbGuild = db.getGuild(guild.id);

// if (dbGuild?.config.logChannel == null) return;

// let channel = await guild.channels.fetch(dbGuild.config.logChannel);
// if (!channel || !channel?.isTextBased()) return;
// channel.send(JSON.stringify(entry));

}

}
import DiscordClient from "../utils/client.ts";
import Database from "../utils/database.ts";
import Event from "../utils/structures/Event.ts"
import { Events, Guild, GuildAuditLogsEntry } from "npm:discord.js";

export default class ReadyEvent extends Event {

constructor() {
super(Events.GuildAuditLogEntryCreate, true);
}

async execute(client: DiscordClient, entry: GuildAuditLogsEntry, guild: Guild): Promise<void> {

console.log(entry) // logs the Entry
console.log(guild) // Logs 'undefined'

// const db = new Database("database.db")

// const dbGuild = db.getGuild(guild.id);

// if (dbGuild?.config.logChannel == null) return;

// let channel = await guild.channels.fetch(dbGuild.config.logChannel);
// if (!channel || !channel?.isTextBased()) return;
// channel.send(JSON.stringify(entry));

}

}
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 10/30/2023 in #djs-questions
get all mesages after a specific time
oh thx
4 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 9/25/2023 in #djs-questions
AutoModerationActionExecution does not trigger
No description
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 9/25/2023 in #djs-questions
AutoModerationActionExecution does not trigger
i also have the AutoModerationExecution intent so i dont think intents are the problem
7 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 9/16/2023 in #djs-questions
DiscordAPIError[50007]: Cannot send messages to this user
ahh alr thx
4 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 9/14/2023 in #djs-questions
Says that interaction.isChatInputCommand is not a function
oh thx that worked
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 9/14/2023 in #djs-questions
Says that interaction.isChatInputCommand is not a function
would it be becouse of the way that i register the events?
async events(): Promise<void> {
for (const entry of walkSync(this.client.root + "\\src\\events", {includeDirs: false, exts: [".ts"]})) {
const file = await import("file://" + entry.path);
const event: Event = new file.default();
if (event.once == true) this.client.once(event.event, (...args: any[]) => {event.execute(this.client, args)});
else this.client.on(event.event, (...args: any[]) => {event.execute(this.client, args)});
}
}
async events(): Promise<void> {
for (const entry of walkSync(this.client.root + "\\src\\events", {includeDirs: false, exts: [".ts"]})) {
const file = await import("file://" + entry.path);
const event: Event = new file.default();
if (event.once == true) this.client.once(event.event, (...args: any[]) => {event.execute(this.client, args)});
else this.client.on(event.event, (...args: any[]) => {event.execute(this.client, args)});
}
}
13 replies
DIAdiscord.js - Imagine a bot
Created by Kay on 9/14/2023 in #djs-questions
Says that interaction.isChatInputCommand is not a function
oh yhea
13 replies