further updates to messages again
This commit is contained in:
parent
00ab8089b9
commit
5568a1dc75
@ -55,15 +55,22 @@ async def check_suggestions_to_delete():
|
||||
msgs_history = channel.history()
|
||||
j1 = await msgs_history.flatten()
|
||||
status_msg = "STATUS: No admin interested yet (mark with an emote to prevent suggestion deletion within 48 hours)"
|
||||
status = 'STATUS:'
|
||||
suggestion = 'SUGGESTION:'
|
||||
for msg in j1:
|
||||
if len(msg.reactions) == 0:
|
||||
created_at = msg.created_at
|
||||
if created_at < datetime.datetime.now()-datetime.timedelta(days=2):
|
||||
print('deleting message: ', msg.content)
|
||||
await msg.delete()
|
||||
elif status_msg in msg.content:
|
||||
first_part = msg.content.split(status_msg)[0]
|
||||
last_part = msg.content.split(status_msg)[1]
|
||||
else:
|
||||
first_part = msg.content.split(status)[0]
|
||||
last_part = msg.content.split(suggestion)[1]
|
||||
final_msg = f'{first_part}{status_msg}\n{suggestion}{last_part}'
|
||||
await msg.edit(content=final_msg)
|
||||
elif status in msg.content:
|
||||
first_part = msg.content.split(status)[0]
|
||||
last_part = msg.content.split(suggestion)[1]
|
||||
user_reactions = []
|
||||
for react in msg.reactions:
|
||||
users = react.users()
|
||||
@ -71,7 +78,7 @@ async def check_suggestions_to_delete():
|
||||
for user in j2:
|
||||
if user.name not in user_reactions:
|
||||
user_reactions.append(user.name)
|
||||
final_msg = f'{first_part}STATUS: Admins interested in topic:{user_reactions} {last_part}'
|
||||
final_msg = f'{first_part}STATUS: Admins interested in topic:{user_reactions}\n{suggestion}{last_part}'
|
||||
await msg.edit(content=final_msg)
|
||||
|
||||
#the entire syntax that is visisble from python3 terminal is not very well displayed in the docs of discord.py and nobody has the current syntax in any suggestions anywhere on the internet. almost every single thing is out of date reee
|
||||
|
Loading…
Reference in New Issue
Block a user