for m in ctx.message.mentions:
print ("user mention %s" % m)
for m in ctx.message.role_mentions:
print ("role mention %s" % m)
if ctx.message.mention_everyone:
print ('everyone mention')
if ctx.message.role_mentions or ctx.message.mention_everyone:
await ctx.send(author.mention+", не пингуй!")
else:
await ctx.send(msg)
pip install -U discord.py
for user_id,counter in user_counter.items():
...
msg += "Ой, а вот у **%s** целых %d подходов %d раз" % (user.name, counter, user_kolvo[user_id])
for user_id in user_counter:
...
msg += "Ой, а вот у **%s** целых %d подходов %d раз" % (user.name, user_counter[user_id], user_kolvo[user_id])
user_data[user_id] = { "counter": число, "quantity": число, "birthday": "32.05.1700" }
...
for user_id in user_data:
msg += "Ой, а вот у **%s** целых %d подходов %d раз" % (user.name, user_data[user_id]["counter"], user_data[user_id]["quantity"])
from discord.ext import tasks
from time import time,localtime
@tasks.loop(seconds=60)
async def timer_notify():
await bot.wait_until_ready()
cur_time = localtime(time())
if cur_time.tm_hour == 23 and cur_time.tm_min == 59:
await channel_for_notifies.send("Имею что сказать!")
timer_notify.start()
bot.run(ТОКЕН)
msg = 'Статистика:\n'
for user_id,counter in user_counter.items():
user = bot.get_user(user_id)
msg = msg+' >> ' + user.name + ': ' + str(counter) + '\n'
user_counter[user_id] = 0
channel.send(msg)