Skip to content

Commit

Permalink
format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed May 2, 2024
1 parent ed054a7 commit c8803f9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
17 changes: 9 additions & 8 deletions src/commands/info/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ export default {
try {
const platform = await platformService.getPlatformByFilter({ 'metadata.id': interaction.guildId });
const hivemindDiscordPlatform = await moduleService.getModuleByFilter({
"options.platforms": {
'options.platforms': {
$elemMatch: {
name: "discord",
platform: platform?.id
}
}
})
console.log(platform, hivemindDiscordPlatform)
name: 'discord',
platform: platform?.id,
},
},
});
console.log(platform, hivemindDiscordPlatform);
if (!hivemindDiscordPlatform) {
return await interactionService.createInteractionResponse(interaction, {
type: 4,
data: {
content: 'The **/question** command uses TogetherCrew Hivemind AI to help answer questions about your community.\nTo enable this feature, ask your community manager to configure the Hivemind module on [togethercrew app](https://app.togethercrew.com).\n**Note**: once configured, it can take up to 24 hours for Hivemind to start working.',
content:
'The **/question** command uses TogetherCrew Hivemind AI to help answer questions about your community.\nTo enable this feature, ask your community manager to configure the Hivemind module on [togethercrew app](https://app.togethercrew.com).\n**Note**: once configured, it can take up to 24 hours for Hivemind to start working.',
flags: 64,
},
});
Expand Down
12 changes: 11 additions & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ import interactionService from './interaction.service';
import guildService from './guild.service';
import platformService from './platform.service';
import moduleService from './module.service';
export { channelService, userService, coreService, eventService, commandService, interactionService, guildService, platformService, moduleService };
export {
channelService,
userService,
coreService,
eventService,
commandService,
interactionService,
guildService,
platformService,
moduleService,
};
6 changes: 2 additions & 4 deletions src/services/module.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import { Module, type IModule } from '@togethercrew.dev/db';
* @returns {Promise<HydratedDocument<IModule> | null>}
*/
const getModuleByFilter = async (filter: object): Promise<HydratedDocument<IModule> | null> => {
return Module.findOne(filter);
return Module.findOne(filter);
};



export default {
getModuleByFilter,
getModuleByFilter,
};
4 changes: 2 additions & 2 deletions src/services/platform.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { Platform, type IPlatform } from '@togethercrew.dev/db';
* @returns {Promise<HydratedDocument<IPlatform> | null>}
*/
const getPlatformByFilter = async (filter: object): Promise<HydratedDocument<IPlatform> | null> => {
return await Platform.findOne(filter);
return await Platform.findOne(filter);
};

export default {
getPlatformByFilter,
getPlatformByFilter,
};

0 comments on commit c8803f9

Please sign in to comment.