mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-05-18 19:32:29 +12:00
Fixed custom emojis, changed command name to [p]bify from [p]b
This commit is contained in:
parent
261e45f054
commit
0d0abcae30
|
@ -12,7 +12,7 @@ class Memeify(commands.Cog):
|
|||
self.bot = bot
|
||||
|
||||
@commands.command()
|
||||
async def b(self, ctx, *, content: str = None):
|
||||
async def bify(self, ctx, *, content: str = None):
|
||||
"""Replaces all B's with :b:'s"""
|
||||
if not content:
|
||||
msg_c = ""
|
||||
|
@ -35,6 +35,7 @@ class Memeify(commands.Cog):
|
|||
# emojis are a bit fucked tho
|
||||
def __bify(self, bify_str, cmd) -> str:
|
||||
mention = re.compile("^@|^#|^&")
|
||||
custom_emoji = re.compile("<:[^:]+:\d{18}>")
|
||||
bify = bify_str.split()
|
||||
# remove first letter if it bifys the command message itself
|
||||
if cmd:
|
||||
|
@ -44,7 +45,7 @@ class Memeify(commands.Cog):
|
|||
# no code blocks >:(
|
||||
i = i.replace("`", "")
|
||||
# special cases for custom emojis and mentions
|
||||
if i[0] == ":" and i[-1] == ":":
|
||||
if custom_emoji.search(i):
|
||||
b.append(i + " ")
|
||||
continue
|
||||
elif mention.match(i):
|
||||
|
|
Loading…
Reference in a new issue