corpnewt / corpbot.py Goto Github PK
View Code? Open in Web Editor NEWA very clumsy python bot for discord
License: MIT License
A very clumsy python bot for discord
License: MIT License
hi corpnewt.
how can i use mongoDB in this bot?
so the data base is not from json.
thank you.
#the issue is that the music/chatterbot/bot cogs are not loading.
#this is the output of the cogs area
Loading CogManager...
Connecting to database on localhost:27017...
Connection failed, trying JSON
Since no mongoDB instance was running, I'm reverting back to the Settings.json
Bot failed to load!
Extension 'Cogs.Bot' raised an error: ModuleNotFoundError: No module named 'psutil'
deck.json is malformed! CAH will not work correctly!
ChatterBot failed to load!
Extension 'Cogs.ChatterBot' raised an error: AttributeError: module 'time' has no attribute 'clock'
Missing idgbkey - skipping.
Music failed to load!
Extension 'Cogs.Music' raised an error: ModuleNotFoundError: No module named 'wavelink'
Loaded 100 of 103 cogs.
Hi, recently I forked CorpBot. I'm configuring the CorpBot's Music.py Cog with my lavalink server host but it say's that it can't find the video, how can I solve this? (it can't play youtube url too)
for example my lavalink server thing:
node = self.bot.wavelink.get_best_node() if not node: node = await self.bot.wavelink.initiate_node(host='lava.xxxxxxx.host', port=2333, rest_uri='http://lava.xxxxxx.host:2333/', password='xxxxxxx', identifier='Kegri', region='us_central')
When i use the play command i get this error
Ignoring exception in command play:
Traceback (most recent call last):
File "E:\Programme\Python\lib\site-packages\discord\ext\commands\core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "E:\Downloads\CorpBot.py-rewrite\Cogs\Music.py", line 350, in play
await self.resolve_search(ctx, url)
File "E:\Downloads\CorpBot.py-rewrite\Cogs\Music.py", line 83, in resolve_search
data = await self.add_to_queue(ctx, url, shuffle)
File "E:\Downloads\CorpBot.py-rewrite\Cogs\Music.py", line 115, in add_to_queue
tracks = await self.bot.wavelink.get_tracks(url)
File "E:\Programme\Python\lib\site-packages\wavelink\client.py", line 100, in get_tracks
return await node.get_tracks(query)
AttributeError: 'NoneType' object has no attribute 'get_tracks'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Programme\Python\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "E:\Programme\Python\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "E:\Programme\Python\lib\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: AttributeError: 'NoneType' object has no attribute 'get_tracks'
here is the whole output of the .bat
Git is not found in your PATH var!
Updates will be disabled!
Starting up 4 shards...
Traceback (most recent call last):
File "C:\Users\Administrator\Downloads\CorpBot.py-rewrite\Main.py", line 395, in
bot.run(settings_dict.get("token",""))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 723, in run
return future.result()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 702, in runner
await self.start(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 666, in start
await self.connect(reconnect=reconnect)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\shard.py", line 445, in connect
raise item.error
discord.errors.PrivilegedIntentsRequired: Shard ID 0 is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
Return code: 1
Starting up 4 shards...
Hello,
During the last night, my bot/client has been banned from Discord for spamming ads on servers. Some persons used the telephone module to spam each server which accepted their calls.
I tried with regex to avoid the bot sending links but I'm really confused and I don't want to get my bot banned anymore. If it happens again, they will probably disable my account too.
Thanks for your help.
I keep getting this error when I try and play something on a voice channel. The hot also doesn't seem to appear in the voice channel even using the join/summon command.
Connection Failure: Cannot connect to host 127.0.0.1:2333 ssl:default [The remote computer refused the network connection]
Error resolving search:
ClientConnectorError(ConnectionKey(host='127.0.0.1', port=2333, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None), ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None))
I also got these errors
Trying to update via git...
fatal: unable to access 'https://github.com/EunolaSims4/MesdusaBot---d.py.git/': Could not resolve host: github.com
Can you give me te old music cog from 1eab7a8
I can’t seem to claim my bot. I use the command and it responds that it’s been claimed but when I go and use a command that requires owner the bot responds saying it hasn’t been claimed
Any reddit command returns the same error.
Hey, I added the gamelookup cog, but it doesnt work... I got an API key from their website, but where do I put it? how do I format it? As what do I save it?
So, originally, the bot refused to load ANY cogs, with the message that something wasn't awaited and that cg_man was NoneType. I was able to await the function, but now I get an error on Loading CogManager....:
Traceback (most recent call last):
File "C:\Users\Samuel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Samuel\Desktop\Froggy Bot\Main.py", line 106, in on_all_shards_ready
await bot.load_extension("Cogs.CogManager")
TypeError: object NoneType can't be used in 'await' expression
I don't know why, can someone help?
This isn't really an issue at least I don't think but disord.py will no longer be updated or maintained and I was wondering if it would effect the bot in any way?
When adding either a hack or link to the bot in the following form, the bot will encode the trailing ticks in rawhack/rawlink.
Expected behaviour would be:
User: $addlink test ```https://test.com```
Bot: test added to link list!
User: $link test
Bot:https://test.com
User: $rawlink test
Bot: ```https://test.com```
Instead the observed behaviour is:
User: $addlink test ```https://test.com```
Bot: test added to link list!
User: $link test
Bot:https://test.com
User: $rawlink test
Bot: ```https://test.com/%60%60%60
The code is very uncontrolled and everywhere. For most python projects, black
is used to format code to ensure readability.
You can find black here: https://github.com/psf/black
I changed your bot, in every language of xp, and the setup now it can work simultaneously with the 2 systems, both with xp reservation and xp per hour, do you want me to send you a copy of the edition that I did?
Hey sorry for making a issue but can I please have Support server or a link to invite the bot I just wanna check it out ty (I recommend giving both)
Need gain xp, not xp reserve in my case xp reserve nit work :/ pliz change this
I keep getting this error when I start my bot. I didn't get it before but after turning on intents I do. I deleted the part that says intents but I am still getting the same error
WEBSOCKET | Connection Failure:: Cannot connect to host 127.0.0.1:2333 ssl:default [Connect call failed ('127.0.0.1', 2333)]
Traceback (most recent call last):
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\connector.py", line 969, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File "C:\Users\shaki\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 943, in create_connection
raise exceptions[0]
File "C:\Users\shaki\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 930, in create_connection
await self.sock_connect(sock, address)
File "C:\Users\shaki\AppData\Local\Programs\Python\Python37-32\lib\asyncio\selector_events.py", line 475, in sock_connect
return await fut
File "C:\Users\shaki\AppData\Local\Programs\Python\Python37-32\lib\asyncio\selector_events.py", line 505, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 2333)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\wavelink\websocket.py", line 76, in _connect
self._websocket = await self._node.session.ws_connect(uri, headers=self.headers, heartbeat=self._node.heartbeat)
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\client.py", line 763, in _ws_connect
proxy_headers=proxy_headers,
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\client.py", line 521, in _request
req, traces=traces, timeout=real_timeout
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\connector.py", line 1051, in _create_direct_connection
raise last_exc
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\connector.py", line 1032, in _create_direct_connection
client_error=client_error,
File "C:\Users\shaki\PycharmProjects\Medusa\venv\lib\site-packages\aiohttp\connector.py", line 975, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 127.0.0.1:2333 ssl:default [Connect call failed ('127.0.0.1', 2333)]
now I’m unable to claiming the bot and it won’t go offline
I have tried everything. CorpBot as is just with Lavalink and my setting_dict and then just my bot and I'm getting the exact same error each time.
Cogs.Settings failed to load!
And
Ignoring exception in on_loaded_extension
Traceback (most recent call last):
File "C:\Users\shaki\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\shaki\OneDrive\Documents\MesdusaBot---d.py\Cogs\Mute.py", line 66, in on_loaded_extension
muteList = self.settings.getServerStat(server, "MuteList")
AttributeError: 'NoneType' object has no attribute 'getServerStat'
Gathering invites...
Ignoring exception in on_loaded_extension
Traceback (most recent call last):
File "C:\Users\shaki\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\shaki\OneDrive\Documents\MesdusaBot---d.py\Cogs\Invite.py", line 91, in on_loaded_extension
if self.settings.getGlobalStat("AllowServerJoin", True): return # No need to check - not restricting
AttributeError: 'NoneType' object has no attribute 'getGlobalStat'
'NoneType' object has no attribute 'getGlobalStat'
The second is happening for pretty much all of the cogs and I don't know why. It was working fine the day before yesterday. It happens when I start the bot From StartBot.bat
and Main.py
So far it's saying for Mute.py
, Debugging.py
, Stream.py
, Invite.py
and it's still loading the bot repeating the
AttributeError: 'NoneType' object has no attribute 'getGlobalStat'
'NoneType' object has no attribute 'getGlobalStat'
error for Debugging and Stream
Hey I want to change how ChatterBot reacts and make it help my community how can i do it and do I need to edit the .brn file or is there a different solution?
writing Pillow.egg-info/PKG-INFO
writing dependency_links to Pillow.egg-info/dependency_links.txt
writing top-level names to Pillow.egg-info/top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.sh'
no previously-included directories found matching 'docs/_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
writing manifest file 'Pillow.egg-info/SOURCES.txt'
copying PIL/OleFileIO-README.md -> build/lib.macosx-10.6-intel-3.6/PIL
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/0f/35tnh08j59sc_j50t0vhk7y80000gn/T/pip-build-lvh4cqzh/Pillow/setup.py", line 753, in <module>
zip_safe=not debug_build(), )
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/private/var/folders/0f/35tnh08j59sc_j50t0vhk7y80000gn/T/pip-build-lvh4cqzh/Pillow/setup.py", line 521, in build_extensions
' using --disable-%s, aborting' % (f, f))
ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
----------------------------------------
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;file='/private/var/folders/0f/35tnh08j59sc_j50t0vhk7y80000gn/T/pip-build-lvh4cqzh/Pillow/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/0f/35tnh08j59sc_j50t0vhk7y80000gn/T/pip-omb9091a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0f/35tnh08j59sc_j50t0vhk7y80000gn/T/pip-build-lvh4cqzh/Pillow/
CorpNewt, meet me on your Discord.
I do not have mongodb installed so it should convert to json, but I keep getting an error that it couldn't get getServerStat. I do have the get_cog in my init
This issue is very similar to "Cards against humanity cog question #42" from BleuSkie.
I have been using CorpBot for a while now and it's great. I used to use the CAH cog all the time but now it's not working. I found out that the deck.json was missing so I redownloaded it from the linked website but that still seems to have the same issue, a keyword error for whiteCards. I had a look into the json and found that there was no mention of whiteCards, the closest I could find was white. From this I assume the format has changed. Thankfully I was able to find an old version of it in the Issue report mentioned at the start, however when trying to run with that file it still doesn't work. Any help would be greatly appreciated!
Thanks for making such a great bot available to others!
Hello,
We are unable to set or get our global user stats, the format may be the root cause of this error, I'm getting the following for settz
:
Ignoring exception in command settz:
Traceback (most recent call last):
File "\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped
ret = await coro(*args, **kwargs)
File "\Cogs\Time.py", line 52, in settz
self.settings.setGlobalUserStat(ctx.author, "TimeZone", tz_list[index]['Item'])
File "Cogs\Settings.py", line 734, in setGlobalUserStat
userList[str(user.id)][stat] = value
TypeError: list indices must be integers or slices, not str
Hey where can I find additional cogs (or I cant?) And can I have a discord server link too I cannot find it on your reddit ty
After the cogs changes now there are changes to the help_formatter!
here you can read them all https://gist.github.com/Rapptz/288294ca99fa1f042f0e39a92ddd88eb
xD
Here is the error
ChatterBot failed to load!
Extension 'Cogs.ChatterBot' raised an error: AttributeError: module 'time' has no attribute 'clock'
...But the bot seems to leave as soon as it joins any discord server, for both me and a friend
I was trying to remove the bot set custom status but I can’t seem to find a way to do so. I’ve shutdown the bot and restarted it.
Hello,
Somehow, out of nowhere, my bot wont start anymore... Apparently some KeyError? I use the latest updated Settings.py file.
May 17 04:03:13 dutchy env[29452]: Traceback (most recent call last):
May 17 04:03:13 dutchy env[29452]: File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 577, in _load_from_module_spec
May 17 04:03:13 dutchy env[29452]: setup(self)
May 17 04:03:13 dutchy env[29452]: File "/usr/bin/CharlesBot/cogs/Settings.py", line 25, in setup
May 17 04:03:13 dutchy env[29452]: bot.add_cog(Settings(bot))
May 17 04:03:13 dutchy env[29452]: File "/usr/bin/CharlesBot/cogs/Settings.py", line 301, in __init__
May 17 04:03:13 dutchy env[29452]: self.load_local()
May 17 04:03:13 dutchy env[29452]: File "/usr/bin/CharlesBot/cogs/Settings.py", line 351, in load_local
May 17 04:03:13 dutchy env[29452]: self.serverDict["Servers"][collection_name] = collection
May 17 04:03:13 dutchy env[29452]: KeyError: 'Servers'
May 17 04:03:13 dutchy env[29452]: The above exception was the direct cause of the following exception:
May 17 04:03:13 dutchy env[29452]: Traceback (most recent call last):
May 17 04:03:13 dutchy env[29452]: File "/usr/local/lib/python3.7/site-packages/discord/client.py", line 255, in _run_event
May 17 04:03:13 dutchy env[29452]: await coro(*args, **kwargs)
May 17 04:03:13 dutchy env[29452]: File "/usr/bin/CharlesBot/index.py", line 43, in on_connect
May 17 04:03:13 dutchy env[29452]: bot.load_extension("cogs.Settings")
May 17 04:03:13 dutchy env[29452]: File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 622, in load_extension
May 17 04:03:13 dutchy env[29452]: self._load_from_module_spec(lib, name)
May 17 04:03:13 dutchy env[29452]: File "/usr/local/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 581, in _load_from_module_spec
May 17 04:03:13 dutchy env[29452]: raise errors.ExtensionFailed(key, e) from e
May 17 04:03:13 dutchy env[29452]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Settings' raised an error: KeyError: 'Servers'```
I could be stupid, however whenever I try to use the $pcpp list, whatever link I try or whatever I do, the bot always responds with:
Something went wrong! Make sure you use a valid pcpartpicker link.
Along with that, the autopcpp command once sent it says "Auto pcpartpicker disabled", afterwards if you send it again it doesn't reply with anything, and once again after sending that it just says "Auto pcpartpicker disabled".
After "turning on" the autopcpp command, and sending a link, the bot does nothing.
Lists failed to load! Extension 'Cogs.Lists' raised an error: ClientException: Command addtag is already registered.
I downloaded the new build of the bot but I keep getting this error for the CogManager
C:\Users\shaki\Downloads\CorpBot.py-rewrite (2)\CorpBot.py-rewrite\Main.py:106: RuntimeWarning: coroutine 'BotBase.load_extension' was never awaited
bot.load_extension("Cogs.CogManager")
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
[2022-08-25 09:34:07] [ERROR ] discord.client: Ignoring exception in on_all_shards_ready
Traceback (most recent call last):
File "C:\Users\shaki\OneDrive\Documents\MEGA\MesdusaBot---d.py\venv\lib\site-packages\discord\client.py", line 409, in _run_event
await coro(*args, **kwargs)
File "C:\Users\shaki\Downloads\CorpBot.py-rewrite (2)\CorpBot.py-rewrite\Main.py", line 109, in on_all_shards_ready
cog_loaded, cog_count = cg_man._load_extension()
AttributeError: 'NoneType' object has no attribute '_load_extension'
Do you have a Discord Support Server?
If a user runs one of the commands belonging to in any case Face.py, and potentially other cogs with a handmade role tag behind it ie. $lenny <@123421>
the bot will then ping that role in the output if it has permission to do so, even if the original user didn't.
This can easily lead to massive mass-mentions in servers.
The current naming conventions and indentations in your code are not at all very nice.
Please read this:
https://www.python.org/dev/peps/pep-0008/
update help pls to the new cogs system
Hello. I am unsure how the cog works. I get a no white card error and invalid form body when I try to run commands for the cog like $hand and $addbot. I saw you needed a deck list, but that didn't seem to download with the rest of the bot. I did see the site in the code and made a deck.json file for it, but I am unsure of the formating. I am entirely new to this and that could be my problem. Could you give me a little insight? Thanks. (Sorry if this is a dumb question)
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.