Code Monkey home page Code Monkey logo

gompei-bot's Introduction

Welcome!

I'm Samuel Currid. Discord bot developer, data miner, and video editing enthusiast.

Current Projects

ReadMe Card

Contacts

Gmail Discord

gompei-bot's People

Contributors

bwhetherington avatar chaarke avatar muirrum avatar samuelcurrid avatar theunlocked avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gompei-bot's Issues

[Feature Request] Keyword Highlighting

Feature: Keyword Highlighting

Parameters:

  • Setting
  • Regular expression pattern

Behavior:

  • When a message is sent that meets the user's designated highlight settings, the user will be DM'd with a message ID, the message contents, and what caused the trigger

Example calls:

  • highlight add foo -> adds the pattern foo to the highlight list. If "foo" appears anywhere in a message, the user will be notified
  • highlight add ^foo$ -> adds the pattern ^foo$ to the highlight list. If a message is sent where the only contents are "foo", the user will be notified
  • .highlight add f([oO0]|\(\)){2}bar -> adds the pattern .*f([oO0]|\(\)){2}bar.* to the highlight list. Any message containing "foobar" anywhere with any of the O's uppercase, lowercase, changed to zeros, or replaced with parentheses, will cause the user to be notified
  • highlight remove foo -> removes the pattern foo from the highlight list. The user will no longer be notified if "foo" appears anywhere in a message
  • highlight block user @Gompei -> messages sent by the user with the @Gompei will not trigger highlights
  • highlight unblock user @Gompei -> messages sent by the user with the @Gompei will now trigger highlights if they match highlight criteria
  • highlight block channel \#general -> messages sent to #general will not trigger highlights
  • highlight unblock channel \#general -> messages sent to #general will now trigger highlights if they match highlight criteria
  • highlight test foo bar -> tests if the string "foo bar" would trigger your highlight criteria
  • highlight block channel \#general foo -> blocks the pattern foo from triggering highlight in #general specifically
  • highlight block user @Gompei foo -> blocks the pattern foo from triggering highlight by @Gompei specifically
  • highlight list -> displays the highlight list and any associated settings
  • highlight clear -> clears the highlight list and any associated settings

Other notes:

  • Users must only be notified for messages in channels they have access to
  • Full list of arguments and sub-parameters:
    • add <pattern> (adds the provided pattern to the highlight list)
    • remove <pattern> (removes the provided pattern from the highlight list)
    • list (displays the highlight list and any associated settings)
    • clear (clears the highlight list and any associated settings)
    • block (blocks provided criteria from triggering highlights)
      • user <user> (blocks the provided user from triggering highlights)
        • <pattern> (blocks the provided user from triggering highlights for the specific pattern. This is optional)
      • channel <user> (blocks messages in the provided channel from triggering highlights)
        • <pattern> (blocks messages in the provided channel from triggering highlights for the specific pattern. This is optional)
    • unblock (unblocks provided criteria from triggering highlights)
      • user <user> (unblocks the provided user from triggering highlights)
        • <pattern> (unblocks the provided user from triggering highlights for the specific pattern. This is optional)
      • channel <user> (unblocks messages in the provided channel from triggering highlights)
        • <pattern> (unblocks messages in the provided channel from triggering highlights for the specific pattern. This is optional)
    • test <test string> (tests whether the provided string will trigger highlights)

[Feature Request] Regex-based Phrase Blacklist (automod)

Feature: Regex-based Phrase Blacklist

Parameters:

  • Regex pattern
  • Whether to add or remove pattern
  • Other actions

Behavior:

  • Provided patterns are added to a blacklist.
  • If a user sends a message that matches a pattern in the blacklist, the set automod actions will occur

Example calls:

  • .censor foo -> adds the pattern foo to the blacklist. Any message containing the string "foo" anywhere will trigger automod
  • .censor add ^foo$ -> adds the pattern foo to the blacklist. Any message consisting of only "foo" will trigger automod
  • .censor add f([oO0]|\(\)){2}bar -> adds the pattern .*f([oO0]|\(\)){2}bar.* to the blacklist. Any message containing "foobar" anywhere with any of the O's uppercase, lowercase, changed to zeros, or replaced with parentheses, will trigger automod.
  • .censor remove ^foo$ -> removes the pattern foo to the blacklist. Messages consisting of only "foo" will no longer trigger automod
  • .censor list -> displays the full list of blacklisted patterns.

