GithubHelp home page GithubHelp logo

sansekai / wa-openai Goto Github PK

View Code? Open in Web Editor NEW
444.0 14.0 475.0 67 KB

WhatsApp Bot OpenAI ChatGPT NodeJS Using Library Baileys

Home Page: https://saweria.co/Sansekai

License: MIT License

JavaScript 100.00%
whatsapp-bot baileys baileys-bot baileys-md javascript nodejs

wa-openai's Introduction

Wa-OpenAI

WhatsApp OpenAI ChatGPT Create with NodeJS Using Library Baileys

BACA DULU

Terdapat 2 fitur yaitu ChatGPT(text) dan DALL-E(Text To Image).
Untuk commandnya menggunakan /ai dan /img

Get & Change OpenAI ApiKey

  • Silakan buat apikeynya terlebih dahulu Disini
  • Ganti ApiKey OpenAI pada file key.json

Install

Install on RDP/Windows ✅

Install NodeJS dan Git Bash terlebih dahulu

$ git clone https://github.com/Sansekai/Wa-OpenAI
$ cd Wa-OpenAI
$ npm install
$ node index.js

Install on Termux ✅

Silakan install manual node_modules terlebih dahulu, karena di termux saat install otomatis melalui npm install terjadi error.
Link node_modules: Klik Disini

$ pkg install git nodejs -y
$ git clone https://github.com/Sansekai/Wa-OpenAI
$ cd Wa-OpenAI

Sesudah menginstall file node_modules, silahkan extract file node_modules.zip dan taruh di folder Wa-OpenAI.

Run

$ node index.js

Donate

Donate For Yusril

License

MIT License

Copyright (c) 2022 M Yusril

wa-openai's People

Contributors

amimhayden22 avatar dansja avatar fskhri avatar sansekai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wa-openai's Issues

No user message in reply and remove / from command

Goodnight. How do I remove the / from the command? Example: I want to do a restaurant service where the user enters:
menu
1
two
3
4
5
6
7

and when the bot responds as it does without tagging the user's original message?

#question Bagaimana cara update tanggal dan waktu?

Haloo, saya ingin menanyakan, bagaimana cara mengupdate tanggal dan waktu pada bot ini?

Karena saya coba bertanya dengan command "/ai jam berapa sekarang" dan "/ai tanggal berapa sekarang" menunjukan hasil seperti gambar dibawah dan tidak dapat terupdate(selalu menampilkan tanggal 28 April 2020 dan jam 11.30)

image

image

Jika ada cara untuk mengatasi ini, saya mohon untuk bantuannya :)

Namun jika memang tidak bisa, mohon konfirmasinya untuk berkenan membalas pertanyaan saya ini :)

Terimakasih

undefined:1, SyntaxError: Unexpected end of JSON input

kemaren jalan terus tiba tiba mati, nah pas gw jalanin lagi malah gini

coder@coder:~/project/Wa-OpenAI$ node index.js
undefined:1


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at useSingleFileAuthState (/home/coder/project/Wa-OpenAI/node_modules/@adiwajshing/baileys/lib/Utils/use-single-file-auth-state.js:36:29)
    at Object.<anonymous> (/home/coder/project/Wa-OpenAI/index.js:19:30)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
    at Module.load (node:internal/modules/cjs/loader:1043:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47

Notifikasi Missing

Bang klo botnya nyala Notif pesan sama Telpon di HP jadi gk ada deringnya..

Error when deploy to cloud azure (ubuntu)

/home/botit4601/Wa-OpenAI/index.js:224
let reason = new Boom(lastDisconnect?.error)?.output.statusCode
^

SyntaxError: Unexpected token .
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

heroku?

any way to deploy this on heroku?

error atau knp ini ngga tau :l

429
{
error: {
message: 'You exceeded your current quota, please check your plan and billing details.',
type: 'insufficient_quota',
param: null,
code: null
}
}
429

hmm :(

tutor

cara ganti api key gmn

Error Request

Maaf bang gw run di panel, kok gini mulu

Maaf, sepertinya ada yang error :Error: Request failed with status code 429

Unexpected token ' . ' [solved]

error code:

index.js:226
let reason = new Boom(lastDisconnect?.error)?.output.statusCode
^

SyntaxError: Unexpected token '.'

Error: Request failed with status code 401

ini kenapa ya bang?

  _closed: false,
  socket: [TLSSocket],
  _header: 'POST /v1/completions HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'Content-Type: application/json\r\n' +
    'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
    'Authorization: Bearer undefined\r\n' +
    'Content-Length: 146\r\n' +
    'Host: api.openai.com\r\n' +
    'Connection: close\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'POST',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  path: '/v1/completions',
  _ended: true,
  res: [IncomingMessage],
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'api.openai.com',
  protocol: 'https:',
  _redirectable: [Writable],
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kEndCalled)]: true,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(kUniqueHeaders)]: null
},
data: { error: [Object] }

},
isAxiosError: true,
toJSON: [Function: toJSON]

