Skip to content

Instantly share code, notes, and snippets.

@ugeugeHigh
Created January 8, 2023 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugeugeHigh/1619909d935f12de1655461cbef827cd to your computer and use it in GitHub Desktop.
Save ugeugeHigh/1619909d935f12de1655461cbef827cd to your computer and use it in GitHub Desktop.
from linebot import LineBotApi
from linebot.models import TextSendMessage
from linebot.exceptions import LineBotApiError
import search
bot_api = '******'
user_id = '******'
def sendText(text):
line_bot_api = LineBotApi(bot_api)
try:
line_bot_api.push_message(user_id, TextSendMessage(text))
except LineBotApiError as e:
print(e.message)
if __name__ == "__main__":
switch = search.switch_s()
text = switch.stock()
sendText(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment