If you wish to see the GitHub repo, you can view the same in the Additional Info section.


Inspiration

Whenever we think of games, we often visualize RPGs, action, adventure, and many other genres that provide excitement and showcase diverse approaches to game design. While these types of games are great for entertainment, they can sometimes stray from core values, potentially making them less beneficial for players. For example, RPGs can easily escalate in violence by encouraging the defeat of opponents.

Inspired by a different approach, we wanted to create a game that not only entertains but also educates and rewards players in a meaningful way. This led us to develop a Discord BOT game focused on Theta, where players are challenged with questions related to Theta blockchain technology. The fastest and most knowledgeable participants are rewarded with NFTs and tfuels, integrating learning with tangible rewards. Our project aims to foster a community of informed individuals, enthusiastic about Theta while promoting a healthy, competitive spirit. By combining the excitement of gaming with educational value, we hope to offer an enriching experience beyond mere entertainment.

What it does

To use the bot, you need to be in the Theta 2024 Hackathon Discord server, which we created specifically for this bot.

⚠️ Note: The bot can be configured to run on any Discord server, as it can be installed with just a single click. However, to simplify the process of interacting with the bot, we have already configured it to work seamlessly with our server. This way, players can simply join our server and start playing this exciting game.

Here are the detailed steps of how a player can interact with the bot and get the most out of it:

1️⃣ In the server, the #bot-updates channel will be the main point of contact between each player and the bot. Only the bot (and the admin) can send messages on this channel, and it will post all updates regarding the game there.

2️⃣The bot will drop a couple of questions related to Theta each day at 4 PM UTC. This daily set of questions is referred to as the daily challenges. The bot will provide timely reminders of when the daily challenge will start. Starting two hours before the daily challenge, the bot will send repeated notifications every 15 minutes, reminding players of the time remaining until the start of the challenge, ensuring that no player misses out.

3️⃣ Not every user on the server can participate in the daily challenges; only verified users are eligible, as winners will receive Tfuels and NFTs. To verify yourself, use the command !verify public-wallet-address. If the provided wallet address is correct, then the account will be saved and the player will be verified. If the address is incorrect or incomplete, you will receive the corresponding error messages.

4️⃣ At 4 PM UTC, the bot will send a notification in the bot-updates channel announcing that the daily challenge is live and detailing the prizes for that day's challenge. Each challenge offers some Tfuels as prizes, but only certain challenges also include NFTs. Specifically, NFTs are awarded for the 1st, 5th, and 10th daily challenges.

5️⃣ After the challenge goes live, all of the registered users will get the set of Theta-related questions on the DM for the bot. Stress the fact that, we used the DM of a player and the bot to convey every important stuff because we did not want to send every notification on the server and fill it with excessive messages.

6️⃣ The questions must be answered within 10 minutes of receiving them in the bot's DM. After selecting an answer for a question, the UI will update to notify you of your selection for that particular question. Once you provide answers to both questions, you will be able to see the time it took for you to respond.

7️⃣ Once the submission window ends, the bot will notify users in the channel. It will then start determining the winner—the player who provided the correct answers to both questions in the shortest time. After identifying the winner, the bot will share the winner's details in the channel.

8️⃣ Once the submission window ends, the bot will notify users in the channel. It will then start determining the winner—the player who provided the correct answers to both questions in the shortest time. After identifying the winner, the bot will share the winner's details in the channel. Additionally, the winner will receive notifications in their DM, including details of the prizes to confirm that they have received the desired rewards in their wallet.

9️⃣ Here is the list of the commands that can be used in the DM with the bot (other than the verification process):

Command Action
!schedule Shows the entire schedule for the 10 daily challenges
!winners Shows the winners for the recently concluded daily challenges
!txn -flag From the past 10 transactions done on the Theta Testnet chain, according to the flag set, the filtered transactions are shown (-s, and -r are the two flags)

How we built it

We used node.js to build the backend for the server as the requests coming to the bot should be directed to that server & for that, we hosted the server code on Theta Edge Cloud as a custom deployment, which is running on the 1005 port.

We used Theta Node JS SDK to make the bot communicate with the Theta blockchain and it is utilizing the same via the following methods:

🟢 Handling the user's verification: The keystore and its password are provided to the Node.js SDK to retrieve the wallet details. If any of the inputs are invalid, an error is returned; otherwise, the wallet details are provided in the response.

🟣 Sending Tfuels & transferring NFTs: Each winner will receive TFUEL as a prize. For some challenges, NFTs may also be awarded. The Node.js SDK is used for TFUEL transfers, while a smart contract call is utilized for NFT transfers.

Apart from these, the server is handling how to maintain data and use it across the bot to handle the incoming messages sent by the users in the server.

Challenges we ran into

  1. After completing our first project for the event (Theta B.A.S.H.), we decided to explore another track and aimed to create something for the Gaming track. However, we had no experience in game development. So, we chose to develop a game on a completely different platform, leading us to create a Discord bot. It was a challenging task, as we not only needed to come up with a unique game idea specific to Discord but also had to learn how to set up and develop a Discord bot.

  2. We were determined that our bot game wouldn't just use simple text prompts and basic features; it needed to be closely integrated with the Theta ecosystem. We first brainstormed the theme of the game and eventually decided that the bot would pose a couple of Theta-related questions daily. In return, users would be rewarded with TFUEL and NFTs. This approach allowed us to achieve two goals at once: educating users about various Theta concepts through a game and rewarding the best performers with prizes. But handling the user messages was nothing short of a nightmare.

In short, the Theta JS SDK part was straightforward for us. However, making the bot respond appropriately to various events on the server side required significant debugging and ensuring everything worked correctly in the end.

Accomplishments that we're proud of

Creating a realistic and knowledge-enhancing game was our proudest achievement. Not only did we develop this game for a platform we were unfamiliar with, but we also created something beneficial for all the players who engage with it. It is a game built with Theta using Theta Edge Cloud.

What we learned

A lot about developing bots for Discord, and also regarding Theta.

What's next for Theta's Discord Bot

Later, we can introduce the Theta Drop feature. A random message will be sent to the users' DMs, and the first 5 users who claim the drop will receive a specific amount of TFUEL.

Built With

Share this project:

Updates