汪汪Bot是一个Telegram Bot,用于帮助你管理一台服务器上的Docker

Overview

WangWangBot

汪汪Bot是一个Telegram Bot,用于帮助你管理一台服务器上的Docker运行的Bot。这是使用视频:

bot_use

部署说明

安装运行

准备 local.env

普通版本

BOT_TOKEN=你的BOT_TOKEN
ADMINS=使用,分隔的管理员ID列表

如果你使用doppler,则是

DOPPLER_TOKEN=

创建并运行容器

docker run -d --name=wangwangbot --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v `pwd`:/data --env-file local.env hdcola/wangwangbot

这里的 pwd 目录默认是包含有 docker-compose.yml 及它会使用到的资源的目录(你也可以指定到别的目录去)。有关docker-compose相关信息,请参考 docker-compose文档

升级

停止、移除容器

docker stop wangwangbot
docker rm wangwangbot

更新image

docker pull hdcola/wangwangbot

之后再运行一遍创建并运行容易即可。

开发者调试

运行状态下使用交互模式进入容器

docker exec -it wangwangbot bash

非运行状态下使用交互模式启动一次性容器

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v `pwd`:/data hdcola/wangwangbot bash

测试doppler环境

docker run --rm -it --init \
   -e "DOPPLER_TOKEN=$(doppler configure get token --plain)" \
   -e "DOPPLER_PROJECT=$(doppler configure get project --plain)" \
   -e "DOPPLER_CONFIG=$(doppler configure get config --plain)" \
   hdcola/wangwangbot
You might also like...
A Telegram bot for remotely managing Binance Trade Bot
A Telegram bot for remotely managing Binance Trade Bot

Binance Trade Bot Manager Telegram A Telegram bot for remotely managing Binance Trade Bot. If you have feature requests please open an issue on this r

An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

This is telegram bot to generate string session for using user bots. You can see live bot in https://telegram.dog/string_session_Nsbot

TG String Session Generate Pyrogram String Session Using this bot. Demo Bot: Configs: API_HASH Get from Here. API_ID Get from Here. BOT_TOKEN Telegram

A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

A telegram bot which can show you the status of telegram bot

BotStatus-Ts-Bot An open source telegram Bot Status bot For demo you can check here The status is updated in every 1 hour About Bot This is a Bot stat

Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal

Ein kleines Wochenend-Projekt von mir. Der Bot überwacht die REST-API des niedersächsischen Impfportals auf freie Impfslots und sendet eine Benachrichtigung mit deinem bevorzugtem Service. Ab da gilt leider: der Schnellste gewinnt. Bitte missbraucht den Bot nicht und verwendet moderate Intervalle.

Telegram Bot to Filter posts in Bot Inline search

Inline-Filter-Bot A Telegram Bot for filter in Inline Features Unlimited Filters Supports all type of filters Supports Alert Button Using Common Marku

Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API.

Tg_PHub_Bot Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API. OS Support All linu

