Added channel api shape and class

This commit is contained in:
2025-02-15 11:05:59 -06:00
parent 8333ab2d44
commit fb81a55035
10 changed files with 170 additions and 21 deletions
+6 -6
View File
@@ -7,7 +7,9 @@ const client = new Client({
Intent.GUILDS,
Intent.GUILD_MESSAGES,
Intent.GUILD_MESSAGE_REACTIONS,
Intent.MESSAGE_CONTENT
Intent.MESSAGE_CONTENT,
Intent.DIRECT_MESSAGES,
Intent.DIRECT_MESSAGE_REACTIONS
],
prefix: '!!'
});
@@ -78,8 +80,8 @@ client.chatCommands.register('me', async (context: Context, _args: any[]) => {
// Note: Testing repeated hydration
const { message } = await context.hydrate(context, [Expectation.Message])
const hydrated = await context.hydrate(message, [Expectation.Channel])
const rehydrated = await context.hydrate(hydrated, [Expectation.Guild]);
rehydrated.guild.name
// const rehydrated = await context.hydrate(hydrated, [Expectation.Guild]);
// rehydrated.guild.name
const hydrate = await context.hydrator(hydrated, [Expectation.Guild]);
const hasGuild = hydrate(hydrated);
@@ -89,10 +91,8 @@ client.chatCommands.register('me', async (context: Context, _args: any[]) => {
await context.reply(`You are ${message.author.username} and this is ${hydrated.guild.name}`, true);
} else {
// Send a message stating the user that they are not in a guild
await context.reply(`You are ${message.author.username} and we are not in a server`, true);
await context.reply(`You are ${message.author.username} and we are in ${hydrated.channel.type === 1 ? 'our DM\'s <3' : 'a Group DM 👀'}`, true);
}
// await context.reply(`You are ${message.author.username} ${hasGuild ? message.guild.name : ''}`, true);
});
// Hydrator - hydration function generator