Skip to content

Commit

Permalink
Update currencies per community number (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch authored Oct 20, 2023
1 parent bfb3f55 commit c17e53f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bot/modules/community/scenes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const {
wizardCommunityWrongPermission,
} = require('./messages');

const CURRENCIES = 20;

exports.communityAdmin = require('./scenes.communityAdmin')();

exports.communityWizard = new Scenes.WizardScene(
Expand Down Expand Up @@ -158,7 +160,7 @@ const createCommunitySteps = {
ctx.wizard.state.error = null;
let currencies = itemsFromMessage(text);
currencies = currencies.map(currency => currency.toUpperCase());
const max = 10;
const max = CURRENCIES;
if (currencies.length > max) {
await ctx.telegram.deleteMessage(
ctx.message.chat.id,
Expand Down Expand Up @@ -554,7 +556,7 @@ exports.updateCurrenciesCommunityWizard = new Scenes.WizardScene(

let currencies = itemsFromMessage(ctx.message.text);
currencies = currencies.map(currency => currency.toUpperCase());
if (currencies.length > 10)
if (currencies.length > CURRENCIES)
return await ctx.reply(ctx.i18n.t('wizard_community_enter_currency'));

const { community } = ctx.wizard.state;
Expand Down

0 comments on commit c17e53f

Please sign in to comment.