Skip to content

Commit fa320bb

Browse files
committed
1.8.0 - Wprowadzono logowanie zmiany nazwy
Usunięto nadmiarowe wpisy w dockerfile
1 parent 263a405 commit fa320bb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM gorialis/discord.py:3.9.0rc1-alpine-master-minimal
22
WORKDIR /PoliBot
33
COPY . .
4-
RUN apk add build-base ffmpeg
54
RUN pip install youtube-dl asyncio discord.py urllib3
65
RUN git pull
76
CMD [ "python", "main.py" ]

main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
id_serwera = credentials.getServerId()
2121
lista_roli = credentials.getRole()
2222

23+
intents = discord.Intents.default()
24+
intents.members = True
2325

2426
# Wariacje zmiennych
2527
wariacje_nauczycieli = ("nauczyciel", "teacher", "nauczycielka")
@@ -301,6 +303,11 @@ async def on_message(self, ctx):
301303
else:
302304
print(f"[{datetime.datetime.now()}] {ctx.author} napisał {ctx.content} na {ctx.channel}")
303305

306+
@commands.Cog.listener()
307+
async def on_member_update(self, pre, post):
308+
if pre.display_name != post.display_name:
309+
print(f"[{datetime.datetime.now()}] {pre.display_name} zmienił swój nick na {post.display_name}")
310+
304311
class Przydzielaczka(commands.Cog):
305312
def __init__(self, bot):
306313
self.bot = bot
@@ -498,7 +505,9 @@ async def kostka(self, ctx, params = 'd20', amount = 1,):
498505
async def ping(self, ctx):
499506
await ctx.send(f"Pong! {int(bot.latency*1000)}ms")
500507

501-
bot = commands.Bot(command_prefix=commands.when_mentioned_or("$"), description=wiadomosc_info, help_command=None)
508+
509+
bot = commands.Bot(command_prefix=commands.when_mentioned_or(
510+
"$"), description=wiadomosc_info, help_command=None, intents=intents)
502511

503512
@bot.event
504513
async def on_ready():

0 commit comments

Comments
 (0)