Skip to content

Commit 5adbdc2

Browse files
committed
bot/modules/nostr: change require to import
For CommunityEvents. And move import to the top.
1 parent 7e0587c commit 5adbdc2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: bot/modules/nostr/index.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
require('websocket-polyfill'); // is it needed?
1+
require('websocket-polyfill');
22
import { logger } from '../../../logger';
33
import * as Config from './config';
44
import { createOrderEvent } from './events';
55
import * as Commands from './commands';
66
import { Telegraf } from 'telegraf';
77
import { MainContext } from '../../start';
88
import { IOrder } from '../../../models/order';
9+
import CommunityEvents from '../events/community';
910

1011
export const configure = (bot: Telegraf<MainContext>) => {
1112
bot.command('/nostr', Commands.info);
@@ -16,9 +17,6 @@ export const configure = (bot: Telegraf<MainContext>) => {
1617
);
1718
}
1819

19-
// I don't know why these requires are here and not at the top of the file,
20-
// so I leave them as they are instead of converting to imports.
21-
const CommunityEvents = require('../events/community');
2220
CommunityEvents.onCommunityUpdated(async (community: any) => {
2321
// todo: notify users
2422
});

0 commit comments

Comments
 (0)