Skip to content

Commit fe0c3e3

Browse files
committed
codde uploadeD
1 parent 12d9758 commit fe0c3e3

40 files changed

+3874
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.idea

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CONVERSATION HANDLERS
2+
* SPECIFY THE BEGINNING AND THE END OF CONVERSATION HANDLERS by writing
3+
#start of conversation handler for........
4+
and
5+
#end of conversation handler for......

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Abhinav Gautam
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
[![Telegram](https://img.shields.io/badge/Telegram-Bot-blue.svg)](https://t.me/SuperCodeBot) [![releases](https://img.shields.io/github/release/Gotham13121997/superCodingBot.svg)](https://github.com/Gotham13121997/superCodingBot/releases/tag/v2) [![license](https://img.shields.io/cocoapods/l/AFNetworking.svg)](https://github.com/Gotham13121997/superCodingBot/blob/master/LICENSE) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/ac9e193532614cb8a7e90adb0fcbe46d)](https://www.codacy.com/app/Gotham13121997/superCodingBot?utm_source=github.com&utm_medium=referral&utm_content=Gotham13121997/superCodingBot&utm_campaign=Badge_Grade)
2+
# superCodingBot
3+
4+
[![Join the chat at https://gitter.im/superCodingBot/Lobby](https://badges.gitter.im/superCodingBot/Lobby.svg)](https://gitter.im/superCodingBot/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5+
6+
THE TELEGRAM BOT FOR COMPETITIVE PROGRAMMERS
7+
8+
## ABOUT
9+
superCodingBot is a telegram bot built in python 3 using python-telegram-bot wrapper.
10+
11+
## [BOT LINK](https://t.me/superCodeBot)
12+
13+
## FEATURES
14+
* Getting ratings from hackerrank,hackerearth,codeforces,spoj and codechef in the form of ranklist
15+
* Automatic updation of ratings
16+
* Getting upcoming competitions and setting reminder for them
17+
* Getting ongoing competitions
18+
* Compiling and running code from the bot itself
19+
* Getting questions from codechef and codeforces according to choice
20+
* Getting topics from geeksforgeeks.com
21+
* Subscribing to get Question of the day
22+
23+
## LIBRARIES USED
24+
* PYTHON-TELEGRAM-BOT
25+
* HTML5LIB
26+
* BEAUTIFUL SOUP
27+
* HACKERRANK API
28+
* APSCHEDULER
29+
* XLSX WRITER
30+
* SQLAlchemy
31+
32+
## USAGE
33+
### PREREQUISITES
34+
* python 3 or above
35+
36+
### CONFIGURATION
37+
* Create your bot and Get your telegram bot token from [BotFather](https://core.telegram.org/bots#botfather)
38+
* Get your hackerrank api key from [Hackerrank](https://www.hackerrank.com/api)
39+
* Register to [Clist](https://www.clist.by) and get your username and api key
40+
* Get your telegram chat id
41+
* You can get your chat id by first messaging to the bot and then checking the url https://api.telegram.org/botYourBOTToken/getUpdates
42+
It will look somewhat like this
43+
{"update_id":8393,"message":{"message_id":3,"from":{"id":7474,"first_name":"AAA"},"chat":{"id":,"title":""},"date":25497,"new_chat_participant":{"id":71,"first_name":"NAME","username":"YOUR_BOT_NAME"}}}
44+
the id of the chat object is your chat id
45+
46+
* Edit the config.ini file with your telegram bot token, hackerrank api key, clist user name, clist api key. Also put your chat id in admin chat id. You can put multiple admin chat ids seperated by comma. Admins will be notified by the bot whenever data or questions are updated and will have access to admin commands. You can also put your persistent storage point if you will be using OPENSHIFT ONLINE to host the bot (If name of your volume is df then put /df/ in the field) otherwise just leave the field blank
47+
48+
### RUNNING ON LOCAL PC
49+
* pip install requirements.txt in console
50+
* run app.py script
51+
* enjoy
52+
53+
### HOSTING ON OPENSHIFT ONLINE
54+
* edit the config.ini file
55+
* save all the files in a repository on github
56+
* create an account on [REDHAT OPENSHIFT ONLINE](https://www.openshift.com)
57+
* select the location of your server
58+
* wait for a few days till you recieve confirmation
59+
* after recieving confirmation, login and create new application
60+
* select python 3.4 or above
61+
* select name and everything
62+
* enter the url of the github repository
63+
* wait for application to start
64+
* enjoy
65+
* You will have to use persistent storage to prevent data loss on deployments
66+
* think of a name for mount point eg /df
67+
* open the openshift console
68+
* go to storage and create a persistent storage
69+
* Go to deployments
70+
* then in deployment configuration attach the persistent storage along with a mount point you thought of
71+
* wait for the app to re-deploy
72+
* enjoy
73+
74+
#### REBUILDING PROJECT ON OPENSHIFT ONLINE
75+
when you want to rebuild your project
76+
77+
* first of all go to deployments and select the latest deployment
78+
* downscale the no of pods to 0 and wait for it to happen
79+
* **IMPORTANT** go to deployment configuration and detach the storage. A deployment will start, let it finish
80+
* Go to builds, select name and click on start build
81+
* After finishing build a deployment will start, let it finish
82+
* Go back to deployment configuration and add storage with same mount point as previous and wait for a new deployment
83+
* After deployment finishes, go to deployments. Select latest and scale the pod to 1.
84+
85+
* **YOU CAN REMOVE YOUR GITHUB REPOSITORY BUT MAKE SURE TO RECREATE IT WHEN REBUILDING YOUR PROJECT**
86+
87+
## COMMANDS
88+
### PUBLIC COMMANDS
89+
* /help - get a list of all the commands
90+
* /compiler - compile and run code
91+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/compiler.gif)
92+
* /register - to register your handle with the bot
93+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/register.gif)
94+
* /unregister - to unregister your handle from the bot
95+
* /update - manually initiate update of your data
96+
* /geeksforgeeks - browse topics from geeksforgeeks.com
97+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/geeksforgeeks.gif)
98+
* /randomcc - get random question from codechef according to choice
99+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/randomcc.gif)
100+
* /randomcf - get random question from codeforces according to choice
101+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/randomcf.gif)
102+
* /ranklist - get a ranklist according to choice
103+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/ranklist.jpeg)
104+
* /upcoming - to get a list of upcoming competitions and setting a reminder for them
105+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/upcoming.gif)
106+
* /ongoing - to get a list of ongoing competitions
107+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/ongoing.gif)
108+
/dontremindme - to tell the bot not to remind you about a competition
109+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/dontremindme.gif)
110+
/subscribe - to subscribe for question of the day
111+
/unsubscribe - to unsubscribe from question of the day
112+
![alt text](https://github.com/Gotham13121997/superCodingBot/blob/master/gifs/subscribe.gif)
113+
114+
### ADMIN COMMANDS
115+
* /givememydb - get the sqlite database
116+
* /senddb - send and replace sqlite database
117+
* /getcfjson - get the codeforcesjson file
118+
* /sendcf - send and replace the codeforces json file
119+
* /adminhandle - get a list of all handles
120+
* /adminud - manually start updating all data
121+
* /adminuq - manually start updating questions
122+
* /adminrestart - restart the bot

0 commit comments

Comments
 (0)