mirror of
https://github.com/friuns2/BlackFriday-GPTs-Prompts.git
synced 2026-05-02 06:53:53 +07:00
2024 chatgpt update
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
[](https://gptcall.net/chat.html?data=%7B%22contact%22%3A%7B%22id%22%3A%22JTrPpMEzOBP79yuMCP9st%22%2C%22flow%22%3Atrue%7D%7D)
|
||||
|
||||
# One sentence to develop a whatsapp chat application | [Start Chat](https://gptcall.net/chat.html?data=%7B%22contact%22%3A%7B%22id%22%3A%22JTrPpMEzOBP79yuMCP9st%22%2C%22flow%22%3Atrue%7D%7D)
|
||||
Describe your needs in one sentence, and give you a WeChat chatbot. For example: We publish an event in the group. After the event is released, group members can send #sign up to sign up for the event; record members who have signed up for the event, and when new members sign up Respond to the successful registration and the registered list; When #Cancel is sent in the group, it will be deleted from the registration list, and the cancellation will be successful; If the member has no registration activity, the reply will remind the current member that there is no registration activity
|
||||
|
||||
@@ -9,6 +9,9 @@ Describe your needs in one sentence, and give you a WeChat chatbot. For example:
|
||||
Below, we will use the latest version of Wchaty to develop a WhatsApp chat robot application using TS language. The following is the official provided example code: #!/usr/bin/env -S node --no-warnings --loader ts-node/esm import { Contact, Message, ScanStatus, types, WechatyBuilder, log, } from 'wechaty' import qrcodeTerminal from 'qrcode-terminal' import { FileBox } from 'file-box' function onScan(qrcode: string, status: ScanStatus) { if (status === ScanStatus.Waiting || status === ScanStatus.Timeout) { const qrcodeImageUrl = [ 'https://wechaty.js.org/qrcode/', encodeURIComponent(qrcode), ].join('') log.info('StarterBot', 'onScan: %s(%s) - %s', ScanStatus[status], status, qrcodeImageUrl) qrcodeTerminal.generate(qrcode, { small: true }) // show qrcode on console } else { log.info('StarterBot', 'onScan: %s(%s)', ScanStatus[status], status) } } function onLogin(user: Contact) { log.info('StarterBot', '%s login', user) } function onLogout(user: Contact) { log.info('StarterBot', '%s logout', user) } async function onMessage(msg: Message) { log.info('StarterBot', msg.toString()) if (msg.type() === types.Message.Video || msg.type() === types.Message.Attachment || msg.type() === types.Message.Audio) { log.info('isFile:',true) } if (msg.text() === 'ding') { await msg.say('dong') } } const bot = WechatyBuilder.build({ name: 'ding-dong-bot', puppet: 'wechaty-puppet-whatsapp', }) bot.on('scan', onScan) bot.on('login', onLogin) bot.on('logout', onLogout) bot.on('message', onMessage) bot.start() .then(() => log.info('StarterBot', 'Starter Bot Started.')) .catch(e => log.error('StarterBot', e)) Please refer to these codes to implement our requirements, and pay special attention to the method of obtaining the message type is types.Message instead of Message.Type. In the next question, I will describe the specific needs. For this question, you only need to reply "I am ready, please tell me your needs", and do not reply with any additional information. When I continue to state the requirements, I will give the sample code of ts implementation, and add the necessary Chinese comments in the code.
|
||||
```
|
||||
|
||||
## Welcome Message
|
||||
I am ready, please tell me your needs.
|
||||
|
||||
## Conversation
|
||||
|
||||
**ASSISTANT**: I am ready, please tell me your needs.
|
||||
@@ -161,4 +164,3 @@ bot.start()
|
||||
|
||||
Note that the above code assumes that the bot is added to a group chat where the event will take place, and that messages containing `#signup` or `#cancellation` are sent by group members. Also, we use a `Set` data structure to store the IDs of participants for easy adding and removing.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user