import win32com.client
 
# 연결 여부 체크
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
bConnect = objCpCybos.IsConnect
if (bConnect == 0):
    print("PLUS가 정상적으로 연결되지 않음. ")
    exit()
 
# 현재가 객체 구하기
objStockMst = win32com.client.Dispatch("DsCbo1.StockMst")
objStockMst.SetInputValue(0, 'A005930')   #종목 코드 - 삼성전자
objStockMst.BlockRequest()
 
# 현재가 통신 및 통신 에러 처리 
rqStatus = objStockMst.GetDibStatus()
rqRet = objStockMst.GetDibMsg1()
print("통신상태", rqStatus, rqRet)
if rqStatus != 0:
    exit()
 
# 현재가 정보 조회
offer = objStockMst.GetHeaderValue(16)  #매도호가


from slacker import Slacker

slack = Slacker('xoxb-1598938386003-1595647391589-mqE5bSrJ8QkoUYOisS3gEyVp')

# Send a message to #general channel
slack.chat.post_message('#auto-stock-bot', '삼성전자 현재가:' + str(offer))

ba4c5121ff818a03b0c64ffc0441daf462a4c82c
<mask token>

<mask token>
if bConnect == 0:
    print('PLUS가 정상적으로 연결되지 않음. ')
    exit()
<mask token>
objStockMst.SetInputValue(0, 'A005930')
objStockMst.BlockRequest()
<mask token>
print('통신상태', rqStatus, rqRet)
if rqStatus != 0:
    exit()
<mask token>
slack.chat.post_message('#auto-stock-bot', '삼성전자 현재가:' + str(offer))

<mask token>
objCpCybos = win32com.client.Dispatch('CpUtil.CpCybos')
bConnect = objCpCybos.IsConnect
if bConnect == 0:
    print('PLUS가 정상적으로 연결되지 않음. ')
    exit()
objStockMst = win32com.client.Dispatch('DsCbo1.StockMst')
objStockMst.SetInputValue(0, 'A005930')
objStockMst.BlockRequest()
rqStatus = objStockMst.GetDibStatus()
rqRet = objStockMst.GetDibMsg1()
print('통신상태', rqStatus, rqRet)
if rqStatus != 0:
    exit()
offer = objStockMst.GetHeaderValue(16)
<mask token>
slack = Slacker('xoxb-1598938386003-1595647391589-mqE5bSrJ8QkoUYOisS3gEyVp')
slack.chat.post_message('#auto-stock-bot', '삼성전자 현재가:' + str(offer))

import win32com.client
objCpCybos = win32com.client.Dispatch('CpUtil.CpCybos')
bConnect = objCpCybos.IsConnect
if bConnect == 0:
    print('PLUS가 정상적으로 연결되지 않음. ')
    exit()
objStockMst = win32com.client.Dispatch('DsCbo1.StockMst')
objStockMst.SetInputValue(0, 'A005930')
objStockMst.BlockRequest()
rqStatus = objStockMst.GetDibStatus()
rqRet = objStockMst.GetDibMsg1()
print('통신상태', rqStatus, rqRet)
if rqStatus != 0:
    exit()
offer = objStockMst.GetHeaderValue(16)
from slacker import Slacker
slack = Slacker('xoxb-1598938386003-1595647391589-mqE5bSrJ8QkoUYOisS3gEyVp')
slack.chat.post_message('#auto-stock-bot', '삼성전자 현재가:' + str(offer))

import win32com.client
 
# 연결 여부 체크
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
bConnect = objCpCybos.IsConnect
if (bConnect == 0):
    print("PLUS가 정상적으로 연결되지 않음. ")
    exit()
 
# 현재가 객체 구하기
objStockMst = win32com.client.Dispatch("DsCbo1.StockMst")
objStockMst.SetInputValue(0, 'A005930')   #종목 코드 - 삼성전자
objStockMst.BlockRequest()
 
# 현재가 통신 및 통신 에러 처리 
rqStatus = objStockMst.GetDibStatus()
rqRet = objStockMst.GetDibMsg1()
print("통신상태", rqStatus, rqRet)
if rqStatus != 0:
    exit()
 
# 현재가 정보 조회
offer = objStockMst.GetHeaderValue(16)  #매도호가


from slacker import Slacker

slack = Slacker('xoxb-1598938386003-1595647391589-mqE5bSrJ8QkoUYOisS3gEyVp')

# Send a message to #general channel
slack.chat.post_message('#auto-stock-bot', '삼성전자 현재가:' + str(offer))
