Example #1
0
async def _(bot: Bot, event: Event, state: T_State):
    v = "default"
    if event.__getattribute__('group_id') is None:
        event.__delattr__('group_id')
    else:
        group_dict = poke_dict[event.__getattribute__('group_id')]
        group_dict[event.sender_id] += 1
        v = await invoke_poke(event.group_id, event.sender_id)
        if v == "disabled":
            await poke.finish()
            return
    r = randint(1, 14)
    if r == 1 or v == "limited":
        await poke.send(
            Message([{
                "type": "poke",
                "data": {
                    "qq": f"{event.sender_id}"
                }
            }]))
    elif r == 2:
        await poke.send(Message('妈你戳'))
    elif r == 3:
        url = await get_jlpx('戳', '你妈', '闲着没事干')
        await poke.send(Message([{"type": "image", "data": {"file": url}}]))
    elif r == 4:
        img_p = Image.open(path)
        draw_text(img_p, '戳你妈', 0)
        draw_text(img_p, '有尝试过玩Cytus II吗', 400)
        await poke.send(
            Message([{
                "type": "image",
                "data": {
                    "file":
                    f"base64://{str(image_to_base64(img_p), encoding='utf-8')}"
                }
            }]))
    elif r == 5:
        await poke.send(Message('呜呜呜再戳人家要哭哭了啦'))
    elif r <= 7:
        await poke.send(
            Message([{
                "type": "image",
                "data": {
                    "file":
                    f"https://www.diving-fish.com/images/poke/{r - 5}.gif",
                }
            }]))
    elif r <= 12:
        await poke.send(
            Message([{
                "type": "image",
                "data": {
                    "file":
                    f"https://www.diving-fish.com/images/poke/{r - 7}.jpg",
                }
            }]))
    else:
        await poke.send(Message('戳你妈'))
Example #2
0
async def _(bot: Bot, event: Event, state: T_State):
    if event.__getattribute__('group_id') is None:
        event.__delattr__('group_id')
    await poke.send(
        Message([{
            "type": "poke",
            "data": {
                "qq": f"{event.sender_id}"
            }
        }]))