Skip to content

Commit

Permalink
added logs
Browse files Browse the repository at this point in the history
^
  • Loading branch information
Setlerr committed Jun 24, 2022
1 parent c0c2ff7 commit 27ac7f6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,3 @@ Learning Python...

Discord bot for registration/creating a events, with some other options.

- logs



TODO:
- Create events using bot command
- Editing events as a bot/admin
- sign up and resign for events.
31 changes: 31 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,36 @@ async def template(ctx,amount: int):
await ctx.author.send(mess)
await ctx.message.delete()

#all messege logs
@client.event
async def on_message_delete(message):
print("deleted")
embed = nextcord.Embed(title=f"{message.author.name} usunął wiadomość z kanału {message.channel}",description=f"{message.content}")
channel = client.get_channel(logs_channel)
await channel.send(embed=embed)

@client.event
async def on_message_edit(message_before,message_after):
embed_message = nextcord.Embed(title=f"{message_before.author.name} edytował wiadomość na kanale {message_before.channel}")
embed_message.add_field(name="Przed",value=f"{message_before.content}",inline=False)
embed_message.add_field(name="Po",value=f"{message_after.content}",inline=False)
channel = client.get_channel(logs_channel)
await channel.send(embed=embed_message)

















client.run(TOKEN)
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
join_leave_channel = 982713233758634004
logs_channel = 982746762303402014
logs_channel = 989940887259840562

0 comments on commit 27ac7f6

Please sign in to comment.