Giter Site home page Giter Site logo

maybe-useful-cogs's Introduction

Maybe-Useful-Cogs

A few cogs for Twentysix's Red-DiscordBot. To add, do [p]cog repo add stevy https://github.com/AznStevy/Maybe-Useful-Cogs/

About Cogs

Osu - I play the game and have a discord server, so I thought it would be nice to have an osu cog.

Leveler - A level-up system using python. (Designed by LadyGhost).

Discomegle - More people/servers, more fun. You are put into a pool that the bot keeps track of and you can talk anonymously to a partner.

Markov - Markov. It is what it is.

Whoplays - Look at what games people in the server are playing.

Why...

Because I wanted to make them.

Do you suck?

Oh.

Support

If you would like some support for these cogs because nothing ever works, you can talk to me in my testing/spam server, bot testing. I don't bite, I promise :3

Leveler Support - Firstly, visit this awesome site dimxxz made: http://dimxxz.net/lvlsupport.html. If those things don't work, read on. pip3 install scipy is known to not work on Windows (Linux should work fine along with pip3 install numpy). Scipy is NOT required, but needed for auto color generation. I personally would recommend downloading it because having the auto command is the difference between http://puu.sh/qLpja/dd46470fda.jpg and http://puu.sh/qL7hK/d94cad0936.jpg. I think you can tell the difference.

  1. Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy, download your version (python version + 32/64-bit), pip3 install (exact location of downloaded file). Then, do the same for http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy.

  2. Google! It's your friend!

  3. Come to the support server to complain or just to hang out c:

MongoDB - Leveler now requires the use of MongoDB. If you are on ubuntu, try this. If you are on Windows, try this (Keep this console separate and open). If you are on another Linux distro, try this. You will also need to install the python module by doing pip3 install pymongo.

Support Me - If you would like to give donations to a broke uni student, you can visit my patreon page or donate using Ethereum at: 0xc7174681a91e00285de5fb5f0eb39c9554eb72b3. Thanks a bunch!

maybe-useful-cogs's People

Contributors

aikaterna avatar aznstevy avatar calebj avatar eslyium avatar jamuwu avatar pierce01 avatar repulser avatar twentysix26 avatar wasalys avatar yeahimrose 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

maybe-useful-cogs's Issues

And for that ?

 
[14/06/2018 16:41] ERROR owner load 74: localhost:27017: [Errno 111] Connection refused
Traceback (most recent call last):
  File "/root/Red-DiscordBot/cogs/owner.py", line 65, in load
    self._load_cog(module)
  File "/root/Red-DiscordBot/cogs/owner.py", line 942, in _load_cog
    self.bot.load_extension(mod_obj.name)
  File "lib/discord/ext/commands/bot.py", line 738, in load_extension
    lib.setup(self)
  File "/root/Red-DiscordBot/cogs/leveler.py", line 3284, in setup
    n = Leveler(bot)
  File "/root/Red-DiscordBot/cogs/leveler.py", line 61, in init
    dbs = client.database_names()
  File "lib/pymongo/mongo_client.py", line 1496, in list_database_names
    for doc in self.list_databases(session, nameOnly=True)]
  File "lib/pymongo/mongo_client.py", line 1476, in list_databases
    "admin").command(cmd, session=session)
  File "lib/pymongo/database.py", line 529, in command
    with client._socket_for_reads(read_preference) as (sock_info, slave_ok):
  File "/usr/local/lib/python3.6/contextlib.py", line 82, in enter
    return next(self.gen)
  File "lib/pymongo/mongo_client.py", line 982, in _socket_for_reads
    server = topology.select_server(read_preference)
  File "lib/pymongo/topology.py", line 224, in select_server
    address))
  File "lib/pymongo/topology.py", line 183, in select_servers
    selector, server_timeout, address)
  File "lib/pymongo/topology.py", line 199, in _select_servers_loop
    self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
