Commit 7aef8ce8 authored by Jens Langhammer's avatar Jens Langhammer

fix escaped query not being used...

parent 51d7db20
......@@ -29,9 +29,7 @@ class ARKCog:
def escape_query(self, query) -> str:
"""Escape mentions from queries"""
if '@' in query:
return ''
return query
return query.replace('<', '\<').replace('>', '\>')
@commands.command()
async def ark(self, query: str, field_to_return: str = None):
......@@ -49,12 +47,12 @@ class ARKCog:
"""
escaped_query = self.escape_query(query)
# Check special queries first
if query in self.special_queries:
await self.bot.say(self.special_queries[query])
if escaped_query in self.special_queries:
await self.bot.say(self.special_queries[escaped_query])
return
cpu_data = ARKCog.do_lookup(query)
cpu_data = ARKCog.do_lookup(escaped_query)
if not cpu_data:
await self.bot.say("I couldn't find anything matching `%s`" % query)
await self.bot.say("I couldn't find anything matching `%s`" % escaped_query)
return
fields = ['ProductName', 'ClockSpeed', 'ClockSpeedMax',
'CoreCount', 'ThreadCount', 'VTD', 'AESTech']
......@@ -63,7 +61,7 @@ class ARKCog:
# Create embedded message
embed = Embed(title="ARK Search Result",
description="Query was `%s`" % query,
description="Query was `%s`" % escaped_query,
color=0x0071c5)
for field in fields:
embed.add_field(name=field, value=cpu_data[field])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment