#!/usr/bin/env python

#############################################################################
#    PLanet IT API - Python 3.6 Planet IT API.
#    Copyright (C) 2017 by Rakibul Yeasin Totul
#    URI - https://www.rytotul.xyz/about
#	 Facebook - https://www.facebook.com/rytotul
#	 Github - https://www.github.com/rytotul
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
#############################################################################

# importing modules
import sys
sys.dont_write_bytecode = True

from optparse import OptionParser
from lib.api import PlanetAPI

# Calling from modules...
parser = OptionParser()
api = PlanetAPI()

# Parser options...
parser.add_option("-t", "--text", help="To send a short SMS", default="Command to send a short SMS", action="store_true")
parser.add_option("-b", "--balance", help="Command to check the current balance", action="store_true")

# Gathering all parser-options in a variable
(args, _) = parser.parse_args()

# App api and login informations
username = ''									# Your username
password = ''									# Your Password

# User Input Message
def message():
	print('\nEnter your Message:')
	text = str(input())
	return text

# User Input Phone number
def number():
	print('\nEnter the phone number where to send SMS:')
	gsm = str(input())
	return gsm

def sms_check(res):

    	if res == '0':
    		response = 'Request was Succesfull'
    	elif res == '-1':
    		response = 'Error proccessing the request'
    	elif res == '-2':
    		response = 'You don\'t have enough credits...'
    	elif res == '-3':
    		response = 'Currenty we can\'t send SMS to this network.'
    	elif res == '-5':
    		response = 'Username or Password is invalid'
    	elif res == '-6':
    		response = 'Destination address is missing'
    	elif res == '-10':
    		response = 'Missing username'
    	elif res == '-11':
    		response = 'Missing the password'
    	elif res == '-13':
    		response = 'Number is not recognised. \nPlease make sure you have added 88 before the number'
    	elif res == '-34':
    		response = 'Sender ID is not Valid'
    	elif res == '-99':
    		response = 'Error proccessing request'
    	else:
    		response = 'SMS send success. ID: ' + res

    	return response

#The main function starts...
def main():
	# The main function

	# Check Balance
	if args.balance is True:
		bal = api.balance(username, password)
		ans = sms_check(bal)
		print('\nCurrent Balance: ', ans)
	
	# Send a short SMS
	if args.text is True:
		text = message()
		gsm = number()
		print('\nSMS Text: ', text, '\nReciever: ', gsm, '\n\nEnter y or Y to Confirm, n or N to discard: ')
		verify = str(input())
		if verify == 'y' or verify == 'Y':
			response = api.s_sms(username, password, text, gsm)
			ans = sms_check(response)
			print('\n', ans)
			sys.exit()

# Starting the program from here...
if __name__ == "__main__":
	try:
		main()
	except IOError:
		print ('\nNot connected to Internet. Connect to internet first...')
		sys.exit()
		pass

# end..............................................

@@ -1224,16 +1224,37 @@
 anetAPI%0D
+%0Aimport lib.settings%0D
 %0A%0D%0A# Cal
@@ -1408,26 +1408,71 @@
 S%22, 
-default=%22Command t
+action=%22store_true%22)%0D%0Aparser.add_option(%22-l%22, %22--long%22, help=%22T
 o se
@@ -1468,37 +1468,36 @@
 help=%22To send a 
-short
+long
  SMS%22, action=%22s
@@ -1738,24 +1738,36 @@
 username = '
+khansunny245
 '%09%09%09%09%09%09%09%09%09# 
@@ -1793,16 +1793,27 @@
 word = '
+01768072680
 '%09%09%09%09%09%09%09
@@ -1899,16 +1899,56 @@
  Message
+ (max 160 chars for short 1080 for long)
 :')%0D%0A%09te
@@ -3665,16 +3665,369 @@
 it()%0D%0A%0D%0A
+%09if args.long is True:%0D%0A%09%09text = message()%0D%0A%09%09gsm = number()%0D%0A%09%09print('%5CnSMS Text: ', text, '%5CnReciever: ', gsm, '%5Cn%5CnEnter y or Y to Confirm, n or N to discard: ')%0D%0A%09%09verify = str(input())%0D%0A%09%09if verify == 'y' or verify == 'Y':%0D%0A%09%09%09response = api.l_sms(username, password, text, gsm)%0D%0A%09%09%09ans = sms_check(response)%0D%0A%09%09%09print('%5Cn', ans)%0D%0A%09%09%09sys.exit()%0D%0A%0D%0A
 # Starti

Update planet.py