You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try:
with open("message_counts.yaml", "r") as f:
return yaml.safe_load(f)
except FileNotFoundError:
return {}
message_count = load_message_counts()
@bot.event
async def on_ready():
print("Bot is ready")
print(f"Loaded message counts: {message_count}")
@bot.event
async def on_message(message: discord.Message):
emoji = '👿'
if message.webhook_id:
return
if message.author.id == bot.user.id:
await bot.process_commands(message)
else:
if message.content.startswith("!"):
user_id = message.author.id
message_count[user_id] = message_count.get(user_id, 0) + 1
with open("message_counts.yaml", "w") as f:
yaml.dump(message_count, f)
cleaned_content = message.content[1:]
webhook_url = 'https://discord.com/api/webhooks/1145308752879300689/GiN-9aHCREzEpdciREtJzDPXgCw7MhAZ4R6mprSRezgHBYSJknUaxmGFz_DAagkm--Zc'
hook = Webhook(webhook_url)
sender = message.author
sender_name = sender.name
sender_id = sender.id
content = (
f"Sender: {sender_name} (ID: {sender_id})\n"
f"Message: {cleaned_content}"
)
await hook.send(content)
await message.add_reaction(emoji)
@bot.command()
async def check_count(ctx, user: discord.User = None):
if user is None:
for user_id, count in message_count.items():
user = bot.get_user(user_id)
if user:
edf = f"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||_ _ _http://henrymistert.lol/embed?title=wall%20of%20clowns&description={user.name}: {count}:%20clown&author=not_nexus&footer=on_top&image=https://cdn.discordapp.com/avatars/1131513517854441572/cee0a76c8ea18dec943bc4598292addb.png?size=1024&color=59D2FE".replace(" ", "_")
await ctx.send(edf)
else:
count = message_count.get(user.id, 0)
await ctx.send(f"{user.name}: {count} messages starting with '!'")```
this sends 2 embeds or more when theres 2 data entries is there a way to make it all on the same embed on different lines
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Beta Was this translation helpful? Give feedback.
All reactions