adding green border to greentext and setting some defaults for generate_embed method
This commit is contained in:
parent
f8b92ee4c8
commit
b536ec8e5a
@ -68,24 +68,26 @@ async def on_message(message):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def generate_embed(embed_url, embed_title=None, embed_description=None):
|
def generate_embed(embed_url=None, embed_title=None, embed_description=None, embed_color=None):
|
||||||
"""
|
"""
|
||||||
generate_embed(embed_url, embed_title=None, embed_description=None)
|
generate_embed(embed_url=None, embed_title=None, embed_description=None, embed_color=None)
|
||||||
|
|
||||||
Generates a discord embed object based on the URL passed in
|
Generates a discord embed object based on the URL passed in
|
||||||
Optionally, you can set the title and description text for the embed object.
|
Optionally, you can set the title and description text for the embed object.
|
||||||
"""
|
"""
|
||||||
image = embed_url
|
|
||||||
|
|
||||||
if not embed_description:
|
if not embed_description and embed_url:
|
||||||
embed_description="[Direct Link]({})".format(image)
|
embed_description="[Direct Link]({})".format(embed_url)
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=embed_title,
|
title=embed_title,
|
||||||
description=embed_description,
|
description=embed_description,
|
||||||
|
color=embed_color,
|
||||||
type='rich'
|
type='rich'
|
||||||
)
|
)
|
||||||
embed.set_image(url=image)
|
if embed_url:
|
||||||
|
embed.set_image(url=embed_url)
|
||||||
|
|
||||||
return embed
|
return embed
|
||||||
|
|
||||||
|
|
||||||
@ -203,7 +205,11 @@ async def on_message(message):
|
|||||||
if message.content.startswith('!greentext'):
|
if message.content.startswith('!greentext'):
|
||||||
await client.send_message(
|
await client.send_message(
|
||||||
message.channel,
|
message.channel,
|
||||||
embed=generate_embed(embed_url=get_from_reddit.get_image(boards='greentext'))
|
embed=generate_embed(
|
||||||
|
embed_title='>implying',
|
||||||
|
embed_color=discord.Color.green(),
|
||||||
|
embed_url=get_from_reddit.get_image(boards='greentext')
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if message.content.startswith('!help'):
|
if message.content.startswith('!help'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user