You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bot pings itself when auto-archiving thread due to inactivity #968
When a help thread is inactive for more than 12 hrs, it's auto archived by a routine. During auto-archive it pings OP and sends some information about why the thread was closed. Ideally it would ping OP, but with transfer-feature help threads also contains Embed posted on behalf of OP by TJ-Bot. In that case, to auto-archive routine it seems as if author of post is Bot itself and hence the ping to itself.
Expected behavior
It should ping the effective author of post(if post contains an embed than find author of embed, otherwise just the author of thread is fine).
To Reproduce
Steps to reproduce the behavior:
Transfer a message using apps>transfer-feature from message context menu.
Wait for 12 hrs of inactivity for routine to trigger(if working on local machine, can change duration of inactivity from 12 hrs to a couple minutes and change that for routine time interval as well).
Screenshots
Additional context
Auto-archive(HelpThreadAutoArchiver.java) routine is inside features/help package.
if owner of thread is bot, get the embed from message that started this thread.
Then get the owner of that embed, that is the effective author of post and should be used to ping.
HelpThreadAutoArchiver.java:133 -> .retrieveMemberById(threadChannel.getOwnerIdLong())//retrives owner of thread .flatMap(author -> threadChannel.sendMessage(author.getAsMention()).addEmbeds(embed))//pings that owner
Activity
Zabuzard commentedon Nov 26, 2023
@ankitsmt211 for a good first issue, please also mention the filenames/methods/lines in code to look at 👍
firasrg commentedon Nov 27, 2023
Could be a good start for me !