Other notes:

  • General automod needs to be implemented first

Weather Cog

Weather Cog with commands for:

  1. Getting current weather information
  2. Opt in daily weather updates for users (DM)
  3. Extreme weather alerts

[Feature Request] Server/Channel/Role/User Information

Feature: Server/Channel/Role/User Information

Parameters:

  • Info type
  • Info type parameter

Behavior:

  • Display information about the provided information type based on the provided parameters (if necessary). I.e. information about the server, a channel in the server, a role in the server, or a specific user in the server.

Example calls:

  • .info server -> Display information about the server
  • .info channel #general -> Display information about #general
  • .info role 687392392898543643 -> Display information about the role with ID 687392392898543643
  • .info user 204705074239242240 -> Display information about the user with ID 204705074239242240

Other notes:

  • Server info includes things such as owner, boosts, basic server settings, member count, role count, channel count, creation date, etc.
  • Channel info includes things such as role access, basic settings, creation date, ID, etc.
  • Role info includes things such as user count, basic settings, creation date, ID, etc.
  • User info includes things such as roles, account creation date, server join date, ID, etc.

[Feature Request] Purge by Message ID

Feature: Purge by Message ID

Parameters:

  • Channel
    • Direct channel link
    • channel ID
  • Start message
    • Message link
    • Message ID
  • (optional) End message
    • Message link
    • Message ID

Behavior:

  • When given a channel and only a start message, purge all messages posted in the provided channel after and including the start message
  • When given a channel, a start message, and an end message, purge all messages posted in the provided channel after and including the start message AND before and including the end message

Example calls:

  • .mpurge #general 642051421549625395 -> purges all messages posted in #general after and including the message with ID 642051421549625395
  • .mpurge #general-2 642051421549625395 -> produce an error because there is no message with the provided ID in the provided channel
  • .mpurge 567169726250352644-642051421549625395 -> purges all messages posted in channel with ID 567169726250352644 after and including the message with ID 642051421549625395(this is the format that discord gives when you shift+click to get a message ID)
  • .mpurge https://ptb.discord.com/channels/567169726250352640/567169726250352644/642051421549625395 -> purges all messages posted after the linked message (inclusive)
  • .mpurge https://ptb.discord.com/channels/567169726250352640/567169726250352644/642051421549625395 https://ptb.discord.com/channels/567169726250352640/567169726250352644/642070277655756801 -> purges all messages posted after the first linked message and before the second linked message (inclusive)
  • .mpurge https://ptb.discord.com/channels/567169726250352640/567169726250352644/642051421549625395 https://ptb.discord.com/channels/567169726250352640/567182715171110942/743314778134413343 -> produce an error because the start and end messages are not in the same channel

Other notes:

  • Channel can be omitted if using message links
  • Secondary confirmation should be required before doing the purge. This could be formatted something like the following:
You are about to purge <#> messages from <channel>. 
The purge will start at <first purged message link> and end at <last purged message link>. 

Are you sure you want to proceed?

[Feature Request] Automod

Feature: Automod

Parameters:

  • Automod type (required)
  • Automod type arguments (required)
    • Automod actions for type
    • Criteria for automod type

Behavior:

  • Checks if incoming messages trigger certain automod triggers
  • Automod response to triggers can be defined or enabled/disabled

