Coder Social home page Coder Social logo

danger-ahead / robot Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 23.0 1.53 MB

Multi purpose discord bot. Performs moderations, quick searches. Serves facts.

Home Page: https://discord.com/api/oauth2/authorize?client_id=843553315442130985&permissions=2148002880&scope=bot

License: MIT License

Python 80.05% Shell 0.19% HTML 10.97% SCSS 1.29% CSS 6.98% JavaScript 0.52%
discord-bot api discord-py

robot's Introduction

roBOT: Development

GitHub repo size GitHub commit activity

your own locally hosted discord bot :D

Discord chat

πŸ€– Add roBOT to your server!

πŸ“· Screenshots of roBOT in action.

πŸ’½ Installation

  • Make sure you’re logged on to the Discord.
  • Navigate to the Discord Developer's Application Page.
  • Click on the New Application button.
  • Give the Application a Name and click on Create.
  • Go to the Bot Tab and then click Add Bot. You will have to confirm by clicking Yes, do it!.
  • Keep the default settings for Public Bot (checked) and Require OAuth2 Code Grant (unchecked).
  • Copy the token from 'Bot' Tab. (Don't share it with anybody)
  • Go to the OAuth2 Tab. Then select Bot under the scopes section.
  • Now choose the Administrator permission.
  • Copy the URL by clicking Copy button above the permissions.
  • Paste the URL into your browser, choose a server to invite the bot to, and click Authorize.(To add the bot, your account needs Manage Server permissions.)
  • Now you've created the bot user and added it into a server. Now start writing the Python code for the bot.
  • Run pip install -r requirements.txt
  • In the .env file, paste the required keys as:

Note: This branch has breaking changes

`RAPID_API=YOUR_API_KEY` (replace '**YOUR_API_KEY**' with your API key)

`OPEN_WEATHER_TOKEN=YOUR_TOKEN` (replace '**YOUR_TOKEN**' with your API key)

`MONGO=MONGODB_KEY` (replace '**MONGODB_KEY**' with your MongoDB key.)

πŸ‘·β€β™€οΈ Working

roBOT reacts with πŸ‘ or πŸ‘Ž after each successful or unsuccessful command execution

You can use roBOT for:

  • Channel moderations (looking for offensive words, muting, unmuting, etc)
  • Trivia, memes and jokes
  • Play games (tossing a coin, rolling a dice, etc)
  • Polls
  • Cleaning up a channel's chats
  • Searching (Wikipedia, DuckDuckGo, movies, music, word meanings, etc)
  • Solving Math problems
  • Updates on COVID-19 or weather

(the list will only keep expanding 😜)...

🀝 Contributions

Contributions are always welcome. Visit our contributing guidelines before making any contributions.

GitHub contributors

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.

robot's People

Contributors

bartick avatar belelaritra avatar coderrounak avatar danger-ahead avatar edald123 avatar eitozx avatar infuman69 avatar komachian avatar kriptonian1 avatar obitorasu avatar pradumnasaraf avatar pranavtrip avatar riddhiathreya avatar sayantanideb avatar schw18tz avatar senor-ducky avatar smart-worker avatar soham4abc avatar vidhibhatt01 avatar vivekkj123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

robot's Issues

Remove duplicate code

The line db = loader.db_loaded() in commands/admin_commands.py has been repeated multiple times (in the functions).

It would be really nice if db could be assigned only once and made a global variable accessible to all the functions.

`message.add_reaction()` missing in `_covrep`

The success or failure command reaction for _covrep command isn't working.

Inside the try block of _covrep, await message.add_reaction('\U0001F44d') has to be added at the last.
Inside the except block of _covrep, pass has to be replaced with await message.add_reaction('\U0001F44E')

Only copying the 2 statements accordingly in the respective blocks should work.

πŸš€ Feature: Music

πŸ”– Feature description

I can add a command that searchs youtube to look for songs and play it in the voice channel, It will also have things like play, pause, queue etc.

🎀 Pitch

For example play despacito. The bot will search youtube and it will search despacitio on youtube and play it in voice chat

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

πŸš€ Feature: Discord Embeded Application

πŸ”– Feature description

A command to start a custom discord embeded application.

Example:

  1. Watch youtube videos with your friends in any discord vc
  2. Play chess with your friends in any discord vc

🎀 Pitch

I think this feature will help users be more interactive in discord voice channels. And users might use this to make their server more active.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

πŸš€ Feature: Cogs Implementation

πŸ”– Feature description

Cogs will add modularity to the commands.

🎀 Pitch

adding cogs will make it easier to add features seamlessly , it will also add some structure to the source code and will also be beginner friendly and easy to understand the code structure, if you allow me i can completely restructure the code into cogs

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

Code needs housekeeping and refactoring.

Description

Currently main.py is riddled with various commands and their implementation. The code also seem to be very repetitive with a lot of recurring if else statements. I think a better approach would be to move all the commands and their respective implementations to lets say a structured directory like roBOT/core/commands/ and subsequently import the commands and their functionalities in the main.py file. Overall this would make it a lot easier for contributors as well as maintainers to keep track of all the current commands and potentially the newer ones which have been planned for the future.

Lock and channel command

πŸ”– Feature description

I want to make a command that can lock a channel so only people with specific role can chat.

🎀 Pitch

If someone is raiding the server instead of going to settings and changing permissions manully you can just use lock or unlock

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

πŸš€ Feature: An Error handler

πŸ”– Feature description

This will be a event who will be responsible for handling most of the API errors that discord throws during a API request.

Or it can remove unwanted errors. Like parsing error.

🎀 Pitch

This will not be a visual feature but will help the bot understand what kind of error has happened and can reply with a specific message without handling the same error for every command.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

Revamp the `_hi` command

Would like to see a better response from the bot when using the _hi command. Customize it your way keeping in line with the nature of the bot.

A Screenshot of the new response is Mandatory in PR

file to be edited:
roBOT/commands/hi_contrib.py

Improve README.md

Instead of directing the users to the freecodecamp tutorial, it will be much nicer if the full installation procedure is mentioned in the README itself.

NOTE:

For fixing the issue, head over to the tutorial and write up all the necessary steps in the README. Mention the creation of the .env file and naming the tokens. Also mention about generating the discord application token and rapidAPI token.

errors in song search feature

  1. Error in line 150 (the key should be url).
  2. Line 151 is redundant. Should be removed.
  3. Error in line 144 (there's no txt attribute, it should be changed to text).
  4. Provide a new line between lines 132 and 133 (to increase code readability).
  5. Lines 149 and 150 can be merged together with a \n like in line 130.
  6. Line 149's text can be changed to something like "Most famous song: ".
  7. Line 150's text can be changed to "Lyrics can be found at: ".

Create a issue template

Create a issue template for this project.
The issue template should be a standard one having all suitable parameters for this project!

Replace `if-elif` blocks

In commands/help.py, there are too many if-elif conditional blocks. The same thing can be implemented by using dict. This, on the whole, would increase code-readability and make it easier for the maintainers to keep track of the code.

For more information on this implementation, kindly refer to main.py.
Other important resources needed for this approach are exec() and eval().

Fix and deploy Github Actions

The current github action fails to run.
You need to fix the .yml file.

The workflow should check for the successful execution of the main.py script and on success, exit and pass the test.

Screenshot:
image

Lines indicating successful execution are missing

In main.py, under the @client.event section, the block elif message.content.startswith("$"): needs to indicate whether the command execution was successful.

You need to add two lines to make this happen. The lines to be added are provided in the following section.

The updated structure will be as follows:

elif message.content.startswith("$"):

    if message.author.guild_permissions.administrator:
        if:
            <all the lines originally under the `if` block go here>
            await message.add_reaction("\U0001f44d") #new line to be added under if
        else:
            <all the lines originally under `else` the block go here>
            await message.add_reaction("\U0001f44E") #new line to be added under else

Change font style in webpage

πŸ”– Feature description

The current font style being used in the web pages isn't quite aesthetic.
You can use any font that is a bit minimalistic. (For reference, you can have a look at these styles - Lato, Yaldevi or Roboto).

🎀 Pitch

The web pages doesn't seem to follow the modern design trends that we are accustomed to seeing today.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

πŸš€ Feature: Adding Screenshots, License and restructuring the README

πŸ”– Feature description

Adding Screenshots, License and restructuring the README

🎀 Pitch

I will convenient for users to see screenshot directly from README rather getting into some kind of file.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

Add an Issue Template

Would like to see a well documented Issue template here.
Go through the project and make a tailored Issue template

Include swear words for moderation!!

Introduce as many swear words as possible each separated by a space.
The file to be changed is:
roBOT/blob/master/commands/scripts/moderate_words.txt

Bengali and Hindi words are also welcome!

Adding more features

Can I work on adding some more features to the bot? Like the bot compliments you when you are feeling low .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.