-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加 cli 启动方式 上传至 PyPI
- Loading branch information
Showing
92 changed files
with
324 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,4 +97,15 @@ jobs: | |
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | ||
${{ secrets.DOCKER_USERNAME }}/bbot:dev | ||
${{ secrets.DOCKER_USERNAME }}/bbot:dev | ||
|
||
pypi: | ||
name: Upload to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prepare environment | ||
uses: actions/checkout@v2 | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
with: | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,15 @@ jobs: | |
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | ||
${{ secrets.DOCKER_USERNAME }}/bbot:latest | ||
${{ secrets.DOCKER_USERNAME }}/bbot:latest | ||
|
||
pypi: | ||
name: Upload to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prepare environment | ||
uses: actions/checkout@v2 | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
with: | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .cli import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import click | ||
|
||
|
||
@click.group() | ||
def main(): | ||
pass | ||
|
||
|
||
@click.command() | ||
def run(): | ||
from .bot import run | ||
|
||
run() | ||
|
||
|
||
main.add_command(run) | ||
|
||
|
||
main.commands["run"].help = "执行此命令运行 BBot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import sys | ||
import asyncio | ||
import contextlib | ||
|
||
from loguru import logger | ||
|
||
from ..bot import app | ||
from ..core.bot_config import BotConfig | ||
|
||
|
||
def run(): | ||
if BotConfig.master == 123456789 or BotConfig.Mirai.verify_key == "xxxxxxxxx": | ||
logger.critical("请先完成 BBot 配置") | ||
sys.exit(1) | ||
with contextlib.suppress(KeyboardInterrupt, asyncio.exceptions.CancelledError): | ||
app.launch_blocking() | ||
logger.info("BBot is shut down.") |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import graiax_bbot.function.command.add_talk | ||
import graiax_bbot.function.command.announcement | ||
import graiax_bbot.function.command.init | ||
import graiax_bbot.function.command.quit_group | ||
import graiax_bbot.function.command.status | ||
import graiax_bbot.function.command.video_resolve | ||
import graiax_bbot.function.command.vive_dynamic | ||
import graiax_bbot.function.command.admin.add | ||
import graiax_bbot.function.command.admin.remove | ||
import graiax_bbot.function.command.configure.atall | ||
import graiax_bbot.function.command.configure.nick | ||
import graiax_bbot.function.command.menu | ||
import graiax_bbot.function.command.subgroup.add_up | ||
import graiax_bbot.function.command.subgroup.add | ||
import graiax_bbot.function.command.subgroup.get_subgroup | ||
import graiax_bbot.function.command.subgroup.remove_up | ||
import graiax_bbot.function.command.subgroup.remove | ||
import graiax_bbot.function.command.up.get_subscribe | ||
import graiax_bbot.function.command.up.subscribe | ||
import graiax_bbot.function.command.up.unsubscribe | ||
import graiax_bbot.function.command.vip.add | ||
import graiax_bbot.function.command.vip.remove | ||
import graiax_bbot.function.command.whitelist.add | ||
import graiax_bbot.function.command.whitelist.close | ||
import graiax_bbot.function.command.whitelist.open | ||
import graiax_bbot.function.command.whitelist.remove | ||
import graiax_bbot.function.command.web_auth | ||
import graiax_bbot.function.event.bot_launch | ||
import graiax_bbot.function.event.exception | ||
import graiax_bbot.function.event.invited_join_group | ||
import graiax_bbot.function.event.join_group | ||
import graiax_bbot.function.event.leave_group | ||
import graiax_bbot.function.event.mute | ||
import graiax_bbot.function.event.offline | ||
import graiax_bbot.function.event.new_friend | ||
import graiax_bbot.function.event.prem_change | ||
import graiax_bbot.function.pusher.init | ||
import graiax_bbot.function.pusher.dynamic | ||
import graiax_bbot.function.pusher.live # noqa | ||
|
||
# import function.scheduler.refresh_token # noqa | ||
|
||
from loguru import logger | ||
|
||
logger.success("[function] 加载完成") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.