traysercassa / discordhandler Goto Github PK
View Code? Open in Web Editor NEWLogging Handler with discord using Python Logging class
License: MIT License
Logging Handler with discord using Python Logging class
License: MIT License
discord allows max. 2000 characters, it would be great to have a way to trim the message to some max length
Hi there! First off, thanks for the module. It saved me a good amount of time in a recent Django project where I had an idea in mind to push critical error to Discord and found your repository.
I'd love to see this code being published to PyPi for easy installation through pip. Do you want me to submit a PR with code cleanup and meeting requirements (setup.py, and moving the DiscordHandler class to a separate module, etc) for a PyPi submission?
I want to apply the logging formatter.
But now DiscordHandler does not support that function.
https://github.com/TrayserCassa/DiscordHandler/blob/master/discord_handler/DiscordHandler.py#L60 is not working in python 3, it should be enclosed in ()
--- Logging error ---
Traceback (most recent call last):
File "/home/fluorescentbacon/.local/lib/python3.7/site-packages/discord_handler/DiscordHandler.py", line 65, in emit
for user in self._notify_users:
TypeError: 'int' object is not iterable
Call stack:
File "main.py", line 108, in
bot.run(TOKEN)
File "/home/fluorescentbacon/.local/lib/python3.7/site-packages/discord/client.py", line 708, in run
loop.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1775, in _run_once
handle._run()
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/fluorescentbacon/.local/lib/python3.7/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 79, in on_ready
logger.info("We have logged in.")
File "/usr/lib/python3.7/logging/init.py", line 1383, in info
self._log(INFO, msg, args, **kwargs)
File "/usr/lib/python3.7/logging/init.py", line 1519, in _log
self.handle(record)
File "/usr/lib/python3.7/logging/init.py", line 1529, in handle
self.callHandlers(record)
File "/usr/lib/python3.7/logging/init.py", line 1591, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.7/logging/init.py", line 905, in handle
self.emit(record)
File "/home/fluorescentbacon/.local/lib/python3.7/site-packages/discord_handler/DiscordHandler.py", line 70, in emit
self.handleError(record)
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.