Skip to content

Commit

Permalink
docs(example): use ContextFlavor in grammy example
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Dec 4, 2021
1 parent d58f464 commit ea77ae2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions examples/example-grammy-bot.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import * as path from 'path';
import * as process from 'process';

import {Bot, Context as BaseContext, session} from 'grammy';
import {Bot, Context as BaseContext, session, SessionFlavor} from 'grammy';

import {I18n, pluralize, I18nContext} from '../source';
import {I18n, pluralize, I18nContextFlavor} from '../source';

interface Session {
apples: number;
}

interface MyContext extends BaseContext {
readonly i18n: I18nContext;
session: Session;
}
type MyContext = BaseContext & I18nContextFlavor & SessionFlavor<Session>;

// I18n options
const i18n = new I18n({
Expand Down

0 comments on commit ea77ae2

Please sign in to comment.