cuy-cli 3.0.7 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/database.js CHANGED
@@ -5,15 +5,14 @@ var conn = mysql.createConnection({
5
5
  host: "db-mysql-sgp1-58823-do-user-11984311-0.b.db.ondigitalocean.com",
6
6
  user: "doadmin",
7
7
  password: "AVNS_71_BT0OkHC4TvDAPny9",
8
- database: "cuyuniverse",
8
+ database: "cuniverse",
9
9
  port: 25060,
10
10
  // ssl: {
11
11
  // ca: fs.readFileSync(__dirname + '/ca-certificate.crt')
12
12
  // }
13
13
  });
14
14
  conn.connect(function (err) {
15
- if (err) return console.log('err conn', err)
16
- console.info('connected');
15
+ if (err) return console.log('error connection sorry...')
17
16
  });
18
17
 
19
18
 
package/bin/index.js CHANGED
@@ -44,18 +44,18 @@ const search = [
44
44
  const cuyPost = (data) => {
45
45
  if (data.description.length < 8 || data.description.length > 100) {
46
46
  console.log('deskripsi terlalu panjang! min:8 max:100');
47
- // return db.destroy();
47
+ db.destroy();
48
48
  }
49
49
 
50
50
  if (data.hashtag.length < 2 || data.hashtag.length > 20) {
51
51
  console.log('hashtag terlalu panjang! min:2 max:20');
52
- // return db.destroy();
52
+ db.destroy();
53
53
  }
54
54
 
55
55
  db.query(`SELECT * from users where secret='${data.secret}' AND cuycli=1`, (err, rows) => {
56
56
  if (err) {
57
57
  console.warn('Maaf, saat ini data yang anda masukan tidak dapat kami proses.')
58
- // return db.destroy();
58
+ db.destroy();
59
59
  }
60
60
  if (!err && rows.length > 0) {
61
61
  const { username, id } = rows[0]
@@ -63,10 +63,10 @@ const cuyPost = (data) => {
63
63
  if (!err) {
64
64
  if (rows != null) {
65
65
  console.info(`congrats ${username} :) anda berhasil membuat postingan baru. silahkan cek di https://cuyuniverse.co`);
66
- // db.destroy();
66
+ db.destroy();
67
67
  } else {
68
68
  console.log('Terjadi kesalahan, saat ini anda tidak dapat membuat postingan via cuycli. Coba lagi nanti!');
69
- // db.destroy();
69
+ db.destroy();
70
70
  }
71
71
  } else {
72
72
  console.warn('Maaf, saat ini data yang anda masukan tidak dapat kami proses.')
@@ -78,21 +78,19 @@ const cuyPost = (data) => {
78
78
 
79
79
  const lastSeen = ({ username }) => {
80
80
  db.query(`select last_seen from users where username='${username}'`, (err, rows) => {
81
- console.log('error: ', err)
82
- console.log('rowsss: ', rows)
83
81
  if (!err && rows.length > 0) {
84
82
  last_seen = rows[0].last_seen
85
83
  if (last_seen == null) {
86
84
  console.info(`${username} belum pernah login`);
87
- // db.destroy();
85
+ db.destroy();
88
86
  } else {
89
87
  console.info(`${username} terahir terlihat pada ${last_seen}`);
90
- // db.destroy();
88
+ db.destroy();
91
89
  }
92
90
  }
93
91
  else {
94
92
  console.warn('Maaf, saat ini data yang anda masukan tidak dapat kami proses.')
95
- // return db.destroy();
93
+ db.destroy();
96
94
  }
97
95
  })
98
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cuy-cli",
3
- "version": "3.0.7",
3
+ "version": "3.1.0",
4
4
  "description": "Cuyuniverse Command Line Tools",
5
5
  "main": "index.js",
6
6
  "repository": {