Coder Social home page Coder Social logo

phenom4n4n / phen-cogs Goto Github PK

View Code? Open in Web Editor NEW
119.0 5.0 69.0 3.45 MB

My public cogs for Red, Discord bot.

Home Page: https://phen-cogs.readthedocs.io/en/latest/

License: MIT License

Python 99.96% Makefile 0.04%
discord red-discordbot hacktoberfest

phen-cogs's Introduction

This repository is archived and these cogs are now unsupported.

Phen-Cogs

Discord Server PyPI - Python Version discord.py Code Style: Black Documentation Status

Various phun and utility cogs for Red-DiscordBot.

Installation

Follow the installation steps for Red-DiscordBot. Once the bot is installed, run the following command in Discord:

[p]repo add Phen-Cogs https://github.com/phenom4n4n/phen-cogs

Cogs

Name Status/Version Description (Click to see full status) Authors
Aki 1.2.0
Play Akinator in Discord!Play Akinator in Discord!
PhenoM4n4n
AltDentifier 1.3.0
Check users with AltDentifier APICheck users with AltDentifier API
PhenoM4n4n
AntiHonde 1.0.1
Automatically ban H0nde alts.Automatically ban H0nde alts.
PhenoM4n4n and TrustyJAID
BanChart 1.1.1
Display a chart of ban moderators.Display a chart of ban moderators.
PhenoM4n4n and Aikaterna
Baron 1.2.4
Tools for managing guild joins and leaves.Tools for managing guild joins and leaves.
PhenoM4n4n, DragDev Studios, and KableKompany
Connect4 1.1.0
Play Connect 4 in Discord!Play Connect 4 in Discord!
Benjamin Mintz, flare, and PhenoM4n4n
CustomPing 1.0.0
Creates a custom ping embed to display latency statistics.Creates a custom ping embed to display latency statistics.
PhenoM4n4n
DisboardReminder 1.4.0
Set a reminder to bump on Disboard.Set a reminder to bump on Disboard.
PhenoM4n4n
EmbedUtils 1.6.2
Create, post, and store embedsCreate, post, and store embeds.
PhenoM4n4n
ForceMention 1.0.0
Mention unmentionablesMentions roles that are unmentionable
Bobloy and PhenoM4n4n
LinkQuoter 1.2.2
Quote Discord message links.Quote Discord message links.
PhenoM4n4n
Lock 1.1.5
Lock channelsLock channels or the whole server
PhenoM4n4n
PermissionsLocker 1.3.0
Force permissions for the bot.Lock bot commands to a certain permissions set.
PhenoM4n4n
PfpImgen 1.1.1
Make images from avatars!Make images from avatars!
PhenoM4n4n
PhenUtils 1.0.1
Various developer utilities.Various developer utilities.
PhenoM4n4n
Plague 1.0.6
Infect users with the plague!Plague game with a doctor and plaguebearer.
PhenoM4n4n
Prefix 1.0.2
Manage guild prefixes.Manage guild prefixes more extensively.
PhenoM4n4n
Ratings 1.0.0
Find out how (simp/sane/smart) you are.Rate yourself on many things.
PhenoM4n4n
RoleUtils 1.4.0
Reaction roles, massroling, and role targeting!.Reaction roles, massroling, and role targeting!.
PhenoM4n4n, Bobloy, TrustyJaid, and Neuro Assassin
Calculator 1.0.1
Calculate stuffCalculate stuff
PhenoM4n4n
SlashTags 0.6.2
Create custom slash commands.Create custom slash commands.
PhenoM4n4n
Tags 2.4.1
Create and use tags.Create and use tags.
PhenoM4n4n, sravan, and npc203
TypeRacer 1.0.4
Race to see who can type the fastest!Race to see who can type the fastest!
Cats3153 and PhenoM4n4n
Webhook 1.3.0
Webhook related commands.Various webhook commands to create and send messages along webhooks.
PhenoM4n4n

