Skip to content

Commit

Permalink
you're welcome
Browse files Browse the repository at this point in the history
  • Loading branch information
endurance committed Dec 22, 2023
1 parent 48d8588 commit 53de90e
Show file tree
Hide file tree
Showing 26 changed files with 46 additions and 51 deletions.
22 changes: 0 additions & 22 deletions src/app.controller.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/app.module.ts

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Logger, Module } from '@nestjs/common';
import { DiscordPingService } from './services/discordPing.service';
import { NecordModule } from 'necord';
import { DiscordChatService } from './services/discordChat.service';
import { GcpModule } from '../../gcp/gcp.module';
import { GcpModule } from '../../../shared/gcp/gcp.module';
import { NecordConfigService } from './services/necordConfig.service';
import { DiscordReadyLoggingService } from './services/discordReadyLogging.service';
import { LangchainModule } from '../../ai/langchain/langchain/langchain.module';
import { LangchainModule } from '../../../shared/ai/langchain/langchain/langchain.module';

@Module({
imports: [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Injectable, Logger } from '@nestjs/common';
import { Context, Options, SlashCommand, SlashCommandContext } from 'necord';
import { DEV_GUILDS } from '../../../constants';
import { DEV_GUILDS } from '../../../../shared/config/constants';
import { OpenAI } from 'langchain/llms/openai';
import { ChatPromptTemplate } from 'langchain/prompts';
import { TextDto } from '../dto/textDto';
import { LlmModelService } from '../../../ai/langchain/langchain/llm-model/llm-model.controller';
import { LlmModelService } from '../../../../shared/ai/langchain/langchain/llm-model/llm-model.controller';

@Injectable()
export class DiscordChatService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { Context, SlashCommand, SlashCommandContext } from 'necord';
import { DEV_GUILDS } from '../../../constants';
import { DEV_GUILDS } from '../../../../shared/config/constants';

@Injectable()
export class DiscordPingService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { NecordModuleOptions } from 'necord';
import { IntentsBitField } from 'discord.js';
import { SecretsManagerService } from '../../../gcp/secretsManager.service';
import { SecretsManagerService } from '../../../../shared/gcp/secretsManager.service';
import { DISCORD_API_DEV_TOKEN, DISCORD_API_TOKEN } from '../secrets/secrets';

@Injectable()
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common';
import { GcpModule } from '../../gcp/gcp.module';
import { GcpModule } from '../../../shared/gcp/gcp.module';
import { SlackTestService } from './slackTest.service';
import { createSlackModule } from './createSlackModule';

Expand Down
File renamed without changes.
10 changes: 3 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SlackTestService } from './frontends/slack/slackTest.service';
import { MainModule } from './main/main.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const sts = await app.resolve(SlackTestService);
sts.helloWorldMethod();

const app = await NestFactory.create(MainModule);
await app.listen(process.env.PORT || 3000);
}

bootstrap();
void bootstrap();
21 changes: 21 additions & 0 deletions src/main/main.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Test, TestingModule } from '@nestjs/testing';
import { MainController } from './main.controller';

describe('AppController', () => {
let appController: MainController;

beforeEach(async () => {
const app: TestingModule = await Test.createTestingModule({
controllers: [MainController],
providers: [],
}).compile();

appController = app.get<MainController>(MainController);
});

describe('root', () => {
it('should return "Hello World!"', () => {
expect(appController.sendHello()).toBe('Hello World!');
});
});
});
4 changes: 2 additions & 2 deletions src/app.controller.ts → src/main/main.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Controller, Get } from '@nestjs/common';

@Controller()
export class AppController {
export class MainController {
@Get()
getHello() {
sendHello() {
return 'hello';
}

Expand Down
10 changes: 10 additions & 0 deletions src/main/main.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Module } from '@nestjs/common';
import { MyDiscordModule } from '../interfaces/chat/discord/myDiscord.module';
import { MySlackModule } from '../interfaces/chat/slack/mySlack.module';
import { MainController } from './main.controller';

@Module({
imports: [MyDiscordModule, MySlackModule],
controllers: [MainController],
})
export class MainModule {}
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';
import { MainModule } from '../src/main/main.module';

describe('AppController (e2e)', () => {
describe('MainController (e2e)', () => {
let app: INestApplication;

beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
imports: [MainModule],
}).compile();

app = moduleFixture.createNestApplication();
Expand Down

1 comment on commit 53de90e

@jonmatthis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️❤️❤️

Please sign in to comment.