dashwav / yin-bot Goto Github PK
View Code? Open in Web Editor NEWDiscord bot with a focus on moderation. Written in discord.py
Home Page: https://dashwav.github.io/yin-bot/
License: MIT License
Discord bot with a focus on moderation. Written in discord.py
Home Page: https://dashwav.github.io/yin-bot/
License: MIT License
All of the bot's responses should be moved to a file in an embeds folder.
Project structure would go something like
/cogs/moderation.py would have its embeds in /cogs/embeds/moderation.py
Not too sure on the naming yet, really not a fan of having two of the same filenames in the program.
Will think on it some
1.1.0 has been released, along with a patch to 1.1.1
https://discordpy.readthedocs.io/en/latest/whats_new.html#v1-1-0
https://discordpy.readthedocs.io/en/latest/whats_new.html#v1-1-1
Yin needs the ability to assign a role to a user when they join the guild.
This would be done with the follwoing commands
.autoassignroles [.aar, .autoassign]
.aar enable/disable
.aar add <role>
.aar rem <role>
Should probably migrate all embeds to using some sort of generalized embed builder function that chunks the embed into multiple embeds as determined by their length. Right now, the warnings command will fail if either is > 1000 characters
In modlog the actioned user just gives the username. However, if there are multiple users with the same username it becomes difficult to quickly see which was moderated.
possible solution:
username@ID
or
snowflakeID
Need to go through and upgrade packages as needed, currently list asyncpg as v .12 but current is up to .18
Since discord has default slowmode, we need to remove this functionality.
I think being able to set a config variable that gets passed in on logger creation in yinbot.py would be extremely useful. Being able to set log level to DEBUG sometimes, but leaving it in INFO most of the time would be nice
We need to improve on the slowmode commands impact on Audit Logs. Because delete_overrides is a different type of action than just changing overrides (both adding and removing overrides are in this category) it adds a different line for each individual action, clogging up audit logs.
Bad, one line for both adding and removing slowmode restriction
Better, combines similar lines into one line
Ideally my thought process was to have yin go through all of the slowmode channels in the database and clean out all overrides at the end of the day. This would combine all of those changes into similar lines as well.
Open to suggestions as to implementation however.
https://discordpy.readthedocs.io/en/rewrite/api.html?highlight=game#discord.Client.change_presence
Just need to change from string to object
Currently I have the bot only post in non-blacklisted channels with a code snippet at the beginning of the command. https://github.com/dashwav/yin-bot/blob/master/cogs/rng.py#L45
This should be abstracted to an annotation ideally
Create a subcommand for .slowmode
that allows a moderator to put a single user in slowmode.
This would use the override permissions to restrict the targeted users write permissions in any channel they talk in, restricting their contribution to the slowmode time limit in any one channel.
There are a ton of Flake8 issues in the repo at the moment - any PR with any number flake8 fixes is appreciated.
Some of the help descriptions are either inaccurate or too long. Need to increase usability
Ideally there should be a -wiki
command similar to -help
that will link to the correct page on https://dashwav.github.io/yin-bot/ that relates to the command to assist those who may not have as much context that help requires
When checking a users warnings there is currently no prior info about kicks and bans, so the potential is there for someone to have been kicked repeatedly but still have a 'clean' record. We need to add this sort of info into the command.
There is already a moderation db table, and helper functions to hook into the table they are just not 100% feature complete and need to be tied into the moderation actions and removed of bugs.
Once the kicks/bans are tracked successfully we need to integrate them into the actual embed building part of the -warnings
command.
Would like to move production onto docker to take advantage of the features there. Probably use Watchtower to manage the docker images or something.
When a user is banned with a reason that is > 480 characters the bot fails to ban them due to length restriction. What ** should** happen is the user is banned and as much of the reason is put into discord.
-mute <@user>
Prevents the user from talking in all channels
-mute <@user> <#channel>
Prevents the user from talking in a single channel
-unmute <@user>
same as -mute <@user>
but in reverse
-unmute <@user> <#channel>
same as -mute <@user> <#channel>
but in reverse
Also maybe a -voice_mute
command or something to server mute a user in voice
Need to figure out how these play into mod_log.
The DB is terribly normalized and is becoming a liability every time I make a release, I need to refactor this to more correctly work the way I need it to.
Steps:
Refactor DB create table
scripts
Refactor cogs/utils/db_utils to correctly reference the new schema.
Create Migration script to move current db to new schema
Kyuunex - ""When someone changes his username and is in 2 servers and logging is enabled on both servers it only logs this change on only 1 server. This behavior seems to inconsistent and it seems random where it will log it.""
https://github.com/dashwav/yin-bot/blob/master/cogs/logging.py#L348
This needs to be changed to find all guilds that the member is in on the server, create a list of logging channels in those servers and then iterate through all of them posting the member updated message
Need to honestly just redo all my garbage in the warnings/moderation to consolidate them.
In the same breath I need to codify the changes from starbot to yinbot for a dummy user so that warnings and modactions can still be displayed. should be ezpz.
This issue is mostly here to remind me when I get less busy.
This is unironically something that always bothers me
This is more just an issue to allow someone to get used to the flow of contributing. Also I am really lazy.
Either need to use the Github Wiki, Github Pages or some sort of website to show all of the commands and their usage as well as a FAQ of some sorts. Creating a set_playing feature to say "-help
for info" was suggested by Nick and I think thats a pretty good initial fix
Probably would be better to switch to a methodology of
__path__ = __import__('yinbot').extend_path(__path__, __name__)
inside the __init__.py files instead of manually inserting the imports. This will help segregate the imports so you can import single files as needed. Instead of getting the forest for the banana, as it were.
It would be nice to be able to load/unload a cog from the bot for on the fly maintenance/testing
More info:
https://discordpy.readthedocs.io/en/latest/migrating.html#cog-changes
If modlog is not set, removed, or invisible to the bot, you are unable to moderate a user.
##Reproduce:
Make a channel
set to modlogging channel
take bot offline or set so bot cant see channel
try to issue a moderate command (just silently fails after confirmation)
For consistency this would be nice to work the same way as an actual ban. Not sure how to implement exactly as the entire premise of the ban is that the member is not in the guild, so searching that way will not work.
When a channel is set as a join log channel and is deleted, the channelid stays in the welcome_channels column in the DB, and when the channel can not be found, the send() function fails and throws an exception.
A few things need to be done to prevent this.
When a single channel send() fails, it should catch the error and continue sending messages to the rest of the channels
Add way to view which channels are currently in welcome_channels ( I had to check the DB to see)
Add ability to remove a channel if it is deleted
(Optional) when a channel is deleted, it should be automatically removed to prevent error spamming.
Currently having a link in the footer message doesn't use the markdown syntax, and having the raw link means people can't click it easily on mobile.
Steps:
cogs/moderation.py::create_embed()
to allow for a custom line added after main message text instead of in footer.cogs/moderation.py
This will make deploying with docker easier
Similar to how fredboat does it here
I would like for there to be some confirmation when a prefix is changed.
Ideally also allow bot to respond when pinged
Better README
Easier installs
Accurate requirements.txt
etc.
Deleting or removing perms for one log channel breaks posting for all logs.
Say you do logging enable
for channels A and B
Then you either delete the channel or remove her read perms for channel B.
This will disable her output to channel A and throw a FORBIDDEN error in the console.
If you just remove read perms it is easy, just reenable them, but if you delete the channel, you have to remove it manually.
Probably should just wrap this into a nicer function to handle sending to only some of the channels. Also, maybe add the ability in logging/vclogs disable/enable to specify the channel.
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.