regorganizing and attempting to allow rehydration

This commit is contained in:
Jaron
2024-11-15 13:49:33 -06:00
parent 5b1fa15e66
commit f3b1546d54
17 changed files with 381 additions and 271 deletions
+19
View File
@@ -20,6 +20,25 @@ client.chatCommands.register('ping', async (context: Context, args: any[]) => {
await context.editMessage(message, `Pong! Latency: ${time}ms`);
});
client.chatCommands.register('me', async (context: Context, _args: any[]) => {
// Note: Testing repeated hydration
const message = await context.hydrate(context.message, [Expectation.Channel])
const rehydrated = await context.hydrate(message, [Expectation.Guild]);
rehydrated.guild.name
const hydrate = await context.hydrator(message, [Expectation.Guild]);
const hasGuild = hydrate(message);
if (hasGuild) {
message.guild.name
} else {
message
}
// await context.reply(`You are ${message.author.username} ${hasGuild ? message.guild.name : ''}`, true);
});
client.chatCommands.register('here', async (context: Context, _args: any[]) => {
const guild = (await context.hydrator(context, [Expectation.Guild]))(context);