Skip to content

Module nonebot_plugin_marshoai.plugins_test.random_number_generator


@on_function_call(description='生成随机数').params(count=Integer(description='随机数的数量'))

async func generate_random_numbers(count: int) -> str

Source code or View on GitHub
python
@on_function_call(description='生成随机数').params(count=Integer(description='随机数的数量'))
async def generate_random_numbers(count: int) -> str:
    random_numbers = [random.randint(1, 100) for _ in range(count)]
    return f"生成的随机数为: {', '.join(map(str, random_numbers))}"

@on_function_call(description='重载测试')

func test_reload()

Source code or View on GitHub
python
@on_function_call(description='重载测试')
def test_reload():
    return 1

The document is being improved. Suggestions are welcome.