Ahmad A.
Ahmad A.
Explore posts from servers
SIASapphire - Imagine a framework
Created by Ahmad A. on 3/29/2024 in #sapphire-support
Button doing nothing
Sorry for ping
13 replies
SIASapphire - Imagine a framework
Created by Ahmad A. on 3/29/2024 in #sapphire-support
Button doing nothing
@Favna answered
13 replies
SIASapphire - Imagine a framework
Created by Ahmad A. on 3/29/2024 in #sapphire-support
Button doing nothing
Latest version index.js - buttons - commands I didnt use the cli module Im using tsc i tried rebuilding not related i think
13 replies
SIASapphire - Imagine a framework
Created by Ahmad A. on 3/29/2024 in #sapphire-support
Button doing nothing
alr checked
13 replies
SIASapphire - Imagine a framework
Created by Ahmad A. on 3/29/2024 in #sapphire-support
Button doing nothing
its not called
13 replies
SIASapphire - Imagine a framework
Created by Ahmad A. on 3/29/2024 in #sapphire-support
Button doing nothing
💀
13 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
Ok
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
import fs from "fs";
import Client from "../Interfaces/Client.js";
import Command from "../Interfaces/Command.js";
import sendLog from "../functions/sendLog.js";
function CommandHandler(client: Client): void {
fs.readdirSync("./build/commands").forEach(async dir => {
const commands = fs.readdirSync(`./build/commands/${dir}`).filter(file => file.endsWith(".js"));

for (const file of commands) {
const command: Command = await import(`../commands/${dir}/${file}`).then(
imported => imported.default
);

client.commands.set(command.data.name, command);
const handlerMessage = `[HANDLER - COMMAND] Loaded a command: ${file} (#${client.commands.size})`;
sendLog(handlerMessage, 2);
}
});
}

export default CommandHandler;
import fs from "fs";
import Client from "../Interfaces/Client.js";
import Command from "../Interfaces/Command.js";
import sendLog from "../functions/sendLog.js";
function CommandHandler(client: Client): void {
fs.readdirSync("./build/commands").forEach(async dir => {
const commands = fs.readdirSync(`./build/commands/${dir}`).filter(file => file.endsWith(".js"));

for (const file of commands) {
const command: Command = await import(`../commands/${dir}/${file}`).then(
imported => imported.default
);

client.commands.set(command.data.name, command);
const handlerMessage = `[HANDLER - COMMAND] Loaded a command: ${file} (#${client.commands.size})`;
sendLog(handlerMessage, 2);
}
});
}

