We meet December with the Secret Santa in the form of a Telegram bot

 3r3125. 3r3-31. Hello hrobrozhiteli! 3r33112.  3r3125. 3r33112.  3r3125. We meet December with the Secret Santa in the form of a Telegram bot 3r33112.  3r3125. When I was still a schoolboy, I opened with Habr periods, and one of the articles that I remembered at that time was 3r315. Club of anonymous Santa Clauses 2013 - 2014 3-???. . At that time, it seemed to me one of the coolest ideas to organize such actions, where you can be in the role of Santa Claus for a complete stranger, and at the same time receive a gift from the same stranger. After this habropost, I learned that such a thing exists in general, which, in principle, gave further impetus to writing this bot (:
 3r3125. Last New Year's Day, I also had such an action at work, where every person in the room got a random person, and you had to give a gift to the person who fell out to you, and this person in turn also gives another person. In the end, all remain with gifts and satisfied. 3r33112.  3r3125.
3r33112.  3r3125. In the last year I had a hobby to create bots on the VK platform, even simply without releasing them into the world, but just for my own sake. I started to create various bots for myself, I had a public of my city, which at that time I attracted a lot of people with the help of a bot. I liked that people could spend a lot of time poking into the bot's functionality, and got pleasure from it, which motivated me to constantly look for new ideas on how to please people, then several customers came to me to write them bots for their publics, and everyone was happy: ) 3r33112.  3r3125. 3r33112.  3r3125. So, I wanted to go with VK [s] (what is there to catch actually already?) 3r330. in Telegram, since I heard that this is an excellent platform for bots. And of course, in order to make a bot, you need an idea. The idea came almost immediately, because the New Year is coming, and the bot in the form of the “Secret Santa” is not a common thing in Telegram, and the desire to write it was a long time ago. Just in the form of sites, as for me, it does not make sense to do this, because there are a lot of such sites. And in the period of some time, I sat down to read the documentation 3r3331. Telegram BOT API
(since I was completely unfamiliar, this is my first project on this platform), I was looking for Open Source bots on Github, I watched how people worked out, sat down for a while, painted what I wanted it to look like. Actually further, I want to introduce you to my creation (:
 3r3125. 3r33112.  3r3125. 3r3386. What it looks like now
3r33112.  3r3125. A user is greeted by a welcome message before the game, which explains that the game has two modes: single and command. 3r33112.  3r3125. 3r33112.  3r3125. 3r3-300. Single [/b] under a provides that the user finds a completely random Santa (within his country). The user presses the button that he wants to find a completely random Santa, the system registers it, and every hour goes and combines in pairs those who do not have it. Within an hour (if, of course, at this moment there are users from your country also without Santa), the user will receive a message with information about his recipient, and also about the fact that Santa is found. 3r33112.  3r3125. 3r33112.  3r3125. 3r3-300. Command [/b] gives users the right to merge into rooms. This is well suited to those who, for example, in offices, or in a large team of friends want to give each other gifts. One person creates a room in the bot, the bot gives the room number to the leader of the room where he can invite other people. People enter the room of this room and fall into it. To start the game, there should be an even number of users in the room, and the leader of the room should click /play. After that, the bot will mix all users and everyone will get its Santa, each person in the room will receive a personal message from Bot, with the data where to deliver the gift. You cannot leave the room if the user has already got Santa. However, the room can be left if the user has not yet received Santa. The leader (creator) of the room cannot leave the room if there is at least someone besides him. 3r33112.  3r3125. 3r33112.  3r3125. After the start of the game, the bot asks the user for information about his country, city, address, full name, wishlist (each user can write a list of desires that Santa can listen to). Further, the person either joins the room, either creates it, or finds the accidental Santa outside the rooms. After you send a gift to the address of your recipient, you must click /sent (the bot will notify the recipient that you sent the parcel, and it will not be long to wait). When the parcel arrives, you can push /delivered (all these commands are in the bot commands in navigation), and your Santa will receive a notification, with “plus karma and respect” (:
 3r3125. 3r33112.  3r3125. The bot once a month also reminds those who have not yet sent a gift, that the New Year is here soon, and you do not need to be a bad Santa, you need to hurry (:
 3r3125. 3r33112.  3r3125. Below I leave a few screenshots of the bot. 3r33112.  3r3125.
A couple of screenshots bot [/b]
3r371. 3r33112.  3r3125. 3r33112.  3r3125.
3r33112.  3r3125. 3r33112.  3r3125. 3r3386. What is implemented
3r33112.  3r3125. I will not dwell on the technical part at all (perhaps the topic of another post), just for those interested I will name, with the help of what I developed. 3r33112.  3r3125. 3r3-300. YAP [/b] : PHP 7-3r3112.  3r3125. 3r3-300. DBMS 3r3-3101. : MySQL
 3r3125. 3r3-300. SDK [/b] : 3r3102. Telegram BOT PHP SDK
3r33112.  3r3125. 3r33112.  3r3125. Anyone interested in the bot can be found in the Telegram as 3r3108. @HappySecretSantaBot
3r33112.  3r3125. 3r33112.  3r3125. All with the first day of winter, excellent December, write bots (this is cool), and with the “coming” New Year :)
3r3125. 3r3125. 3r3125. 3r3118. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r3119. 3r3125.
3r3125. 3r3125. 3r3125. 3r3125.
+ 0 -

Add comment