0.0.5 • Published 4 years ago

reapex-discord v0.0.5

Weekly downloads
16
License
-
Repository
-
Last release
4 years ago

Installation:

npm i reapex-discord

Basic configuration:

//Importing package as "rpx"
const rpx = require("reapex-discord");
//Creating your bot client
const bot = rpx.bot
//Import mysql
const mysql = rpx.mysql
//Create prefix
var prefix = "."

//Simple MySql Config
var sql = mysql.createConnection({
    host: "",
    user: "",
    password: "",
    database: ""
});

Start the bot client:

// Starting bot
rpx.start('NzI3NDI2OTYwNTYwNzUwNjgy.XxckPQ.q8n3OIM3KEoEXJLZVvXz9LzcBrU')

Check if bot client & MySQL can connects:

//Set presence, can be 'available', 'idle', 'dnd', or 'invisible'
rpx.setPresence('Sample Text', 'WATCHING', 'idle')
//Check your database connection
rpx.mysqlCheck(sql)

You can disconnect your bot client with :

rpx.exit()

MySQL queries:

//Run a simple query
rpx.mysqlQuery(sql, "SHOW TABLES") //Log result 

//Retrieve the data
let query = "Your query"
sql.query(query, function (err, result) {
    if (err) {
        console.log(err)
    }
    else {
        console.log(result)
    }
});

Encryption/Decryption:

Maybe who going to crypt a plain string or decode it ? Use these methods:

Encode your plain text:

rpx.encode('your_plain_text')

Decode your encrypted text:

rpx.decode('your_encrypted_text')