Skip to content

Instantly share code, notes, and snippets.

#1 Sign In

GET    /sign_in

{
	account:string,
	password:string
}

Response

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "project_name"
[packages]
python-telegram-bot = "*"
flask = "*"
gunicorn = "*"
requests = "*"
from . import olami
from . import kkbox
import configparser
import logging
import telegram
from flask import Flask, request
from telegram.ext import Dispatcher, MessageHandler, Filters
# Load data from config.ini file
config = configparser.ConfigParser()
config.read('config.ini')
+from telegram import ReplyKeyboardMarkup
+from telegram.ext import Dispatcher, CommandHandler, MessageHandler, Filters
+
+welcome_message = '親愛的主人,您可以問我\n' \
+ '天氣,例如:「高雄天氣如何」\n' \
+ '百科,例如:「川普是誰」\n' \
+ '新聞,例如:「今日新聞」\n' \
+ '音樂,例如:「我想聽周杰倫的等你下課」\n' \
+ '日曆,例如:「現在時間」\n' \
+ '詩詞,例如:「我想聽水調歌頭這首詩」\n' \
[TELEGRAM]
ACCESS_TOKEN =
WEBHOOK_URL =
web: gunicorn main:app --log-file -
const {LineHandler} = require('bottender')
exports.lineHandler = new LineHandler()
.onText(async context => {
const text = context.event.text
const reply = text
await context.replyText(reply)
}
)
const config = require('../../config')
const axios = require('axios')
const md5 = require('md5')
class Olami {
constructor(appKey = config.olami.appKey, appSecret = config.olami.appSectet, inputType = 1) {
this.URL = 'https://tw.olami.ai/cloudservice/api'
this.appKey = appKey
this.appSecret = appSecret
this.inputType = inputType