Contact

If you encounter bugs or require support, go to #support_phen-cogs on the cog support server. For feature requests, open a PR/issue on this repo.

Credits

Red-DiscordBot

All Cog Creators

phen-cogs's People

Contributors

cruxcraft avatar fixator10 avatar flame442 avatar i-am-zaidali avatar japandotorg avatar kablekompany avatar kpopdev avatar kuro-rui avatar noumelon avatar npc203 avatar obi-wan3 avatar phenom4n4n avatar ryan5453 avatar sourcery-ai-bot avatar sravan1946 avatar theguywiththehat avatar yuansheng1549 avatar zephyrkul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

phen-cogs's Issues

[LinkQuoter] Suggestion | Delete Invoking Link Message

An option to choose to delete the link that was sent and add the user into the embed that sent the message link.
Like something similar to how translate does it. So you don't have to have that long ass link on top of the embed. Since the embed has a jump link in it.

Requested by User#0001
image

tags: owner_guide example for custom block misc fixes

The example in the owner_guide is mis-indented and doesn't give the block a name. It should be:

[p]tagset block add duck

import aiohttp

class RandomDuck(tse.Block):
    ACCEPTED_NAMES = ("duck",)

    async def process(self, ctx: tse.Context):
        async with aiohttp.ClientSession() as session:
            async with session.get("https://random-d.uk/api/v2/random") as resp:
                data = await resp.json()
        return data["url"]

return RandomDuck

[Tags] alias support

Add support for aliasing tags, this should add a new aliases attribute to tag objects. Caches will need to be built similar to bot.all_commands with all aliases as keys to the tag object for fast tag processing. Converters also need to be updated so passed aliases point to the regular tag object (and multiple aliases can’t be registered). The info command will need to show all tag aliases, and a tag’s aliases should be limited to 20. Also consider setting a server’s tag limit to 250.

[RoleUtils] auto role support

Add support for auto roles and sticky roles.

  • auto role list should be cached on init and modified with commands make sure to modify cog mixin inits to accept one Config.all_members call on initialization and pass it to each mixin before adding it to the bot
  • auto roles and sticky roles should wait until the member passes verification if the guild has welcome rules enabled. this is a bit tricky since i'll have to decide whether or not there should be a timeout while waiting for verification, and also decide whether a leave listener should be added to return early
  • check whether roles can be added before adding them

[CustomPing] Host latency broken

image
Traceback:

Traceback (most recent call last):
  File "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/red/.local/share/Red-DiscordBot/data/TechBot/cogs/CogManager/cogs/customping/customping.py", line 111, in ping
    s = speedtest.Speedtest(secure=True)
  File "/home/red/.local/share/Red-DiscordBot/data/TechBot/cogs/Downloader/lib/speedtest.py", line 1091, in __init__
    self.get_config()
  File "/home/red/.local/share/Red-DiscordBot/data/TechBot/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 "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 832, in invoke
    await super().invoke(ctx)
  File "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1353, in invoke
    await super().invoke(ctx)
  File "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/red/.pyenv/versions/red/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: ValueError: invalid literal for int() with base 10: ''

[ReactRole] Error in reactrole bind

i tried to use the reactrole bind but somehow it doesn't work. i provided the error below.

Exception in command 'reactrole bind'
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/roleutils/reactroles.py", line 163, in reactrole_add
r["rules"] = rules
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/config.py", line 115, in aexit
await self.value_obj.set(self.raw_value)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/config.py", line 561, in set
await super().set(value)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/config.py", line 257, in set
await self.driver.set(self.identifier_data, value=value)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/redbot/core/drivers/json.py", line 146, in set
value_copy = json.loads(json.dumps(value))
File "/usr/lib/python3.8/json/init.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type ReactRules is not JSON serializable

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 902, 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 1340, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/mkurisu069/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, 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: TypeError: Object of type ReactRules is not JSON serializable

