-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bot/modules/user: convert to TS (#631)
Convert bot/modules/user to TypeScript.
- Loading branch information
1 parent
3e4ac23
commit e8c973c
Showing
5 changed files
with
60 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
// @ts-check | ||
const { userMiddleware } = require('../../middleware/user'); | ||
|
||
const Scenes = (exports.Scenes = require('./scenes')); | ||
import { Telegraf } from 'telegraf'; | ||
import Scenes from './scenes'; | ||
import { CommunityContext } from '../community/communityContext'; | ||
|
||
exports.configure = bot => { | ||
export const configure = (bot: Telegraf<CommunityContext>) => { | ||
bot.command('/settings', userMiddleware, async ctx => { | ||
try { | ||
const { user } = ctx; | ||
await ctx.scene.enter(Scenes.Settings.id, { user }); | ||
} catch (err) { | ||
} catch (err: any) { | ||
ctx.reply(err.message); | ||
} | ||
}); | ||
}; | ||
|
||
export { | ||
Scenes | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Settings from './settings'; | ||
|
||
export default { Settings } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters