File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ import open from 'open'
2+
13import { handleAdsEnable , handleAdsDisable } from './ads'
24import { handleHelpCommand } from './help'
35import { handleImageCommand } from './image'
@@ -6,6 +8,7 @@ import { handleReferralCode } from './referral'
68import { runBashCommand } from './router'
79import { normalizeReferralCode } from './router-utils'
810import { handleUsageCommand } from './usage'
11+ import { WEBSITE_URL } from '../login/constants'
912import { useChatStore } from '../state/chat-store'
1013import { useFeedbackStore } from '../state/feedback-store'
1114import { useLoginStore } from '../state/login-store'
@@ -375,6 +378,14 @@ export const COMMAND_REGISTRY: CommandDefinition[] = [
375378 clearInput ( params )
376379 } ,
377380 } ) ,
381+ defineCommand ( {
382+ name : 'buy-credits' ,
383+ handler : ( params ) => {
384+ open ( WEBSITE_URL + '/profile?tab=usage' )
385+ // Don't save to history.
386+ clearInput ( params )
387+ } ,
388+ } ) ,
378389 defineCommandWithArgs ( {
379390 name : 'image' ,
380391 aliases : [ 'img' , 'attach' ] ,
Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ export const SLASH_COMMANDS: SlashCommand[] = [
6969 description : 'View credits and subscription quota' ,
7070 aliases : [ 'credits' ] ,
7171 } ,
72+ {
73+ id : 'buy-credits' ,
74+ label : 'buy-credits' ,
75+ description : 'Open the usage page to buy credits' ,
76+ } ,
7277 {
7378 id : 'new' ,
7479 label : 'new' ,
You can’t perform that action at this time.
0 commit comments