Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrieve event value problem #42

Closed
UsainSrht opened this issue May 16, 2022 · 4 comments
Closed

retrieve event value problem #42

UsainSrht opened this issue May 16, 2022 · 4 comments

Comments

@UsainSrht
Copy link

I didn't test on other events but retrieving the "author" value in message delete event returns the member that the bot retrieved first.

For example when I load the bot
X deletes a message and the bot logs the deleted message and says X's message was deleted
Y deletes his message and the bot says X's message was deleted
Z deletes his message bot says X's message was deleted

My code:

on message delete:
	retrieve event-value "author" and store it in {_author}
	make new embed:
		set title of embed to "Deleted Message"
		add inline field named "Author" with value "%mention tag of {_author}%" to embed
		add inline field named "Deleter" with value "x" to embed
		add inline field named "channel" with value (mention tag of event-channel) to embed
		add field named "Msg" with value event-string to embed
	post (last created embed) to (channel with id "id")

Disky version 4.0beta2
MC version 1.18.2
skript version 2.6.1

@ItsTheSky
Copy link
Member

This is a limitation of discord, unfortunately;
The retrieve author will retrieve the last user logged in the guild's logs. If the timings are bad & another action is logged right before your message deletion, the effect will store this user and not the right one. There's no real way to get the message's deletion author, I'm just trying to make it more simple for you.
I'll search for a fix, but still, I think it's almost impossible to.

@UsainSrht
Copy link
Author

This is a limitation of discord, unfortunately; The retrieve author will retrieve the last user logged in the guild's logs. If the timings are bad & another action is logged right before your message deletion, the effect will store this user and not the right one. There's no real way to get the message's deletion author, I'm just trying to make it more simple for you. I'll search for a fix, but still, I think it's almost impossible to.

I know but I wasn't talking about deleter of the message. I was talking about author of deleted message

@ItsTheSky
Copy link
Member

Then you're using the wrong syntax. Check for author of expression.

@UsainSrht
Copy link
Author

Then you're using the wrong syntax. Check for author of expression.

author of expression requires a message but there is no message in message delete event?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants