Ejemplo n.º 1
0
async def _(bot: Bot, event: PokeNotifyEvent):
    # msg = choice([
    #     "你再戳!", "?再戳试试?", "别戳了别戳了再戳就坏了555", "我爪巴爪巴,球球别再戳了", "你戳你🐎呢?!",
    #     "那...那里...那里不能戳...绝对...", "(。´・ω・)ん?", "有事恁叫我,别天天一个劲戳戳戳!", "欸很烦欸!你戳🔨呢",
    #     "?", "差不多得了😅", "欺负咱这好吗?这不好", "我希望你耗子尾汁"
    # ])
    file = "file:///{0}/src/data/voices/miko-daily-023.mp3".format(os.getcwd())
    await poke.finish(MessageSegment.record(file))
Ejemplo n.º 2
0
async def _(bot: Bot, event: Event, state: T_State):
    print(os.getcwd())
    # await test.send(MessageSegment.record(file="miko-daily-023.mp3"))
    # with open("./src/plugins/test/data/miko-daily-023.mp3", "rb") as file:
    #     data = b64encode(file.read()).decode()
    #     await test.send(f"[CQ:record,file=base64://{data}]")
    await test.send(
        MessageSegment.record("file:///{0}/data/miko-daily-023.mp3".format(
            os.path.abspath(os.path.dirname(__file__)))))
Ejemplo n.º 3
0
async def _poke(bot: Bot, event: Event, state: dict) -> None:
    if (event.notice_type == 'notify' and event.target_id == event.self_id):
        files = os.listdir('./voice')
        voice_name = get_random_reply(files)

        sys = platform.system()
        if sys == "Windows":
            voice_file = os.getcwd() + '\\voice\\' + voice_name
        elif sys == "Linux":
            voice_file = os.getcwd() + '/voice/' + voice_name
        voice_reply = MessageSegment.record(file='file:///' + voice_file)

        text = voice_name.split('_')[2]

        # test_file='file:///D:\\Projects\\QQbot\\ChristinaQQbot\\voice\\t.amr'
        # test_reply=MessageSegment.record(file=test_file,magic=0)
        # await bot.send_msg(group_id=event.group_id,message=test_reply)

        await bot.send_msg(group_id=event.group_id, message=voice_reply)
        await bot.send_msg(group_id=event.group_id, message=text)
Ejemplo n.º 4
0
async def handle_rest(bot: Bot):
    await rest.finish(MessageSegment.record(get_record_url("rest")))
Ejemplo n.º 5
0
async def handle_sleep(bot: Bot):
    await sleep.finish(MessageSegment.record(get_record_url("sleep")))