diff --git a/src/core/structures/context.ts b/src/core/structures/context.ts index 5333693..0fdc7f2 100644 --- a/src/core/structures/context.ts +++ b/src/core/structures/context.ts @@ -37,6 +37,11 @@ export class Context extends CoreContext { public get channel() { return this.ctx.val.channel; } + + public get channelId(): Snowflake { + return safeUnwrap(this.ctx.map(m => m.channelId).mapErr(i => i.channelId)); + } + /** * If context is holding a message, message.author * else, interaction.user @@ -45,6 +50,10 @@ export class Context extends CoreContext { return safeUnwrap(this.ctx.map(m => m.author).mapErr(i => i.user)); } + public get userId(): Snowflake { + return this.user.id; + } + public get createdTimestamp(): number { return this.ctx.val.createdTimestamp; }