Added skye to the ~enso command

pull/2/head
sgoudham 5 years ago
parent 6c5ba7d461
commit 2afb2304d2

@ -10,10 +10,6 @@ from discord.ext.commands import cooldown, BucketType
import config import config
from cogs.Embeds import error_function from cogs.Embeds import error_function
channels = ["enso-chan-commands"]
colour_list = [c for c in config.colors.values()]
class Waifus(commands.Cog): class Waifus(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
@ -23,18 +19,21 @@ class Waifus(commands.Cog):
@commands.command(aliases=['Kakashi']) @commands.command(aliases=['Kakashi'])
async def kakashi(self, ctx): async def kakashi(self, ctx):
# Surround with try/except to catch any exceptions that may occur
try: try:
with open('images/WaifuImages/kakashiImages.txt') as file: with open('images/WaifuImages/kakashiImages.txt') as file:
kakashi_array = file.readlines() kakashi_array = file.readlines()
if str(ctx.channel) in channels: # If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in config.channels:
# set member as the author # Set member as the author
member = ctx.message.author member = ctx.message.author
userAvatar = member.avatar_url userAvatar = member.avatar_url
embed = discord.Embed(title="**Hatake Kakashi**", colour=discord.Colour(random.choice(colour_list))) embed = discord.Embed(title="**Hatake Kakashi**",
colour=discord.Colour(random.choice(config.colour_list)))
embed.set_image(url=random.choice(kakashi_array)) embed.set_image(url=random.choice(kakashi_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
embed.timestamp = datetime.datetime.utcnow() embed.timestamp = datetime.datetime.utcnow()
@ -61,13 +60,15 @@ class Waifus(commands.Cog):
with open('images/WaifuImages/togaImages.txt') as file: with open('images/WaifuImages/togaImages.txt') as file:
toga_array = file.readlines() toga_array = file.readlines()
if str(ctx.channel) in channels: # If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in config.channels:
member = ctx.message.author # set member as the author # Set member as the author
member = ctx.message.author
userAvatar = member.avatar_url userAvatar = member.avatar_url
embed = discord.Embed(title="**Himiko Toga**", embed = discord.Embed(title="**Himiko Toga**",
colour=discord.Colour(int(random.choice(colour_list)))) colour=discord.Colour(int(random.choice(config.colour_list))))
embed.set_image(url=random.choice(toga_array)) embed.set_image(url=random.choice(toga_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
embed.timestamp = datetime.datetime.utcnow() embed.timestamp = datetime.datetime.utcnow()
@ -93,13 +94,14 @@ class Waifus(commands.Cog):
with open('images/WaifuImages/tamakiImages.txt') as file: with open('images/WaifuImages/tamakiImages.txt') as file:
tamaki_array = file.readlines() tamaki_array = file.readlines()
if str(ctx.channel) in channels: # If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in config.channels:
# set member as the author # set member as the author
member = ctx.message.author member = ctx.message.author
userAvatar = member.avatar_url userAvatar = member.avatar_url
embed = discord.Embed(title="**Tamaki Suoh**", colour=discord.Colour(random.choice(colour_list))) embed = discord.Embed(title="**Tamaki Suoh**", colour=discord.Colour(random.choice(config.colour_list)))
embed.set_image(url=random.choice(tamaki_array)) embed.set_image(url=random.choice(tamaki_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
embed.timestamp = datetime.datetime.utcnow() embed.timestamp = datetime.datetime.utcnow()
@ -126,7 +128,7 @@ class Waifus(commands.Cog):
'gria', 'lilu', 'marcus', 'eric', 'ifrah', 'gria', 'lilu', 'marcus', 'eric', 'ifrah',
'janet', 'connor', 'taz', 'ryder', 'ange', 'janet', 'connor', 'taz', 'ryder', 'ange',
'izzy', 'david', 'clarity', 'angel', 'chloe', 'izzy', 'david', 'clarity', 'angel', 'chloe',
'corona'] 'corona', 'skye']
if name: if name:
proper_name = name.lower() proper_name = name.lower()
@ -149,14 +151,15 @@ class Waifus(commands.Cog):
with open(f'images/ServerMembers/{random.choice(array)}.txt') as file: with open(f'images/ServerMembers/{random.choice(array)}.txt') as file:
array = file.readlines() array = file.readlines()
if str(ctx.channel) in channels: # If the channel that the command has been sent is in the list of accepted channels
# set member as the author if str(ctx.channel) in config.channels:
# Set member as the author
member = ctx.message.author member = ctx.message.author
userAvatar = member.avatar_url userAvatar = member.avatar_url
embed = discord.Embed( embed = discord.Embed(
title=f"Oh Look! A Cute Person <a:huh:676195228872474643> <a:huh:676195228872474643> ", title=f"Oh Look! A Cute Person <a:huh:676195228872474643> <a:huh:676195228872474643> ",
colour=discord.Colour(random.choice(colour_list))) colour=discord.Colour(random.choice(config.colour_list)))
embed.set_image(url=random.choice(array)) embed.set_image(url=random.choice(array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
embed.timestamp = datetime.datetime.utcnow() embed.timestamp = datetime.datetime.utcnow()
@ -164,14 +167,15 @@ class Waifus(commands.Cog):
def displayServerImage(array, ctx, name): def displayServerImage(array, ctx, name):
if str(ctx.channel) in channels: # If the channel that the command has been sent is in the list of accepted channels
# set member as the author if str(ctx.channel) in config.channels:
# Set member as the author
member = ctx.message.author member = ctx.message.author
userAvatar = member.avatar_url userAvatar = member.avatar_url
embed = discord.Embed( embed = discord.Embed(
title=f"**Oh Look! A Cute Picture of {name.capitalize()}!! <a:huh:676195228872474643> <a:huh:676195228872474643> **", title=f"**Oh Look! A Cute Picture of {name.capitalize()}!! <a:huh:676195228872474643> <a:huh:676195228872474643> **",
colour=discord.Colour(random.choice(colour_list))) colour=discord.Colour(random.choice(config.colour_list)))
embed.set_image(url=random.choice(array)) embed.set_image(url=random.choice(array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
embed.timestamp = datetime.datetime.utcnow() embed.timestamp = datetime.datetime.utcnow()

Loading…
Cancel
Save