Giter Site home page Giter Site logo

campdevs / discordbot Goto Github PK

View Code? Open in Web Editor NEW
72.0 72.0 19.0 1.44 MB

Discord bot.

Home Page: https://glitch.com/edit/#!/carnelian-crayfish

License: MIT License

JavaScript 100.00%
discord discord-bot discord-js discord-js-bot discordjs-commando

discordbot's Introduction

campDevs

campDevs website

discordbot's People

Contributors

adityaparab avatar beatriceo avatar dependabot[bot] avatar eritscher avatar glynnw avatar htjjen avatar jdraiv avatar joker314 avatar pahosler avatar psyperl avatar ryanarnouk avatar snyk-bot avatar waffle-iron avatar

Stargazers

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

Watchers

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

discordbot's Issues

Add Help Command

I am thinking we should maybe add a help command to list all the commands you can give the bot as well as provide info on a specific command so someone can call it correctly. What do you guys think?

Examples can include:
@bot help
lists commands

@bot help __________<---command here
lists info on command

Administrator commands

We need adminstrative commands such as:

  • clearing/purging messages
  • banning w/ public reason message
  • kicking w/o message deleting
  • softban (kick with messages deleted)
  • mute
  • deafen
  • moving user to another voice channel

Bot failing

Update: the current theory is listed below

Collection#exists was removed in master but remains in stable. The hypothesis is that the resolution of #88 will resolve this issue; because an unstable version is currently being used when attempting to run.


Needs investigation. Reported by @Septimus via Discord.

Bot Crashing

