Skip to content

Commit

Permalink
Fixes issues caused wrong relative paths (#620)
Browse files Browse the repository at this point in the history
* fix: adds order attribute to the ICommunity interface

* chore: moves generated files to the 'dist' directory, and adds it to the .gitignore file

* refactor: removes 'orders' field from the ICommunity interface

The 'orders' field is not part of the Mongoose document, but rather it's something that's calculated on-the-fly
as part of the response to the `/findcomms` command for each community. Converting the mongoose document to a
plain object gets rid of the TSC errors without having to introduce an 'orders' field to the ICommunity interface.

This solution is preferred as the ICommunity interface should ideally mirror what's stored in the database.

* fix: adjusts relative paths that were causing issues with /setlang and /version commands
  • Loading branch information
bilthon authored Dec 27, 2024
1 parent 4b278ce commit e1563fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/modules/language/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { showFlagsMessage } = require('./messages');
exports.setlang = async ctx => {
try {
const flags = [];
fs.readdirSync(path.join(__dirname, '../../../locales')).forEach(file => {
fs.readdirSync(path.join(__dirname, '../../../../locales')).forEach(file => {
const lang = file.split('.')[0];
const flag = getLanguageFlag(lang);
if (flag !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion bot/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const initialize = (botToken: string, options: Partial<Telegraf.Options<MainCont

bot.command('version', async (ctx: MainContext) => {
try {
const pckg = require('../package.json');
const pckg = require('../../package.json');
await ctx.reply(pckg.version);
} catch (err) {
logger.error(err);
Expand Down

0 comments on commit e1563fd

Please sign in to comment.