mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 10:02:23 +00:00
square 修复空格被吞问题
This commit is contained in:
parent
3304b60d1c
commit
485c2d6444
13
square.py
13
square.py
@ -3,13 +3,14 @@ from pagermaid.utils import alias_command
|
||||
|
||||
@listener(is_plugin=True, outgoing=True, command=alias_command("square"),
|
||||
description="生成文本矩形",
|
||||
parameters="<行> <列> <文本>")
|
||||
parameters="<文本> <行> <列>")
|
||||
async def square(context):
|
||||
if not len(context.parameter):
|
||||
if not len(context.parameter) > 2:
|
||||
await context.edit('出错了呜呜呜 ~ 参数错误。')
|
||||
return
|
||||
hang = context.parameter[0]
|
||||
lie = context.parameter[1]
|
||||
parameters = context.parameter[-2:]
|
||||
hang = parameters[0]
|
||||
lie = parameters[1]
|
||||
try:
|
||||
hang = int(hang)
|
||||
lie = int(lie)
|
||||
@ -19,9 +20,7 @@ async def square(context):
|
||||
if hang < 1 or lie < 1:
|
||||
await context.edit('出错了呜呜呜 ~ 参数错误。')
|
||||
return
|
||||
parameters = context.parameter
|
||||
del parameters[0]
|
||||
del parameters[0]
|
||||
parameters = [i for i in context.parameter if i not in parameters]
|
||||
text = " ".join(parameters)
|
||||
text *= lie
|
||||
text = text.strip()
|
||||
|
Loading…
Reference in New Issue
Block a user