mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: Added workflow to release at NPM site (#48)
* chore: Changed name for release * chore: Sorted package.json * ci: Added workflow to publish releases * chore: Updated .gitignore * chore: Updated lint to use nodejs v18 * chore: Updated package name in README.md * chore: Change the current version
This commit is contained in:
committed by
GitHub
parent
13810ec7ea
commit
7c3f0df560
16
README.md
16
README.md
@@ -35,7 +35,7 @@ yarn add github:WhiskeySockets/Baileys
|
||||
|
||||
Then import your code using:
|
||||
``` ts
|
||||
import makeWASocket from '@adiwajshing/baileys'
|
||||
import makeWASocket from '@whiskeysockets/baileys'
|
||||
```
|
||||
|
||||
## Unit Tests
|
||||
@@ -45,7 +45,7 @@ TODO
|
||||
## Connecting
|
||||
|
||||
``` ts
|
||||
import makeWASocket, { DisconnectReason } from '@adiwajshing/baileys'
|
||||
import makeWASocket, { DisconnectReason } from '@whiskeysockets/baileys'
|
||||
import { Boom } from '@hapi/boom'
|
||||
|
||||
async function connectToWhatsApp () {
|
||||
@@ -175,7 +175,7 @@ You obviously don't want to keep scanning the QR code every time you want to con
|
||||
|
||||
So, you can load the credentials to log back in:
|
||||
``` ts
|
||||
import makeWASocket, { BufferJSON, useMultiFileAuthState } from '@adiwajshing/baileys'
|
||||
import makeWASocket, { BufferJSON, useMultiFileAuthState } from '@whiskeysockets/baileys'
|
||||
import * as fs from 'fs'
|
||||
|
||||
// utility function to help save the auth state in a single folder
|
||||
@@ -288,7 +288,7 @@ Baileys does not come with a defacto storage for chats, contacts, or messages. H
|
||||
It can be used as follows:
|
||||
|
||||
``` ts
|
||||
import makeWASocket, { makeInMemoryStore } from '@adiwajshing/baileys'
|
||||
import makeWASocket, { makeInMemoryStore } from '@whiskeysockets/baileys'
|
||||
// the store maintains the data of the WA connection in memory
|
||||
// can be written out to a file & read from it
|
||||
const store = makeInMemoryStore({ })
|
||||
@@ -327,7 +327,7 @@ The store also provides some simple functions such as `loadMessages` that utiliz
|
||||
### Non-Media Messages
|
||||
|
||||
``` ts
|
||||
import { MessageType, MessageOptions, Mimetype } from '@adiwajshing/baileys'
|
||||
import { MessageType, MessageOptions, Mimetype } from '@whiskeysockets/baileys'
|
||||
|
||||
const id = 'abcd@s.whatsapp.net' // the WhatsApp ID
|
||||
// send a simple text!
|
||||
@@ -445,7 +445,7 @@ Sending media (video, stickers, images) is easier & more efficient than ever.
|
||||
- When specifying a media url, Baileys never loads the entire buffer into memory; it even encrypts the media as a readable stream.
|
||||
|
||||
``` ts
|
||||
import { MessageType, MessageOptions, Mimetype } from '@adiwajshing/baileys'
|
||||
import { MessageType, MessageOptions, Mimetype } from '@whiskeysockets/baileys'
|
||||
// Sending gifs
|
||||
await sock.sendMessage(
|
||||
id,
|
||||
@@ -527,7 +527,7 @@ const sendMsg = await sock.sendMessage(id, templateMessage)
|
||||
Do not enter this field if you want to automatically generate a thumb
|
||||
*/
|
||||
mimetype: Mimetype.pdf, /* (for media messages) specify the type of media (optional for all media types except documents),
|
||||
import {Mimetype} from '@adiwajshing/baileys'
|
||||
import {Mimetype} from '@whiskeysockets/baileys'
|
||||
*/
|
||||
fileName: 'somefile.pdf', // (for media messages) file name for the media
|
||||
/* will send audio messages as voice notes, if set to true */
|
||||
@@ -586,7 +586,7 @@ The presence expires after about 10 seconds.
|
||||
If you want to save the media you received
|
||||
``` ts
|
||||
import { writeFile } from 'fs/promises'
|
||||
import { downloadMediaMessage } from '@adiwajshing/baileys'
|
||||
import { downloadMediaMessage } from '@whiskeysockets/baileys'
|
||||
|
||||
sock.ev.on('messages.upsert', async ({ messages }) => {
|
||||
const m = messages[0]
|
||||
|
||||
Reference in New Issue
Block a user