idk what to add
fixator10 / fixator10-cogs Goto Github PK
View Code? Open in Web Editor NEWCogs for Red-DiscordBot. Including port of Stevy's V2 leveler.
License: MIT License
Cogs for Red-DiscordBot. Including port of Stevy's V2 leveler.
License: MIT License
idk what to add
I know there's already an option to associate a badge with a level but it would nice to have the same feature with a role :)
I noticed that commands such as [p]lvlset badge set
don't have a cooldown. Would be quite useful if they do, as it can be quite spammy.
Is your feature request related to a problem? Please describe.
You can add rep to users, but you can't remove rep points from users
Describe the solution you'd like
A command to down rep users (literally just remove a point from them, instead of adding one)
Describe alternatives you've considered
There really are none.
CodeFactor found multiple issues:
steamcommunity\steamcommunity.py:196
Commit f1581b3
godvilledata\godvilledata.py:4
Commit a7df069
translators\translators.py:109
Commit fe5813e
minecraftdata\minecraftdata.py:74
Commit f478ea7
minecraftdata\minecraftdata.py:109
Commit f478ea7
minecraftdata\minecraftdata.py:127
Commit f478ea7
minecraftdata\minecraftdata.py:189
Commit f478ea7
minecraftdata\minecraftdata.py:207
Commit f478ea7
minecraftdata\minecraftdata.py:134
Commit f478ea7
memegen\memegen.py:8
Commit fe5813e
Would be nice to have a feature where leveler takes into account the current level the user has, and automatically give the user a leveler up role (if he/she is missing it) and or take away a role if he/she is below a certain level (feature request from: #77)
Would it be possible to get a function to pull the data form Malarne's leveler into yours? Im just looking for the xp values not settings or anything although profile backgrounds would be awesome lol
Is your feature request related to a problem? Please describe.
I have used this cog in the past at a large-ish scale. If you are unfortunate enough to get raided, this cog will be your first class ticket to bot quarantine. Discord does not remove that (still have a ticket open from December, I have moved on).
You cannot set the allowed retries to zero, say goodbye to your reaction limits. Furthermore, I have not touched the cog in a while, but I hope there is an option now to disable the DM it sends on failure. The thousands of bots will not be able to pass the captcha, they will get the error DM, therefore this cog will send thousands of DMs in a matter of minutes. Your one way ticket to quarantine.
Describe the solution you'd like
Add a way to disable retrying the captcha (reaction death) and a way to disable the DM on failure (assuming it's not in there already).
Reference my issue that was not carried over here.
Describe alternatives you've considered
I don't use this cog anymore. I want to help anyone who does still use it help themselves in not losing their bot to something they cannot control.
Additional context
I do appreciate and thank you for taking over and continuing this cog, it's helpful when it doesn't turn against you due to Discord's crap userbot raid filtering.
Describe the bug
Exception thrown with the [p]top
command.
To Reproduce
Seems like you just have to run the [p]top
command when you haven't sent any other messages in the server?
Expected behavior
No exception thrown, show the expected output of [p]top
.
Bot's logs
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/leveler/leveler.py", line 390, in top
await self._find_server_exp(user, server),
File "/data/cogs/CogManager/cogs/leveler/leveler.py", line 3583, in _find_server_exp
for i in range(userinfo["servers"][str(server.id)]["level"]):
TypeError: 'NoneType' object is not subscriptable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/data/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/data/venv/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: 'NoneType' object is not subscriptable
Red version
3.4.9
Additional context
Happened in my server with a member who just joined the server. I can run the [p]top
command just fine, but when they ran it the exception above happened instead. I did a quick glance at the code and it's probably because userinfo
on line 3580 is None, since they never sent any messages beforehand.
Is your feature request related to a problem? Please describe.
Potentially confusing wording in the messages log cog.
Describe the solution you'd like
I would like to suggest that the word "redacted" be changed to "edited" to make it more clear what is being logged, as "edited" is the official terminology Discord uses.
Additional context
N/A
Please add two simple commands delchannel
and delrole
that can delete a channel or role based on name or channel/role ID. This is a really simple feature that could be combo'd with other cogs and automated triggers to do some cool stuff.
CodeFactor found multiple issues:
leveler\leveler.py:31
leveler\leveler.py:154
leveler\leveler.py:242
leveler\leveler.py:1733
leveler\leveler.py:1799
leveler\leveler.py:2723
leveler\leveler.py:2733
leveler\leveler.py:2737
leveler\leveler.py:3246
leveler\leveler.py:3388
leveler\leveler.py:2554
leveler\leveler.py:3040
leveler\leveler.py:31
leveler\leveler.py:44
leveler\leveler.py:154
leveler\leveler.py:242
leveler\leveler.py:289
leveler\leveler.py:305
leveler\leveler.py:322
leveler\leveler.py:344
leveler\leveler.py:1315
leveler\leveler.py:1733
leveler\leveler.py:1799
leveler\leveler.py:2366
leveler\leveler.py:2723
leveler\leveler.py:2733
leveler\leveler.py:2737
leveler\leveler.py:2853
leveler\leveler.py:2861
leveler\leveler.py:3093
leveler\leveler.py:3246
leveler\leveler.py:3350
leveler\leveler.py:3388
leveler\leveler.py:3423
leveler\leveler.py:159
leveler\leveler.py:264
leveler\leveler.py:1199
leveler\leveler.py:1216
leveler\leveler.py:1538
leveler\leveler.py:1905
leveler\leveler.py:2744
leveler\leveler.py:2760
leveler\leveler.py:2767
When adding a new badge and then entering the same command but with ,for example, a changed price, the changes are not updated in the DB, even though the message is sent that says it got updated.
I assume this error comes from the missing string conversion of the server ID in line 1829
Fixator10-Cogs/leveler/leveler.py
Line 1829 in 1559441
After updating to the latest version of Red (being 3.2.2)
the Leveler cog has stopped functioning and can't be loaded any longer.
These are the errors displayed in the Console:
http://prntscr.com/qp5dbh (Screenshot link)
Bare in mind i do have Pillow installed and Numpy (the correct versions)
hopefully this gets fixed, and if it is something on my side. please help me fix it.
Thank you for your amazing cogs.
Is your feature request related to a problem? Please describe.
When using rolemembers to pull a list of all members for a server, some users are more easily identified by their given nickname rather than their actual username.
Describe the solution you'd like
It would be nice if the rolemembers command could also return a column with the related nickname at the time of the query such that results would be:
ID, Name, Nickname
Describe alternatives you've considered
Additional context
Part of this desire is to help manage a server where everyone is required to set a nickname (which doesn't change after). Adding this additional column (either optionally or always included) would be very useful for scenarios like this where the name you see differs from the username and getting a list to cross reference that includes it all is most useful.
Discord is currently slowly rolling out a feature that lets you upload icons for roles. Since the PersonalRoles Cog lets people customize their own role i wonder if there is some way to also enable that people can upload their own icon for their personal role.
Simple but useful feature. The ability for admins/owners to add a specific EXP amount to users. Nice to have a setlevel command, but [p]lvladmin giveexp @user exp and [p]lvladmin takeexp @user exp would be quite useful as well to give and take users certain amount of EXP rather than a set level.
I do believe this is a mee6 feature already.
--> Added the suggestion to take EXP as well.
Hey there, so something I've noticed thats kinda suprising to me how the Leveler cog is global settings for everything would there be a way to have a "default setting" but let server owners be able to adjust things like exp gain and such on their own that it only changes on their own server
Maybe I'm just being abit qol about this but it does limited what you can do with this cog.
My regards
Hi! I like to suggest some delete commands for leveler. My idea is to have a command called [p]lvlreset
. It can have the options to wipe out the levels for an individual user or the whole server. Hope it makes sense, thank you for reading.
Describe the bug
A user was loading a newly installed copy of leveler on their bot and got this
To Reproduce
Install motor > 2.5.1 and try to load leveler, motor 3.0.0 was just released a couple days ago seems like
Expected behavior
The info.json should have an upper bound for motor's version
Bot's logs
The image in the "Describe the bug" section
Red version
Red 3.4.16
Additional context
I would have PRed the change myself but I don't know what you would like to make the valid motor version range
Allow us to delete default backgrounds.
When using the [p]profile command if you have no badges equipped in a slot it displays a plus sign to indicate you can have a badge there, but once you put some badges in place it tends to look off having those pluses there. Is it possible to either disable those pluses all together or to make them disappear after getting the first badge
[2019-07-03 21:28:19] [ERROR] red: Package loading failed
Traceback (most recent call last):
File "/home/edgar06ka/bot/lib/python3.7/site-packages/redbot/core/core_commands.py", line 104, in _load
await bot.load_extension(spec)
File "/home/edgar06ka/bot/lib/python3.7/site-packages/redbot/core/bot.py", line 252, in load_extension
lib = spec.loader.load_module()
File "", line 405, in _check_name_wrapper
File "", line 905, in load_module
File "", line 730, in load_module
File "", line 265, in _load_module_shim
File "", line 696, in _load
File "", line 677, in _load_unlocked
File "", line 726, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/edgar06ka/mybot/cogs/CogManager/cogs/leveler/init.py", line 1, in
from .leveler import Leveler
File "/home/edgar06ka/mybot/cogs/CogManager/cogs/leveler/leveler.py", line 4, in
from PIL import Image, ImageDraw, ImageFont, ImageColor, ImageOps, ImageFilter
File "/home/edgar06ka/mybot/cogs/Downloader/lib/PIL/Image.py", line 60, in
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/home/edgar06ka/mybot/cogs/Downloader/lib/PIL/init.py)
Currently, it's awesome people can receive badges by badges link to a level. But I think it would be really nice if badges were automatically added to their profile IF there's space free. This way people won't have to spam commands either to show their badges.
The Issue
Forecast.io (Dark Sky) is no longer accepting new sign ups, so new users of the bot cog can no longer generate API keys. Dark Sky itself is going to stop at the end of 2021.
Possible Alternatives in Order of Suitability
EDIT: Spelling errors and incomplete sentence... oops...
Describe the bug
i am unable to run leveler on my Red-Bot
To Reproduce
load the repo
install the cog
ask to load
Expected behavior
run?
Bot's logs
object NoneType can't be used in 'await' expression
[21:42:41] ERROR [red] Package loading failed
╭─────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────╮
│ /home/pi/venv/lib/python3.11/site-packages/redbot/core/core_commands.py:188 in _load │
│ ❱ 188 await bot.load_extension(spec) │
│ /home/pi/venv/lib/python3.11/site-packages/redbot/core/bot.py:1680 in load_extension │
│ ❱ 1680 lib = spec.loader.load_module() │
│ in _check_name_wrapper:605 │
│ in load_module:1120 │
│ in load_module:945 │
│ in _load_module_shim:290 │
│ in _load:721 │
│ in _load_unlocked:690 │
│ in exec_module:940 │
│ in _call_with_frames_removed:241 │
│ /home/pi/.local/share/Red-DiscordBot/data/rhbot/cogs/CogManager/cogs/leveler/init.py:4 in │
│ ❱ 4 from .leveler import Leveler │
│ /home/pi/.local/share/Red-DiscordBot/data/rhbot/cogs/CogManager/cogs/leveler/leveler.py:9 in │
│ ❱ 9 from .abc import CompositeMetaClass │
│ /home/pi/.local/share/Red-DiscordBot/data/rhbot/cogs/CogManager/cogs/leveler/abc.py:8 in │
│ ❱ 8 from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase │
│ /home/pi/.local/share/Red-DiscordBot/data/rhbot/cogs/Downloader/lib/motor/motor_asyncio.py:18 in │
│ ❱ 18 from .frameworks import asyncio as asyncio_framework │
│ /home/pi/.local/share/Red-DiscordBot/data/rhbot/cogs/Downloader/lib/motor/frameworks/asyncio/init.py:28 in │
│ ❱ 28 from asyncio import coroutine # For framework interface. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'coroutine' from 'asyncio' (/usr/lib/python3.11/asyncio/init.py)
Red version
3.5.1
Additional context
seens to be hapenning in a lot of other cogs...
Describe the bug
While installing the SciPy
for Leveler cog
in venv
getting following error:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
red-discordbot 3.4.5 requires attrs==19.3.0, but you have attrs 20.3.0 which is incompatible.
red-discordbot 3.4.5 requires Pygments==2.6.1, but you have pygments 2.7.4 which is incompatible.
red-discordbot 3.4.5 requires pytz==2020.1, but you have pytz 2020.5 which is incompatible.
To Reproduce
python -m pip install -U --force-reinstall numpy scipy matplotlib ipython jupyter pandas sympy nose
Expected behavior
Expecting to install " SciPy" without any error.
Red version
3.4.5
Additional context
I don't know whether it is related to above pip installation issues but I cant change the value of !lvladmin msgcredits
and !lvladmin setprice
both are stuck to0
.
Describe the bug
If the image URL for a badge is no longer valid, commands that interact with levelers badge system will have a large timeout before returning information (such as profile, available badges, etc).
To Reproduce
[p]profile
Expected behavior
In the instance that a badges image cannot be accessed, a lower timeout along with an error message logged about being unable to retrieve the badge would work well. Because this is nosql, updating the image url would have to be applied across all user objects rather than just in the badges table
Red version
3.4.12
Additional context
To resolve this issue, I had to manually update the badge url within mongodb across all user objects.
Describe the bug
After the 3.5.x update I wanted to check again if all commands of the respective cogs work, unfortunately your system was also affected where the bot has no longer responded to it :D an error message does not come, he also loads your system, but I can not see after I enter the green rake that he has accepted it. So, unfortunately i can't tell you more because i don't have any more info or error messages
To Reproduce
[/ or !]messageslog channel log-channel-for-all-chats
It would be neat if you could associate backgrounds with a level the same way you can currently with badges. That's all :)
Hello,
Currently it is not possible to remove multiple roles, I would like to request this.
Why?
I am busy with setting up a server where you get roles until a specified role that overrides the other roles. EG: The first 15 levels you will get cloths like socks,pants,gloves,hat etc etc etc. Then you get a full suite, what removes all previous roles. At this point you get extra roles until the next major thing that removes the previous roles.
LD;DR
Multiple roles to semi role role play in a semi role hoarding manner.
Describe the bug
Can't load red, check logs below
To Reproduce
!load leveler
Expected behavior
Bot's logs
Feb 25 11:38:21 localhost redbot[1376]: [2022-02-25 11:38:21] [ERROR] red: Package loading failed
Feb 25 11:38:21 localhost redbot[1376]: Traceback (most recent call last):
Feb 25 11:38:21 localhost redbot[1376]: File "/mnt/git/discordbot/cogs/CogManager/cogs/leveler/leveler.py", line 30, in <module>
Feb 25 11:38:21 localhost redbot[1376]: from motor.motor_asyncio import AsyncIOMotorClient
Feb 25 11:38:21 localhost redbot[1376]: File "/mnt/git/discordbot/cogs/Downloader/lib/motor/motor_asyncio.py", line 29, in <module>
Feb 25 11:38:21 localhost redbot[1376]: AsyncIOMotorClient = create_asyncio_class(core.AgnosticClient)
Feb 25 11:38:21 localhost redbot[1376]: File "/mnt/git/discordbot/cogs/Downloader/lib/motor/motor_asyncio.py", line 25, in create_asyncio_class
Feb 25 11:38:21 localhost redbot[1376]: return create_class_with_framework(cls, asyncio_framework,
Feb 25 11:38:21 localhost redbot[1376]: File "/mnt/git/discordbot/cogs/Downloader/lib/motor/metaprogramming.py", line 288, in create_class_with_framework
Feb 25 11:38:21 localhost redbot[1376]: new_class_attr = attr.create_attribute(new_class, name)
Feb 25 11:38:21 localhost redbot[1376]: File "/mnt/git/discordbot/cogs/Downloader/lib/motor/metaprogramming.py", line 204, in create_attribute
Feb 25 11:38:21 localhost redbot[1376]: doc = getattr(cls.__delegate_class__, attr_name).__doc__
Feb 25 11:38:21 localhost redbot[1376]: AttributeError: type object 'MongoClient' has no attribute 'topology_description'
Feb 25 11:38:21 localhost redbot[1376]: During handling of the above exception, another exception occurred:
Feb 25 11:38:21 localhost redbot[1376]: Traceback (most recent call last):
Feb 25 11:38:21 localhost redbot[1376]: File "/home/pix/vanilla/lib/python3.8/site-packages/redbot/core/core_commands.py", line 172, in _load
Red version
3.4.16
Additional context
When users type in the captcha with cap letters as the image shows the bot counts it a fail unless they lowercase it.
Describe the bug
I've set the badge type to bars via [p]lvlset badge type bars
and then the badge area in my profile is just blank, see:
To Reproduce
Set the bot up, do [p]lvlset badge type bars
, then [p]profile
and there are no badges anymore.
Expected behavior
List of the user-selected badges in bars form
Bot's logs
Nothing out of the ordinary (no errors)
Red version
3.4.0
Currently if a person has a larger nickname/username, when using the [p]profile command their name will appear cut off and unreadable. Is it possible to implement a sort of text wrapping so longer names can be displayed properly here is an example,
https://cdn.discordapp.com/attachments/541001560059019267/552650648521539599/profile.png
Describe the bug
I've just done the math and was wondering why the leaderboard with ?top
says I have less XP than I should have by accumulating the values of the past levels shown on the profile card shown with ?profile
. I couldn't wrap my head around it until I've tried around with some users. Seems like the XP required shown in the XP bar in the profile is calculated here:
Fixator10-Cogs/leveler/leveler.py
Line 3620 in b96ff1f
But the top leaderboard and the XP that actually leads to levelups uses this formula:
Fixator10-Cogs/leveler/leveler.py
Line 3623 in b96ff1f
One example: the profile card said the user is Level 3 and at 468/621 XP to level up. But when I did check the leaderboard, it said they had 1080 points. I used the second formula to calculate that they needed 1094 XP to level up. So 14 XP more, not 153 XP like their profile said. They wrote a message, it gave 17 XP and they leveled up. The leaderboard showed 1097 points and their profile said Level 4 and 3/760 XP. the 760 needed is of course incorrect again. From 4 to 5 you need 621 XP to level up, not 760 (as calculated via the second formula). I've plotted the actual values in this pastebin. The "earned" value is interesting for the leaderboards. I assume that the XP required is calculated by the wrong formula here:
Fixator10-Cogs/leveler/leveler.py
Line 3022 in b96ff1f
I think you just need to use the second formula and subtract the overall XP for the next level from the overall XP of the current level. My guess could be wrong, though.
To Reproduce
Chat until ?top
says you're less than 20 XP away to a level up according to a value in the pastebin, e.g. 269 XP for level 2. Do ?profile
and see how it says you need more than 20 XP for the level up. Write a message that yields XP. Check ?profile
again and see that you've gained a level up.
Expected behavior
The profile exp total for the level should be correct, for example with the formula mentioned above.
Bot's logs
No error or anything.
Red version
v3.4.0
Additional context
n/a
Would there be a way to "disable" the Leveler as I've noticed it's always creating a database even if a server doesnt use the level system which basicly wastes unecesarry space and basicly causes "tracking"
Prehaps have it off by default and a command to turn it on
Thanks in Advance!
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.