Traceback (most recent call last):
  File "/root/Red-DiscordBot/cogs/owner.py", line 65, in load
    self._load_cog(module)
  File "/root/Red-DiscordBot/cogs/owner.py", line 942, in _load_cog
    self.bot.load_extension(mod_obj.name)
  File "lib/discord/ext/commands/bot.py", line 738, in load_extension
    lib.setup(self)
  File "/root/Red-DiscordBot/cogs/leveler.py", line 3284, in setup
    n = Leveler(bot)
  File "/root/Red-DiscordBot/cogs/leveler.py", line 61, in init
    dbs = client.database_names()
  File "lib/pymongo/mongo_client.py", line 1496, in list_database_names
    for doc in self.list_databases(session, nameOnly=True)]
  File "lib/pymongo/mongo_client.py", line 1476, in list_databases
    "admin").command(cmd, session=session)
  File "lib/pymongo/database.py", line 529, in command
    with client._socket_for_reads(read_preference) as (sock_info, slave_ok):
  File "/usr/local/lib/python3.6/contextlib.py", line 82, in enter
    return next(self.gen)
  File "lib/pymongo/mongo_client.py", line 982, in _socket_for_reads
    server = topology.select_server(read_preference)
  File "lib/pymongo/topology.py", line 224, in select_server
    address))
  File "lib/pymongo/topology.py", line 183, in select_servers
    selector, server_timeout, address)
  File "lib/pymongo/topology.py", line 199, in _select_servers_loop
    self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

[Leveler] cog will not load anymore

Hi,
Since some time (didn't see exactly when it was happening first, but from the logs, looks like it first had this issue 10/09/2017), I can't load the Leveler cog and have the following error:
[07/03/2018 21:01] ERROR red load_cogs 573: Command role is already registered. Traceback (most recent call last): File "red.py", line 570, in load_cogs owner_cog._load_cog(extension) File "/home/gsecurity/Red-DiscordBot/cogs/owner.py", line 948, in _load_cog self.bot.load_extension(mod_obj.__name__) File "lib/discord/ext/commands/bot.py", line 738, in load_extension lib.setup(self) File "/home/gsecurity/Red-DiscordBot/cogs/leveler.py", line 3286, in setup bot.add_cog(n) File "lib/discord/ext/commands/bot.py", line 655, in add_cog self.add_command(member) File "lib/discord/ext/commands/core.py", line 487, in add_command raise discord.ClientException('Command {0.name} is already registered.'.format(command)) discord.errors.ClientException: Command role is already registered.
I really have no idea what is causing this.
If I force load the cog with the !load command, I will get this error:
[07/03/2018 20:52] ERROR owner load 74: Command role is already registered. Traceback (most recent call last): File "/home/gsecurity/Red-DiscordBot/cogs/owner.py", line 65, in load self._load_cog(module) File "/home/gsecurity/Red-DiscordBot/cogs/owner.py", line 948, in _load_cog self.bot.load_extension(mod_obj.__name__) File "lib/discord/ext/commands/bot.py", line 738, in load_extension lib.setup(self) File "/home/gsecurity/Red-DiscordBot/cogs/leveler.py", line 3286, in setup bot.add_cog(n) File "lib/discord/ext/commands/bot.py", line 655, in add_cog self.add_command(member) File "lib/discord/ext/commands/core.py", line 487, in add_command raise discord.ClientException('Command {0.name} is already registered.'.format(command)) discord.errors.ClientException: Command role is already registered.
and the cog is deactivated by the boat for loading next time.
But, at this stage, manually loading the cog with !load will give the above error, but afterwards seems to work.

Any idea ?

(Red is up-to-date so is leveler).
Thank you.
Regards.

Calculating leader board takes a long time on big servers

Hi - We've found that on servers with very large user populations, calculating 'top' can be extremely expensive as _required_exp() is built up in a loop for each level for each user. Run time with about 30k users is just under 5 minutes. We're on older code (pre-mongo) but the level->exp calculation implementation hasn't changed much from what I can tell.

Opened #60 to fix.

leveler, pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

idk why this keeps happening, my bot won't load the cog can i please get help? here's my full traceback

Traceback (most recent call last): File "/home/skullbite/red/cogs/owner.py", line 65, in load self._load_cog(module) File "/home/skullbite/redt/cogs/owner.py", line 948, in _load_cog self.bot.load_extension(mod_obj.__name__) File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 738, in load_extension lib.setup(self) File "/home/skullbite/red/cogs/leveler.py", line 2989, in setup n = Leveler(bot) File "/home/skullbite/redt/cogs/leveler.py", line 63, in __init__ dbs = client.database_names() File "lib/pymongo/mongo_client.py", line 1213, in database_names ("nameOnly", True)]))["databases"]] File "lib/pymongo/database.py", line 513, in command with client._socket_for_reads(read_preference) as (sock_info, slave_ok): File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__ return next(self.gen) File "lib/pymongo/mongo_client.py", line 904, in _socket_for_reads with self._get_socket(read_preference) as sock_info: File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__ return next(self.gen) File "lib/pymongo/mongo_client.py", line 868, in _get_socket server = self._get_topology().select_server(selector) File "lib/pymongo/topology.py", line 214, in select_server address)) File "lib/pymongo/topology.py", line 189, in select_servers self._error_message(selector)) pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