if (guild.channels.exists("name", config.auditChannel) && config.adminTransparency) {
                   ^

TypeError: guild.channels.exists is not a function

Marking as "urgent" because it is crashing the bot.


This appears to be the faulty line:

if (guild.channels.exists("name", config.auditChannel) && config.adminTransparency) {


Based on the error message, we know that

  • guild.channels exists
  • guid.channels.exists might exist, but it might not -- but it's not a function.

wiki

create basic wiki page(s)

"good first issue" brainstorm needed

We need to come up with issues that those who are new to open source may find accessible. In particular, certain events, such as "Hacktoberfest", encourage users to make pull requests to FOSS.

Does anyone have any ideas? Perhaps easy-to-add commands? Or, perhaps textual changes to documentation (personally, that's a ๐Ÿ‘Ž idea from me because it doesn't immerse users into FOSS as much (albeit such changes are vital to FOSS).

How about timezone converters? Etc.

In addition, how about we add a special section for new contributors to the CONTRIBUTING file, which clearly explains how to make commands in an easy-to-understand manner? (Please mark such pull requests as "Towards #81" rather than "Resolves #81")

Feature Requests

Post feature requests in issues.
I've added a feature request label

Rollem / Rickroll

Do we want to add rickroll? I don't have any personal feelings, but it was one of the staple functions of Camperbot along with 8ball that got used semi-regularly.

We could rate limit it to keep anyone from being (overly) annoying.

PHPDoc Command

I have ported over my command for loading documentation links from the documentation at PHP.net. They already have a robust search system in the URL where if a direct match is found, documentation is served up, and if not it shows a list of recommendations; this command mirrors that producing either a message with recommendations on no match found or an embed on match found.

Example is as follows:
Screenshot

Does anyone have any feedback, questions, or cocerns before I open a PR?

Add Brownie points/other points system

I was wondering if you guys want to add some kind of brownie point system to credit users to help others with a thanks command. This point system doesn't really need to be brownie points but just some point/ranking system.

usage would probably be similar to @user thanks and then that users gets points.

snyk.io integration / badge

Snyk is a vulnerability database and monitoring service we can integrate in to ensure that our 3rd party code remains free (as possible) from security vulnerabilities. There is also a badge we can add to the profile.

It's not completely free, but I believe the free tier is more than enough for what we would ever potentially need. It can also be integrated into the CI / CD if we end up setting that up to proactively monitor new depedencies as they are commited in.

https://snyk.io

links

add links to Readme.md for commando.js, discord.js, using glitch, etc

Code of conduct

[good first issue] [help wanted] [needs-discussion]

It's crucial that software development is a safe and open environment. We should add a code of conduct, such as the Contributor Covenant.

Discuss!

Add command that directs users to file issues here

We should add a command to the bot to file issues and send them directly to a new issue. We should also make the command discoverable and the user aware it exists somehow. Maybe a message in the help command or such.

Add security.txt file

๐Ÿ—บ Overview

Security is really important. We already have a contact email for code-of-conduct violations. We're now using it for security vulnerability reporting too, I guess. Now, we need to add this email to a standardised file so that tools that security researchers might use can pick up on it (also, so that security researchers who are looking can easily find this contact email)

๐Ÿ“š Description

This is the email:

It needs to be added to a new file called .security.txt which should be in the top-level directory (that is, it shouldn't be in any folders)

This file should look like this:

# Reach out to this email and we will look into the issue as soon as we can.
Contact: mailto:[email protected]

๐Ÿ“‚ Relevant files

  • .security.txt (new)

๐Ÿ”— Find out more

About security.txt

Magic 8 Ball

"shake" the Magic 8 Ball and get a response to your life changing questions.

have options for
Classic Responses
Funny Responses
Sarcastic Responses
Mean "grumpy cat" Responses
Random Response from above responses

PHPDoc Command Refactoring

The PHPDoc command has some of its logic outside of the try catch. This needs to be refactored so the whole process is wrapped in the error handling.

Creating as a reminder for myself to clean this up.

Pakt Free book command

A command should be added that when called it scrapes the Pakt free book of the day site and does a better embed than the default when the URL is shared.

Example:
+paktfree

Example Output:
-Today's Free Book:
-Learning Python
--Learning Python has a dynamic and varied nature. With this book, it will take you all the way to creating a fully fledged application. Explore the essentials of programming, data structures and prepare to be taught how to manipulate them. From there you will move onto controlling the flow of a program and writing reusable and error proof code. Discover different programming paradigms that will allow you to find the best approach to any situation and learn how to perform performance optimization as well as debugging.

simple website/blog

this is a small group now, so this is a back burner issue, in other words I'm just seeding ideas for future projects.
Create a forward facing page describing our project and possibly bot development in general. We've already done some interesting things, let's talk about them!

Cat-us code

Catuscode is a command I implemented around https://http.cat/ (a cat for every HTTP status code). The functionality is very simple, you use catuscode 500 for example and it displays the following:
500 Code

Part of me thinks it's a goofy feature, I implemented it because I was basically working down a list of free APIs to play with, but on the same, in the discord channel we do have occasional questions like Why is my API call returning status code 301 and cat-pictures always help to stick in peoples memory. The box model explained with cats sleeping in a box comes to mind.

What do y'all think? Is there any value in porting this over?

Pull Request template is broken

Overview

The pull request template, designed for making pull requests include all the correct information, is not correctly formatted

๐Ÿ’ก What's wrong

The Resolves XXXX text should, in fact, have a hashtag: Resolves #XXXX

In addition, there is a missing HTML closing comment at the end of this line

<!-- Describe which tests you performed (either manual or automatic)

It should, in fact, be

<!-- Describe which tests you performed (either manual or automatic) -->

This makes that subsection look a little hidden when the PR is submitted.

๐Ÿ“– Relevant Files

The changes you will need to make might be found in the below files

Add self-assignable pronoun roles

๐Ÿ—บ Overview

This is a good first issue. It's been specially made for newer contributors to open source; or new contributors to this repository, to start out.

You'll want to be familiar with the popular chat platform Discord -- and create a server there to test your bot. Then, you can create a bot, bot token, invitation link, and fill in the environment file, by following along our Contributing file.

Make sure to give your bot a role with adequate permissions so that it can give other users roles. That's important for this issue.

Remember: we're here to help. Your first contributions will likely be hard (either to open source; or to this repository). But we're really bored and are willing to spend a lot of time to guide you.

๐Ÿ’ก Description

Your task is to add a command pronoun that will allow users to self-assign themselves a limited set of roles. An example of the syntax of this command is given below

-pronoun add she

Your command should take two arguments. The first will be the action the user wants to take.

  • add ; a
  • remove ; r

On start-up, your file should read from a JSON file in the src/utils directory. You should make this file in your pull request, and give it the following text:

[
  {"aliases": ["he", "his", "him"], "roleName": "he/him"},
  {"aliases": ["she", "her", "hers"], "roleName": "she/her"},
  {"aliases": ["they", "their", "theirs", "them"], "roleName": "they/them"},
]

The code you write should

  • Read from the JSON file
  • If a user asks for something in an aliases field, check if the role specified in roleName exists
  • If so, assign the user that role. If not, show an error message to the user.

If the user does pronoun remove rather than pronoun add, in the last step you should remove the role from the user.

ProTip: you can require() in a JSON file and it will automatically get parsed as JS object
ProTip: look at other pieces of code that create commands
ProTip: The msg argument you get when responding to commands is documented and you might find guild interesting (it represents a server). This is quite hard, though, so please do ask if you get stuck!

๐Ÿ“‘ Resources

๐Ÿ“‚ Files you need to change

FCC Challenge Function

With the release of the new FCC curriculum and subdomain, it is fairly safe to assume our scraper based FCC challenge function is now broken.

AutoMagical tiny URL

Sometimes links we find and want to post in channel have a URL that is larger than the character limit in discord. Pass your long URLs to the bot, and it will send a discord friendly URL to the channel.

Dice Roll Command

Whether for legit table topping or just for lols, a dice roller should be added to the bot.

It should accept a string of dice and rolls in the following format: "1d6 2d20" where the first number is the number or rolls and the second is the number of sides on the dice.

Example:
+rollit 1d6 2d20

Example Output:
Roll Total: 30
1d6: 1
1d20: 12
1d20: 17

Better bot name

Lets try to list ideas for a bot name here and decide on a better name.

Do we need more labels?

I have already added these labels:

  • security
  • i18n
  • do not merge
  • urgent

Do we, perhaps, want some of these?

  • p1 "Priority-1, important"
  • p2 "Priority-2, in need of prompt attention"
  • p3 "Priority-3, can wait"

I mean, we could just use milestones.

In addition, we could add

  • text

To mark issues purely about text.

Can anyone think of any other labels we could use (either for PRs, or issues)

Remove Random Response to Bots

Should we remove th feature to randomly respond to other bots? This feature won't do very much good for us as there aren't really any other bots; but what about other guilds?

Allow multiple bot owners

Currently the bot doesn't allow but a single owner. We should allow multiple owner ids in the dotenv file or should we move that to a config file instead?

Add a linter to make sure code is formatted properly.

I think we should add an eslint or some similar linter to make sure that everyone contributing to the project uses the proper design and to insure that all the code is clean and good and formatted to our preferences (no semicolons, spaces, etc.)

campDevs email account

there needs to be an email account for this org
or
an individual needs to supply an email for a point of contact

this would be used for things like people needing to report issues or violations from the code of conduct
if we can set up a private email server we could all have personalized campDevs email as well

How to: create bot account

Clear instructions on how to create a bot account and add it to a server. Also streamline the token process by having a prompt on the cli ask for the token and store it in ".env". Optionally it should generate or spit out the url to add the bot to the server.

MDN command

I have prototypal code for calling documentation from MDN and want to run it past everyody before coding up a final copy.

Currently since MDN does not expose an API that I am aware of, the code I've written already works by doing a google search for a keyword and/or phrase locke down to the MDN domain, and then returns the first result as an embed.

Is this satisfactory? If not, does anyone have any ideas for a better implementation?

Vote/Poll Feature

A voting feature that will allow you to set up a poll

poll should have a customizable heading
poll should have customizable options with a two option minimum and possibly a fixed max of 10
poll should be able to accept a time limit with a default time limit of 1 hour (or longer perhaps)
poll should be able to set a percentage of guild members to vote, which will make the time limit minimum 48 hours, in other words poll could be set to require that a minimum 30% of members vote
the person that starts a poll should be able to get results of a running poll before time limit expires
members will have access to results at the end of the poll
results and poll should expire from database after 30 days

votes should be anonymous but only allow one vote per member
if you can think of any other options please add in comments, do not start a new issue.

@Devs - please read

Let's start adding better titles to the issues. Maybe prefixes like:
@campDevs/discordbot
Important!
Feature
News
Bugs
etc.

This will help keep things organized and help with getting each other's attention.

Another nice thing would be acknowledging a posted issue. Especially if there is a title that mentions the group.

If you see an issue that you would like to tackle, assign yourself to it and move it out of the inbox (maybe this is something you don't see if you aren't using waffle.io?)

Add tags to your issue, there is probably already an appropriate tag in the list.

These are just suggestions to make things a tad more helpful. Things are already getting busy with three or four active people. If this grows at all a little organization will go a long way.

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.