Getting rid of Enso specific channel restrictions

Rest well my prince
pull/8/head
sgoudham 4 years ago
parent d368173c31
commit 3b21b0b0f5

@ -1,4 +1,3 @@
import asyncio
import datetime import datetime
import random import random
@ -7,7 +6,6 @@ from discord.ext import commands
from discord.ext.commands import cooldown, command, BucketType from discord.ext.commands import cooldown, command, BucketType
import db import db
import settings
from settings import colour_list, enso_ensochancommands_Mention from settings import colour_list, enso_ensochancommands_Mention
@ -74,9 +72,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the kissing gifs # Open the file containing the kissing gifs
with open('images/FunCommands/kissing.txt') as file: with open('images/FunCommands/kissing.txt') as file:
# Store content of the file in kissing_array # Store content of the file in kissing_array
@ -96,16 +91,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -152,9 +137,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the cuddling gifs # Open the file containing the cuddling gifs
with open('images/FunCommands/cuddling.txt') as file: with open('images/FunCommands/cuddling.txt') as file:
# Store content of the file in cuddling_array # Store content of the file in cuddling_array
@ -174,16 +156,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -200,9 +172,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the killing gifs # Open the file containing the killing gifs
with open('images/FunCommands/killing.txt') as file: with open('images/FunCommands/killing.txt') as file:
# Store content of the file in killing_array # Store content of the file in killing_array
@ -222,16 +191,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -248,9 +207,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the cuddling gifs # Open the file containing the cuddling gifs
with open('images/FunCommands/slapping.txt') as file: with open('images/FunCommands/slapping.txt') as file:
# Store content of the file in cuddling_array # Store content of the file in cuddling_array
@ -270,16 +226,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -296,9 +242,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the patting gifs # Open the file containing the patting gifs
with open('images/FunCommands/patting.txt') as file: with open('images/FunCommands/patting.txt') as file:
# Store content of the file in patting_array # Store content of the file in patting_array
@ -318,16 +261,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -348,9 +281,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Get the member and the userAvatar # Get the member and the userAvatar
member, userAvatar = getMember(ctx) member, userAvatar = getMember(ctx)
@ -365,16 +295,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -390,10 +310,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the choking gifs # Open the file containing the choking gifs
with open('images/FunCommands/choking.txt') as file: with open('images/FunCommands/choking.txt') as file:
# Store content of the file in choking_array # Store content of the file in choking_array
@ -413,16 +329,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
@ -439,9 +345,6 @@ class interactive(commands.Cog):
# Surround with try/except to catch any exceptions that may occur # Surround with try/except to catch any exceptions that may occur
try: try:
# If the channel that the command has been sent is in the list of accepted channels
if str(ctx.channel) in settings.channels:
# Open the file containing the hug gifs # Open the file containing the hug gifs
with open('images/FunCommands/hugging.txt') as file: with open('images/FunCommands/hugging.txt') as file:
# Store content of the file in hugging_array # Store content of the file in hugging_array
@ -461,16 +364,6 @@ class interactive(commands.Cog):
# Send the embedded message to the user # Send the embedded message to the user
await ctx.send(embed=embed) await ctx.send(embed=embed)
# else the command is sent in an invalid channel
else:
# Call error_function() and display it to the user
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)

Loading…
Cancel
Save