Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more changes #72

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const onMessage = async (ctx: OnMessageContext) => {
if (ctx.session.openAi.imageGen.isEnabled) {
const price = openAiBot.getEstimatedPrice(ctx);
if (price > 0) {
await ctx.reply(`Processing withdraw for ${price.toFixed(2)}¢...`);
//await ctx.reply(`Processing withdraw for ${price.toFixed(2)}¢...`);
}
const isPaid = await payments.pay(ctx, price);
if (isPaid) {
Expand All @@ -129,7 +129,7 @@ const onMessage = async (ctx: OnMessageContext) => {
if (conversationHandler.isValidCommand(ctx)) {
const price = conversationHandler.getEstimatedPrice(ctx);
if (price > 0) {
await ctx.reply(`Processing withdraw for ${price.toFixed(2)}¢...`);
//await ctx.reply(`Processing withdraw for ${price.toFixed(2)}¢...`);
}
const isPaid = await payments.pay(ctx, price);
if (isPaid) {
Expand Down
13 changes: 4 additions & 9 deletions src/modules/conversation-handler/conversationGpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function conversationGpt(
) {
try {
await ctx.reply(
`_Usign model ${conversation.session.openAi.chatGpt.model}_.\n${appText.gptHelpText}\n`,
`${appText.gptHelpText}\n`,
{
parse_mode: "Markdown",
}
Expand Down Expand Up @@ -92,20 +92,15 @@ export async function conversationGpt(
// maxMilliseconds: 300000 // 5min
// });
const userPrompt = userInput?.msg?.text;
if (
userPrompt.toLocaleLowerCase().includes("end") ||
userPrompt.toLocaleLowerCase().includes("/end")
) {
if (userPrompt === "/end")
{
conversation.session.openAi.chatGpt.chatConversation = [];
await ctx.reply(
`${appText.gptChatEnd} ${usage} (${totalPrice.toFixed(2)}¢)`
);
break;
}
if (
userPrompt.toLocaleLowerCase().includes("help") ||
userPrompt.toLocaleLowerCase().includes("/help")
) {
if (userPrompt === "/help") {
await ctx.reply(`${appText.gptHelpText}`, {
parse_mode: "Markdown",
});
Expand Down
2 changes: 1 addition & 1 deletion src/modules/open-ai/utils/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Adjust image size or how many images are generated`,
chatGptChangeModel: `*🖌️ ChatGPT Help*\nChoose one of the following models`,
generatingText: `Generating response...`,
introText: `You can write your question/prompt for ChatGPT`,
gptHelpText: `Write *end* to finish this conversation.\nWrite *help* to repeat this message.`,
gptHelpText: `Use /end to end the conversation.\n`,
gptChatEnd: "Chat finished. Total tokens used:",
endChat: "Thanks for using 1.country services",
gptChatPaymentIssue: `Once the withdrawal instructions are completed, you can return to the current conversation by writing the */chat* command.\n
Expand Down