7
7
![ License MIT] ( https://img.shields.io/pypi/l/discord-ext-prometheus )
8
8
![ Grafana Dashboard Downloads] ( https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgrafana.com%2Fapi%2Fdashboards%2F17670&query=%24.downloads&logo=Grafana&label=downloads&color=orange )
9
9
10
- This is a library that makes it easy to add prometheus metrics to your Python Discord bot.
10
+ This is a extension library for [ discord.py ] ( https://github.com/Rapptz/discord.py ) that makes it easy to add prometheus metrics to your Python Discord bot.
11
11
12
12
# Installation
13
13
37
37
38
38
![ Dashboard Preview] ( https://grafana.com/api/dashboards/17670/images/13525/image )
39
39
40
- Available to import from [ Grafana dashboards] ( https://grafana.com/grafana/dashboards/17670-discord-bot/ )
40
+ Available to import from [ Grafana dashboards] ( https://grafana.com/grafana/dashboards/17670-discord-bot/ ) .
41
41
42
42
# How to use
43
43
@@ -53,14 +53,14 @@ from discord.ext import commands
53
53
from discord.ext.prometheus import PrometheusCog
54
54
55
55
async def main ():
56
- bot = commands.Bot(
57
- command_prefix = ' ! ' ,
58
- intents = Intents.all(),
59
- )
56
+ bot = commands.Bot(
57
+ command_prefix = " ! " ,
58
+ intents = Intents.all(),
59
+ )
60
60
61
- await bot.add_cog(PrometheusCog(bot))
61
+ await bot.add_cog(PrometheusCog(bot))
62
62
63
- await bot.start(' YOUR TOKEN' )
63
+ await bot.start(" YOUR TOKEN" )
64
64
65
65
asyncio.run(main())
66
66
```
@@ -77,24 +77,24 @@ from discord.ext.prometheus import PrometheusCog, PrometheusLoggingHandler
77
77
logging.getLogger().addHandler(PrometheusLoggingHandler())
78
78
79
79
async def main ():
80
- bot = commands.Bot(
81
- command_prefix = ' ! ' ,
82
- intents = Intents.all(),
83
- )
80
+ bot = commands.Bot(
81
+ command_prefix = " ! " ,
82
+ intents = Intents.all(),
83
+ )
84
84
85
- await bot.add_cog(PrometheusCog(bot))
85
+ await bot.add_cog(PrometheusCog(bot))
86
86
87
- @bot.listen ()
88
- async def on_ready ():
89
- logging.info(f ' Logged in as { bot.user.name} # { bot.user.discriminator} ' )
87
+ @bot.listen ()
88
+ async def on_ready ():
89
+ logging.info(f " Logged in as { bot.user.name} # { bot.user.discriminator} " )
90
90
91
- logging.info(' Starting the bot' )
92
- await bot.start(' YOUR TOKEN' )
91
+ logging.info(" Starting the bot" )
92
+ await bot.start(" YOUR TOKEN" )
93
93
94
94
asyncio.run(main())
95
95
```
96
96
97
- ## Change the Prometheus port
97
+ ## Changing the Prometheus port
98
98
99
99
The default port is ` 8000 ` but can be changed while creating the cog.
100
100
0 commit comments