Giter Club home page Giter Club logo

ncnu-etutor-reposter-telegram-bot's Introduction

NCNU-etutor-reposter-telegram-bot

暨大數位學伴計畫設計的社團貼文轉貼至 telegram 頻道的轉貼機器人

需求

  1. Python 3.7.6 or later
  2. pip 套件管理器

建立環境 / 部署

※注意!資料夾需要是可讀寫的狀態

一般方式

※ 如果電腦同時安裝有Python 2 和 3 版本,請使用 pip3 來進行接下來的所有操作

  1. 安裝 Python(至少 3.7.6 或更新的版本)
  2. 安裝 pip(Linux 請安裝 pip3,例如:sudo apt install python3-pip
  3. pip install python-telegram-bot==12.4.2 安裝 python-telegram-bot 的 python套件
  4. pip install requests
  5. 複製 config.ini.example 成 config.ini 並填入對應的設定內容
  6. 切換至專案目錄底下後,Windows 使用者請執行 py group_reposter_bot.py.py或直接點擊 .py 檔案;Linux 使用者請執行 python3 group_reposter_bot.py

使用 pipenv

  1. 安裝 Python(至少 3.7.6 或更新的版本)
  2. 安裝 pip(Linux 請安裝 pip3,例如:sudo apt install python3-pip
  3. pip install pipenv
  4. 切換至專案目錄下後執行 pipenv install
  5. 複製 config.ini.example 成 config.ini 並填入對應的設定內容
  6. Windows 使用者請執行 pipenv run py group_reposter_bot.py;Linux 使用者請執行 pipenv run python3 group_reposter_bot.py

LICENSE

See LICENSE.

ncnu-etutor-reposter-telegram-bot's People

Contributors

hms5232 avatar jiachiwen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ncnu-etutor-reposter-telegram-bot's Issues

Old Handler API is deprecated (use_context)

執行的時候應該會發現終端機上出現下列文字:

group_reposter_bot.py:34: TelegramDeprecationWarning: Old Handler API is deprecated - see https://git.io/fxJuV for details
updater = Updater(token=telegram_bot_token) # 呼叫 bot 用

查詢後發現在第 12 版的 API 中,這個裡面的參數 use_context 預設是 False,而新版(目前看官方文件應為 13 版,可是我用 pip install python-telegram-bot== 有看到最新的是 12.5 沒有 13 版耶@@)預設是 True。但目前的程式碼如果將其設定為 True 的話會出錯,因此如果發現機器人無法執行,請確認 python-telegram-bot 套件版本並設定 use_context=False

終端機提示的官方指南網址有大神翻譯的中文可看,而關於 use_context 可以參考官方文件

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.