1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 14:27:27 +00:00

Testing with audit logs

This commit is contained in:
Myned 2017-10-21 16:40:06 -04:00
parent 4faa5b9bb7
commit 4528c6fe10

View file

@ -6,6 +6,7 @@ import subprocess
import sys import sys
import traceback as tb import traceback as tb
from contextlib import suppress from contextlib import suppress
from pprint import pprint
import discord as d import discord as d
from discord import utils from discord import utils
@ -135,8 +136,13 @@ def after(voice, error):
@commands.is_owner() @commands.is_owner()
@checks.del_ctx() @checks.del_ctx()
async def test(ctx): async def test(ctx):
channel = bot.get_channel(int(cid)) logs = []
voice = await channel.connect() async for entry in ctx.guild.audit_logs(limit=None, action=d.AuditLogAction.message_delete):
voice.play(d.AudioSource, after=lambda: after(voice)) logs.append(
f'@{entry.user.name} deleted {entry.extra.count} messages from @{entry.target.name} in #{entry.extra.channel.name}')
pprint(logs)
# channel = bot.get_channel(int(cid))
# voice = await channel.connect()
# voice.play(d.AudioSource, after=lambda: after(voice))
bot.run(u.config['token']) bot.run(u.config['token'])