[BanChart] Reported ban number is not equal to the number of bans in the chart

Banchart uses len(await ctx.guild.bans) to determine how many bans there are for the header of the image, however the audit log can have a different number of ban events in many cases. If a user is unbanned, they will not be in ctx.guild.bans, but a ban audit log case may remain for them. Also, audit log cases expire after a while, so a ban might exist with no audit log case. For this reason, I suggest tracking the number of bans as you iterate over them, then putting that number in the image. The "Gathering stats for the last {limit} bans.text can probably continue to use the naivelen(await ctx.guild.bans)` calculation.

[repo] Write useful command descriptions

Across the repo command descriptions are lacking/not that helpful. I’d like to write full descriptions of most utility/moderation focused commands that include examples.

[PermissionsLocker] Embed sending on permlock cmd

Bot didn't have send embed perms. Not sure how you'd like to handle it since there's a couple different approaches, so I'm opening an issue.

Traceback (most recent call last):
  File "/.../cat38/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/.../Red-DiscordBot/cogs/CogManager/cogs/permissionslocker/permissionslocker.py", line 96, in permlock
    await ctx.send(embed=e)
  File "/.../cat38/lib/python3.8/site-packages/redbot/core/commands/context.py", line 93, in send
    return await super().send(content=content, **kwargs)
  File "/.../cat38/lib/python3.8/site-packages/discord/abc.py", line 904, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/.../cat38/lib/python3.8/site-packages/discord/http.py", line 241, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/.../cat38/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "/.../cat38/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 814, in invoke
    await super().invoke(ctx)
  File "/.../cat38/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1325, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/.../cat38/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: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

[SlashTags] global tag support

