pseudocoder10's blog

By pseudocoder10, 4 years ago, In English

Hello everyone, I'm sure many of you have been watching and enjoying the recent lockout streams organized by ecnerwala and scott_wu and would be wanting to compete with your friends in a similar format. I have made a discord bot that does exactly the same. The source code for the bot can be found here.

The bot gives a set of 5 problems with ratings from [x, x+400], where x is chosen by you and the point distribution is [100, 500]. The first person to solve a problem gets the points for it. The match ends when someone has >= 800 points or 45 minutes have been elapsed. The bot automatically updates the status when someone solves a problem but you can also do it manually.

To invite the bot to your discord server, click here. If you don't wanna go through the hassle of setting up a discord server, join this server to try the bot instantly.

Steps to use

First you will have to link your codeforces handle with your discord id. To do that type .handle identify <cf username>. The bot will give you a random string, which you have to set as your first name in your profile. On successfully doing that, you will be able to compete with others.

Ex

Now you can challenge your opponent by typing .match challenge <opponent discord name> <rating>. The bot will now give problems in the range [rating, rating+400] if your opponent accepts the match.

Ex

To accept a challenge, simply type .match accept and the bot will chose 5 random unsolved problems by both the participants in the rated range given.

Ex

The bot will automatically update the status of the match, but you can also manually trigger it by typing .match update.

Ex

The bot has few more features which you can try out yourself by joining this server. Any suggestions to make it better are welcomed.

UPD: If you want to report any bug or make suggestions, it will be better to comment in the support server rather than commenting here, since I will be able to respond faster and there will be better communication.

UPD: The bot has a new command .round. It is very similar to .match but now you can compete against multiple opponents (upto 5), can select time duration, number of problems (upto 6), rating for each problem and points for each problem. Additionally you can also specify whether you want a new problem to appear after someone solves a problem. You can also generate your own problemset for the round. Detailed commands usage can be found here

UPD: You can now create your own tournaments in your server using the bot. The supported tournament types are Single elimination, Double elimination and Swiss. The tournaments will be hosted on Challonge and you just need to setup a tournament using .tournament setup command and the bot will take care of setting and updating brackets. Detailed information about this command can be found here

  • Vote: I like it
  • +506
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +135 Vote: I do not like it

Here..
IMG-20200609-012417

»
4 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Adding a music bot on the server pairs well :D

Link: Octave

»
4 years ago, # |
  Vote: I like it +57 Vote: I do not like it

Excellent bot; many thanks for setting it up!

A few suggestions, with respect to match configuration: it'd be great if we could change the specific rating for each problem (rather than increments of 100), the number of problems in the set, the score for each problem, and the time limit.

From a server administration standpoint, it'd also be helpful to have the option to disable the bot in certain channels, to limit spam. It seems likely that many servers would rather dedicate one channel to the bot, and would thus prefer to disable it everywhere else.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Yes, seconded! Please let us change time limits.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +34 Vote: I do not like it

    For the second point, you can do this via discord itself:

    Go to the channel settings/permissions and you'll be able to specify permissions for the bot, you can just disable Read Messages.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    Thanks for the suggestions, I'll definitely try to implement them, and as Mohammad_Yasser suggested, its better to manually remove read messages permission for channels where you don't want the bot to send messages.

»
4 years ago, # |
  Vote: I like it +59 Vote: I do not like it

Great! I have a few suggestions:

  1. Maybe instead of changing the first name, it'd be better to submit a compilation error to a given problem? Don't know, it's up for you.

  2. Change "questions" to "problems"/"tasks"!!!

»
4 years ago, # |
  Vote: I like it +82 Vote: I do not like it

Checked. Nice, recommended.

»
4 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

Hey, I and GrandDaddy did a match but there was a problem which we had both solved earlier. Can you update it such that it won't show the problems we had solved earlier ?

If you had already implemented something to prevent this, then it might be the error due to the same problem having different index in a Div1 and Div2 contest.

In our case :-
We both had solved https://codeforces.net/contest/1341/problem/D
But the bot put the problem https://codeforces.net/contest/1340/problem/B in the match.

»
4 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

I have some suggestion pseudocoder10.

please add some sort of tag filter for problems, for example i'd like the first problem to have tags A, B and C then i want the second problem to not to have tags X, Y and Z.

Also having more freedom on problems' difficulty is appreciated. Also its nice to be able to schedule the competition, change it's length, change the scores and so on. Also being able to set a deadline for each problem sounds interesting (then solving a problem after it's deadline won't give any points).

You can also add $$$1$$$ v.s. $$$1$$$ v.s. $$$1$$$ competition, $$$2$$$ v.s. $$$2$$$ competition and etc. In other words a $$$w_1$$$ v.s. $$$w_2$$$ v.s. $$$\ldots$$$ v.s. $$$w_k$$$ competition.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    The idea for tag filters for each individual problem sounds a bit overkill for this format, but you can submit an issue for it.

    For the second part, allowing users to set time/number of problems/rating/score distribution is already on the To-Do list.

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Does .handle identify < username> not work if it's sent by another bot??

I created my own bot to compete with (in nodejs), but I was unable to identify the handle. Although it was working well when any other USER was trying. So, is the identifying disabled for bots??

Well, I did that because I wanted to practice some mixed set of questions rather than competing directly with other users.. Basically competing with, and against myself for the time being.

Please tell me if there's already a way possible to do it. Thanks.

P.s. I don't know much about discord, I was just trying to implement my own thing.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    No, .handle identify wont work with bots. If you really wanna do that, make a discord alt and challenge it.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I'm doing it that way but I also wanted the .accept challenge thing to be automated. Nvm I'll continue doing it like that, and thanks for the bot!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

can many people play at same time

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

can more than two people participate in this contest formation?? if yes,then command i should use,please clarify......

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can't do that, this bot only supports 1v1 matches. You could probably clone the bot and modify the code to support different formations, though.

»
4 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

very nice bot..I love this bot..I like doing duels on errichto's server..and we have this bot..which is super cool

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is the bot still working? I tried it on a few discord servers and it is not responding to the usual commands

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any server where any version of it works now?

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

is this bot still working?