export default CommandHandler;
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
import { Client as BaseClient, Collection, GatewayIntentBits } from "discord.js";
import Command from "../Interfaces/Command.js";
import ClientConfig from "../Interfaces/ClientConfig.js";
import CommandHandler from "../handlers/commandHandler.js";
import EventHandler from "../handlers/eventHandler.js";
import Modal from "../Interfaces/Modal.js";
import ModalHandler from "../handlers/modalHandler.js";
import { PasteClient } from "pastebin-api";
import secrets from "../json/secrets.json" assert { type: "json" };
import sendLog from "../functions/sendLog.js";
class Client extends BaseClient<true> {
public readonly commands: Collection<string, Command>;
public readonly modals: Collection<string, Modal>;
public pastebin: PasteClient;
constructor() {
super({
intents: [GatewayIntentBits.Guilds],
allowedMentions: { parse: ["users"] },
});

this.commands = new Collection<string, Command>();
this.modals = new Collection<string, Modal>();
this.pastebin = new PasteClient(this.config.pastebin);
}
config = secrets as unknown as ClientConfig;
async init() {
await sendLog(`[SYSTEM] Handlers have been initiated.`);
await CommandHandler(this);
await EventHandler(this);
await ModalHandler(this);
return await this.login(this.config.token);
}
}
export default Client;
import { Client as BaseClient, Collection, GatewayIntentBits } from "discord.js";
import Command from "../Interfaces/Command.js";
import ClientConfig from "../Interfaces/ClientConfig.js";
import CommandHandler from "../handlers/commandHandler.js";
import EventHandler from "../handlers/eventHandler.js";
import Modal from "../Interfaces/Modal.js";
import ModalHandler from "../handlers/modalHandler.js";
import { PasteClient } from "pastebin-api";
import secrets from "../json/secrets.json" assert { type: "json" };
import sendLog from "../functions/sendLog.js";
class Client extends BaseClient<true> {
public readonly commands: Collection<string, Command>;
public readonly modals: Collection<string, Modal>;
public pastebin: PasteClient;
constructor() {
super({
intents: [GatewayIntentBits.Guilds],
allowedMentions: { parse: ["users"] },
});

this.commands = new Collection<string, Command>();
this.modals = new Collection<string, Modal>();
this.pastebin = new PasteClient(this.config.pastebin);
}
config = secrets as unknown as ClientConfig;
async init() {
await sendLog(`[SYSTEM] Handlers have been initiated.`);
await CommandHandler(this);
await EventHandler(this);
await ModalHandler(this);
return await this.login(this.config.token);
}
}
export default Client;
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
Argument of type 'this' is not assignable to parameter of type 'Client'.ts(2345)
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
in the handlers
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
With "this"
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
Still getting an error
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
I didnt get where u wanted me to put the client sorry
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
import { Client as BaseClient, Collection, GatewayIntentBits } from "discord.js";
import Command from "../Interfaces/Command.js";
import ClientConfig from "../Interfaces/ClientConfig.js";
import CommandHandler from "../handlers/commandHandler.js";
import EventHandler from "../handlers/eventHandler.js";
import Modal from "../Interfaces/Modal.js";
import ModalHandler from "../handlers/modalHandler.js";
import { PasteClient } from "pastebin-api";
import secrets from "../json/secrets.json" assert { type: "json" };
import sendLog from "../functions/sendLog.js";
class Client<T extends boolean> extends BaseClient<T> {
public readonly commands: Collection<string, Command>;
public readonly modals: Collection<string, Modal>;
public pastebin: PasteClient;
constructor() {
super({
intents: [GatewayIntentBits.Guilds],
allowedMentions: { parse: ["users"] },
});

this.commands = new Collection<string, Command>();
this.modals = new Collection<string, Modal>();
this.pastebin = new PasteClient(this.config.pastebin);
}
config = secrets as unknown as ClientConfig;
async init() {
await sendLog(`[SYSTEM] Handlers have been initiated.`);
const client = await new Client().init();
await CommandHandler(this);
await EventHandler(this);
await ModalHandler(this);
return await this.login(this.config.token);
}
}
export default Client;
import { Client as BaseClient, Collection, GatewayIntentBits } from "discord.js";
import Command from "../Interfaces/Command.js";
import ClientConfig from "../Interfaces/ClientConfig.js";
import CommandHandler from "../handlers/commandHandler.js";
import EventHandler from "../handlers/eventHandler.js";
import Modal from "../Interfaces/Modal.js";
import ModalHandler from "../handlers/modalHandler.js";
import { PasteClient } from "pastebin-api";
import secrets from "../json/secrets.json" assert { type: "json" };
import sendLog from "../functions/sendLog.js";
class Client<T extends boolean> extends BaseClient<T> {
public readonly commands: Collection<string, Command>;
public readonly modals: Collection<string, Modal>;
public pastebin: PasteClient;
constructor() {
super({
intents: [GatewayIntentBits.Guilds],
allowedMentions: { parse: ["users"] },
});

this.commands = new Collection<string, Command>();
this.modals = new Collection<string, Modal>();
this.pastebin = new PasteClient(this.config.pastebin);
}
config = secrets as unknown as ClientConfig;
async init() {
await sendLog(`[SYSTEM] Handlers have been initiated.`);
const client = await new Client().init();
await CommandHandler(this);
await EventHandler(this);
await ModalHandler(this);
return await this.login(this.config.token);
}
}
export default Client;
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
In handlers
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
This is the error
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
Argument of type 'this' is not assignable to parameter of type 'Client'.ts(2345)
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<boolean>'?ts(1064)
40 replies
DIAdiscord.js - Imagine an app
Created by Ahmad A. on 12/3/2023 in #djs-questions
super.user error after updating packages
this is Client<true>?
40 replies