TranxCraft / iTranxCraft

The Rewrite Of TranxCraft - a custom plugin that does many wonderful things.
3 stars 1 forks source link

Enhance Announcer #44

Closed Fyrsta closed 9 years ago

Fyrsta commented 9 years ago

The ability to use variables in the announcer would be a welcomed feature. For example, you could use {%lottery_date%} to inject the date of the next lottery into an announcement, which would enhance #23.

Obviously we'd need to come up with a variable structure that would be easy to use and won't cause problems. The announcer should be able to be managed through the admin panel, so @Kent55's thoughts here would be good.

Another thing would be to dynamically create variables for use in the plugin, however this would most likely cause errors as it wouldn't be the best of ways (reflection, most likely) to get the contents of the variable and use it in announcements. It would be far easier to have a link to GitHub on the panel where a feature could be requested and it goes through a bot account.

An example message from the bot on GitHub could be: Name: {Name of requester} Variable: {Variable} Use of variable: {The use of the variable, e.g. the date of the next lottery}

This would require a good amount of work from @Kent55, though. I'm not familiar with the GitHub API. I guess if we were to integrate this the ability to link the users GitHub account would be useful.

Kent55 commented 9 years ago

@WickedGamingUK I like the idea but what's the purpose of dynamically creating them?

Fyrsta commented 9 years ago

@Kent55 What do you mean dynamically creating them? The purpose of this is so you can create an announcement that runs every so often with data from the server.

For example, you could have an annoucement like the following: "Make sure to join this weeks lottery where the winner is drawn on {%lottery_date%}"

This when ran would be changed to something like the following: "Make sure to join this weeks lottery where the winner is drawn on Saturday 20th"

Not the best of texts, but it demonstrates the use of this.

If you were on about the dynamic creation of variables, it's not really a good idea like I said. A link into GitHub to create variable requests would be far better if it's possible for you to do easily.

Kent55 commented 9 years ago

@WickedGamingUK I understand what they are, I've used this in templating numerous times. I just didn't see what you were thinking when you said: "Another thing would be to dynamically create variables for use in the plugin". What do you mean by this?

Fyrsta commented 9 years ago

@Kent55 Oh, that. Basically a way to define a variable for use in announcements. This would be quite difficult to implement successfully into the plugin and will undoubtedly cause errors down the road. I don't think it's a good idea.

I think a link in the admin panel to GitHub would be a good idea. Is this something you could do?

Kent55 commented 9 years ago

@WickedGamingUK Yeah definitely, I'll talk to you in person to get an idea of exactly what you want.

Fyrsta commented 9 years ago

@Kent55 Great, thanks.