Skip to content

Commit

Permalink
Merge pull request 1inch#155 from 1inch/update-help
Browse files Browse the repository at this point in the history
Update help and 1inch info
  • Loading branch information
krboktv authored Jul 2, 2021
2 parents 021434f + 89a56c2 commit 19b51b9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
25 changes: 25 additions & 0 deletions src/commands/1inch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Telegraf, Context } from 'telegraf'
import { strings } from '@helpers/strings'
import { checkLock } from '@middlewares/checkLock'
import { clarifyIfPrivateMessages } from '@helpers/clarifyIfPrivateMessages'

export function setup1inchInfo(bot: Telegraf<Context>) {
bot.command(['1inch'], checkLock, sendInfo)
}

export function sendInfo(ctx: Context) {
if (ctx.update.message?.date) {
console.log(
'Replying to 1inch',
Date.now() / 1000 - ctx.update.message?.date
)
}

const aboutOneInch = strings(ctx.dbchat, 'oneInchInfo');
const link =
'[1inch Network](http://1inch.io/?utm_source=shieldy_en&utm_medium=cpc&utm_campaign=powered) ([IOS](https://apps.apple.com/app/apple-store/id1546049391?pt=122481420&ct=shieldy_ru&mt=8))';

return ctx.replyWithMarkdown(`${aboutOneInch}\n\n${link}`, {
disable_web_page_preview: false,
})
}
Loading

0 comments on commit 19b51b9

Please sign in to comment.