11import events from 'events'
2- import { PAYOK } from 'payok'
3- import { nanoid } from 'nanoid'
42import dotenv from 'dotenv'
53import { keyboardChatGPT } from './chat_gpt.js'
64import { COMMAND_GPT } from '../../constants/index.js'
75import { db } from '../../db/index.js'
86import { ct } from '../../utils/createTranslate.js'
97import { keyboardMyAccount } from './my_account.js'
8+ import { createStartKeyboardForReplyMarkup } from '../../utils/createStartKeyboard.js'
109
1110dotenv . config ( { path : '../.env' } )
1211
@@ -25,8 +24,8 @@ export const keyboardDalle = async (bot, msg) => {
2524 ...options ,
2625 reply_markup : {
2726 inline_keyboard : [
28- [ { text : '🏞 Купить подписку' , callback_data : `buy_subscription_M_${ chatId } ` } ] ,
29- [ { text : 'Выйти' , callback_data : `${ COMMAND_GPT } _M_${ chatId } ` } ]
27+ [ { text : t ( 'keyboard_buy_subscription' ) , callback_data : `buy_subscription_M_${ chatId } ` } ] ,
28+ [ { text : t ( 'exit_key' ) , callback_data : `${ COMMAND_GPT } _M_${ chatId } ` } ]
3029 ]
3130 }
3231 }
@@ -65,7 +64,8 @@ export const keyboardDalle = async (bot, msg) => {
6564 const msgId = msg . message_id
6665 const options = {
6766 parse_mode : 'HTML' ,
68- reply_to_message_id : msgId
67+ reply_to_message_id : msgId ,
68+ reply_markup : await createStartKeyboardForReplyMarkup ( msg )
6969 }
7070 try {
7171 db . subscriber . findOne ( {
@@ -74,20 +74,20 @@ export const keyboardDalle = async (bot, msg) => {
7474 user_id : msg . from . id
7575 }
7676 } ) . then ( res => {
77- if ( res ?. dataValues . mode ?. match ( / \D A L L - E / ) )
77+ if ( res ?. dataValues . mode ?. match ( / \D A L L E / ) )
7878 return sendDalle ( bot , chatId , options )
7979 else if ( res ?. dataValues . mode ) {
8080 db . subscriber . update (
8181 {
82- mode : 'DALL-E ' ,
82+ mode : 'DALLE ' ,
8383 first_name : msg . from . first_name ,
8484 last_name : msg . from . last_name ,
8585 username : msg . from . username ,
8686 language_code : msg . from . language_code
8787 } ,
8888 { where : { chat_id : chatId } }
8989 ) . then ( res => {
90- bot . select_mode = 'DALL-E '
90+ bot . select_mode = 'DALLE '
9191 return sendDalle ( bot , chatId , options )
9292 } )
9393 } else {
@@ -98,9 +98,9 @@ export const keyboardDalle = async (bot, msg) => {
9898 last_name : msg . from . last_name ,
9999 username : msg . from . username ,
100100 language_code : msg . from . language_code ,
101- mode : 'DALL-E '
101+ mode : 'DALLE '
102102 } ) . then ( res => {
103- bot . select_mode = 'DALL-E '
103+ bot . select_mode = 'DALLE '
104104 return sendDalle ( bot , chatId , options )
105105 } )
106106 }
0 commit comments