# hary-bot

> Make Your Heart Comfortable

Latest version **1.0.1** (published 2022-08-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install hary-bot
pnpm add hary-bot
yarn add hary-bot
bun add hary-bot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-08-28 |
| First published | 2022-08-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 40 |
| Unpacked size | 117.2 MB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| Author | HARY-IT |
| Maintainers | rinawatihlingga, haryonokudadiri |
| Keywords | simple, api, rest, api |

## Links

- npm: https://www.npmjs.com/package/hary-bot
- Repository: https://github.com/MltrCyber/hary-api
- Homepage: https://github.com/MltrCyber/hary-api#readme
- Issues: https://github.com/MltrCyber/hary-api/issues
- npm.io page: https://npm.io/package/hary-bot

## Dependencies (40)

- [url](https://npm.io/package/url.md) ^0.11.0
- [cors](https://npm.io/package/cors.md) ^2.8.5
- [mime](https://npm.io/package/mime.md) ^3.0.0
- [monk](https://npm.io/package/monk.md) ^7.3.3
- [path](https://npm.io/package/path.md) ^0.12.7
- [ytpl](https://npm.io/package/ytpl.md) ^2.0.5
- [axios](https://npm.io/package/axios.md) ^0.21.4
- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [sshpk](https://npm.io/package/sshpk.md) ^1.17.0
- [base32](https://npm.io/package/base32.md) 0.0.6
- [cfonts](https://npm.io/package/cfonts.md) ^3.1.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [moment](https://npm.io/package/moment.md) ^2.29.3
- [morgan](https://npm.io/package/morgan.md) ^1.10.0
- [needle](https://npm.io/package/needle.md) ^2.6.0
- [base-64](https://npm.io/package/base-64.md) ^1.0.0
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.11
- [express](https://npm.io/package/express.md) ^4.17.1
- [mongodb](https://npm.io/package/mongodb.md) ^3.6.3
- [nodemon](https://npm.io/package/nodemon.md) ^2.0.18
- [request](https://npm.io/package/request.md) ^2.88.2
- [hary-bot](https://npm.io/package/hary-bot.md) ^1.0.0
- [passport](https://npm.io/package/passport.md) ^0.6.0
- [spinnies](https://npm.io/package/spinnies.md) ^0.5.1
- [scrape-yt](https://npm.io/package/scrape-yt.md) ^1.4.8
- [urlencode](https://npm.io/package/urlencode.md) ^1.1.0
- [ytdl-core](https://npm.io/package/ytdl-core.md) ^4.11.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7
- [memorystore](https://npm.io/package/memorystore.md) ^1.6.7
- [yt-converter](https://npm.io/package/yt-converter.md) ^1.3.2
- [connect-flash](https://npm.io/package/connect-flash.md) ^0.1.1
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.6
- [node-schedule](https://npm.io/package/node-schedule.md) ^2.1.0
- [tiktok-scraper](https://npm.io/package/tiktok-scraper.md) ^1.4.12
- [express-session](https://npm.io/package/express-session.md) ^1.17.3
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0
- [ssl-express-www](https://npm.io/package/ssl-express-www.md) ^3.0.7
- [whatsapp-web.js](https://npm.io/package/whatsapp-web.js.md) ^1.17.0
- [express-rate-limit](https://npm.io/package/express-rate-limit.md) ^6.4.0
- [express-ejs-layouts](https://npm.io/package/express-ejs-layouts.md) ^2.5.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-08-28
- 1.0.0 — 2022-08-28

## README

# hary-bot 
Npm Package for using whatsapp bot 

## How To Use

```
const qrcode = require('qrcode-terminal');
const axios = require('axios');
const fs = require ('fs');
const cors = require("cors");
  const session = require('express-session');
  const cookieParser = require('cookie-parser');
  const expressLayout = require('express-ejs-layouts');
  const passport = require('passport');
  const flash = require('connect-flash');
  const schedule = require('node-schedule');
  const MemoryStore = require('memorystore')(session);
  const rateLimit = require("express-rate-limit");
  var logger = require('morgan');
  const apikey = ('hary');
const CFonts = require('cfonts');

const yt = require('yt-converter')
const {
    color
} = require('./lib/color')

const ytdl = require('ytdl-core');
const { Client , LocalAuth , MessageMedia } = require('whatsapp-web.js');
const client = new Client({
    authStrategy: new LocalAuth(),
    executablePath:' C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
});
 

client.on('qr', qr => {
    qrcode.generate(qr, {small: true});
});

client.on('authenticated',() =>{
    console.log('AUTHENTICATED')});

client.on('ready', () => {
    console.log('Client is ready!');
});
client.on('message', message => {
    console.log(message.body);
});
 
 client.on('message',async message => {
    const hary = message.body
    if(message.body === 'P') {
        message.reply('Ouu?');
    }
    else if (hary === 'p'){
        message.reply('Iya?')
    }
    else if (hary === 'cecan'){
        const media =  MessageMedia.fromUrl(`https://hary.cloud/api/cecan?apikey=${apikey}`)
        client.sendMessage(message.from,media,{unsafeMime :true});
    }
else if (hary === 'cecandoc'){
    const media =  MessageMedia.fromUrl(`https://hary.cloud/api/cecan?apikey=${apikey}`)
    client.sendMessage(message.from,media,{sendAsDocument : true})  
}
else if (hary.startsWith ('ytmp3be')){
     const link = message.body.slice(7)
    const id = link.split('=')[1]
message.reply('_Wait!_')
    const media = await axios (`https://hary.cloud/api/download/ytmp3?url=${link}&apikey=${apikey}`)
    .then(res => res.data)
    client.sendMessage(message.from, await MessageMedia.fromUrl(media.result, { sendMediaAsDocument: true }))
}

else if (hary.startsWith ('ytmp3')){
     const link = message.body.slice(6)
    const id = link.split('=')[1]
message.reply('_Wait!_')
    const media = await axios (`https://hary.cloud/api/download/ytmp3?url=${link}&apikey=${apikey}`)
    .then(res => res.data)
    client.sendMessage(message.from, await MessageMedia.fromUrl(media.result, { sendMediaAsDocument: true }))
}

else if (hary.startsWith ('ytmp4be')){
     const link = message.body.slice(7)
    const id = link.split('=')[1]
message.reply('_Wait!_')
    const media = await axios (`https://hary.cloud/api/download/ytmp4?url=${link}&apikey=${apikey}`)
    .then(res => res.data)
    client.sendMessage(message.from, await MessageMedia.fromUrl(media.result, { sendMediaAsDocument: true }))
}
else if (hary.startsWith ('ytmp4')){
     const link = message.body.slice(6)
    const id = link.split('=')[1]
message.reply('_Wait!_')
    const media = await axios (`https://hary.cloud/api/download/ytmp4?url=${link}&apikey=${apikey}`)
    .then(res => res.data)
    client.sendMessage(message.from, await MessageMedia.fromUrl(media.result, { sendMediaAsDocument: true }))
}





});
 
client.initialize();



```
```
#lib/color.js
const chalk = require('chalk')

const color = (text, color) => {
    return !color ? chalk.green(text) : chalk.keyword(color)(text)
}

const bgcolor = (text, bgcolor) => {
	return !bgcolor ? chalk.green(text) : chalk.bgKeyword(bgcolor)(text)
}

module.exports = {
	color,
	bgcolor
}

```

---
_Source: https://npm.io/package/hary-bot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
