mirror of
https://github.com/jaronpate/unicord.git
synced 2026-10-18 21:47:40 +00:00
Added channel api shape and class
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user