Giter Site home page Giter Site logo

noahbot's Introduction

NoahBot Contribution Guidelines

The paperwork

To contribute, please follow these guidelines:

  • Look at the current Issues and/or discussions taking place in the #bot-dev channel on Discord for things that needs to be done.
  • Please create a feature branch for your work.
  • Please use pull requests from feature branch to master once you are confident that the implementation is done.

Before creating a pull request

Please ensure that the following is fulfilled:

Functionality and testing

  • The code has been tested on your own server and appears to work as intended.
  • The code handles errors and malformed input gracefully.
  • The command is implemented in both slash commands and prefix commands using the same approach as all other places (if applicable).
  • Permissions are set correctly.

Code quality

  • Follow PEP-8 style guidelines, except the maximum line width (which can exceed 80 chars in this repo - we're not in the 1970's anymore).
  • Try/except the actual error which is raised.
  • Proof read the code and fix oddities.
  • If in doubt, assume Birb is already exhausted from work. ๐Ÿ™ƒ

Always leave the campground cleaner than you found it.

noahbot's People

Contributors

heckerbirb avatar clubby789 avatar 0xemma avatar toxicbiohazard avatar khaoticdude avatar

Stargazers

Frank Gottinger avatar Lav avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

noahbot's Issues

++spoiler <URL> command to replace mee6 !spoiler <URL>

The command should copy/paste the URL into the (probably hidden for most) "spoiler-report" channel (ID 570672411067023372) and delete the original command that the user sent.

The current format is the following, and is fine to replicate:

New spoiler report from: Birb#0001

Details:

https://urlgoes-here.com/path/to/blog

[Don't close this] More debug/info/warn/error log messages would be nice

(Place holder issue for adding more log messages)

When adding log messages consider the following things, for each type of log message:

ALL log messages:

  • Must have correct English. Use a spell checker. If in doubt, ask Birb.
  • Must use formal version of words - no colloquialism ("dunno", "gonna", etc.), and avoid shorthand words ("don't", "can't", etc.).
  • Can optionally contain bits of humor and funny sentences, as long as they make sense.

Debug logs:

  • Should contain helpful data so that when the log appears in a terminal during normal runtime, it helps find the root cause of a problem.
  • Should be as verbose as needed except for logging Python memory references (i.e. don't print object references unless they have a meaningful "to string" function).
  • Should exist where they make sense to exist
  • Should not be spammy.
  • Should not be used as "trace" level messages (i.e. don't log "entering XYZ" function and "leaving XYZ")

Info logs:

  • Should contain general nice-to-know information about the event that occurred, so that when we disable printing debug messages, the info messages will tell what happened (e.g. "Member FooBar identified as XYZ", "Adam#6969 was banned until 2022-03-14")
  • Should be readable by a non-technical person.
  • Should not contain nerdy, verbose information.

Warn logs:

  • Should warn about a potentially bad situation that may happen or have happened which may be bad.
  • Should preferably contain information about how to resolve the situation (e.g. "cleanup may be needed").

Error logs:

  • Should be verbose.
  • Should be used even if we can recover seamlessly.

slash command spoiler - Bug

image

I have faced the same issue when using slash command for spoiler. I thought it was only me for so long. But now I can confirm everyone has the same issue.

Support for automatic role update (e.g. ranks)

It would be nice to have a way for members to automatically have their roles updated when they rank up in HTB. This could be done like the old bot:

The old bot had an "on_message" hook which would basically perform the ++identify functions when the user typed something on the server, if that user is not "timed out" for checking. That is, on user message, check if timeout - if not, perform identify the role obtaining/assigning functionality from the ++identify step and put the user on a 1 hour long timeout. The timeout was a table in the database containing rows of (id, discord_user_id, last_checked) or something like that. A new timeout would be a new row or an update of an existing row.

Ability for bot to ignore user/channel (optional: duration)

Ignoring a user: the bot could simply check if the ctx.author is ignored (row in table in the DB) and then just return without doing anything.

Ignoring a channel: do not perform actions from this channel at all and/or optionally return a dummy message, if required by Discord (e.g. slash commands requiring a response).

The optional timeout could be implemented similar to the way auto-unmute and auto-unban are implemented today (i.e. auto-unignore).

++join (without a role) should list available roles to join

The help text says:

++join [role_name...]

Join a vanity role if such is specified, otherwise list the vanity roles available to join.

but typing just ++join adds you to Blue Team. Should instead send an embed of a list of the joinable roles.

Store current roles per user in the DB for auto-assign upon rejoining

We should store the current roles of a user in the DB so that whenever a user leaves and returns, they will get their roles back.
This should include the Mute role, meaning the ++mute and ++unmute functions need to also add/remove the muted role of the user in the DB.

Bonus: users get to keep their vanity roles as well, which in some cases are once-in-a-lifetime "trophies" if you like, e.g. the April Fools event roles.

DB Table user_role_link should contain at least:

  • id (default id field, also primary key)
  • discord_user_id
  • discord_role_id

We can then SELECT discord_role_id FROM user_role_link WHERE discord_user_id = %s and add each role we have stored.

Mod actions and record affection:

  • ++tempban / ++ban should clear the records
  • ++kick should keep the records
  • ++mute should add Muted role
  • ++unmute should delete Muted role
  • ++join should add <role> role
  • ++leave should remove <role> role
  • Any event "trophy" roles, such as the April Fools roles, should be added to the DB also when assigned to the user

(The names are just suggestions)

Refactor _proxy_helpers.py

It started as a common place to keep shared code to better support the whole slash-and-prefix-commands mix, but has since then grown to a "utils.py" file which is bad.

It should be refactored, e.g. extracting common functions like ban and mute to a new file, so that _proxy_helpers.py only contains code meant to wrap other calls, for ambiguity purposes (like how the reply-function works with both slash and prefix commands and sort of acts as a proxy or wrapper to their real function calls).

Add/Remove/Use custom macros

Ability to create and store custom macros for use:

++addmacro <macro_name> <content_here>: store the content in a row in a table in the DB
++listmacros (alias: listmacro): list all macros stored, showing their macro_name and their text, cut off to at most, say, 20 chars followed by 3 periods (e.g. "This is a macro that...").
++removemacro <macro_name> (alias: deletemacro, delmacro): delete the macro from the DB
++macro_name (slash command version: /macro <macro_name> -- or if you're feeling frisky, dynamically load the new macro as a guild-specific slash command): output the command as NoahBot

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.