Update dbrand commands
This commit is contained in:
parent
452835aa54
commit
c97ab24e8b
1 changed files with 8 additions and 8 deletions
|
@ -516,7 +516,7 @@ class DbrandCog(commands.Cog):
|
|||
self.bot = bot
|
||||
self.base_url = "https://dbrand.com/"
|
||||
|
||||
@commands.group(name="db", pass_context=True)
|
||||
@commands.group(name="db", aliases=["dbrand"], pass_context=True)
|
||||
async def _db(self, ctx):
|
||||
if ctx.invoked_subcommand is None:
|
||||
await ctx.send(
|
||||
|
@ -538,13 +538,11 @@ class DbrandCog(commands.Cog):
|
|||
|
||||
@_db.command(name="shipping")
|
||||
async def _shipping(self, ctx, *, search: str):
|
||||
if not re.match(search, r"^[A-Z-]+$", re.IGNORECASE):
|
||||
if not re.match(r"^[A-Z- ]+$", search, re.IGNORECASE):
|
||||
await ctx.send("Please use text to search for shipping.")
|
||||
search = "-".join(search.split(" "))
|
||||
matches = [
|
||||
x
|
||||
for x in DBRAND_DATA["shippingArray"]
|
||||
if x.contains(search.lower())
|
||||
x for x in DBRAND_DATA["shippingArray"] if search.lower() in x
|
||||
]
|
||||
if len(matches) > 0:
|
||||
link = self.base_url + "/shipping/" + matches[0]
|
||||
|
@ -555,10 +553,12 @@ class DbrandCog(commands.Cog):
|
|||
+ "(https://dbrand.com/shipping)",
|
||||
color="#FFBB00",
|
||||
url=link,
|
||||
image="https://upload.wikimedia.org/wikipedia/commons/thumb"
|
||||
+ "/b/b4/Dbrand_logo.svg/2560px-Dbrand_logo.svg.png",
|
||||
thumbnail="https://dev.zevaryx.com/db_logo.png",
|
||||
)
|
||||
embed.set_image(
|
||||
"https://upload.wikimedia.org/wikipedia/commons/thumb"
|
||||
+ "/b/b4/Dbrand_logo.svg/2560px-Dbrand_logo.svg.png"
|
||||
)
|
||||
embed.set_thumbnail("https://dev.zevaryx.com/db_logo.png")
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue