Aaron
Aaron
Explore posts from servers
DIAdiscord.js - Imagine a boo! 👻
Created by Aaron on 1/29/2024 in #djs-voice
Permission Overwrites on Voice Channels
oh and the Connect perm also has a green check mark
6 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/29/2024 in #sapphire-support
Encountering Error `TypeError: emitter.getMaxListeners is not a function`
so ima just put that off as a ts-node bug
16 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/29/2024 in #sapphire-support
Encountering Error `TypeError: emitter.getMaxListeners is not a function`
Gotcha, I mean I changed where the pieces are loaded to src and it works for now
16 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/29/2024 in #sapphire-support
Encountering Error `TypeError: emitter.getMaxListeners is not a function`
and not the ts versions
16 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/29/2024 in #sapphire-support
Encountering Error `TypeError: emitter.getMaxListeners is not a function`
the error seems to occur when I am using the compiled pieces
16 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/29/2024 in #sapphire-support
Encountering Error `TypeError: emitter.getMaxListeners is not a function`
no
16 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/29/2024 in #sapphire-support
Encountering Error `TypeError: emitter.getMaxListeners is not a function`
import { Listener } from '@sapphire/framework';
import { ApplyOptions } from '@sapphire/decorators';
import { ChannelType, OverwriteType, Snowflake, VoiceState } from 'discord.js';

@ApplyOptions<Listener.Options>({
name: 'voiceStateUpdate',
})
export class VoiceStateUpdate extends Listener {
channels: Set<Snowflake> = new Set<Snowflake>();
async run(old_state: VoiceState, new_state: VoiceState) {
const channel_id = '1201376611786817566';
const category_id = '1201376440332079124';

if (new_state.channelId === channel_id) {
try {
const new_channel = await old_state.guild.channels.create({
name: `${old_state.member?.user.username} | private`,
type: ChannelType.GuildVoice,
parent: category_id,
permissionOverwrites: [
{
allow: ['ManageChannels', 'ManageRoles', 'Connect'],
type: OverwriteType.Member,
id: old_state.member?.id!,
},
{
allow: ['Connect'],
deny: ['ManageChannels', 'ManageRoles'],
type: OverwriteType.Member,
id: old_state.guild.id,
},
],
});

await old_state.setChannel(
new_channel,
'voice channel was created by them',
);

this.channels.add(new_channel.id);
} catch (err) {
this.container.logger.error(err);
}
}

if (
old_state.channel &&
this.channels.has(old_state.channelId!) &&
old_state.channel?.members.size! <= 0
) {
await old_state.channel!.delete('Everyone left the voice channel');
}

return;
}
}
import { Listener } from '@sapphire/framework';
import { ApplyOptions } from '@sapphire/decorators';
import { ChannelType, OverwriteType, Snowflake, VoiceState } from 'discord.js';

@ApplyOptions<Listener.Options>({
name: 'voiceStateUpdate',
})
export class VoiceStateUpdate extends Listener {
channels: Set<Snowflake> = new Set<Snowflake>();
async run(old_state: VoiceState, new_state: VoiceState) {
const channel_id = '1201376611786817566';
const category_id = '1201376440332079124';

if (new_state.channelId === channel_id) {
try {
const new_channel = await old_state.guild.channels.create({
name: `${old_state.member?.user.username} | private`,
type: ChannelType.GuildVoice,
parent: category_id,
permissionOverwrites: [
{
allow: ['ManageChannels', 'ManageRoles', 'Connect'],
type: OverwriteType.Member,
id: old_state.member?.id!,
},
{
allow: ['Connect'],
deny: ['ManageChannels', 'ManageRoles'],
type: OverwriteType.Member,
id: old_state.guild.id,
},
],
});

await old_state.setChannel(
new_channel,
'voice channel was created by them',
);

this.channels.add(new_channel.id);
} catch (err) {
this.container.logger.error(err);
}
}

if (
old_state.channel &&
this.channels.has(old_state.channelId!) &&
old_state.channel?.members.size! <= 0
) {
await old_state.channel!.delete('Everyone left the voice channel');
}

return;
}
}
16 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
I seem to be understanding more of how sapphire works
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
Well thanks for all the help guys!
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
so it'd work similar I just have to import that function and use the function name
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
gotcha
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
Okay, but how do I load those as sub commands ?
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
What is the point of the lib folder? I looked at some of those other projects and they don't seem to do much with it if they use it at all
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
Also as for the other question I had, do i really have to code my subcommands all in one file?
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
Yea, I haven't used typescript in a while, I just have never made a bot in rust panicc
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
they are a dead project now. but it was actually a refreshing library rather than djs
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
lol
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
Haven't made a discord bot in 2.5 years KEKW
67 replies
SIASapphire - Imagine a framework
Created by Aaron on 1/24/2024 in #sapphire-support
How do you register paths for pieces? Also have an additional question when this one is solved.
yea thats fair. Idk what I was thinking there.
67 replies