phasecorex / pcxcogs Goto Github PK
View Code? Open in Web Editor NEWPhasecoreX's Cogs for Red-DiscordBot
License: GNU General Public License v3.0
PhasecoreX's Cogs for Red-DiscordBot
License: GNU General Public License v3.0
The members of my server have requested that if other users are tagged in the contents of the .remindme
, then when it comes time to send the reminder, the bot adds all tagged users (including the author) to a DM.
I'd love to be able to use months / years on .remindme
and I've started working on implementing functionality to support this here Cog-Creators/Red-DiscordBot#5000
The current implementation uses a new converter that spits back a relativedelta object instead of a timedelta and .remindme
would need to switch over to that new converter as well in order to support relative formatting.
Hello, for decodebinary I would like to request that you make it so that it doesn't error out (in console) if the bot is missing perms in a server, as my bot and others peoples bots are in servers that we (the owner of the bot) are not in where we can't control the permissions of the bot.
The following enhancement would be great:
If a user modifies the name of his own channel, autoroom is saving this new name for the user. When the user comes back and creates a new autoroom, the old custom name should be used as default. If there is no entry for that user, then autoroom will use the default settings (custom, game, name).
I would want to be able to do [p]remindme 12h20m some reminder
to set up reminder that will happen in 12 hours and 20 minutes. Iirc, Red's core offers a utility converter for that kind of times so you might be able to use it (TimedeltaConverter
)
hey,
at the moment the message from the bot in the textchannel of the room:
luxus, this is your own text channel that anyone in your AutoRoom can use.
maybe it would be nice if it would give informations how to allow people in a private room
Got this in console after latest cog update:
[2020-08-19 01:51:37] [CRITICAL] red.main: Caught unhandled exception in task:
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 70, in uvloop.loop.Handle._run
TypeError: error_handler() missing 1 required positional argument: 'fut'
I believe it's originated from remindme.py#L71 or #L73
My red version: 3.4.0
Discord.py version : 1.4.1
Python version : 3.8.5
OS: Linux Ubuntu 18.04.x x64
From the looks of things, i think the import updated? heres the traceback.
File "/home/motz/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/motz/agb-final/Cogs/admin.py", line 296, in netspeed
s = speedtest.Speedtest(secure=True)
AttributeError: module 'speedtest' has no attribute 'Speedtest'
Updated red to v3.4.14
Bot no longers move users the new the room created.
give manage permissions perm on the created channels (Public) so they can manage and control who can join and who can't (make togglable if needed)
also allow for multiple member ranks and default permisisons setups like voice activity Or push to talk stream to room or not
When i run [p]netspeed i get this traceback error.
Traceback (most recent call last):
File "C:\Users\Admin\redenv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\VertyBot\cogs\CogManager\cogs\netspeed\netspeed.py", line 31, in netspeed
s = speedtest.Speedtest(secure=True)
File "C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\VertyBot\cogs\Downloader\lib\speedtest.py", line 1091, in init
self.get_config()
File "C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\VertyBot\cogs\Downloader\lib\speedtest.py", line 1173, in get_config
ignore_servers = list(
ValueError: invalid literal for int() with base 10: ''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Admin\redenv\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Admin\redenv\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Admin\redenv\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ValueError: invalid literal for int() with base 10: ''โ
When running the speed test, I get the following error (in the docker logs)
[2021-04-12 16:25:38] [ERROR] red: Exception in command 'netspeed'
Traceback (most recent call last):
File "/data/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/data/cogs/CogManager/cogs/netspeed/netspeed.py", line 31, in netspeed
s = speedtest.Speedtest(secure=True)
File "/data/cogs/Downloader/lib/speedtest.py", line 1091, in __init__
self._shutdown_event = shutdown_event
File "/data/cogs/Downloader/lib/speedtest.py", line 1173, in get_config
upload = get_attributes_by_tag_name(root, 'upload')
ValueError: invalid literal for int() with base 10: ''
I'm not sure that this is a cog issue though, from the traceback it looks like a library issue?
PCXCogs/updatenotify/updatenotify.py
Line 66 in 345afa7
It's unclear what the unit is from the help dialog.
Currently, the plugin is useless, since its only source of ban info is down at the moment. Research is needed to look into if there are other public lists we can add to this plugin.
Or, maybe we can make our own global ban list?
Traceback (most recent call last):
File "/home/redbot/redenv/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "/home/redbot/.local/share/Red-DiscordBot/data/Elemental/cogs/CogManager/cogs/autoroom/autoroom.py", line 290, in on_voice_state_update
await self._process_autoroom_delete(member.guild, auto_voice_channels)
File "/home/redbot/.local/share/Red-DiscordBot/data/Elemental/cogs/CogManager/cogs/autoroom/autoroom.py", line 344, in _process_autoroom_delete
for vc in guild.get_channel(category_id).voice_channels:
AttributeError: 'NoneType' object has no attribute 'voice_channels'
It would be awesome if AlertBot could be added as a service for the bancheck cog. I can even supply the coding for the actual check so that you don't have to go through the trouble of having to figure out how their api works and code it yourself. If you decide to include it a couple notes:
Alertbot has a default api limit of 1 request per second and 1000 requests per day(resets at midnight EST), to work around this the code includes tokens as a list and includes a while statement to check if a 200 response is given and if not will automatically cycle to the next token in the list.
Of course your cog uses a different method of handling the data and embed so of course that may need to be "tweaked" to your liking and to work with your embed creation and your lookup_result.py. But figured it couldn't hurt to request it.
async def ablookup(self, member):
URL = "https://api.alertbot.services/v1/?action=bancheck&userid={}".format(member.id)
#tokens needs to be set as a list so multiple tokens can be added since alertbot only allows 1000 requests per day per token
tokens = []
x = 0
#uses while statement to cycle through tokens for when daily requests have been reached
while x < len(tokens):
header = {"AuthKey": tokens[x]}
resp = await self.bot.session.get(url, headers=header)
if resp.status == 200:
resp = await resp.json()
resp["data"]["result"] = result
ava = member.avatar_url
if result["banned"]:
title = f"Ban Found for {member}!"
reason = result["reason"]
date = result["date"]
proof = result["proof"]
desc = f"UserID: {member.id}\nReason: {reason}\nDate: {date}\nProof URL: {proof}\n"
color = discord.Color.red()
else:
title = f"No ban found for {member}"
color = discord.Color.Green()
desc = f"UserID: {member.id}"
return (ava, desc, color, title)
x += 1
False
```
Hi,
I want to request a feature for Wikipedia cog to also display the said wiki article's main image, just like how discord shows it when you post a Wikipedia article link in a channel. I was diving in the code and I can see that you're currently fetching the plaintext version from API and plaintext version does not return any image links iirc. So I am already sweating while writing this because to implement this feature, you will probably need to rewrite some part of the cog to facilitate this but I'm not sure if you would be interested in doing this. Nevertheless, I thought I would open a new issue and give you a high five. ๐
Just a reminder for me to add the optional AutoRoom Source clone permissions to the [p]autoroomset permissions
command.
I'd also like to clean up some wording, such as "missing required permissions" and "missing optional permissions": one is a hard stop, the other isn't.
I think that's it.
Would it be possible to have a RemindMe reminder target someone else? I.E. !remind @anotheruser in 5 minutes MESSAGE
?
This is a feature available in Ub3rbot and I'd love to be able to do it with Red :)
I would like to see a option to report users to ksoft.si api with a seperate command. I am not sure if that is possible, I report them now via there bot in there server.
My idea was like this: Add a image as proof and [p]bancheck report
I hope you will get my idea. You can always hit me up on discord Brandjuh#0001
. I am also in red server aswell in cog server.
From a conversation on the support server, add the ability to keep and drop dice.
This will most likely be a large rewrite.
Here is a reference, there are other dice rolls that can be done as well: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/688330/Rolling+Dice
BanCheck can be set up so that when a user first joins the server, they are checked against all ban lists. This enhancement adds to that, where a user can automatically be banned if they appear on a ban list.
Ideally it would be a link to the service's own instructions for requesting an API key, just in case they change that process on their end. As it is, it can be a bit tricky figuring out where to get an API key for, say, Globan.
When I try to ban a member by ID I will get the following error:
Traceback (most recent call last):
File "/root/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "/root/.local/share/Red-DiscordBot/data/cuffbotv3/cogs/CogManager/cogs/bancheck/bancheck.py", line 568, in banreport
await self._user_report(ctx, proof_image_url, True, member, ban_message)
File "/root/.local/share/Red-DiscordBot/data/cuffbotv3/cogs/CogManager/cogs/bancheck/bancheck.py", line 697, in _user_report
member_avatar_url,
UnboundLocalError: local variable 'member_avatar_url' referenced before assignment
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/root/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/root/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'member_avatar_url' referenced before assignment
Add a setting to give the ability to change the destination of the reminder between the current channel the command was used in or in direct messages. An example of this would probably be [p]remindmeset dm <true/false>
. If true
, bot will send the reminder as normal. If false
, bot will send the reminder in the channel the command was executed.
For BanCheck I suggest making the enableservice commands set the API as a global and not guild in config, as to get a Token, you need to have the bots Client ID and it needs to be approved before you get the token, so only the owner should be able to set it. I also suggest having a command that gives you the links that take you straight to where you sign up to get a API key.
Being able to choose what types of messages the bot will react to will be useful. If there is a community art channel and people provide feedback, it would be annoying for every message to get the upvote and downvote emoji reacted to it
the default of 64kbit is being used right now.
it would preferably be the highest possible value or the value from the auto room channel that it was created from.
Another suggestion:
A new toggle to activate "live game update" for an autoroom source.
If activated, new channels get the name from the default settings (name, game, custom), like before. As soon as the creator of the channel plays a game, the name of the channel switches to the game's name. If the creator stops playing, the channel get it's old name back or if the creator switches the game, the channel gets the name from the new game.
There have been a fair few updates lately, and checking exactly what those updates are tends to be an annoying process since I'm not building the image from git, but rather pulling from Docker Hub.
It'd be useful to have a simple changelog type message in UpdateNotify that either explains the update or maybe just pulls the last few commit comments from git.
Also, thank you for your work on both the docker image and these cogs, they've been super useful!
I think it would be nice if [p]reminder list
would either show the time until reminder gets sent or the time when it will be sent
Would love to see roles & their permissions in addtion to the @everyone role copied over from the autoroom source! I have a banned from vc video role that I can't seem to apply to the generated autorooms.
Thank you! Love the cog otherwise, best one available :-)
I would like to see an edit option to the remindme cog, but there is a problem at this:
Editable: Time or text
The solution is simple. As I saw, variable FUTURE is created when we add a new reminder. This can be used to edit the reminder like it was an identifier, unique to the reminder. Using this identifier, we can edit the reminder.
We add the following command:
identifier
option
value
Looks like https://discord.services is down, so auto ban checks will fail silently. I need to set up an error handler (it's returning a 521 web server is down error), and should also look into adding other public ban lists as failovers.
Here's the stack trace:
Traceback (most recent call last):
File "/data/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "/data/cogs/CogManager/cogs/bancheck/bancheck.py", line 72, in search
await self.user_lookup(ctx.channel, member)
File "/data/cogs/CogManager/cogs/bancheck/bancheck.py", line 83, in user_lookup
response = await self.lookup(member.id)
File "/data/cogs/CogManager/cogs/bancheck/bancheck.py", line 117, in lookup
result = await response.json()
File "/data/venv/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1027, in json
headers=self.headers)
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/venv/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 912, in invoke
await ctx.command.invoke(ctx)
File "/data/venv/lib/python3.7/site-packages/redbot/core/commands/commands.py", line 512, in invoke
await super().invoke(ctx)
File "/data/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 1065, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/data/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 639, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/data/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8'
While I don't use that cog, I noticed that it may notify about "update" when the version installed is newer than the one that pypi reports, e.g.
Hello!
There is a newer version of Red-DiscordBot available!
Your version: 3.4.0
Latest version: 3.3.10
When I try to use the command "autoroom allow" there's always an error. It worked before but when I tried earlier it no longer worked. I provided the traceback results below.
Exception in command 'autoroom allow'
Traceback (most recent call last):
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/mkurisu069/.local/share/Red-DiscordBot/data/Redbot/cogs/CogManager/cogs/autoroom/commands/autoroom.py", line 109, in allow
await self._process_allow_deny(ctx, True, member_or_role=member_or_role)
File "/home/mkurisu069/.local/share/Red-DiscordBot/data/Redbot/cogs/CogManager/cogs/autoroom/commands/autoroom.py", line 139, in _process_allow_deny
if not await self.check_required_perms(ctx.guild):
AttributeError: 'AutoRoom' object has no attribute 'check_required_perms'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 832, in invoke
await super().invoke(ctx)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1348, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'AutoRoom' object has no attribute 'check_required_perms'
It'd be nice to have an associated text channel created in the category set when a user makes a room (x's room, x's text room). Sometimes a user doesn't prefer to or can't talk, and having one "global" voice text channel can get messy fast when many autorooms are being created.
I'd like if there was an ability to be able to disable the click the bell for others to be notified, per server could be an option.
At present, the only options for room names are game
or name
, which generates a room based on either the game you're playing or your discord name.
Ideally, I'd like to have the generated rooms use a sequential numbered list, based on a predefined name.
For example, if the predefined name was Table
, then the first room generated would be Table 1
, the second Table 2
, etc. This would allow for cleaner organisation, and be a lot clearer to the users.
Thanks!
Is it possible to disable a user from modifying a room they have generated automatically?
It seems that when a room is created, the user that created it is given a certain set of permissions. Ideally I'd like to be able to disallow this, so the channel functions like a basic unmodifiable channel for the duration of it's existance.
Embed field value limits are not respected. I set a long-ish reminder and tried to view it, however, I was unable to:
Exception in command 'reminder list'
Traceback (most recent call last):
File "/home/pi/.pyenv/versions/vance/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/pi/red-files/vance/cogs/CogManager/cogs/remindme/commands/reminder.py", line 110, in list
await embed_splitter(embed, author)
File "/home/pi/red-files/vance/cogs/CogManager/cogs/remindme/pcx_lib.py", line 62, in embed_splitter
await destination.send(embed=embed)
File "/home/pi/.pyenv/versions/vance/lib/python3.8/site-packages/discord/abc.py", line 1064, in send
data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
File "/home/pi/.pyenv/versions/vance/lib/python3.8/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.fields.0.value: Must be 1024 or fewer in length.
In embed.fields.1.value: Must be 1024 or fewer in length.
I took a brief look at your embed splitter and it appears that this could also affect other cogs.
From a conversation on the support server regarding enhancing the existing embeds.
Unless there is an option to toggle back to plaintext, would it be possible to get link embeds to show up? If that isn't possible, then maybe have a link to the original remindme message inputted by the user, since that message will probably still have the full image/video embed.
Thanks!
UpdateNotify compares the most recent commit hash to its own commit hash it was built from. This is fine until the latest commit skips CI. At that point, UpdateNotify will see that the hashes differ, and wait until the Docker Hub image gets updated. The problem is if the image is manually built or triggered as a downstream build, the image will be rebuilt with the previous build, which results in a newer build, but differing hashes. The user will be notified that there is an update, when really there isn't.
The solution is to modify the GitHub hash fetching so that it gets the newest commit that doesn't include the phrase "[skip ci]" (or any other variant). Then it will see the hashes match and never check for a newer build.
The workaround for the moment is for me to just remember to never skip a build, even if it is a readme change.
Hi,
Id would be cool to have the option/command to change the name generation of the automatic created Voice/Text channels with a template with fields like:
An example would be:
{access} {name}'s Room
๐ John's Room
On a related note: the automatically generated text channels only have the name: autoroom-text-channel is that a bug or desired behaviour?
Type: FEATURE REQUEST
Cog: Autoroom
I would like to have the possibility to add a list of custom names to an autoroom source. A new room created from this source should get one name from this list randomly.
Hello, i was thinking of if the new native discord timestamps could be used after a reminder has been added.
Example:
I will remind you of that <t:1632597245:R>
post <t:1632597245:R>
in a discord chat. you can find examples from here.
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.