retire les espaces en trop dans les commandes avis et remind
This commit is contained in:
parent
8a4cefb6ef
commit
a07edd5155
1 changed files with 8 additions and 1 deletions
|
@ -312,7 +312,7 @@ class Utils(commands.Cog):
|
|||
return stringMessage
|
||||
|
||||
def _cleanCodeStringWithMention(self, string):
|
||||
string = f"`{string}`"
|
||||
string = f"`{self._removeStartEndSpacesString(string)}`"
|
||||
findedMention = self._getMentionInString(string)
|
||||
for i in range(0, len(findedMention)):
|
||||
string = string.replace(findedMention[i], f"`{findedMention[i]}`") # conserve la mention dans le message
|
||||
|
@ -329,6 +329,13 @@ class Utils(commands.Cog):
|
|||
findedMention = list(dict.fromkeys(findedMention)) # suppression doublon de mention
|
||||
return findedMention
|
||||
|
||||
def _removeStartEndSpacesString(self, string):
|
||||
while string.startswith(" "):
|
||||
string = string[1:]
|
||||
while string.endswith(" "):
|
||||
string = string[:-1]
|
||||
return string
|
||||
|
||||
@commands.command(name='sondage')
|
||||
async def _sondage(self, ctx, *args):
|
||||
"""Fais un sondage.\n ➡ Syntaxe: .sondage "<Question>" "<Proposition1>" "<Proposition...>" "<Proposition20>" """
|
||||
|
|
Reference in a new issue