mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 06:32:47 +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"),
|
@listener(is_plugin=True, outgoing=True, command=alias_command("square"),
|
||||||
description="生成文本矩形",
|
description="生成文本矩形",
|
||||||
parameters="<行> <列> <文本>")
|
parameters="<文本> <行> <列>")
|
||||||
async def square(context):
|
async def square(context):
|
||||||
if not len(context.parameter):
|
if not len(context.parameter) > 2:
|
||||||
await context.edit('出错了呜呜呜 ~ 参数错误。')
|
await context.edit('出错了呜呜呜 ~ 参数错误。')
|
||||||
return
|
return
|
||||||
hang = context.parameter[0]
|
parameters = context.parameter[-2:]
|
||||||
lie = context.parameter[1]
|
hang = parameters[0]
|
||||||
|
lie = parameters[1]
|
||||||
try:
|
try:
|
||||||
hang = int(hang)
|
hang = int(hang)
|
||||||
lie = int(lie)
|
lie = int(lie)
|
||||||
@ -19,9 +20,7 @@ async def square(context):
|
|||||||
if hang < 1 or lie < 1:
|
if hang < 1 or lie < 1:
|
||||||
await context.edit('出错了呜呜呜 ~ 参数错误。')
|
await context.edit('出错了呜呜呜 ~ 参数错误。')
|
||||||
return
|
return
|
||||||
parameters = context.parameter
|
parameters = [i for i in context.parameter if i not in parameters]
|
||||||
del parameters[0]
|
|
||||||
del parameters[0]
|
|
||||||
text = " ".join(parameters)
|
text = " ".join(parameters)
|
||||||
text *= lie
|
text *= lie
|
||||||
text = text.strip()
|
text = text.strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user