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

Put summary/reason text in footer instead of description #21

Open
rootslinux opened this issue Oct 25, 2018 · 1 comment
Open

Put summary/reason text in footer instead of description #21

rootslinux opened this issue Oct 25, 2018 · 1 comment

Comments

@rootslinux
Copy link

Hi. First of all, thank you very much for writing this extension. My project makes use of it and it is wonderful. I'm using the work you did here as inspiration for writing a very similar extension for phpBB. I have a suggestion to make that I feel would improve the notification format.

I'd like to suggest that the notifications would look nicer if you made use of the footer text in the embed object. This space is ideal for additional content such as delete reasons, article summaries, etc. that you currently include as part of the description. described here:

With everything jammed into just the description, it can look kind of messy sometimes. The footer text is a smaller font that is placed on a new line after the end of the description. The only downside that I've been able to find is that it seems the footer text is pretty much raw, unformatted text and you can't do things like create links in them like you can in the description text. (Although this can also be seen as a benefit, since you don't have to be as careful that user-generated content messes up the formatting in Discord).

This is just a suggestion, but it shouldn't be too difficult to implement. You just need to add an optional $footer argument in the push_discord_notify() function, and if it is present your post just needs to change slightly to include it. Of course you also need to modify all the different event functions to separate out what text goes in the description and what goes in the footer.

		if (isset($footer))
		{
			$post = sprintf('{"embeds": [{"color": "%d", "description" : "%s"}, "footer": {"text": "%s"}]}', $color, $message, $footer);
		}
		else {
			$post = sprintf('{"embeds": [{"color": "%d", "description" : "%s"}]}', $color, $message);
		}

You can see the format for a footer in a message here:
https://discordapp.com/developers/docs/resources/channel#embed-object

@kulttuuri
Copy link
Owner

Thanks! I'll have a look at this next week :)

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

No branches or pull requests

2 participants