搜尋
首頁後端開發Python教學使用 Discord 作為無限的雲端儲存服務

Discloud 是一個本地運行的 Discord 機器人,可將您的個人 Discord 伺服器轉變為無限的雲端儲存服務。它作為 Python 腳本在您的 PC 上運行(我一直在考慮製作 .exe 檔案以便於分發)並上傳您選擇的資料夾中的所有檔案。

安裝

  • 需要 Python 3.x
  • 使用 git clone https://github.com/4rnv/Discloud.git 複製此儲存庫
  • 執行 pip install -rrequirements.txt

此專案使用 Discord.py 套件來管理從本機用戶端到 Discord 伺服器的訊息傳遞和網關連線。

用法

在您的 Discord 帳戶上啟用開發者模式。在 Discord 上,進入使用者設定 >外觀>進階並啟用開發者模式。

Using Discord as an unlimited cloud storage service

按照 Discord 開發者入口網站上的說明建立一個基本的 Discord 機器人。

  • https://discord.com/developers/applications
  • https://discord.com/developers/docs/quick-start/getting-started。
  • 允許其上傳文件和發送訊息。

Using Discord as an unlimited cloud storage service

透過點擊應用程式中的重置令牌來產生機器人令牌> YOUR_BOT_NAME >機器人。

Using Discord as an unlimited cloud storage service

將該機器人新增至您的伺服器(請參閱上面連結中的 Guild 安裝)。

Using Discord as an unlimited cloud storage service

複製您的頻道 ID(右鍵單擊頻道名稱)和機器人令牌(來自機器人頁面),然後將它們新增至與 app.py 相同目錄中的 .env 檔案中。將它們分別命名為 CHANNEL_IDBOT_TOKEN

BOT_TOKEN=x0x0x0x0 # Alphanumeric
CHANNEL_ID=00000000 # This will be an integer

在 app.py 檔案中,指定要監視新檔案的目錄的路徑。預設為 ./upload.

  1. 使用 python app.py 運行機器人

筆記

Discord 對於非 Nitro 使用者有 25MB 的檔案限制,因此大於 25MB 的檔案將被忽略。

檔案大小限制存在一些不確定性。 2024 年 9 月,Discord 宣布他們將把大小限制減少到 10MB。然而,在我的測試運行期間,我能夠上傳最大 25MB 的檔案。

您也可以將較大的檔案壓縮為 zip 檔案並上傳(zip 檔案的有效大小最大為 100MB)。

確保您的機器人有權將檔案上傳到伺服器。 db.json 檔案儲存有關已上傳檔案的資訊。

Discord 伺服器的多功能性令人難以置信。如果您的電腦儲存空間不足,您可以將您的個人伺服器配置為理論上無限的雲端儲存。

GitHub 倉庫:https://github.com/4rnv/Discloud

以上是使用 Discord 作為無限的雲端儲存服務的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
列表和陣列之間的選擇如何影響涉及大型數據集的Python應用程序的整體性能?列表和陣列之間的選擇如何影響涉及大型數據集的Python應用程序的整體性能?May 03, 2025 am 12:11 AM

ForhandlinglargedatasetsinPython,useNumPyarraysforbetterperformance.1)NumPyarraysarememory-efficientandfasterfornumericaloperations.2)Avoidunnecessarytypeconversions.3)Leveragevectorizationforreducedtimecomplexity.4)Managememoryusagewithefficientdata

說明如何將內存分配給Python中的列表與數組。說明如何將內存分配給Python中的列表與數組。May 03, 2025 am 12:10 AM

Inpython,ListSusedynamicMemoryAllocationWithOver-Asalose,而alenumpyArraySallaySallocateFixedMemory.1)listssallocatemoremoremoremorythanneededinentientary上,respizeTized.2)numpyarsallaysallaysallocateAllocateAllocateAlcocateExactMemoryForements,OfferingPrediCtableSageButlessemageButlesseflextlessibility。

您如何在Python數組中指定元素的數據類型?您如何在Python數組中指定元素的數據類型?May 03, 2025 am 12:06 AM

Inpython,YouCansspecthedatatAtatatPeyFelemereModeRernSpant.1)Usenpynernrump.1)Usenpynyp.dloatp.dloatp.ploatm64,formor professisconsiscontrolatatypes。

什麼是Numpy,為什麼對於Python中的數值計算很重要?什麼是Numpy,為什麼對於Python中的數值計算很重要?May 03, 2025 am 12:03 AM

NumPyisessentialfornumericalcomputinginPythonduetoitsspeed,memoryefficiency,andcomprehensivemathematicalfunctions.1)It'sfastbecauseitperformsoperationsinC.2)NumPyarraysaremorememory-efficientthanPythonlists.3)Itoffersawiderangeofmathematicaloperation

討論'連續內存分配”的概念及其對數組的重要性。討論'連續內存分配”的概念及其對數組的重要性。May 03, 2025 am 12:01 AM

Contiguousmemoryallocationiscrucialforarraysbecauseitallowsforefficientandfastelementaccess.1)Itenablesconstanttimeaccess,O(1),duetodirectaddresscalculation.2)Itimprovescacheefficiencybyallowingmultipleelementfetchespercacheline.3)Itsimplifiesmemorym

您如何切成python列表?您如何切成python列表?May 02, 2025 am 12:14 AM

SlicingaPythonlistisdoneusingthesyntaxlist[start:stop:step].Here'showitworks:1)Startistheindexofthefirstelementtoinclude.2)Stopistheindexofthefirstelementtoexclude.3)Stepistheincrementbetweenelements.It'susefulforextractingportionsoflistsandcanuseneg

在Numpy陣列上可以執行哪些常見操作?在Numpy陣列上可以執行哪些常見操作?May 02, 2025 am 12:09 AM

numpyallowsforvariousoperationsonArrays:1)basicarithmeticlikeaddition,減法,乘法和division; 2)evationAperationssuchasmatrixmultiplication; 3)element-wiseOperations wiseOperationswithOutexpliitloops; 4)

Python的數據分析中如何使用陣列?Python的數據分析中如何使用陣列?May 02, 2025 am 12:09 AM

Arresinpython,尤其是Throughnumpyandpandas,weessentialFordataAnalysis,offeringSpeedAndeffied.1)NumpyArseNable efflaysenable efficefliceHandlingAtaSetSetSetSetSetSetSetSetSetSetSetsetSetSetSetSetsopplexoperationslikemovingaverages.2)

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

WebStorm Mac版

WebStorm Mac版

好用的JavaScript開發工具

VSCode Windows 64位元 下載

VSCode Windows 64位元 下載

微軟推出的免費、功能強大的一款IDE編輯器