Can't run in azure vps

let reason = new Boom(lastDisconnect?.error)?.output.statusCode

SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)


cannot deploy it on a server like render or heroku

when i tried to upload the bot to a server it fails to deploy. Here is what i get:

Jan 22 10:18:16 PM Bot success conneted to server
Jan 22 10:18:16 PM Donate for creator https://saweria.co/sansekai
Jan 22 10:18:16 PM Type /menu to see menu
Jan 22 10:18:16 PM Closing open session in favor of incoming prekey bundle
Jan 22 10:18:16 PM Closing session: SessionEntry {
Jan 22 10:18:16 PM _chains: {
Jan 22 10:18:16 PM 'Be9l9Ldvl81rhxlNzv4JOUit/y9feOX2cIY3aVQuWGg4': { chainKey: [Object], chainType: 1, messageKeys: {} }
Jan 22 10:18:16 PM },
Jan 22 10:18:16 PM registrationId: 1981289101,
Jan 22 10:18:16 PM currentRatchet: {
Jan 22 10:18:16 PM ephemeralKeyPair: {
Jan 22 10:18:16 PM pubKey: <Buffer 05 ef 65 f4 b7 6f 97 cd 6b 87 19 4d ce fe 09 39 48 ad ff 2f 5f 78 e5 f6 70 86 37 69 54 2e 58 68 38>,
Jan 22 10:18:16 PM privKey: <Buffer f0 d4 13 47 c4 7e 6f cd 08 9c 04 eb 64 c7 bf 1b 8f 71 da 63 55 99 d0 82 dc 62 04 08 dc 69 4a 7d>
Jan 22 10:18:16 PM },
Jan 22 10:18:16 PM lastRemoteEphemeralKey: <Buffer 05 4f b0 b5 41 8d 26 5c 6f 45 c7 c3 25 bd ef fb 35 2f 1f 6c 77 ce d9 79 14 f5 74 dc f6 89 64 ce 41>,
Jan 22 10:18:16 PM previousCounter: 0,
Jan 22 10:18:16 PM rootKey: <Buffer 93 c2 c8 dc 1e 45 4e f3 78 c5 82 ab 0d ec f6 0d 82 fe 25 d3 5a 08 9e b3 ae 07 8b 50 d8 2d 0e e6>
Jan 22 10:18:16 PM },
Jan 22 10:18:16 PM indexInfo: {
Jan 22 10:18:16 PM baseKey: <Buffer 05 0f 1d b0 79 a0 35 b6 29 ca 88 ea 93 63 aa 51 6e 79 39 c9 46 31 ed b8 69 8c 89 a2 ca 8a c7 77 0a>,
Jan 22 10:18:16 PM baseKeyType: 1,
Jan 22 10:18:16 PM closed: -1,
Jan 22 10:18:16 PM used: 1674406096464,
Jan 22 10:18:16 PM created: 1674406096464,
Jan 22 10:18:16 PM remoteIdentityKey: <Buffer 05 8e aa f5 8f 47 b0 a0 35 f1 23 a5 71 03 af 9f 3d e9 3a 69 13 00 03 df 31 17 77 21 6c 40 15 19 17>
Jan 22 10:18:16 PM },
Jan 22 10:18:16 PM pendingPreKey: {
Jan 22 10:18:16 PM signedKeyId: 0,
Jan 22 10:18:16 PM baseKey: <Buffer 05 0f 1d b0 79 a0 35 b6 29 ca 88 ea 93 63 aa 51 6e 79 39 c9 46 31 ed b8 69 8c 89 a2 ca 8a c7 77 0a>,
Jan 22 10:18:16 PM preKeyId: 1136569
Jan 22 10:18:16 PM }
Jan 22 10:18:16 PM }
Jan 22 10:18:16 PM Decrypted message with closed session.
Jan 22 10:18:17 PM Decrypted message with closed session.
Jan 22 10:18:17 PM Decrypted message with closed session.
Jan 22 10:18:17 PM Decrypted message with closed session.
Jan 22 10:18:18 PM Decrypted message with closed session.
Jan 22 10:18:18 PM Decrypted message with closed session.

Custom Prompts

Hey, I'm unable to figure out how to use/add custom prompts (in sansekai.js)

Inquiring about Deploying

Hello Sansekai, I hope you are all right. I want to know how to deploy the bot on Koyeb please.

Thank you So Much!!!

Error gan

Error nya kek gini Maaf, sepertinya ada yang error

bot command

permisi izin tanya, ini bot nya cara biar engga pakai cmd gimna kak, jadi auto respon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.