feat: bootstrap from Fabric monorepo

This commit is contained in:
nav
2026-05-13 07:06:03 +00:00
commit d9c5175233
46 changed files with 7808 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Channel } from '../entities/channel.entity';
@Injectable()
export class ChannelsService {
constructor(
@InjectRepository(Channel)
private readonly channelRepo: Repository<Channel>,
) {}
listByGuild(guildId: string) {
return this.channelRepo.find({
where: { guildId },
order: { createdAt: 'ASC' },
take: 200,
});
}
create(input: Partial<Channel>) {
const channel = this.channelRepo.create({
guildId: String(input.guildId ?? ''),
name: String(input.name ?? ''),
kind: input.kind === 'announcement' ? 'announcement' : 'text',
isPrivate: Boolean(input.isPrivate),
lastSeq: 0,
});
return this.channelRepo.save(channel);
}
}