Блог пользователя pseudocoder10

Автор pseudocoder10, 4 года назад, По-английски

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

  • Проголосовать: нравится
  • +506
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +135 Проголосовать: не нравится

Here..
IMG-20200609-012417

»
4 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Adding a music bot on the server pairs well :D

Link: Octave

»
4 года назад, # |
  Проголосовать: нравится +57 Проголосовать: не нравится

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 года назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    Yes, seconded! Please let us change time limits.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +34 Проголосовать: не нравится

    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 года назад, # ^ |
      Проголосовать: нравится +17 Проголосовать: не нравится

    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 года назад, # |
  Проголосовать: нравится +59 Проголосовать: не нравится

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 года назад, # |
  Проголосовать: нравится +82 Проголосовать: не нравится

Checked. Nice, recommended.

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

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.me/contest/1341/problem/D
But the bot put the problem https://codeforces.me/contest/1340/problem/B in the match.

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

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 года назад, # ^ |
      Проголосовать: нравится +17 Проголосовать: не нравится

    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 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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 года назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

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

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

can many people play at same time

»
4 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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 года назад, # |
Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

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 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
12 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
9 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

is this bot still working?