Python Chatbot Project in Discord and Minecraft
Chatbot Project Report
Introduction
In my university group project, we were given a task to create a chatbot using Python which encouraged us to use a version control program like Git and the Python IDE PyCharm in order to write our python program. I came up with the idea to create a Minecraft chatbot that works inside of both Discord and inside of the actual Minecraft game itself, my team enjoys playing games as much as I do and thought it would be a good idea to do. I came up with this idea for old Minecraft players returning to the game without much knowledge of the current patch’s item crafting recipes and this will be able to help them figure out the new updates from within the game itself.
Programming
In the beginning, we thought about what software we should be using, first of all, for version control we decided to use Git on the website GitHub since Jakub already had a premium account from GitHub to make the repository private and it helped us to put all our code into one place so that we can all access each other’s code and make corrections as well as check changes that have been made, it also allowed us to leave comments such as when I was refactoring some of Jakub’s code I found some simple mistakes which I corrected and commented on. Another piece of software I used was PyCharm, this is a python IDE which makes programming a lot simpler and more efficient as it helps with auto completing things like variables and finishing off brackets and overall just makes programming easier in general.
Within the team, I’d say I was one of the least experienced programmers so I took it upon myself to do paired programming with Jakub, a more experienced programmer in order to help me learn better programming techniques and methods as well as helping to improve myself as programmer.
The task Jakub and I had was to make the chatbot understand the user’s question as an input and provide a correct answer to the question as an output. In order to do this Jakub and I wrote the program “meaning.py” and within this program we wrote lists of the different types of user inputs the user could write in to ask questions and many of the inputs would be classified as “Craft_question” and “Item_question” which would then be used to classify what kind of question it is which will later on allow us to link this input to the correct output. The “self.items_names” variable holds a link that carries a dictionary of many items within Minecraft which will be used later to fetch data about the items which will relate to the user input. Jakub and I worked on the inputs together as Jakub did not know the entire English language as well as I did and I knew I could help for things like how a user would ask a question. The “predict” function within “meaning.py” was mostly made by Jakub but I helped with a few of the for loops used, my impact within this function was helping Jakub link to the lists I had created in the previous function and checking for any mistakes that Jakub may have made in spelling or in syntax. I also worked with Jakub to create “MessageHandler.py” to handle the output of the chatbot in order to create the perfect output for the user’s question.
Other tasks required in order to make our chatbot functional was input refactoring and creating a connection with Minecraft which was Owain’s job and responsibility as well as tokenizing the user’s inputs and Baran and Tomas had the task of creating the API for the Minecraft items we would be using to answer the user’s question.
Group Meetings
We held group meetings twice a week Wednesday to figure out what we should be doing where Baran, our scrum master would create a Kanban Board using Trello for us so we know what we should be doing over the next week and Fridays we worked together on bugs or errors we had in order to adapt or change our tasks or even ask for advice from our teammates, these sessions were used for discussing the things we found tricky or had to change.
Above is one of the kanban boards used in the early stages of our project. Made in Trello
Used Technologies
· Python 3.6 (PyCharm IDE)
· Git (Version Control)
· Trello (Agile Workspace for Kanban Board)
Conclusion
This project is the first project I had done as a team and completed and has been quite an experience, doing paired programming with Jakub has helped me improve my programming techniques in Python3 as I got to see where I was going wrong in specific aspects of my programming as well as making my programs more efficient. I learnt how to create a connection to a discord API which I thought was a lot more complicated but with some research was quite simple to understand. I was able to enhance my Object-Oriented Programming techniques when helping to refactor the code near the end of our project. I had my first experience with PyCharm which has been a good experience as it is one of the best Python IDEs I’ve used. During our project, we had a team member swapped and had to adapt our project and planning to our new as well as help him catchup to where we were in our project and help him to decide what he wanted to do in order to help us. This project has helped develop my communication skills as it was done within a team and has taught me that I cannot be lazy when working as a pair since I needed all the help I could get from my team since I also had responsibilities that I had to relay in our team meetings. Although my technical skills weren’t as advanced as the rest of my team’s I feel that I was still able to have an impact and learn many things through communication within my team. This project has allowed us to become closer as friends rather than just a team working on a project and that has definitely motivated me to look forward to my next group project.
Here is a screenshot of the chatbot in use. Credit to Owain for letting me use this picture
Above is a video created by Baran showcasing our project working in both Discord and Minecraft.