Leveler lags after a huge amount of users.

I already contacted Stevy about this, however, i figured out that it doesn't lag because it compresses a image, it lags because it makes a huge file that saves all the data, then when that hits around 2mb, the system starts to hog the CPU. I think Twentysix might be able to explain this better than me.

My recommendation: Make a save file for separate users, for example User1.json and User2.json, or make seperate discord servers json (that'll fill up quickly as well).

Leveler permissions

Hi,

Is there a way to give other users the permission to use the lvladmin commands ? For example to add a new bg ? Thanks a lot c:

Badge Issue

Why can't we see the badge icon ? Instead its just showing the Badge name with an ID.

Ex: BadgeName 1234556788

Leveler not able to load.

Here is the error I get in my console.

ServerSelectionTimeoutError: localhost:27017: [WinError 10061] No connection could be made because the target machine actively refused it
[16/07/2017 19:02] ERROR red load_cogs 560: localhost:27017: [WinError 10061] No connection could be made because the target machine actively refused it
Traceback (most recent call last):
File "red.py", line 557, in load_cogs
owner_cog._load_cog(extension)
File "C:\Users\gr33m\OneDrive\Greem Bot\cogs\owner.py", line 899, in _load_cog
self.bot.load_extension(mod_obj.name)
File "lib\discord\ext\commands\bot.py", line 738, in load_extension
lib.setup(self)
File "C:\Users\gr33m\OneDrive\Greem Bot\cogs\leveler.py", line 2986, in setup
n = Leveler(bot)
File "C:\Users\gr33m\OneDrive\Greem Bot\cogs\leveler.py", line 60, in init
dbs = client.database_names()
File "lib\pymongo\mongo_client.py", line 1149, in database_names
"listDatabases")["databases"]]
File "lib\pymongo\database.py", line 491, in command
with client._socket_for_reads(read_preference) as (sock_info, slave_ok):
File "C:\Users\gr33m\AppData\Local\Programs\Python\Python35-32\lib\contextlib.py", line 59, in enter
return next(self.gen)
File "lib\pymongo\mongo_client.py", line 859, in _socket_for_reads
with self._get_socket(read_preference) as sock_info:
File "C:\Users\gr33m\AppData\Local\Programs\Python\Python35-32\lib\contextlib.py", line 59, in enter
return next(self.gen)
File "lib\pymongo\mongo_client.py", line 823, in _get_socket
server = self._get_topology().select_server(selector)
File "lib\pymongo\topology.py", line 214, in select_server
address))
File "lib\pymongo\topology.py", line 189, in select_servers
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 10061] No connection could be made because the target machine actively refused it

Failed to load: cogs.leveler

If you could help, that'd be neat-o.

setlevel

I cant set level to my friend,i got this error.
1
And 1 more error,other users cant use profile or else.
1

[Leveler] Installing on a Raspberry Pi

I have a self-hosted instance of Red on my pi (raspbian stretch), but mongodb from apt isnt quite updated, and according to this answer will not due to raspbian being a ARM x86 system.

So, is still possible to run this cog on a Raspbian Red? Is there any options left?

Thanks in advance!

leveler, anything to do with images broke

I have looked into this for a while trying to see if it is on my side, I belive this is not because of me. Here is a log when I try to do [p]profile

