OpenTibia Python Tibia<->Discord bot

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
Self-hosted Discord bot to communicate to and from your server. Automatically inserts tables needed to database on first-time setup.

Git repo: delusionx/Serpent (https://github.com/delusionx/Serpent/)

Pre-implemented commands: online, uptime
Command prefix: ;
Example on how to add a new command: Add uptime command · delusionx/[email protected] (https://github.com/delusionx/Serpent/commit/2187339f29c25b27549380a3d9aa5d0d991fe086)
Example on sending data from server to the bot with a custom event: Player death event · delusionx/[email protected] (https://github.com/delusionx/Serpent/commit/02825d54d26e520a3c8c2aa41b23bdf01ea9ff4b)

If you want to send data from your server to the bot, use the enqueue(command, args) function anywhere in a Lua file, add it to event_listener.py in self.commands and handle with either a custom callback or the default command_finish callback. Keep in mind this is a work-in-progress and a barebones project, let me know if anything is broken by submitting an issue on Github.

If you'd like to see it in action, join my testing server: Join the Serpent Discord Server! (https://discord.gg/NqPmGDz)
 
Last edited:

Kaspar

Unprejudiced
Staff member
Global Moderator
Premium User
Joined
Jun 2, 2016
Messages
508
Best answers
2
Reaction score
353
Location
Sweden
Wonderful contribution yet again. Kudos!
 

Ochman

Premium User
Premium User
Joined
Feb 27, 2016
Messages
234
Best answers
3
Reaction score
144
Hello Delusion,
Nice contribution. Do you think we (community) can make an use of this bot, making it OTLand bot? (Something like The Forgotted Server Discord)?
If so, please reformat code with PEP8 standards, so it'll be easier to contribute.
 
OP
Delusion

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
Hello Delusion,
Nice contribution. Do you think we (community) can make an use of this bot, making it OTLand bot? (Something like The Forgotted Server Discord)?
If so, please reformat code with PEP8 standards, so it'll be easier to contribute.
It's intended for private use in OT Discord servers, not a public general-use bot.
 

Ochman

Premium User
Premium User
Joined
Feb 27, 2016
Messages
234
Best answers
3
Reaction score
144
I assumed so, but maybe we could create a "bot template" that anyone could fork if they're willing to?
Just like TFS, people copy it and then work on it separately.


I personally could contribute to it adding functionalities, but to do so, we should standarize our code with PEP8 standards.
It depends on the intended purpose of this source code. If you'd like to share with whatever you made for yourself - it's okay. But I am saying that we could potentially develop something bigger; and for this we'll need to stick to suggestions made by Python Style Guide.
 
OP
Delusion

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
I assumed so, but maybe we could create a "bot template" that anyone could fork if they're willing to?
Just like TFS, people copy it and then work on it separately.


I personally could contribute to it adding functionalities, but to do so, we should standarize our code with PEP8 standards.
It depends on the intended purpose of this source code. If you'd like to share with whatever you made for yourself - it's okay. But I am saying that we could potentially develop something bigger; and for this we'll need to stick to suggestions made by Python Style Guide.
Some of this is old code, some of this I rewrote quickly (The entire repo is only a few days old). I wanted to create something that I can continuously work on as a means to learn git and try to get used to it. I'll start formatting to PEP8 standards so others can contribute.
Edit: finished
 
Last edited:

Ochman

Premium User
Premium User
Joined
Feb 27, 2016
Messages
234
Best answers
3
Reaction score
144
I could possible do refactor tomorrow, but have you made some changes already?
I assume I'd touch most of the files, so even tho it's repository, it might be messy to merge those changes later on
 
Top