OI Duel Bot

Revision en8, by Bruteforceman, 2022-08-28 13:37:50

Hi, I made a duel bot where you can challenge other users in a OI styled duel. It is sort of like a combination of regular duel matches and lockout challenges. You can find the bot at OIDuelBot. The bot is currently available only for Telegram, but I have plans to make one for discord as well.


You can challenge other users in a OI styled duel. In the duel, you have to race against time to solve the subtasks before your opponent. If your opponent solves a particular subtask before you, they gets the point for that subtask, and you won't get any points for it even if you solve it in the future. The player with more points at the end of the duel wins the challenge.

How to use

First, you need to add the bot in a telegram group. Here are the commands you can use in the bot

/register [oj.uz username] — you have to register yourself in order to enter your duel

/challenge [telegram username] — you can challenge other users in a OI styled duel

/accept — you can accept the challenge from other users

/decline — you can decline the challenge from other users

/duration [minutes] — you can set the duration of your challenge between 10 and 180 minutes

/difficulty [number] — you can set a difficulty from 1 to 10

/withdraw — you can withdraw from your current challenge

/rules — you can see the rules of the duel

/help — shows help text

Note that you have to start all commands with a forward slash which is the convention for telegram bots.

How the bot works

When you challenge a user, you will get a random problem unsolved by both users from oj.uz. The difficulty is measured by the number of ACs, which is probably not a very good measure, but I couldn't think of anything better for now. So you may sometimes get problems with lower or higher difficulty than you expect. If you don't like the problem, you can withdraw the match with your opponent. Also, since I am hosting the bot in a free heroku server, it will be inactive for about 6 hours every day (from 3:30 AM BST onwards). So if the bot doesn't respond, it's probably inactive at that moment.

Here is the github link if you want to look into the code or host the bot yourself: Github

Future plans

  1. Make a discord version
  2. Duel on problems from specified sources (IOI, BOI etc).
  3. Duel with three or more users
  4. Add rating system

Thanks to _blaNk_ for helping me test the bot. If you find any bugs/issues, let me know.

Tags ioi, bots, #oj.uz, duel


  Rev. Lang. By When Δ Comment
en8 English Bruteforceman 2022-08-28 13:37:50 111
en7 English Bruteforceman 2022-08-28 13:25:44 0 (published)
en6 English Bruteforceman 2022-08-28 13:24:01 37
en5 English Bruteforceman 2022-08-28 13:21:10 39
en4 English Bruteforceman 2022-08-28 13:20:29 144
en3 English Bruteforceman 2022-08-28 13:17:25 266
en2 English Bruteforceman 2022-08-28 12:02:12 66
en1 English Bruteforceman 2022-08-28 12:00:28 2160 Initial revision (saved to drafts)