汪汪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
老房东的代码练习册
老房东的代码练习册
A python Discord wrapper made in well, python.

discord.why A python Discord wrapper made in well, python. Made to be used by devs who want something a bit more, general. Basic Examples Sending a me

HellSec 6 Mar 26, 2022
Free and Open Source Channel/Group Voice chat music player for telegram ❤️ with button support Heroku Commands

ZeusMusic Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.7 or higher PyTgCalls MongoDB 2nd Telegram Account (needed for userbot) 🧪 Get SESSION

ZeusNetwork 4 Jan 03, 2022
Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

Aaron DeVera 2 May 11, 2022
Public release of Telepathy, an OSINT toolkit for investigating Telegram groups. Enhanced features and improvements will be added over time.

Telepathy Welcome to Telepathy, an OSINT toolkit for scraping Telegram data to help investigate shady goings on. Currently, the tool is limited to scr

Jordan Wildon 484 Jan 01, 2023
👾 Telegram Smart Group Assistant 🤖

DarkHelper 🌖 Features ⚡️ Smart anti-apam & anti-NFSW message checker Tag Members , Entertain facility , Welcommer ban , unban , mute , unmute , lock

amirali rajabi 38 Dec 18, 2022
Python version of PlaceNL's headless bot with automatic access token refresh

Reddit /r/place 2022 headless bot This headless Python bot will automatically login to reddit, obtain access tokens (and refreshes them when they expi

19 May 21, 2022
Easy to use Google Pub/Sub

Relé makes integration with Google PubSub straightforward and easy. Motivation and Features The Publish-Subscribe pattern and specifically the Google

Mercadona 188 Jan 06, 2023
A simple anti-ghostping python bot made using diskord.

Anti Ghostping A simple Anti-Ghostping python bot made with ❤ using Diskord Requirements No one will use this but, all you need for this bot is: Pytho

RyZe 2 Sep 12, 2022
Spotify Web API client for Python 3

Welcome to the GitHub repository of Tekore! We provide a client for the Spotify Web API for Python, complete with all available endpoints and authenti

Felix Hildén 186 Dec 22, 2022
Python wrappers for INHECO ODTC and SCILA libraries by INHECO GmbH.

Python wrappers for INHECO ODTC and SCILA libraries by INHECO GmbH.

1 Feb 09, 2022
A tool for creating credentials for accessing S3 buckets

s3-credentials A tool for creating credentials for accessing S3 buckets For project background, see s3-credentials: a tool for creating credentials fo

Simon Willison 138 Jan 06, 2023
Discord Bot Personnal Server - Ha-Neul

Haneul Bot, it's a discord for help me on my personnal discord, she do a lot of boring and repetitive stain. You can use on your own server if you want, you just need to find a host for the programm

Maxvyr 1 Feb 03, 2022
Python SDK for accessing the Hanko Authentication API

Hanko Authentication SDK for Python This package is maintained by Hanko. Contents Introduction Documentation Installation Usage Prerequisites Create a

Hanko.io 3 Mar 08, 2022
Userbot Telegram dengan Telethon

FLICKS - UBOT Repo FLICKS UBOT Repo Yang Dibuat Oleh Rizzz Dari beberapa Repo Yang Ada Di Github. Generate String Using Replit ⤵️ DEPLOY TO HEROKU Sup

FJ_GAMING 14 May 16, 2022
This is a story bot, that will scrape stories from r/stories subreddit and convert it into an Audio File.

Introduction This is a story bot, that will scrape stories from r/stories subreddit and convert it into an Audio File. Installation pip install -r req

Yasho 11 Jun 30, 2022
DaProfiler vous permet d'automatiser vos recherches sur des particuliers basés en France uniquement et d'afficher vos résultats sous forme d'arbre.

A but educatif seulement. DaProfiler DaProfiler vous permet de créer un profil sur votre target basé en France uniquement. La particularité de ce prog

Dalunacrobate 73 Dec 21, 2022
We propose the adversarial blur attack (ABA) against visual object tracking.

ABA We propose the adversarial blur attack (ABA) against visual object tracking. The ICCV link: https://arxiv.org/abs/2107.12085 and, https://openacce

Qing Guo 13 Dec 01, 2022
This script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin.

BOOKING IN BERLINS VACCINATION CENTERS This python script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin. T

17 Jan 13, 2022
This is a music bot for discord written in python

this is a music bot for discord written in python, it is designed for educational use ONLY, I do not take any responsibility for uses outside of educational use

5 Dec 24, 2021
API kumpulan doa-doa sesuai al-qur'an dan as-sunnah

API kumpulan doa-doa sesuai al-qur'an dan as-sunnah

Miftah Afina 4 Nov 26, 2022