Code Monkey home page Code Monkey logo

codeedu's Introduction

Treasure Hunt Bot

Crowdin

Source code of the Code Hunting Games bot for Telegram. Visit the official website for further information on how to play the game and how to organize your own games.

Developed at the University of Urbino (Italy) for the CodeMOOC course.

Contribute

Are you organizing Code Hunting Games in your country and the bot is not yet localized? Check out the bot’s translation project on CrowdIn.

Source code pull requests are welcome. Please also check out issues to give feedback on errors, possible bugs, or improvements.

Deploy your own bot

A Code Hunting Games session can very easily be organized for free using our @treasurehuntbot.

If you want to deploy your bot on your own, requirements are as follows:

  • A Telegram bot,
  • Server with a public IP,
  • PHP 7,
  • MySQL.

In order to install the bot, please proceed as follows:

  1. Get the code from this repository and ensure that your Web server correctly serves the source files at directory /src through the PHP interpreter.
  2. Copy the /src/config-template.php file to /src/config.php and edit if as follows:
    1. Set TELEGRAM_BOT_TOKEN to your Telegram bot's token,
    2. Set all DATABASE constants to point to your local MySQL and ensure that the database user you are setting has read/write access,
    3. Update BOT_DEEPLINK_START_ROOT, replacing BOTNAME with your Telegram bot's nickname.
  3. Install the database schema, running the /sql/treasurehuntbot.sql script,
  4. Check whether the bot works, by running php pull.php (in directory /src): this will attempt to process Telegram messages you send to your bot in pull mode.
  5. If everything works correctly, setup a webhook to your bot through the Telegram bot API:
curl -F "url=https://YOURDOMAIN/PATH-TO-BOT/src/hook.php" https://api.telegram.org/botBOTTOKEN/setWebhook

(Make sure to replace the URL with the correct path to your server and the TOKEN with your Telegram bot's token.)

That is all: the bot should now respond to your messages automatically. You're all set and ready to create your own Code Hunting Games.

codeedu's People

Contributors

lorenzck avatar brendan-p avatar xavbeta avatar alessandrobogliolo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.