TWiz - Unofficial Discord Bot

zyiks

Well-Known Member
Reaction score
40
Changelog:
* Channels can now have custom world configuration using command !set_channel_world <world>. If world is not set, will use default world that has been set with !set_world. To reset channel world use !set_channel_world without a parameter.
* Reports are now stored for both attacking and defending side.
* !reports command shows report type(Attack/Defend)
* Query response time should now be faster
* Revealed hidden !stronghold command in help. !stronghold <attacker> <defender> calculates coins gained for every member of attacking tribe. Both attacker and defender must be tribe tags.
* Commands will be deleted after bot responds to lessen spam
* Removed clear command due to conflicts with other bots
* World updating should be faster and even less requests to tw servers (still updates once an hour, no point in checking in more often)
* Bugfixes
 

Deleted User - 11602898

Guest
Hi,

Can you add world of different country?
I'm in IT59

Thanks a lot any response
 

zyiks

Well-Known Member
Reaction score
40
Yes, you can add worlds of any country. I have added IT59 for you. Use !set_world it59

Also in the future please state the full domain of the world, I don't have them all memorized.
 

zyiks

Well-Known Member
Reaction score
40
Sorry for the downtime!

* Added auto-reboot to TWiz service
* Added notification to developer when auto-reboot fails
* Fixed issue where servers that added the bot while offline could not use any commands
 

Frying Pan Warrior

Still Going Strong
Reaction score
578
Sorry for the downtime!

* Added auto-reboot to TWiz service
* Added notification to developer when auto-reboot fails
* Fixed issue where servers that added the bot while offline could not use any commands

Just wondering, are you ever planning to make it open source so that tribes can fork and make customized versions?
 

zyiks

Well-Known Member
Reaction score
40
If I were to make it public it would be under a license that forces all modifications to be made publicly available as well. Is there a feature you are looking for that is missing? Or is this a security issue?
 

JawJaw

Awesomest CM Ever
Reaction score
2,210
If I were to make it public it would be under a license that forces all modifications to be made publicly available as well. Is there a feature you are looking for that is missing? Or is this a security issue?

You actually wouldn't be able to enforce this in any kind of license considering your bot is using a Discord library (either node js or python), using public data from Tribal Wars and/or TWStats. Meaning that all your bot does is process data, which is not protected by copyright and does not contain anything that makes your bot special / different from any other bot.

Just as an FYI (as a fellow Discord Bot developer and someone that deals with licensing on an almost daily basis) ;)
 

zyiks

Well-Known Member
Reaction score
40
Do you have any sources for this? I'm interested in reading more.

Obviously I can't enforce it on anyone, if someone makes modifications and hosts it for themselves I won't even know they are doing it, not to mention even being able to track them down or take any legal action. But that doesn't mean my code is not under copyright and I'm stopped from licensing it. Just means anyone who does things ethically will do it the proper way. And they shouldn't expect me to help anyone to host the bot or respond to any queries without following the license.

The license of the library I use to interface with discord is under the MIT License which permits me to license the modifications under different terms and the way I get data from TW is my own code. I do not share the public data myself, the code has to be given the location of the data after runtime, which would be a url.

There's also a difference between having a patent and a copyright. My bot does indeed not contain anything "special/different", which stops me from getting a patent, but it does not invalidate copyright. If you come to the same code on your own you are free to do so as there is no patent blocking you, however you are not free to copy my code without following the license since my copyright and license apply to the code.

In the end I only want to make such a requirement because I want to keep the playing level fair. If someone makes a modification that ends up being really innovative and helpful it would be shared with everyone.
 
Last edited:

Frying Pan Warrior

Still Going Strong
Reaction score
578
The license of the library I use to interface with discord is under the MIT License which permits me to license the modifications under different terms

I agree with you, your code and personal copyright has nothing to do with what it accomplishes at run-time.

Though, unless you plan on taking people who make useful modifications without forking up the code to court (or report them to discord), there won't be a way to enforce it.

Realistically there will probably be no one who needs to fork it for their purpose. In my case if I ever wanted to use it though, I'd like to self host it because I like to have all communications processed on my own servers. (Eg, the bot downloads messages to look for commands and the messages would then be processed by a third party.)

So I was just curious if you were ever going to make it open source. Have to say I also get a little thrill looking at peoples' code. ( : lol
 

zyiks

Well-Known Member
Reaction score
40
Though, unless you plan on taking people who make useful modifications without forking up the code to court (or report them to discord), there won't be a way to enforce it.

As stated previously, I can't and I don't really care enough to sue someone(probably would try to file a DMCA once or twice just for the experience if discord even allows it :) ). I'm just interested in keeping the game as fair as possible as I can without investing too much of my time into it. I haven't played tribalwars in months so I'm losing 3€ a month hosting it for ~4k users.

Realistically there will probably be no one who needs to fork it for their purpose. In my case if I ever wanted to use it though, I'd like to self host it because I like to have all communications processed on my own servers. (Eg, the bot downloads messages to look for commands and the messages would then be processed by a third party.)

Currently the bot checks if the message starts with the command prefix of the server or contains valid regexes, such as cooridnates or report links/report bbcode. Otherwise nothing happens. There may be some easter egg regexes left from when I was still playing, I haven't actually checked it in a while. None of your messages get logged. In hindsight the "view message history" premission isn't required anymore either since I removed all administration commands after making the bot public. I'll change the url to disinclude the premission tomorrow most likely.

If you are really interested I can probably dig up an old version of TWiz that only supports one world that was used in the early stages of en107. It probably has more features than the current TWiz(albeit less performance due to SQLite vs PostgreSQL but it doesn't matter since its only one world), such as conquers and War Stats. That's provided I can find my backups of old hard drives and they actually contain it. I'll probably have no issue releasing this one under "
Do What the Fuck You Want to Public License", this could serve as a good tutorial on how to access world data and how to make your own TWiz clone.

I'll also note that the codebase for both of these versions are pretty bad in hindsight as I mostly learn through developing rather than reading, theres some things documentation or tutorials just don't mention clearly enough like ON CONFLICTs changing the id of the row on update, causing me to hit the 32bit limit.
 

nanzer

Member
Reaction score
30
Hi :) Not sure if you're still developing this, but thought I'd bring an odd bug to your attention if you are! When I use !circ, it pulls up members who have been deleted for some time. Any idea why this is happening?

Thanks for developing this btw!
 
Top