Exception in command 'profile'
Traceback (most recent call last):
File "lib/discord/ext/commands/core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "/home/pi/Desktop/PeaterBot/cogs/leveler.py", line 105, in profile
await self.draw_profile(user, server)
File "/home/pi/Desktop/PeaterBot/cogs/leveler.py", line 1987, in draw_profile
profile_image = Image.open('data/leveler/temp/{}_temp_profile_profile.png'.format(user.id)).convert('RGBA')
File "lib/PIL/Image.py", line 2572, in open
% (filename if filename else fp))
OSError: cannot identify image file 'data/leveler/temp/208696987082555393_temp_profile_profile.png'

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

Traceback (most recent call last):
File "lib/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "lib/discord/ext/commands/core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "lib/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OSError: cannot identify image file 'data/leveler/temp/208696987082555393_temp_profile_profile.png'

Refused connection Error on load

I can't get it to load, and receive the following traceback call on the log:

ServerSelectionTimeoutError: localhost:27017: [WinError 10061] No connection cou
ld be made because the target machine actively refused it
[25/04/2018 15:46] ERROR red load_cogs 573: localhost:27017: [WinError 10061] No
connection could be made because the target machine actively refused it
Traceback (most recent call last):
File "red.py", line 570, in load_cogs
owner_cog._load_cog(extension)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Red\cog
s\owner.py", line 948, in _load_cog
self.bot.load_extension(mod_obj.name)
File "lib\discord\ext\commands\bot.py", line 738, in load_extension
lib.setup(self)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Red\cog
s\leveler.py", line 3284, in setup
n = Leveler(bot)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Red\cog
s\leveler.py", line 61, in init
dbs = client.database_names()
File "lib\pymongo\mongo_client.py", line 1496, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "lib\pymongo\mongo_client.py", line 1476, in list_databases
"admin").command(cmd, session=session)
File "lib\pymongo\database.py", line 529, in command
with client._socket_for_reads(read_preference) as (sock_info, slave_ok):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\con
textlib.py", line 81, in enter
return next(self.gen)
File "lib\pymongo\mongo_client.py", line 982, in _socket_for_reads
server = topology.select_server(read_preference)
File "lib\pymongo\topology.py", line 224, in select_server
address))
File "lib\pymongo\topology.py", line 183, in select_servers
selector, server_timeout, address)
File "lib\pymongo\topology.py", line 199, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 10061] No
connection could be made because the target machine actively refused it
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0656E710>

Failed to load: cogs.

Sorry if this was previously mentioned, but I couldn't google myself out of this one.. ;<
Help please and thanks for the awesome cog!

Leveler

Please help me, I can't install leveler because i cant install pillow

Add option to show local stats

Hi, I know it is work in progress but having only global stats is not the best solution :( Hope you will add local stats or some flags to see local in future.

Thanks!

[leveler]Cog doesn't load :/

When i try to load leveler :
[0mn = Leveler(bot)
  
File "/root/Red-DiscordBot/cogs/leveler.py", line 61, in __init__dbs = client.database_names()
  
File "lib/pymongo/mongo_client.py", line 1496, in list_database_namesfor doc in self.list_databases(session, nameOnly=True)]
  
File "lib/pymongo/mongo_client.py", line 1476, in list_databases"admin").command(cmd, session=session)
  
File "lib/pymongo/database.py", line 529, in commandwith client._socket_for_reads(read_preference) as (sock_info, slave_ok):
  
File "/usr/local/lib/python3.6/contextlib.py", line 82, in enter
return next(self.gen)
  
File "lib/pymongo/mongo_client.py", line 982, in _socket_for_reads
server = topology.select_server(read_preference)
  
File "lib/pymongo/topology.py", line 224, in select_server
address))
  
File "lib/pymongo/topology.py", line 183, in select_servers
selector, server_timeout, address)
  
File "lib/pymongo/topology.py", line 209, in _select_servers_loop
self._description.check_compatible()
  
File "lib/pymongo/topology_description.py", line 121, in check_compatible
raise ConfigurationError(self._incompatible_err)
pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 0, but this version of PyMongo requires at least 2 (MongoDB 2.6).

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.