ethan<333
ethan<333
DIAdiscord.js - Imagine a boo! 👻
Created by ethan<333 on 9/27/2024 in #djs-questions
guildAuditLogEntryCreate
client.on("guildAuditLogEntryCreate", async (log, guild) => {
if(log.action === AuditLogEvent.ChannelCreate) {
console.log(log.target?.id); // error
}
});
client.on("guildAuditLogEntryCreate", async (log, guild) => {
if(log.action === AuditLogEvent.ChannelCreate) {
console.log(log.target?.id); // error
}
});
Property 'id' does not exist on type 'Guild | AnyThreadChannel | Role | User | NonThreadGuildBasedChannel | GuildEmoji | Invite | ... 10 more ... | GuildOnboardingPrompt'.
Property 'id' does not exist on type 'Invite'.
Property 'id' does not exist on type 'Guild | AnyThreadChannel | Role | User | NonThreadGuildBasedChannel | GuildEmoji | Invite | ... 10 more ... | GuildOnboardingPrompt'.
Property 'id' does not exist on type 'Invite'.
9 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ethan<333 on 4/9/2024 in #djs-questions
TS Error
export interface Command {
name?: string; // Command names are taken from file names
description: string;
type: ApplicationCommandType;
defaultPermissions?: PermissionResolvable;
options?: ApplicationCommandOptionData[];
run: (interaction: ECICInteraction) => void;
autocomplete?: (interaction: AutocompleteInteraction) => void;
}

public appCommands: Command[] = [];

public refreshCommands(): Promise<Collection<string, ApplicationCommand<{
guild: GuildResolvable;
}>>> {
return this.application.commands.set(this.appCommands.map(cmdObj => {
const command: ApplicationCommandDataResolvable = {
name: cmdObj.name as string,
type: cmdObj.type, // Type 'ApplicationCommandType' is not assignable to type 'ApplicationCommandType.ChatInput'.
defaultMemberPermissions: cmdObj.defaultPermissions || null,
dmPermission: false
};

if(cmdObj.type === ApplicationCommandType.ChatInput) {
command.description = cmdObj.description; // Property 'description' does not exist on type 'UserApplicationCommandData'.
command.options = cmdObj.options; // Property 'options' does not exist on type 'UserApplicationCommandData'.
}

return command;
}));
}
export interface Command {
name?: string; // Command names are taken from file names
description: string;
type: ApplicationCommandType;
defaultPermissions?: PermissionResolvable;
options?: ApplicationCommandOptionData[];
run: (interaction: ECICInteraction) => void;
autocomplete?: (interaction: AutocompleteInteraction) => void;
}

public appCommands: Command[] = [];

public refreshCommands(): Promise<Collection<string, ApplicationCommand<{
guild: GuildResolvable;
}>>> {
return this.application.commands.set(this.appCommands.map(cmdObj => {
const command: ApplicationCommandDataResolvable = {
name: cmdObj.name as string,
type: cmdObj.type, // Type 'ApplicationCommandType' is not assignable to type 'ApplicationCommandType.ChatInput'.
defaultMemberPermissions: cmdObj.defaultPermissions || null,
dmPermission: false
};

if(cmdObj.type === ApplicationCommandType.ChatInput) {
command.description = cmdObj.description; // Property 'description' does not exist on type 'UserApplicationCommandData'.
command.options = cmdObj.options; // Property 'options' does not exist on type 'UserApplicationCommandData'.
}

return command;
}));
}
17 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ethan<333 on 3/31/2024 in #djs-questions
My bot won't start
No description
37 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ethan<333 on 10/31/2022 in #djs-voice
not playing audio
const { joinVoiceChannel, createAudioResource, createAudioPlayer } = require("@discordjs/voice");

const connection = joinVoiceChannel({
channelId: state.channel.id,
guildId: state.guild.id,
adapterCreator: state.guild.voiceAdapterCreator
});

const player = createAudioPlayer();
connection.subscribe(player);

const resource = createAudioResource("../../effect.mp3");
player.play(resource);
const { joinVoiceChannel, createAudioResource, createAudioPlayer } = require("@discordjs/voice");

const connection = joinVoiceChannel({
channelId: state.channel.id,
guildId: state.guild.id,
adapterCreator: state.guild.voiceAdapterCreator
});

const player = createAudioPlayer();
connection.subscribe(player);

const resource = createAudioResource("../../effect.mp3");
player.play(resource);
why does this not play anything?
7 replies