Statistics Plugin
A simplistic approach to statistics gathering which works by default and requires no further setup.
1from discord.ext import commands
2
3from antispam import AntiSpamHandler
4from antispam.ext import Stats
5
6bot = commands.Bot(command_prefix="!")
7bot.handler = AntiSpamHandler(bot, no_punish=True)
8bot.stats = Stats(bot.handler)
9bot.handler.register_extension(bot.stats)
10
11# We don't want to collect stats on guild 12345
12# So lets ignore it on this plugin
13bot.stats.blacklisted_guilds.add(12345)
14
15
16@bot.event
17async def on_ready():
18 # On ready, print some details to standard out
19 print(f"-----\nLogged in as: {bot.user.name} : {bot.user.id}\n-----")
20
21
22if __name__ == "__main__":
23 bot.run("Bot Token")