Revert "[Away] Set delete_after with a minimum of 5s (#210)" (#211)

This reverts commit efe32dda52.
This commit is contained in:
aikaterna
2021-02-19 11:34:24 -08:00
committed by GitHub
parent efe32dda52
commit ae36d3b48c

View File

@@ -242,11 +242,6 @@ class Away(commands.Cog):
embed_links = message.channel.permissions_for(guild.me).embed_links
away_msg = user_data["MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if away_msg[1] < 5:
await self.config.user(author).MESSAGE.set((away_msg[0], 5))
away_msg = away_msg[0], 5
if away_msg:
if type(away_msg) in [tuple, list]:
# This is just to keep backwards compatibility
@@ -261,10 +256,6 @@ class Away(commands.Cog):
await message.channel.send(msg, delete_after=delete_after)
continue
idle_msg = user_data["IDLE_MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if idle_msg[1] < 5:
await self.config.user(author).IDLE_MESSAGE.set((idle_msg[0], 5))
idle_msg = idle_msg[0], 5
if idle_msg and author.status == discord.Status.idle:
if type(idle_msg) in [tuple, list]:
idle_msg, delete_after = idle_msg
@@ -278,10 +269,6 @@ class Away(commands.Cog):
await message.channel.send(msg, delete_after=delete_after)
continue
dnd_msg = user_data["DND_MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if dnd_msg[1] < 5:
await self.config.user(author).DND_MESSAGE.set((dnd_msg[0], 5))
dnd_msg = dnd_msg[0], 5
if dnd_msg and author.status == discord.Status.dnd:
if type(dnd_msg) in [tuple, list]:
dnd_msg, delete_after = dnd_msg
@@ -295,10 +282,6 @@ class Away(commands.Cog):
await message.channel.send(msg, delete_after=delete_after)
continue
offline_msg = user_data["OFFLINE_MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if offline_msg[1] < 5:
await self.config.user(author).OFFLINE_MESSAGE.set((offline_msg[0], 5))
offline_msg = offline_msg[0], 5
if offline_msg and author.status == discord.Status.offline:
if type(offline_msg) in [tuple, list]:
offline_msg, delete_after = offline_msg
@@ -312,10 +295,6 @@ class Away(commands.Cog):
await message.channel.send(msg, delete_after=delete_after)
continue
streaming_msg = user_data["STREAMING_MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if streaming_msg[1] < 5:
await self.config.user(author).STREAMING_MESSAGE.set((streaming_msg[0], 5))
streaming_msg = streaming_msg[0], 5
if streaming_msg and type(author.activity) is discord.Streaming:
streaming_msg, delete_after = streaming_msg
if embed_links and not guild_config["TEXT_ONLY"]:
@@ -338,10 +317,6 @@ class Away(commands.Cog):
await message.channel.send(msg, delete_after=delete_after)
continue
listening_msg = user_data["LISTENING_MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if listening_msg[1] < 5:
await self.config.user(author).LISTENING_MESSAGE.set((listening_msg[0], 5))
listening_msg = listening_msg[0], 5
if listening_msg and type(author.activity) is discord.Spotify:
listening_msg, delete_after = listening_msg
if embed_links and not guild_config["TEXT_ONLY"]:
@@ -364,10 +339,6 @@ class Away(commands.Cog):
await message.channel.send(msg, delete_after=delete_after)
continue
gaming_msgs = user_data["GAME_MESSAGE"]
# Convert possible `delete_after` of < 5s of before PR#210
if gaming_msgs[1] < 5:
await self.config.user(author).GAME_MESSAGE.set((gaming_msgs[0], 5))
gaming_msgs = gaming_msgs[0], 5
if gaming_msgs and type(author.activity) in [discord.Game, discord.Activity]:
for game in gaming_msgs:
if game in author.activity.name.lower():
@@ -401,12 +372,9 @@ class Away(commands.Cog):
"""
Tell the bot you're away or back.
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).MESSAGE()
if mess:
@@ -425,12 +393,9 @@ class Away(commands.Cog):
"""
Set an automatic reply when you're idle.
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).IDLE_MESSAGE()
if mess:
@@ -449,12 +414,9 @@ class Away(commands.Cog):
"""
Set an automatic reply when you're offline.
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).OFFLINE_MESSAGE()
if mess:
@@ -473,12 +435,9 @@ class Away(commands.Cog):
"""
Set an automatic reply when you're dnd.
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).DND_MESSAGE()
if mess:
@@ -497,12 +456,9 @@ class Away(commands.Cog):
"""
Set an automatic reply when you're streaming.
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).STREAMING_MESSAGE()
if mess:
@@ -521,12 +477,9 @@ class Away(commands.Cog):
"""
Set an automatic reply when you're listening to Spotify.
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).LISTENING_MESSAGE()
if mess:
@@ -543,14 +496,11 @@ class Away(commands.Cog):
Set an automatic reply when you're playing a specified game.
`game` The game you would like automatic responses for
`delete_after` Optional seconds to delete the automatic reply. Must be minimum 5 seconds
`delete_after` Optional seconds to delete the automatic reply
`message` The custom message to display when you're mentioned
Use "double quotes" around a game's name if it is more than one word.
"""
if delete_after < 5:
return await ctx.send("Please set a time longer than 5 seconds for the `delete_after` argument")
author = ctx.message.author
mess = await self.config.user(author).GAME_MESSAGE()
if game.lower() in mess: