(discord.py) Get user’s, last message from a JSON file without specifying the name/id

I have an users.json file which store the user’s id and lmessage (current date,time) if he is write in a room. {“5314934047066510132”: {“lmessage”: “2021-04-21 10:21:01”}}…

Why is my cooldown sending even when there is no cooldown? discord.py

So I am attempting to create a cooldown for one of my commands. (The command) @commands.cooldown(1, 5, commands.BucketType.user) async def balance(ctx): await load_jsons(ctx) coins = users_w[…

How to make a bot join a channel and respond in chat discord.py

I just started learning to code very recently in order to make a discord bot in python. I have used both pieces of code separately and they have worked, but when trying to use them together only the …

Changing color of a discord role

Everything is set up right, the bot is in the discord, connected, etc. This code: import discord import random client = discord.Client() @client.event async def on_ready(): print(‘We have logged …

discord.py bot sends message each and finishes only when sending each words

I’m new in this, it’s really annoying that the bot would send each bad word one by one until it finishes. Here’s the code. @client.event async def on_message(message): if message.author == client….

Discord.py Stuck Trying to Loop Through Logs and Send to Server

I am trying to create a simple discord bot that parses a log file that is constantly being written to and sending the new lines to a discord channel I have on my server name logs. Parsing the file and …

I would like to make a discord bot that sends a message when a member goes online but I can’t seem to make it work ? (python)

I would like to make it so when a member goes online my both will send a message in the server welcoming the member but I cannot find a way to do so if I could get the name of the user too it would …

Using MongoDB on Discord.py for scheduled tasks

Purpose I have some commands like temp-mute, temp-ban, and other commands that need to be done after commands execution, and I do need to schedule things like giveaways and trigger a function as soon …

Check if A role has perms – Discord.py

Here Is a Good question. I want to check all roles in a server for admin, then create a new channel and allow only those set roles to have access. I dont want to use @commands.has_guild_permissions().

How to delete mp3 file after the bot played it

I am trying to create a music bot and now I want the bot to delete the current playing song after it finished playing. There’s my code: import asyncio import os import discord from discord.embeds …