Comments
  • 使用docker运行bot出错

    使用docker运行bot出错

    使用的docker命令: docker run -d --name=wangwangbot --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /root/wangwangbot/data:/data --env-file local.env hdcola/wangwangbot

    /root/wangwangbot/local.env文件内容如下: BOT_TOKEN=我的bot token ADMINS=我的id

    对bot发送/admin发现没有反应,但是发送/start和/help有回应

    使用tail /root/wangwangbot/logs/wangwangbot.log 查到以下内容

    日志错误信息如下: compose.config.errors.ComposeFileNotFound: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml
    

    2021-08-22 01:10:56.357 | ERROR | aiogram.utils.executor:start_polling:323 - Task exception was never retrieved future: <Task finished name='Task-24' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py:409> exception=ComposeFileNotFound(['docker-compose.yml', 'docker-compose.yaml', 'compose.yml', 'compose.yaml'])> Traceback (most recent call last):

    File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 417, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): │ │ │ │ │ │ └ True │ │ │ │ │ └ [<aiogram.types.update.Update object at 0x7f6922d849a0>] │ │ │ │ └ <function Dispatcher.process_updates at 0x7f692165d160> │ │ │ └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f6920e70c70> │ │ └ <method 'from_iterable' of 'itertools.chain' objects> │ └ <class 'itertools.chain'> └ <module 'itertools' (built-in)> File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 238, in process_updates return await asyncio.gather(*tasks) │ │ └ [<coroutine object Handler.notify at 0x7f691f8b5d40>] │ └ <function gather at 0x7f69232258b0> └ <module 'asyncio' from '/usr/local/lib/python3.9/asyncio/init.py'> File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.update.Update object at 0x7f6922d849a0>,) │ └ <bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f6920e70c70>> └ Handler.HandlerObj(handler=<bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7... File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 259, in process_update return await self.message_handlers.notify(update.message) │ │ │ │ └ <aiogram.types.fields.Field object at 0x7f692177aac0> │ │ │ └ <aiogram.types.update.Update object at 0x7f6922d849a0> │ │ └ <function Handler.notify at 0x7f692169ea60> │ └ <aiogram.dispatcher.handler.Handler object at 0x7f6920e705e0> └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f6920e70c70> File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.message.Message object at 0x7f6922d84190>,) │ └ <function admin_command at 0x7f691f8cab80> └ Handler.HandlerObj(handler=<function admin_command at 0x7f691f8cab80>, spec=FullArgSpec(args=['message'], varargs=None, varkw...

    File "/WangWangBot/WangWangBot/handlers/users/admin.py", line 23, in admin_command msg, reply_markup = get_top_services_msg() └ <function get_top_services_msg at 0x7f6922de93a0>

    File "/WangWangBot/WangWangBot/handlers/users/admin.py", line 13, in get_top_services_msg services = docker.check_dir_service_list(Config.DOCKER_COMPOSE_DIR) │ │ │ └ '/data/' │ │ └ <class 'WangWangBot.config.Config'> │ └ <function check_dir_service_list at 0x7f691f8ca550> └ <module 'WangWangBot.utils.docker' from '/WangWangBot/WangWangBot/utils/docker.py'>

    File "/WangWangBot/WangWangBot/utils/docker.py", line 101, in check_dir_service_list project = get_project( └ <function get_project at 0x7f691f8c6ca0>

    File "/usr/local/lib/python3.9/site-packages/compose/cli/command.py", line 144, in get_project config_details = config.find(project_dir, config_path, environment, override_dir) │ │ │ │ │ └ None │ │ │ │ └ {'PATH': '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOSTNAME': 'f7410364dcb6', 'BOT_TOKE... │ │ │ └ None │ │ └ '/data' │ └ <function find at 0x7f691ff6a4c0> └ <module 'compose.config' from '/usr/local/lib/python3.9/site-packages/compose/config/init.py'> File "/usr/local/lib/python3.9/site-packages/compose/config/config.py", line 320, in find raise ComposeFileNotFound(SUPPORTED_FILENAMES) │ └ ['docker-compose.yml', 'docker-compose.yaml', 'compose.yml', 'compose.yaml'] └ <class 'compose.config.errors.ComposeFileNotFound'>

    compose.config.errors.ComposeFileNotFound: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml
    

    Snipaste_2021-08-22_09-37-37

    help wanted 
    opened by TheEnd233 1
  • 如果服务器上的Docker没有启动会报错

    如果服务器上的Docker没有启动会报错

    File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 417, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): │ │ │ │ │ │ └ True │ │ │ │ │ └ [<aiogram.types.update.Update object at 0x7f82a949adf0>] │ │ │ │ └ <function Dispatcher.process_updates at 0x7f82a839a5e0> │ │ │ └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f82a87ddee0> │ │ └ <method 'from_iterable' of 'itertools.chain' objects> │ └ <class 'itertools.chain'> └ <module 'itertools' (built-in)> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 238, in process_updates return await asyncio.gather(*tasks) │ │ └ [<coroutine object Handler.notify at 0x7f82a963c640>] │ └ <function gather at 0x7f82a6a11700> └ <module 'asyncio' from '/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/asyncio/init.py'> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.update.Update object at 0x7f82a949adf0>,) │ └ <bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f82a87ddee0>> └ Handler.HandlerObj(handler=<bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7... File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 259, in process_update return await self.message_handlers.notify(update.message) │ │ │ │ └ <aiogram.types.fields.Field object at 0x7f82a82bf340> │ │ │ └ <aiogram.types.update.Update object at 0x7f82a949adf0> │ │ └ <function Handler.notify at 0x7f82a836e160> │ └ <aiogram.dispatcher.handler.Handler object at 0x7f82a88094f0> └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f82a87ddee0> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.message.Message object at 0x7f82a96588e0>,) │ └ <function admin_command at 0x7f82a96411f0> └ Handler.HandlerObj(handler=<function admin_command at 0x7f82a96411f0>, spec=FullArgSpec(args=['message'], varargs=None, varkw...

    File "/Users/hd/work/WangWangBot/WangWangBot/handlers/users/admin.py", line 25, in admin_command msg, reply_markup = get_top_services_msg() └ <function get_top_services_msg at 0x7f82a8b75550>

    File "/Users/hd/work/WangWangBot/WangWangBot/handlers/users/admin.py", line 14, in get_top_services_msg services = docker.check_dir_service_list(Config.DOCKER_COMPOSE_DIR) │ │ │ └ '/Users/hd/work/WangWangBot/' │ │ └ <class 'WangWangBot.config.Config'> │ └ <function check_dir_service_list at 0x7f82a963aa60> └ <module 'WangWangBot.utils.docker' from '/Users/hd/work/WangWangBot/WangWangBot/utils/docker.py'>

    File "/Users/hd/work/WangWangBot/WangWangBot/utils/docker.py", line 101, in check_dir_service_list project = get_project( └ <function get_project at 0x7f82a963a1f0>

    File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/compose/cli/command.py", line 152, in get_project client = get_client( └ <function get_client at 0x7f82a9634ca0> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/compose/cli/docker_client.py", line 41, in get_client client = docker_client( └ <function docker_client at 0x7f82a9634e50> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs) │ │ └ {'base_url': 'unix:///var/run/docker.sock', 'timeout': 60, 'user_agent': 'docker-compose/1.29.2 docker-py/5.0.0 Darwin/20.6.0'} │ └ 0 └ <class 'docker.api.client.APIClient'> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() │ │ └ <function APIClient._retrieve_server_version at 0x7f82a9298940> │ └ <docker.api.client.APIClient object at 0x7f82a9658b80> └ <docker.api.client.APIClient object at 0x7f82a9658b80> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( └ <class 'docker.errors.DockerException'>

    docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

    bug 
    opened by hdcola 0
Releases(1.0.2)
Owner
老房东的代码练习册
老房东的代码练习册
Converts between Spotify's new lyrics (and their proprietary format) to an LRC file for local playback.

spotify-lyrics-to-lrc Converts between Spotify's new lyrics (and their proprietary format) to an LRC file for local playback. How to use: Open Spotify

~noah~ 6 Nov 19, 2022
A telegram bot does not allow channels to send messages to the telegram supergroup

Channel Message Handler Getting started Installation $ git clone https://github.com/AbhijithNT/GroupChannelHandler.git Change directory $ cd ChannelMe

Abhijith N T 0 Dec 26, 2021
Chatbot with python code!

Chatbot Python Chatbot with python! How to Run Installation requirements. pip install -r requirements.txt Sample Chatbot The required files must be d

Mohammad Dori 3 Jul 15, 2022
⚡ ʑɠ ცơɬ Is One Of The Fastest & Smoothest Bot On Telegram Based on Telethon ⚡

『ʑɠ ცơɬ』 ⚡ ʑɠ ცơɬ Is One Of The Fastest & Smoothest Bot On Telegram Based on Telethon ⚡ Status Of Bot Telegram 🏪 Dєρℓογ το нєяοκυ Variables APP_ID =

ʑɑʑɓɦɑɪ 0 Feb 12, 2022
Telegram File to Link Fastest Bot , also used for movies streaming

Telegram File Stream Bot ! A Telegram bot to stream files to web. Report a Bug | Request Feature About This Bot This bot will give you stream links fo

Avishkar Patil 194 Jan 07, 2023
A Simple and User-Friendly Google Collab Notebook with UI to transfer your data from Mega to Google Drive.

Mega to Google Drive (UI Added! 😊 ) A Simple and User-Friendly Google Collab Notebook with UI to transfer your data from Mega to Google Drive. ⚙️ How

Dr.Caduceus 18 Aug 16, 2022
Archive tweets and make them searchable

Tweeter Archive and search your tweets and liked tweets using AWS Lambda, DynamoDB and Elasticsearch. Note: this project is primarily being used a tes

Kamil Sindi 8 Nov 18, 2022
Ditch Xiaomi's cloud and use a Telegram bot instead

Yi-Home_Telegram_Bot_Interface Ditch Xiaomi's cloud and use a Telegram bot instead Features Motion detection Works by monitoring a tmp file that is cr

Erli 10 Aug 18, 2022
Python lib for Embedly

embedly-python Python library for interacting with Embedly's API. To get started sign up for a key at embed.ly/signup. Install Install with Pip (recom

Embedly 80 Oct 05, 2022
Utilizing the freqtrade high-frequency cryptocurrency trading framework to build and optimize trading strategies. The bot runs nonstop on a Rasberry Pi.

Freqtrade Strategy Repository Please test all scripts and dry run them before using them in live mode Contact me on discord if you have any questions!

Michael Fourie 90 Jan 01, 2023
A module grouping multiple translation APIs

translatepy (originally: translate) An aggregation of multiple translation API Translate, transliterate, get the language of texts in no time with the

349 Jan 06, 2023
A fork of discord.py for anime enjoyers

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async and await

Senpai Development 4 Nov 05, 2021
A results generator and automatic token checker for Yandex Contest

Yandex contest Python checking tools A results generator and automatic token checker for Yandex Contest. Версия на русском языке Installation Clone th

Nikolay Chechulin 9 Dec 14, 2022
GBSLocalLauncher - A script to compose ENV file for Local Compose

GBSLocalLauncher This is a script to compose ENV file for Local Compose. It crea

2 Jan 27, 2022
Simple Similarities Service

simsity Simsity is a Super Simple Similarities Service[tm]. It's all about building a neighborhood. Literally! This repository contains simple tools t

vincent d warmerdam 95 Dec 25, 2022
Python Client for Instagram API

This project is not actively maintained. Proceed at your own risk! python-instagram A Python 2/3 client for the Instagram REST and Search APIs Install

Facebook Archive 2.9k Dec 30, 2022
Pythonic wrapper for the Aladhan prayer times API.

aladhan.py is a pythonic wrapper for the Aladhan prayer times API. Installation Python 3.6 or higher is required. To Install aladhan.py with pip: pip

HETHAT 8 Aug 17, 2022
Multi-purpose bot made with discord.py

PizzaHat Discord Bot A multi-purpose bot for your server! ℹ️ • Info PizzaHat is a multi-purpose bot, made to satisfy your needs, as well as your serve

DTS 28 Dec 16, 2022
A simple way to create a request to the coinpayment API with a valid HMAC using your private key and command

Coinpayments Verify TXID Created for Astral Discord bot A simple way to create a request to the coinpayment API with a valid HMAC using your private k

HellSec 1 Nov 07, 2022
Want to play What Would Rather on your Server? Invite the bot now! 😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

FSP Gang s' YT 3 Oct 18, 2021