Example calls:

  • .pingspam enable -> enables automod for pingspam
  • .messagespam disable -> disables automod for messagespam
  • .attachmentspam criteria 4 5s -> sets pingspam automod to be triggered when someone sends 4 pings in 5 seconds (if pingspam automod is disabled automod won't trigger, but the criteria will still be set)
  • .censor addpunish mute 10m -> adds a 10 minute mute to the list of actions that will be taken against the offending message/user if pingspam automod is triggered (if pingspam automod is disabled automod won't trigger, but the punishment will still be set)
  • .pingspam removepunish delete -> removes message deletion from the list of actions that will be taken against the offending message/user if pingspam automod is triggered
  • .automod -> displays all automod settings

Other notes:

  • Full list of automod types and trigger parameters:
    • pingspam (pinging too many people too fast)
      • criteria <count> <timespan> (number of unique pings within specified timespan)
    • messagespam (sending too many messages too fast)
      • criteria <count> <timespan> (number of unique pings within specified timespan)
    • attachmentspam (sending too many attachments too fast)
      • criteria <count> <timespan> (number of unique pings within specified timespan)
    • linkspam (sending too many links too fast)
      • criteria <count> <timespan> (number of unique pings within specified timespan)
    • censor (sending a message containing a blacklisted phrase)
      • add <pattern> adds provided pattern to the phrase blacklist
      • remove <pattern> removes provided pattern from the phrase blacklist
  • Full list of automod response types and corresponding parameters:
    • mute <duration> (mutes the offending user for provided time. Mutes indefinitely if no duration is provided)
    • delete (deletes offending messages)
    • dm/pm (privately messages the offending user notifying them they triggered automod, how, and the punishment)
    • message (same as dm/pm, but sends into channel with offending messages)
    • warn (warns the offending user, notifying them they triggered automod, how, and the punishment)
    • kick (kicks the offending user)
    • ban (bans the offending user for the provided duration. Indefinitely if no duration is provided)
    • softban (quickly bans and unbans the offending user. This removes the last 48 hours of messages they have sent)
    • alert/defer <channel> <roles> (pings provided roles in the provided channel that an offense has occurred so that it can be reviewed)

[Feature Request] Suggestions

Feature: Suggestions

Parameters:

  • Suggestion action
  • Suggestion ID (if necessary)
  • Suggestion action reason (optional)
  • Suggestion type (if necessary)

Behavior:

  • Create and display lists of suggestions for the server
  • Allows users to make suggestions for the server
    • suggestion call will be deleted and replaced with an embed by carl bot
  • Allow administrators to mark suggestions as considered, approved, denied, or implemented
  • DM suggestion maker whenever the status of their suggestion has changed and for what reason
  • Potential alternate implementation: have changeable settings so you can decide whether to delete suggestion calls or DM suggestion makers.

Example calls:

  • .suggest this makes a suggestion -> Makes a suggestion with a unique ID and the description "this makes a suggestion"
  • .suggestion deny 1 -> Denies suggestion 1 with no reason
  • .suggestion consider 1 how tho -> Marks suggestion 1 as considered with the reason "how tho"
  • .suggestion approve 1 -> Marks suggestion 1 as approved with no reason
  • .suggestion implemented 1 did it -> Marks suggestion 1 as implemented with reason "did it"
  • .suggestion list -> lists all suggestions ever made (separated by status)
  • .suggestion list denied lists all suggestions currently marked as denied
  • .suggestion list approved -> lists all suggestions currently marked as approved
  • .suggestion list active -> lists all active suggestions (suggestions not currently marked as denied or implemented)

Other notes:

  • Will need a way to set a suggestion channel (where suggestions will go when made and/or where they must be made, e.g. a server feedback channel)
  • Suggestion actions:
    • deny -> denied, will not be implemented
    • consider -> considered, may or may not be implemented
    • approve -> approved, will be implemented
    • implemented -> implemented, no more to do
    • list -> list all suggestions (list actions follow)
      • denied -> list denied suggestions
      • considered -> list considered suggestions
      • approved -> list approved suggestions
      • implemented -> list implemented suggestions
      • active -> list active suggestions (considered or approved)
      • inactive -> list inactive suggestions (denied or implemented)

[Feature Request] Time-based Purge

Feature: Time-based Purge

Parameters:

  • (required) channel
    • Direct channel link
    • channel ID
  • (required) Start time
    • 12-hour time (e.g. ##am, ##:##am, ##pm, or ##:##pm). Assumes current day. Colons can be omitted
    • 24-hour time (e.g. ##:## or ####). Assumes current day.
    • Unix time
    • Some other explicit date + time format?
    • A quantity of time (e.g. #s, #m, #h, #d, etc.)
  • (optional) End time
    • 12-hour time (e.g. ##am, ##:##am, ##pm, or ##:##pm). Assumes current day. Colons can be omitted
    • 24-hour time (e.g. ##:## or ####). Assumes current day.
    • Unix time
    • Some other explicit date + time format?

Behavior:

  • When given a channel and only a start time in a time/date format, purge all messages posted in the provided channel after the start time
  • When given a channel, a start time in a time/date format, and an end time, purge all messages posted in the provided channel between the start and end times
  • When given a channel and only a start time in a time quantity format, purge all messages posted in the provided channel less than the provided quantity of time before the current time

Example calls:

  • .tpurge #general 10am -> purges all messages posted in #general between 10am and current time
  • .tpurge #general 10am 1pm -> purges all messages posted in #general between 10am and 1pm
  • .tpurge #general 1000 1300 -> purges all messages posted in #general between 10am (1000) and 1pm (1300)
  • .tpurge #general 1603879200 -> purges all messages posted in #general between 1603879200 (10/28/2020 @ 10:00am UTC) and current time
  • .tpurge #general 1603879200 1603976400 -> purges all messages posted in #general between 1603879200 (10/28/2020 @ 10:00am UTC) and 1603976400 (10/29/2020 @ 1:00pm UTC)
  • .tpurge #general 1h -> purges all messages posted in #general in the last hour

Other notes:

  • Command must either (a) always expect UTC or (b) bot must know the current/expected timezone. Unsure which would be better
  • Secondary confirmation should be required before doing the purge. This could be formatted something like the following:
You are about to purge <#> messages from <channel> between <start time> and <end time>. 
The purge will start at <first purged message link> and end at <last purged message link>. 

Are you sure you want to proceed?

[Feature Request] Command usage restriction

Feature: Command usage restriction

Parameters:

  • Command/category to restrict
  • Restriction type (whitelist/blacklist/clear/unset) [optional]
  • Restriction action (role/channel/user) [optional]
  • ID to restrict (if necessary)

Behavior:

  • Allow/disallow certain users or roles from using certain commands in certain channels
  • List restriction settings

Example calls:

  • .restrict ban -> lists the current restriction settings for the ban command (whether its in whitelist or blacklist mode, the users/roles on the list
  • .restrict ban whitelist -> sets the ban command to the whitelist restriction type for all types
  • .restrict roll blacklist role -> sets the roll command to the blacklist restriction type for roles
  • .unrestrict kick role 742118136458772551 -> unrestricts the usage of .kick for the role with ID 742118136458772551. If kick is set to blacklist mode for roles this removes 742118136458772551 from the blacklist. If whitelist mode this adds 742118136458772551 to the whitelist.
  • .restrict ban role 742118136458772551 -> restricts the usage of .ban for role with ID 742118136458772551. If ban is set to blacklist mode for roles this adds 742118136458772551 to the blacklist. If whitelist mode this removes 742118136458772551 from the whitelist.
  • .restrict roll user 204705074239242240 -> restricts the usage of .roll for user with ID 204705074239242240.
  • .restrict moderation whitelist -> sets the moderation category of commands to the whitelist restriction type
  • .restrict roll channel 567179438047887381 -> restricts the usage of .roll in the
    channel with ID 567179438047887381.
  • .unrestrict moderation role 742118136458772551 -> unrestricts the usage of commands in the moderation category for the role with ID 742118136458772551.
  • .restrict ban clear -> clears restriction settings for .ban, emptying any blacklists or whitelists
  • .restrict ban clear role -> clears restriction settings roles for .ban, emptying the role blacklist/whitelist
  • .restrict ban unset -> unsets restriction settings for .ban. This means Gompei will refer down to the category's settings (in this case, the Moderation category) until settings are set again for .ban
  • .restrict ban unset user -> unsets restriction settings for .ban for users. This means Gompei will refer down to the category's settings on the user basis (in this case, the Moderation category) until user settings are set again for .ban
  • .restrict ALL role 742118136458772551 -> restricts the usage of all commands from the role with ID 742118136458772551.
  • .unrestrict ALL channel 567179438047887381 -> unrestricts the usage of all commands in the channel with ID 567179438047887381.

Other notes:

  • ALL is a super-category referring to ALL commands. This is basically the default for everything if command- or category-specific settings are unset. No part of ALL can be unset (most you can do is an empty blacklist or whitelist, which would give everyone full permissions or no permissions, respectively, if everything else is unset)
  • Full list of restriction types and parameters:
    • restrict/unrestrict base command. Latter is used to unrestrict usage
      • <command/category/ALL> command/category to change restriction settings for. List current settings if no additional parameters
        • whitelist/blacklist/clear/unset sets the command restriction setting to whitelist, blacklist, clear (clears the current list), or unset (refer to higher lower tier of heirarchy). Changes the setting for roles, users, and channels if no additional parameters
          • role sets role restrictions to blacklist or whitelist depending on previous parameter
          • user sets user restrictions to blacklist or whitelist depending on previous parameter
          • channel sets channel restrictions to blacklist or whitelist depending on previous parameter
        • user/channel/role <id> adds or removes the provided ID from its corresponding whitelist/blacklist depending on if restrict or unrestrict were called
  • When a command is set to whitelist mode, only users that have been whitelisted are allowed to use the command
  • When a command is set to blacklist mode, all users are allowed to use the command except those that have been blacklisted
  • Roles that have Administrator permissions or are higher than the Gompei role in the role list have access to all commands in all channels (Gompei ignores all restrictions)
  • Calling .restrict or .unrestrict should always provide a confirmation prompt saying something like You are about to [add/remove] [user/role] <ID> [to/from] the [whitelist/blacklist] for the command <command>. This will [restrict/unrestrict] their access to the command. Confirm?
  • Setting up command categories may be troublesome, but it would simplify adjusting restrictions.
  • Everything should be unset by default with the exception of ALL, which should be set to an empty whitelist (so only admins can use it). This avoids a shortcoming of Carl bot, which is that it has a lot of commands enabled by default for everyone which you may not want or probably shouldn't be.
  • Could possibly have a special option for restriction by permissions, so you could do something like .unrestrict <command> permission manage-messages which will allow the command to be used by any role or user that has the manage-messages permission.
  • Listing restrictions for a command could look something like the following:
    Screenshot 2020-11-10 150112

Hierarchy

  • User restrictions have precedence over role restrictions (so if a user has a role with access to a command, but the user has been specifically restricted from using it, they cannot use it). See below
  • Channel restrictions have precedence over user and role restrictions (so if a command is whitelisted to only be used in a certain channel, no matter the restrictions for a user or their roles, the channel restriction takes precedence so they can only use it in corresponding channels). However, this is only a filter. If a user or role is blacklisted from using a certain command, they cannot use it anywhere, even in a whitelisted channel. See below
    restrictIDs
  • Command restrictions have precedence of category restrictions (so if a category is restricted for a role, but a specific command in that category is unrestricted, then that command alone will be allowed). See below
    restrictTypes
  • Edge case: Suppose ban is unset for users, has a whitelist containing Moderators, and an empty whitelist for channels (so the command can be used in any channel, but only by moderators). Suppose the Moderation category has a whitelist for users containing the user UserFoo, an empty blacklist for roles, and an empty whitelist for channels (so UserFoo alone can use any Moderation command in any channel). UserFoo is not a moderator. Because UserFoo is whitelisted in the user list for the Moderation category and the user list is unset for ban, UserFoo CAN use ban despite not being a moderator. Basically, having an unset list is the same as saying "use the list for whatever is lower in the hierarchy."
  • This hierarchy allows for very intricate settings such as having a command restricted on a whitelist basis for roles, but on a blacklist basis for users (e.g. you can set a role whitelist for kick that only allows the the command to be used by moderators, but set a user blacklist so that a specific mod cannot use it)

Create setup page

README needs to be updated and setup page needs to be updated to show how to setup the bot with intents.

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.