Imported re for regex use
This commit is contained in:
parent
3deed243ce
commit
796ae55ffd
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from .utils import config
|
from .utils import config
|
||||||
from .utils import checks
|
from .utils import checks
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class Tags:
|
class Tags:
|
||||||
|
@ -35,8 +36,8 @@ class Tags:
|
||||||
"""Use this to add a new tag that can be used in this server
|
"""Use this to add a new tag that can be used in this server
|
||||||
Format to add a tag is !tag add <tag> - <result>"""
|
Format to add a tag is !tag add <tag> - <result>"""
|
||||||
try:
|
try:
|
||||||
tag = re.search("(.*) - (.*)",result).group(1).strip()
|
tag = re.search("(.*) - (.*)", result).group(1).strip()
|
||||||
tag_result = re.search("(.*) - (.*)",result).group(2).strip()
|
tag_result = re.search("(.*) - (.*)", result).group(2).strip()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
await self.bot.say("Please provide the format for the tag in: !tag add <tag> - <result>")
|
await self.bot.say("Please provide the format for the tag in: !tag add <tag> - <result>")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue