汪汪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
老房东的代码练习册
老房东的代码练习册
(@Tablada32BOT is my bot in twitter) This is a simple bot, its main and only function is to reply to tweets where they mention their bot with their @

Remember If you are going to host your twitter bot on a page where they can read your code, I recommend that you create an .env file and put your twit

null 3 Jun 4, 2021
Simple bot to receive feedback,same as livegram bot but with more features & full control over bot

Kontak Simple bot to receive feedback,same as livegram bot but with more features & full control over bot Deploy to VPS

Mahin Ahmed 2 Dec 16, 2021
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Aran 1 Oct 13, 2021
Easy & powerful bot to check if your all Telegram bots are working or not. This bot status bot updates every 45 minutes & runs for 24x7 hours.

PowerfulBotStatus-IDN-C-X Easy & powerful bot to check if your all Telegram bots are working or not. This bot status bot updates every 45 minutes & ru

IDNCoderX 5 Oct 6, 2022
Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Based on python-aria-mirror-bot

- [ MAYBE UPDATE & ADD MORE MODULE ] Bagas Mirror&Leech Bot Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring file

null 4 Nov 23, 2021
Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar seu próprio token, e lembrando, é um bot básico, não se utiliza Cogs nem slash commands nele!

BotDiscordPython Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar s

Matheus Muguet 4 Feb 5, 2022
Sunflower-farmers-automated-bot - Sunflower Farmers NFT Game automated bot.IT IS NOT a cheat or hack bot

Sunflower-farmers-auto-bot Sunflower Farmers NFT Game automated bot.IT IS NOT a

Arthur Alves 17 Nov 9, 2022
A Telegram Bot with(Forwarder Bot + User Bot + More Features )

A Telegram Bot with(Forwarder Bot + User Bot + More Features )

Kaif 3 Feb 16, 2022
Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-reddit-bot

Ace Attorney twitter Bot Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-

Luis Mayo Valbuena 542 Dec 17, 2022
null 471 Dec 24, 2022