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 上,進入使用者設定 >外觀>進階並啟用開發者模式。
按照 Discord 開發者入口網站上的說明建立一個基本的 Discord 機器人。
- https://discord.com/developers/applications
- https://discord.com/developers/docs/quick-start/getting-started。
- 允許其上傳文件和發送訊息。
透過點擊應用程式中的重置令牌來產生機器人令牌> YOUR_BOT_NAME >機器人。
將該機器人新增至您的伺服器(請參閱上面連結中的 Guild 安裝)。
複製您的頻道 ID(右鍵單擊頻道名稱)和機器人令牌(來自機器人頁面),然後將它們新增至與 app.py 相同目錄中的 .env 檔案中。將它們分別命名為 CHANNEL_ID 和 BOT_TOKEN。
BOT_TOKEN=x0x0x0x0 # Alphanumeric CHANNEL_ID=00000000 # This will be an integer
在 app.py 檔案中,指定要監視新檔案的目錄的路徑。預設為 ./upload.
- 使用 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中文網其他相關文章!

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

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

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

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

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

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

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

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


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

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

熱門文章

熱工具

Dreamweaver CS6
視覺化網頁開發工具

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

SublimeText3漢化版
中文版,非常好用

WebStorm Mac版
好用的JavaScript開發工具

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器