HotaruBlaze / TES3MP_DiscordRelay

Discord Relay for TES3MP!
5 stars 4 forks source link

Use Discordia API ? #2

Closed ghost closed 5 years ago

ghost commented 5 years ago

https://github.com/SinisterRectus/Discordia

HotaruBlaze commented 5 years ago

Possibly related to #1 however not enough info provided and not worth its own issue.

ghost commented 5 years ago

using discordia api which is scriptable with LUA would make the modability of the Relay more accessible to the tes3mp scripters crowd which is working with LUA..

Shigbeard commented 5 years ago

Discordia isn't Lua. It's Luvit. Discordia will not function in a standard Lua or LuaJIT environment without heavy modifications to both Discordia AND the Lua/LuaJIT environment it's running out of.

Pre-built libs for Discord aren't magic remedies that make everything 1000x easier, especially in Lua, which is barely a language as it is before you even begin to consider the fact that your usage of Lua entirely depends on its implementation and the environment it will be used it. To just link a Discord lib in a new issue and act like everyone else is wrong shows that you don't actually know what you are talking about, and simply googled "discord lua api" thinking that makes you a great developer.

HotaruBlaze commented 5 years ago

Using Discordia is not possible as it requires Luvit.

As far as im aware tes3mp lua's engine is only standard lua, so you are expecting me to use something thatis not compatable with tes3mp lua implamentation.

Could i possible reuse/convert some of their code to make it work on tes3mp? Sure, it may be possible

However this is not a simple "oh just use discordia and the problem is solved."

So no, i cant just "Use Discordia API ?"


To put it simply, tes3mp lua engine and lua is single threaded by default, meaning it can run the tes3mp server scripting, or it can run the discord bot.

You could simply check for new discord messages using UpdateTime(), but that means your checking discord everytime the time changes.

Aswell as if their is any issue connecting to discord at that time, the whole server could stop, Possibly crashing the server or atleast enough of a delay to disconnect players.

To remedy this you would need to change the bot to use coroutines, however this solution does have its own large share of issues and is still very early WIP aswell as an implementation of this has not even been tested yet.