twentysix26 / x26-cogs Goto Github PK
View Code? Open in Web Editor NEWGeneral purpose cogs for Red V3
License: GNU General Public License v3.0
General purpose cogs for Red V3
License: GNU General Public License v3.0
Cog
Describe the feature you'd like to see
Add multiple possibilities for all message sending actions such as send-in-channel, dm-user, send-dm.
Like this warden could randomly choose one possible response and send it.
Maybe even an optional weight/probability parameter so you can control which message is more likely to be chosen.
As the configuration is in yaml something like this could work.
Without weight.
rank: 2
name: random-greeting
event: on-message
if:
- message-matches-any: ["hello"]
do:
- send-in-channel:
- message: "hello $user_mention"
- message: "greetings $user_mention"
- message: "howdy $user_mention"
With optional weight parameter.
rank: 2
name: random-weighted-greeting
event: on-message
if:
- message-matches-any: ["hello"]
do:
- send-in-channel:
- message: "hello $user_mention"
weight: 80
- message: "greetings $user_mention"
weight: 10
- message: "howdy $user_mention"
weight: 10
Cog
Describe the feature you'd like to see
A clear and concise description of what you'd like to see
Can we get a place to share our custom warden scripts.
Maybe someplace simple like a pinned issue.
In the first para of conditions for warden on the line there is a word called patters assuming u meant patterns .. here's the link
Also attached a ss below ..
Cog
Describe the bug
As the bot/server owner i'm unable to invoke commands like 'vaporize' or 'voteout' i get greeted with this message 'You are not authorized to issue this command.' there is only one server of mine where i can successfully invoke these commands, i've checked permissions and reset Defender multiple times with the same result.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The command should execute the action
Cog
Describe the feature you'd like to see
I would like to be able to use the send-to-channel
action to ping a mentionable role.
For instance, if an on-emergency
event was triggered, I'd like to be able to send a message to a specific channel like:
send-to-channel: [HelperAlerts, "@HelperRole, Emergency Mode has been enabled."]
where HelperRole is set to allow mentions.
Cog
Describe the feature you'd like to see
A configurable short cool down on the notifications from modules such as invite filter and comment analysis would be nice. When it comes to invite filter, spam bots can usually get a good 1-3 invites in before they are removed.
If you use a warden rule to relay this information, a simple heat condition check prevents this from behaving like the invite filter and it can only run its notify-staff action once before the invite spammer is removed.
Cog
Describe the feature you'd like to see
For delete-last-message-sent-after
, increase time allowed before deletion.
Optional: If above a certain recommended "maximum" time, send a warning before rule applying.
This will be useful for when a message passes a threshold and an attribute set by the condition. An example config;
rank: 2
name: SEVERE_TOXICITY above 80
event: [on-message]
if-all:
- commentanalysis_attributes: "SEVERE_TOXICITY"
- commentanalysis_threshold: 80
- is-staff: false
do:
- issue-command: "mute $user_id"
Cog
Describe the feature you'd like to see
This function would be able to add emote reactions under messages the rule acts upon.
Cog
Describe the feature you'd like to see
This action would be similar to delete-last-message-sent-after
action but it would replace the message instead of deleting with the send-message
action under it.
Cog
Describe the feature you'd like to see
Allow Warden to reply to messages with/without pinging. This would be a better usage instead of having to specify $user_mention in the message send field to direct content to users. You had your own idea for implementation, so I am not going to suggest how you do this, just logging it here as a feature request.
Cog
Describe the feature you'd like to see
When applying a periodic rule, depending on user base size, the rule can take a while to verify. What this change proposes is a way set an automatic override temporarily (or toggle) to push the rule through without needing interaction.
For example, if I only change a send-message entry to fix a typo, it is still (technically, not literally) the same rule. However, it will need to spend a long time (varies) re-verifying that same rule with constant attention just to apply a typo fix.
Cog
Describe the enhancement
Similarly to Cog-Creators/Cog-Browser#10, it might make sense to call the field differently to avoid users from misinterpreting it as something they need to handle manually.
Awesome cogs! Thank you for your work.
I'm trying to get the defender working, but it says:
Possible configuration issue: I'm not able to see the audit log in this server. I may need this to detect staff activity.
Is this a permission problem of the bot/application on discords side or did I miss configuring something in Red?
Thanky you.
Cog
Describe the feature you'd like to see
Similar to user-activity-matches-any
in Warden conditions, there should be an online-status-matches-any
consisting of Online, Away, DND, Streaming, & Offline.
Cog
Describe the feature you'd like to see
I want to start off by saying that this is my 2nd Git issue/request/suggestion thing so I apologise if it's not done correctly.
On my instance of Red I've got two cogs that do this in a somewhat okay but not ideal method. Blocking or alerting staff of rich presence invites/status invites. They do this pretty well but sadly it requires manual execution to do its job. I am currently using Defender to handle message spam, specific keyword filtering, banning users if their username matches x and y and raid detection so it's safe to say I am more than happy with how it works. A little while ago however I was watching over a troll that joined the server and noticed that their custom status was set to an invite link and wondered if Defender could search for statuses that match any form of advertising and either I'm blind and glossed over it or there isn't a way (currently) to do it.
My feature request is to add status or activity scanning for advertising, applying roles if their status matches x/y etc etc. It might make the whole process more resource demanding but that's totally a sacrifice I'm willing to take should this be possible.
If you'd like to contact me for a better explanation, my Discord is ItzXenonUnity | Lou#2369
Cog
Describe the feature you'd like to see
It would be nice to have a new action that could generate relative timestamps via a set variable. Example:
- var-assign-timestamp: [var_5minutes, R, 5 minutes]
This would produce a variable on action that would display in 5 minutes
, as we used the R timestamp version.
Another example:
- var-assign-timestamp: [var_2hours, f, 2 hours]
would display: July 20, 2022 10:55 AM
as we used f instead of R
As warden is not meant to be persistent. This feature should be limited to 24 hours time as it is meant to be relative to the execution.
Cog
Describe the feature you'd like to see
Sometimes you just do not want it to run in general chat. 💯
Cog
Describe the feature you'd like to see
message-contains-word
should be punctuation aware. If you are looking for "word"
and someone uses it to end a sentence with proper punctuation ("word?"
), it does not proc as a valid word match. If you do "*word*"
to match it then you might as well just use message-matches-any
because it is the same thing.
Cog
Describe the feature you'd like to see
When running def messages user
. if you are using an ID it may not be apparent to mods who you are looking at and they may overlap lookups, ask who it is, etc.
I have made a warden rule that does this for me, but I would like to see it in the core function instead of separate message with warden trickery.
Cog
Describe the feature you'd like to see
Warden rules could be enabled/disabled. By default, every rule should be enabled, but if you specified the following, it would disable it and place it under a disabled category:
rank: 1
name: rule_example
event: [disabled]
Why this would be useful
Sometimes rapid-deployed rules are required such as the case of the namescraper h0nde a few months ago.
These rules can be reused later on without needing a rewrite or searching through uploads, etc.
Cog
Describe the feature you'd like to see
A new action similar to Start-Sleep
from Powershell within Warden rules. Example: start-sleep: 10s
This would sleep the execution of the rule action being processed before continuing after the specified time period.
Cog
Is it possible through Defender or Warden at some point to monitor fo role deletion/creation, channel deletion/creation and thresholds around bans and Unbans? I’ve seen a couple bots have this functionality that if they see someone of power start mass deleting roles or mass removing channels it auto-strips all their roles. You can define limits per hour or per day on how many roles, channels or bans/unbans can take place per user each hour and each day. If you are aware of a cog that does this already so I don’t have to use another bot to monitor for this that would be great! Think this would be a good addition to defender if it’s possible. Thanks!
Cog
Describe the feature you'd like to see
To go along with the user-activity-matches-any
condition. This would be a context variable that lists the user activity as it were when the rule ran. e.g. $user_activity
Cog
Describe the feature you'd like to see
A clear and concise description of what you'd like to see
I'm sure this could be done with warden rules but the raider detection module is pretty simple and easy to use. The only downside is that it often mutes or punishes users for spamming bot commands like Dank Memer in the bot channel. Obviously it's doing its job but its doing it a little too well.
A channel ignore command would be absolutely perfect. It would cut down on accidental flags and manual intervention and I feel as if it would add more flexibility to defender so you can pick what channels you wish to ignore
Cog
Describe the feature you'd like to see
The ability to use (custom)heatpoints with the compare condition as per example below.
name: test
rank: 2
event: [on-message, on-message-edit]
priority: 1
if:
- if-any:
- message-matches-any: ["hello*"]
- if-not:
- category-matches-any: [123456789]
do:
- add-custom-heatpoints: ["$test-$user_id", 50, 24h]
- compare: [$test-$user_id, ">=", 100]
- if-true:
- send-message: [$channel_id, "hello $user_mention, your heatpoints is equally to 100 or above."]
- if-false:
- send-message: [$channel_id, "hello $user_mention, your heatpoints is below 100."]```
Cog
Describe the feature you'd like to see
A filter for Warden's heat store listing.
[p]def memory <string>
Example:
If you wanted to view all custom heat for a user's ID, [p]def memory 123456789012345678
antispam-123456789012345678, 2
badwords-123456789012345678, 3
Example2:
If you wanted to view all heat for an antispam rule, [p]def memory antispam
antispam-123456789012345678, 2
antispam-876543210987654321, 1
I need automod features in by bot like automute and stuff but cant figure how to add a warden rule. Please help.
Cog
Describe the feature you'd like to see
New feature for Warden module: Scheduled Rules and Timed (Quick/Expiring) Rules
Scheduled Example: You wish to disable the word "Apple" from being said after 8pm UTC, then allowed again after 8am.
Timed/Expiring Example: You want to stop role X from saying "Apple" for the next 2 hours.
Scheduled/Expiring would be under its own category such as "periodic".
You could also re-activate timed/expired rules by using an already available command: !def warden run <rule>
Why would this feature be useful
A lot of servers don't have the sheer manpower to always have moderators available at irregular times depending on the region the guild is predominantly used by. By using timed rules, you can enforce stricter rulesets when mods are assumed resting and it will be disabled by the time some are waking up.
Cog
Describe the feature you'd like to see
Now that stickers are rolling out more widely, and no sign of the promised permission controlling them, it would be nice if messages with stickers could be detected by Warden. A condition like message-has-sticker
would do. A glance at the discord.py documentation suggests it should be a simple check for whether a message's stickers list is empty, so hopefully feasible to add.
Thanks for reading
Cog
Describe the feature you'd like to see
Since we have a sync ban, if we could add sync unban, that would be interesting, as it can save us the hassle, of unbanning users manually in Server B, which I normally tend to forget, after unbanning them in Server A.
Cog
Describe the feature you'd like to see
An on-nickname-change
event would allow Warden to completely replace the normal Filter cog, as currently it has no way (that I'm aware of) to detect nickname changes, aside from just periodically running the rule.
Cog
Describe the feature you'd like to see
An update command to warden so we don't have to remove the rule then re-add it, especially if the rule(s) are long.
[p]defender warden update <rule>
Cog
Feature
Allow use of regex instead of simple wildcards, instead of simple wildcards. (something like https://docs.python.org/3/library/re)
Preferably add a new condition like message-matches-regex
since regex is a lot more complex than wildcards, and would break old rules.
Cog
Defenders listeners should respect Red's cog disabled in guild setting. While you have most events locked behind an enabled setting within the cog there's some that don't have an explicit setting and they should still respect cog disabled in guild if a bot owner chooses to set the cog as disabled by default.
Cog
Describe the feature you'd like to see
Similar to cogs dealing with economy that allow third party econ selection. Defender should have a selection between using mod
cog vs WarnSystem
for usages such as vote-outs, raid detection, etc. Warden would also utilize and replace with the selected mod tool.
Example:
softban-user
when using WS instead of mod would run a level 4 warn natively (softban).
Thank you for you consideration.
Cog
Describe the feature you'd like to see
A clear and concise description of what you'd like to see
Some bots out there like Wick, CrossLine and a couple others that I've forgotten the names to provide information on where the invite link goes. Let's say for example someone posts a link to discord.gg/, currently the invite filter module only displays the message (so the invite code), username, their ID, the channel & a jump to message link. I personally think that having an option for more details similar to what is shown here. I have obviously removed sensitive information both because I don't want users joining it and also because it violates Discords' community guidelines, hence it's been reported.
Having it all displayed through invite filter would be much more easier to manage the situation instead of having to run another command to know what the invite goes to.
Cog
Describe the bug
Defender - Warden
Ignores new messages sent when a user replies to someone else comment.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
For the Warden to detect the content of the message to delete
Cog
Describe the feature you'd like to see
This was a requested feature that slipped through the cracks (discord link of original request) of me actually putting in an issue for.
Simply, there would be a toggle for the Invite Filter, much like CommentAnalysis, that would only notify and show invite information instead of taking an action.
Cog
Describe the feature you'd like to see
Add more Discord action actions like mute-user
so I can create a modlog with a specified reason.
send-mod-log
does not add a reason to manually adding the muted role to a user.
Cog
Describe the feature you'd like to see
A new context variable that links to the current guild picture. ex: $guild_pic
When making -send-message
embed responses or similar, you currently need to manually link the server's "profile" picture if you utilize it. If you directly link it instead of using a static object such as an attachment, it will eventually break if ever changed. This means you need to go through every single rule this image is linked to, and change it.
Cog
Describe the feature you'd like to see
I think it would be more useful if md was used instead of rust as markdown when running the def messages user and channel command. By using this, it puts the channel color as orange, doesn't interact strangely with numbers/emotes/statements, everything else remains the same.
Cog
Describe the feature you'd like to see
When using CommentAnalysis
, Threshold limit has to be set to 98%+ to avoid false-positives. This is not a Defender issue, however, in order to provide feedback to the AI API to correct these false positives, I am requesting 2 items
First, the ability to Notify but Not Delete items that trigger the threshold limits for CommentAnalysis
. Currently, Action None
actually Deletes the Message in addition to Logging it.
Second, the ability to submit Feedback scores from the reported message embed, as outlined in the API Docs under Sending feedback: SuggestCommentScore
This will allow us to submit corrections for false positive in context, while alerting the staff to actual TOXIC/INSULT/THREAT messages..
Cog
Describe the feature you'd like to see
Before I started using Red I was using Carlbot for its flexible moderation and feature set. One feature that I found really handy was the drama channel premium feature where it would delete the message and then it would send a mini transcript to the channel set on the dashboard and it would post an embed looking like this.
It would then give you some options in the form of emojis (I imagine it could be done with buttons now that they are a thing). I found it extremely handy because it gave you context, previous messages and then options on how to deal with the person.
I've managed to create something similar but obviously I can't recreate the emoji action part. If this were to get added to Defender I imagine it would open up many more possibilities
Cog
Describe the feature you'd like to see
Essentially what this would be doing is looking at the past few messages and see if they are the same thing, so it'd be like antispam but not exclusive to one user, using a shared phrase. For example, if one user said "This is a raid" and the next 8 users said "This is a raid" it'd pick up on this, warn them and delete their messages. However, there'd have to be some time limits as well as role restrictions/whitelisted roles. For example, there are chains, so trusted users/roles we wouldn't want this to be applied to.
Cog
Describe the feature you'd like to see
Allow subscription on reaction events, similar to on-message on-message-edit on-message-delete on-user-join on-user-leave.
Just like how sometimes certain messages are not wanted in certain text channels by certain users, certain reactions are not wanted on certain messages. This will give you the possibility to configure that behavior.
Cog
Describe the bug
Since Red's update to 3.5 and then 3.51, Defender no longer loads. There was also a python point release.
To Reproduce
Steps to reproduce the behavior:
Steps 1-3 or 4-8 yield the same trace (I've got a backup of the bot so I was able to reproduce the error even after following the instructions).
[2023-05-10 06:13:42] [ERROR] red: Package loading failed
Traceback (most recent call last):
File "/data/venv/lib/python3.11/site-packages/redbot/core/core_commands.py", line 188, in _load
await bot.load_extension(spec)
File "/data/venv/lib/python3.11/site-packages/redbot/core/bot.py", line 1680, in load_extension
lib = spec.loader.load_module()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 605, in _check_name_wrapper
File "", line 1120, in load_module
File "", line 945, in load_module
File "", line 290, in _load_module_shim
File "", line 721, in _load
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/data/cogs/CogManager/cogs/defender/init.py", line 2, in
from .defender import Defender
File "/data/cogs/CogManager/cogs/defender/defender.py", line 24, in
from .abc import CompositeMetaClass
File "/data/cogs/CogManager/cogs/defender/abc.py", line 24, in
from .core.warden.rule import WardenRule
File "/data/cogs/CogManager/cogs/defender/core/warden/rule.py", line 25, in
from .utils import has_x_or_more_emojis, REMOVE_C_EMOJIS_RE, run_user_regex, make_fuzzy_suggestion, delete_message_after
File "/data/cogs/CogManager/cogs/defender/core/warden/utils.py", line 1, in
from fuzzywuzzy import fuzz, process
ModuleNotFoundError: No module named 'fuzzywuzzy'
Expected behavior
I expected the cog to load without issue. Provided that happens, I expect the cog to load its configs.
Cog
Describe the feature you'd like to see
There are two suggestions that would really be nice to include. One of them is supporting embeds for send-in-channel: or any other actions that send message including dm's. It's not a "must have" feature and there is no rush to include it but would just be nice to have that option in the bots embed colour.
Second feature I was hoping that could be added was the ability to make the issue-command be set so it shows that the bot invoked the command rather than the person who created this rule. One of the reason is that in large servers, you get unwanted dms of people asking me why I kicked/banned them, even though it clearly says on the rule "THIS WAS AN AUTOMATED ACTION" but seems like no one likes reading.
That's all, even if these don't get implemented, it's alright. I love defender/warden as it is and won't ever stop using it 🥰
Cog
Describe the feature you'd like to see
The following variables for messages (which are already calculated, but not available in filters) to be exposed:
Hence, a system can be created like WickBot, wherin all messages add to a custom heat level, the "badder" the message the more heat, and if a large number is reached action is taken. This is more effective than having individual rules for each element, as their effect can combine.
(E.g. for Wick, 0.08% per lowercase character, 0.12% for uppercase, 3% for emojis, 1.5% for zalgo; going to 100% for punishment)
Cog
Describe the bug
When a user tries to post a Discord promo link (https://promos.discord.gg/7ASKkGRnEYmdjxEpAyjGEJNg for example), the bot treats this as a server invite and actions/rules on the user tied to discord.gg in general.
To Reproduce
Steps to reproduce the behavior:
message-contains-invite: true
targeting the test rank'Expected behavior
It should ignore and treat it as a regular URL. You can workaround by ignoring it using the warden - if-not:
condition in conjunction with a match for promo in an invite. However, this does not stop Invite Filter from performing invite behavior unless you fork and program this behavior in.
Screenshots
If applicable, add screenshots to help explain your problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.