Add support for adding global slash tags + slash commands.

  • update object with global support
  • make function to add global / non global slash tags
  • update converters for global slash tags (make sure regular tag commands can't access global slash tags and edit)
  • set up global tag + command caching (command cache can be same as stored by ID)

[tags] TODO

Ongoing list of TODO's for Tags

  • require/blacklist blocks
  • dm/reply blocks (once discord.py supports)
  • react blocks
  • aliases
  • automatic documentation builds
  • redirect blocks (combine with dm/reply?)
  • use caching all over for listeners

[Baron] Feature request: Add a "whitelist only" mode.

There's no setting to set a "whitelist only" mode. Having no setting but a whitelist makes the whitelist useless since there's nothing about the cog that utilizes the whitelist. It's just there.

It would be cool to have a "whitelist only" mode as with my bot I allow people to invite my bot via requests and then whitelisting servers the bot can do in so I don't have to do any extra work like serverlocking, etc.

[Tags] add cooldown support

Add a cooldown block tethered to a cooldown mapping object on the Tag object itself, which can key based on role, server, channel, or user. The parameter describes bucket type, payload describes response? default response should include time left.

[Disboard reminder] lock setup

For the lock command add a sub command like role [mention/id] as some servers have member roles so locking the everyone role wont lock the chanel
so the end comand would look like this
[p]bumpreminder lock role {id}

LinkQuoter Rewrite

This issue discusses the goals of the LinkQuoter rewrite.
New settings:

  • Cross-server quoting. A server must opt-in to allow its messages to be quoted on other servers, and for messages from other servers to be quoted on it.
  • Verify perms. Defaulting to true, this server setting will determine whether a user needs read messages on a channel to quote from it.

New code functions:

  • Link to message converter - while this needs to be in a class for the command, it would be optimal to have this work without getting context on automatic quoting, so the core function should be separate from the class converter

[DisboardReminder] Add response time

Hi there,

I am not sure if this would be against Disboard ToS (like the bumping leaderboard), but it would be really cool if it would be possible to have a leaderboard that shows how fast everyone is responding to the bot by doing !d bump. It could be an average or just the fastest time possible, both should work fine and look really cool!

[LinkQuoter] Feature Request : allow cross server links

hey,

nice nifty cog, thanks for that.
currently linkquoter only quotes links if they're of the same server, but I think if it could quote cross server links, it would be useful for owners and mods who operate on multiple community servers utilizing the same bot. It could potentially save us time when sharing cross server links so we don't have to spend time giving context to other users who don't know where the direct message link originated from because bot will automatically provide the rough context. there could be other scenarios in which this feature would be helpful to community leaders, which I am not able to think right now.

[Tags] Ability To Define Permission Restrictions In {require(...):[response]}

The current requirement parameters are only valid for guild tags since I can only define a role/channel and not a guild permission such as kick_member for global commands. I'm trying every possible combination I can think of to make slash commands hidden or only accessible to Staff of a server however I have no luck.

I am requesting the following;

  • Allow the permissions parameter in {required(...):[response]}. This will enable the ability to require Discord permissions to run a mod command that should only be accessible to a user with said permission.

I'm unsure how to limit global slash tags to Staff only unless you're able to help me in this regards.

Linkquoter Deleting

linkquoter only shows the link quoted, but lets say I do [link] [message], and I have delete on, I think it would be good if the message would show up as the content and the embed as the linkquoted content

[DisboardReminder] Update failed

rapidfuzz seems to not be in the requirements but it was added in 5bf081e
Traceback:

Exception during loading of package
Traceback (most recent call last):
  File "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/redbot/core/core_commands.py", line 171, in _load
    await bot.load_extension(spec)
  File "/home/red/.pyenv/versions/red/lib/python3.8/site-packages/redbot/core/bot.py", line 1355, in load_extension
    lib = spec.loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/red/.local/share/Red-DiscordBot/data/TechBot/cogs/CogManager/cogs/disboardreminder/__init__.py", line 25, in <module>
    from .disboardreminder import DisboardReminder
  File "/home/red/.local/share/Red-DiscordBot/data/TechBot/cogs/CogManager/cogs/disboardreminder/disboardreminder.py", line 45, in <module>
    from .converters import FuzzyRole, StrictRole
  File "/home/red/.local/share/Red-DiscordBot/data/TechBot/cogs/CogManager/cogs/disboardreminder/converters.py", line 4, in <module>
    from rapidfuzz import process
ModuleNotFoundError: No module named 'rapidfuzz'

[EmbedUtils] Add An Option To Edit Embed Messages

Feature Request

If someone needed to edit an embed that has role reactions attached to the message, being able to edit the embed without needing to resend the embed and having to redo all of the said role reactions would make it a lot more convenient and it makes more logical sense.

Something like [p]embed edit <message_id> <fromfile/frommsg/fromdata/etc.>

[Webhook] sesion invanate

have the webhook cog have a option to run sesion forever in a channel not just have a 2 min timeout

[EmbedUtils] Role pings are not supported

When creating an embed from json, role pings are disabled. Add an option that allows you to do role notification.
image

Side note:
When storing the json, the storage does not allow a content field:
image

[Tags] Problems loading

I keep getting this error:

Traceback (most recent call last):
  File "/home/bot/redenv/lib/python3.8/site-packages/redbot/core/core_commands.py", line 171, in _load
    await bot.load_extension(spec)
  File "/home/bot/redenv/lib/python3.8/site-packages/redbot/core/bot.py", line 1364, in load_extension
    lib.setup(self)
  File "/home/bot/.local/share/Red-DiscordBot/data/proleman/cogs/CogManager/cogs/tags/__init__.py", line 44, in setup
    bot.add_cog(Tags(bot))
  File "/home/bot/.local/share/Red-DiscordBot/data/proleman/cogs/CogManager/cogs/tags/core.py", line 90, in __init__
    bot.add_dev_env_value("tags", lambda ctx: self)
  File "/home/bot/redenv/lib/python3.8/site-packages/redbot/core/bot.py", line 352, in add_dev_env_value
    raise RuntimeError(f"The name {name} is already used.")
RuntimeError: The name tags is already used.```

This happens every time I try to load the cog.

Prefix command Abuse.

As u know , ur cog for prefix cmd manage ment is great but it needs to be fixed as people can abuse and cause errors to it , u can make a prefix how long u want (even 2000+ chars) which causes the prefix view command to bug and give a error ... the solution is to make the max prefix length to 10 character or so ... this applies for noumenon as well .. and also I pinged u in ur server to tell u but u banned as I felt it was important ..
image

[RoleUtils] !reactrole create throws an error when trying to create an embed in a different channel

I have my bot as part of a role which has the Manage Roles permission enabled, but not Administrator.
For some reason, I run into a lot of issues when a channel is specified.

!reactrole create :regional_indicator_h:;@He/Him #role-assignment Blue
This command uses an existing role. I get the response Error in command 'reactrole create'. Check your console or logs for details.

Traceback (most recent call last):
  File "/home/jademalo/.pyenv/versions/MTGPLBot/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/jademalo/MTGPLBot/cogs/CogManager/cogs/roleutils/reactroles.py", line 183, in reactrole_create
    message = await channel.send(embed=e)
  File "/home/jademalo/.pyenv/versions/MTGPLBot/lib/python3.8/site-packages/discord/abc.py", line 935, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/home/jademalo/.pyenv/versions/MTGPLBot/lib/python3.8/site-packages/discord/http.py", line 241, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

This seems to be a simple missing permissions error, but it doesn't make a whole lot of sense since the bot should have the manage roles permission. In addition, it's not making a new role, so I've got absolutely zero idea why it would need any additional permissions.
Giving the bot the full Administrator permission results in this working correctly.

!reactrole create :regional_indicator_h:;@He/Him Blue
This command works correctly, so long as the command is invoked from the correct channel. It seems that the first command breaks due to it failing to place the role into a different channel? I'm not really sure.


Hopefully these cases are clear enough, I'm not really sure why this is happening. I can just about get the functionality I want by invoking it in the specific channel to begin with, but there's clearly something going wrong here. It will also sometimes just display the !reactrole create help menu, and I've got no idea why it does that.

[bug ] linkquoter cog slow down the bot.

hi i have 20 cogs loaded in my bot but when i load linkquoter cog the bot is super slow for me and it hang really bad.
but when i unload linkquoter cog the bot is fast again. idk whats wrong for real. there is no error in my console too.
can u guys please fix this thank you.<333
my bot was slow yesterday and i unload and load all cogs 1 by 1 and i found out this.

[embedutils] embed edit frommsg needs 2nd message parameter

To be useful, [p]embed edit frommsg should take two parameters, the source message id and the target message id. That's what I was expecting, but ...

It currently only takes one message parameter which it extracts the embed from, and then adds back to the message. The end result is that an edit happens, but with no actual change (i.e. same content it had before is written back to the message).

[Webhook] Add Option To Create Embeds

Type:

  • Bugfix
  • New Feature
  • Enhancement

Description

Webhooks can support multiple embeds in a single message, which is useful for servers that uses embeds for their rules and other server information. It would be nice if you could add a command that accepts JSON file uploads to create these multiple embed messages.

[p]webhook send <webhook_link> <message_or_file>

[Webhooks] A option to Disable Pings

would there be a way to edit the webhook sesion cog so there is a setting to disable pings crossing both servers as this could esaly be used to raid and could get quite anoying

[Tags] Add ability to specify AND/OR with the require/blacklist block.

I tried to use require block, but unable to check two parameters (&& check) with it.
I want role "r1" to be able to use tag "t1" only in channel "c1".
I tried {require(r1, c1):Error Message} {command: c1} This tag is working if any of r1 or c1 is satisfied. I want it to work only if both are satisfied
Is there any other way?
If this section is not meant for these type of questions. Sorry

Baron Finds Servers after bot restart

Make the baron thingy leave botfarms, bl servers, smol servers, on init to prevent people who invite the bot while its offline which is exactly what happened today

[Feature Request] Embedutils

For the Embedutils cog, it would be convenient to view the stored embeds format in a code block. Another very useful change would be to be able to send stored embeds to specified channels. I dont believe there is an option for that yet, there is only a show one which could do the same thing but its more useful if using it in larger servers.

aki session sometimes ends with json.decoder.JSONDecodeError

Hi,

aki session sometimes ends with said error as title says:
Here is the full traceback:

Traceback (most recent call last):

  File "/opt/lib/python3.9/site-packages/redbot/vendored/discord/ext/menus/__init__.py", line 638, in update
    await button(self, payload)
  File "/opt/cogs/CogManager/cogs/aki/aki.py", line 34, in no
    await self.aki.answer("no")
  File "/opt/lib/python3.9/site-packages/akinator/async_aki/async_akinator.py", line 189, in answer
    resp = self._parse_response(await w.text())
  File "/opt/lib/python3.9/site-packages/akinator/async_aki/async_akinator.py", line 88, in _parse_response
    return json.loads(",".join(response.split("(")[1::])[:-1])
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I have a feeling this is an issue with upstream library but unsure so here's an issue.

[SlashTags] Error in `slashtag global edit tagscript`

Seems like the call to the main group command is missing ctx.

Traceback (most recent call last):
  File "/home/zephyrkul/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/zephyrkul/.local/share/Red-DiscordBot/cogs/CogManager/cogs/slashtags/commands.py", line 448, in slashtag_global_edit_tagscript
    await self.slashtag_global_edit(tag, tagscript=tagscript)
  File "/home/zephyrkul/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 291, in __call__
    return self.callback(self.cog, *args, **kwargs)
TypeError: slashtag_global_edit() missing 1 required positional argument: 'tag'

tags: please use code formatting for raw subcommand output

Please have [p]tag raw and [p]tag global raw subcommands use code formatting for their output so that if the production of the tag is a URL, it won't be subject to Discord's URI-quoting, which mangles the result.

For example, a tag that simply outputs a link like https://...{args(1)} is detected by Discord as a URL and thus rendered as https://...%7Bargs(1)%7D which makes it very hard to understand. For the user to be able to make any use of it, they then need to manually convert that back to actual curly-braces (as when cuttting-and-pasting to use it in another command).

tags: access bot instance in Custom Block environment

I'd like to be able to access the bot instance in the Custom Block environment so that I can write code like:

[p]tagset block add taxon

from functools import partial
from pyinaturalist import get_taxa_autocomplete

bot = self.bot  # self is the cog (i hope!)

class TaxonName(tse.Block):
    ACCEPTED_NAMES = ("taxon",)

    async def process(self, ctx: tse.Context):
        query = ctx.verb.payload
        response = await bot.run_in_executor(None, partial(get_taxa_autocomplete, q=query))
        if response:
            results = response.get("results")
            if results:
                taxon = results[0]
                return taxon["name"]
        return "No Match"

return TaxonName

Unfortunately, that results in:

Traceback (most recent call last):
  File "/home/synrg/.local/share/Red-DiscordBot/data/CuckooBee/cogs/CogManager/cogs/tags/owner.py", line 111, in tagsettings_block_add
    block = self.compile_block(code)
  File "/home/synrg/.local/share/Red-DiscordBot/data/CuckooBee/cogs/CogManager/cogs/tags/owner.py", line 61, in compile_block
    result = env["func"]()
  File "<string>", line 6, in func
NameError: name 'self' is not defined

My workaround is to use loop = asyncio.get_event_loop() and then run the synchronous API call get_taxa_autocomplete in that, and that works, but being able to use the bot instance would open up other possibilities for custom blocks for which there are no such convenient alternatives.

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.