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.bot = bot
|
||||||
self.base_url = "https://dbrand.com/"
|
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):
|
async def _db(self, ctx):
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
|
@ -538,13 +538,11 @@ class DbrandCog(commands.Cog):
|
||||||
|
|
||||||
@_db.command(name="shipping")
|
@_db.command(name="shipping")
|
||||||
async def _shipping(self, ctx, *, search: str):
|
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.")
|
await ctx.send("Please use text to search for shipping.")
|
||||||
search = "-".join(search.split(" "))
|
search = "-".join(search.split(" "))
|
||||||
matches = [
|
matches = [
|
||||||
x
|
x for x in DBRAND_DATA["shippingArray"] if search.lower() in x
|
||||||
for x in DBRAND_DATA["shippingArray"]
|
|
||||||
if x.contains(search.lower())
|
|
||||||
]
|
]
|
||||||
if len(matches) > 0:
|
if len(matches) > 0:
|
||||||
link = self.base_url + "/shipping/" + matches[0]
|
link = self.base_url + "/shipping/" + matches[0]
|
||||||
|
@ -555,10 +553,12 @@ class DbrandCog(commands.Cog):
|
||||||
+ "(https://dbrand.com/shipping)",
|
+ "(https://dbrand.com/shipping)",
|
||||||
color="#FFBB00",
|
color="#FFBB00",
|
||||||
url=link,
|
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)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue