#discord-bots
1 messages · Page 785 of 1
Bruh
for purge command when i do ;clear 5 it says cleared 5 messages but the message "cleared 5 messages" its not being deleted
since you send a message, there's one message more that you have to delete
or it's just the way you sent it
did you send it after the purge?
Probably not the case I think because the monkey patch version works fabulously
My Bot IsVerified, How do I make it where I can see constant cpu usage?
if mes =='&botinfo':
users= await get_bank_data()
bedem = discord.Embed(title = 'System Resource Usage', description = 'See CPU and memory usage of the system.',color=discord.Color.orange())
bedem.add_field(name = 'CPU Usage', value = f'{psutil.cpu_percent()}%', inline = False)
bedem.add_field(name = 'Memory Usage', value = f'{psutil.virtual_memory().percent}%', inline = False)
bedem.add_field(name = 'Available Memory', value = f'{psutil.virtual_memory().available * 100 / psutil.virtual_memory().total}%', inline = False)
server=len(client.guilds)
bedem.add_field(name='Total Users',value=len(users))
bedem.add_field(name='Total Servers',value=server)
bedem.add_field(name='version',value='2.0')
bedem.add_field(name='Verification Status',value='Verified!!')
await ctx.channel.send(embed=bedem)
advertising and cant even use a db?
okimii help me
Working with undocumented crap is a pain in the ass
lack of PEP8, seriously?
why are you using aiosqlite but json?
Is that not what you're showing?
import discord
from discord.ext import commands
import random
from random import choice
from itertools import cycle
import os
import json
import random
import datetime
import requests
import aiosqlite
import asyncio
from typing import Text
from discord.ext import tasks
from discord.ext.commands import clean_content
import aiohttp
import platform
from aiohttp import ClientSession
import time
i need help doing it tho
thats what im saying the heck
I was thinking tasks.loop but that didn't work
Use something like black code formatter, it helps alot
a little bit of everything, all of the time
don't use requests, use aiohttp instead
lemme read what you were doing, hold on
import time
intents = discord.Intents.all()
bot = commands.Bot(command_prefix="+",intents=intents)
bot.version = "1.0"
bot.remove_command('help')
@bot.command(name="ping")
async def ping(ctx: commands.Context):
await ctx.send(f"**Pong! {round(bot.latency * 1000)}ms**")
@bot.command(name="invite")
async def invite(ctx: commands.Context):
await ctx.send(" **Witaj jeżeli chcesz mnie dodać na swój serwer tutaj masz link ...**")
@bot.command(name="Support")
async def Support(ctx: commands.Context):
await ctx.send(" **Jeżeli chcesz dowiedzieć się informacji dotyczących bota uzyskać pomoc czy popisać z ludzmi to masz tutaj link do serwera support ...
my eyes
why import aiosqlite if youre gonna use json as a db
lacking unnecessary code breaks to be able to say you did it only in 30 lines
exactly
i'm concerned mainly about the lack of spaces and the bot.command(name=...)
If there is a roasting vacancy then it's time for my code to get roasted then 
and also aiosqlite but json db
LMFAO
hmu
@commands.command()
async def help(self, ctx):
return```
placeholder
subclass bot
and will delete later
nah, i prefer working with decorators
you have a good repo with a trash main
cogs?
oh yea
make a main file with on ready thats all and make all commands in cogs
in tys
nah
and a for loop of the cogs folder
make commands in on_message

in just the main file
.
Oh yea, adjusting the main file is in the list
When did I do that?
just wonderingg
no I meant
default on_message process commands -> override it and process commands yourself
ah okay
okie
spared time
:sadge: ok
P R A C T I C A L I T Y
W H A T
On a scale of 1 to 10 how well do y'all rate the code quality of that repo? 
update_presence task in on_ready?
class rename_(commands.Cog):```
rip pep8
5.5
@commands.command()
async def help(self, ctx):
return``` out of ten
time to remove that placeholder
wasn't gonna hardcode it anyway
I'll give it a 9
I haven't checked a lot tho
that also sounds like a vomiting material
you mean more commands? or
nope overall
when did I updated presence under on_ready?
nice <:
you start the task from there
@bot.event
async def on_ready():
print(f"Successfully logged in as {bot.user}")
bot.usage_cache = await get_usage_of(bot.db, "global")
if not update_presence.is_running():
update_presence.start()
Only listener for on_ready
it has a 1 sec delay but I agree, I forgot to do that
im ignoring globals you used...
he used what
he what
lmao
Pretty sure other way would be check db by spamming it
I'll drop it to a 5
which is far worse by design
good work imo
I wish y'all read the comment which mention the used of globals
thanks mate
global _prev, _count
"""
We are interested in having overall command usage as the bot's rpc
And this value being reflected in the rpc instantaneously after command usage is satisfactory
If there are multiple changes in minimal duration of time then the rpc should not spam requests to the discord api
here we will enforce our own limit to prevent such an occurence. This limit (in seconds) is dictated by MIN_DELAY_OF_RPC
Albeit the database can handle multiple requests in a second (in terms of resources)
We will not be checking the db every seconds because it is bad from a design perspective
Instead we will be caching this under bot.prev_cache and inheritents of commands.Cog will manipulate this value
Such way requests to the database can be kept to an minimum and be performant
"""
railway.app
what's that
np
it's a pretty new vps afaik
thats why i mentioned that its fine there, at the same time
^^
@velvet tinsel @slate swan all latter solutions are severely slower or much more resource consuming.
wrong self reply smh
im gonna check some codes in github
ok
can you really not delete unicode from a string?
when im waitin on replay on my problem from staff from danbothost
I can, I just wanted to notify the user that they used a unicode emoji
better yet and I dont have to remove it but use a appropriate parser
I wanted to show the parser I used earlier
which did what you just said now
ic
It is a feature I dropped later
i cant manage to parse it i keep getting decoding errors
!d discord.ext.commands.Greedy
class discord.ext.commands.Greedy```
A special converter that greedily consumes arguments until it can’t. As a consequence of this behaviour, most input errors are silently discarded, since it is used as an indicator of when to stop parsing.
When a parser error is met the greedy converter stops converting, undoes the internal string parsing routine, and continues parsing regularly.
For example, in the following code:
```py
@commands.command()
async def test(ctx, numbers: Greedy[int], reason: str):
await ctx.send("numbers: {}, reason: {}".format(numbers, reason))
``` An invocation of `[p]test 1 2 3 4 5 6 hello` would pass `numbers` with `[1, 2, 3, 4, 5, 6]` and `reason` with `hello`...
FINALLY
wth what i find on my github profile xd but is not releted to discord
but database....
lmao, you know the feeling
you dont , you can just store their id , and get/fetch it whenever you need the object
not sure if it would work

when it works
It will only consume until the first non-value
Now I just use Optional or Union and call it a day



it works and typehints must be a good practice :p
where i can chat on a topic not related to python? sorry for asking here but idk where i can ask
!ot-names
Off-topic channels
There are three off-topic channels:
• #ot0-psvm’s-eternal-disapproval
• #ot1-perplexing-regexing
• #ot2-never-nester’s-nightmare
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
imagine using classes for making commands.
You were kind of right on the main file not being clean thing gotta agree
i mostly make a subclass and run the bot in a main file
I don't...normally subclass Bot
no
better handling
nah i dont mean the Bot object
import lightbulb
from lightbulb.ext import filament
class EchoCommand(filament.CommandLike):
implements = [lightbulb.SlashCommand, lightbulb.PrefixCommand]
name = "echo"
description = "repeats the given text"
text_option = filament.opt("text", "text to repeat")
async def callback(self, ctx):
await ctx.respond(ctx.options.text)
``` this is funny
I think someone rating my project 6 and a 9 is pretty nice 
no look again
now its 5 and 3
5 3
oh cuz of globals
yes
10
suggest me a better way to do it without globals
botvars
im to slow
well i'd say if you change the class names to PascalCase and use bot variables instead of globals , it would be better
y
it has the botvar, it is actively checking if the previous var is same as new before making an api call
but again, you have a reason to not use botvar
it is much cleaner, well.
yea agreed , and you dont name the global variable something which you would use often
At that point, having an class for Cache would be a much better idea
no worries, I got time, I'll wait for your idea /friendly 
i mean you could use a cache class
Yes, it is what I thought of first to remove the use of gloabals but wouldn't that bring a long clutter to a fraction of the orginal problem we had in the first place
what are you gonna cache
probably will do it soon tho, it indeed doesn't look professional
previous value of that was updated as rpc and the command usage which was already updated to the attached postgres database
this is to make significantly less fetch requests from the database
and provide a faster solution
and made me resort to use gloabals
caching with a dict is a better than globals tbh
i was gonna use it for my hikari project
💀
how are you importing it
but we are updating it in the local scope so we still have to use globals, unless it was an attribute
and we came to my solution of gloabls
just do
from discordheximals import discordheximals
beautiful full circle 
Make your twitter wrapper async and I'll use it
i am
Good
no joke
i have a task for you :))
>>> from discordheximals import discordheximals
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'discordheximals'
>>>
mhm?
🚪🏃
try to find a way to remove unicode from a string🚶
so, my bot joins a vc, i want i play song.mp3 that has the rickroll, but it says that it is not voice connected, (ideally when it joins it's supposed to have a green ring around it signaling that it is voice connected) but it doesn't do that by default, how can i do that when i join the vc?
Can I have some test cases?
lmfao
test cases by?
#ot0-psvm’s-eternal-disapproval come here
help?
hello i want to make a command that sends command via webhook
!d discord.Webhook.send
await send(content=..., *, username=..., avatar_url=..., tts=False, ephemeral=False, file=..., files=..., embed=..., embeds=..., allowed_mentions=..., view=..., thread=..., wait=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message using the webhook.
The content must be a type that can convert to a string through `str(content)`.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object.
If the `embed` parameter is provided, it must be of type [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") and it must be a rich embed type. You cannot mix the `embed` parameter with the `embeds` parameter, which must be a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects to send.
yes but how do i make it via dsicord bot
its hard to explain
basically i command like !hello and it responds hello in webhook form
Finalised on an easier solution and just did an botvar, still works
comment there (or here) if have any suggestions and I'll do them

Hello can you help me i made this code on a bot without cogs and now i put it into cog form but it can't define a bunch of stuff is that a visual studio error or what do i need to fix to make this work? https://paste.pythondiscord.com/ejixulefom.py
how can i get the user tha created/deleted a channel?
Well first of all inside a class self will always go first in a function
*for getting default prefix, custom prefix is stored in the database
this is json file is to prevent circular imports and better plug and play
correct but i still says not defined
even if i fix it
Whats undefined
I don't think you can
the same way carl and them do it for the logs witch idk how they do it
but this works great https://paste.pythondiscord.com/lahunufusu.py
@final iron
why are you putting your github link with a message that doesn't need it?
wat?
how can i get the link of a message?
if you already have the the discord.Message object then do .jump_url to get the openable url of the message for example : msg.jump_url
ty
i have thos command but i get this error ```python
sql = "INSERT INTO customers (name, code) VALUES (%s,%s)"
val = (user,test)
mycursor.execute(sql, val)
mydb.commit()
in redeem
mycursor.execute(sql, val)
Command raised an exception: MySQLInterfaceError: Python type Member cannot be converted
You are trying to give it a Member object, if you are trying to just have the customers name then do :
val = (user.name, test) before executing it
i have this tho user = ctx.author
yes, it is fine
ctx.author is a Member object, it has the name attribute
You can either store it as name (customer, it can be changed) or id as the guy above mentioned which constant throughout the span of discord account
it is, but since the column name is customer it is safer to assume the database is containing the lexical names and not the ids
which is why I gave the help for name
still not good
what if hes storing accounts and the user changes his name?
an elaboration would be apt
read this
clearly mentioned
still why use name?
op is clearly testing,
that aside it is customer, not customer_id which should be the case where ID is stored
just save the customer by id or store it with both and just check the id
that's mutually agreeable,
personally I'll use store the id and fetch the user (and their present name) when needed.

yes
evening okimii and Achxy
Guys how do i add these buttons?
I'm trying to setup a bot to use slash commands in a cog using the pycord library. how do I do this cause nothing I try is working
!d discord.ui.View
class discord.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
evening
hru
Are you using 2.0?
Python 3.9.5
Discord.py version 2.0
you dont and you need dpy 2.0
O-
Anyone have the place i can get it from?
well link but yh
raise discord.ClientException(f'Callback for {self.name} command is missing "self" parameter.')
discord.errors.ClientException: Callback for elemental command is missing "self" parameter.
@commands.command(aliases=['game', 'elementel', 'element', 'ele'], pass_context=True)
@commands.guild_only()
async def elemental():
embed = discord.Embed(title="Elemental - A horror masterpiece",
description="\"elemental\" some info.\n"
"info and stuff.\n"
"ahysgsa.", color=invisible_color)
embed.set_thumbnail(url="https://cdn.discordapp.com/attachments/934929464620613742/934954348214108160/Logo_Black.jpg")
embed.set_footer(text=footertext, icon_url=footerimg)
Any idea on why i'm getting this ? i never saw this
youre missing self
yea i'm dumb
Where do i get it from?
but ill recommend a fork
like disnake
O i already got this
but dont work
do i delete the one i already have or...?
Can you go into your code and print discord.__version__?
@slate swan
hey andy whats a context manager? confused on the topic
do what andy said
with open("file") as fp:
...
``` For an example, in the above code we run `open` via context manager which handles opening the file, placing the file pointer into `fp` then later **closing** the file after we exist the context manager. If we only did `fp = open("file")` it would open but not close it later
1.7.3
oof its not 2.0
You aren't on v2.0
ah ic
thx
Install it via pip with git+<url>
E.g `pip install git+github.com/Rapptz/discord.py/
Done also is it discord.ui or discord_ui
cause i see a _ui but no .ui
.ui
.ui apparently does not exist
how do i do a hyperlink in an embed?
you dont import it as i said
from discord.ui right
"text"
o-
class subclass(disnake.ui.View):
...
Uhh it just threw my cogs out the window-
ty
yw
how
hello. I have this command, but i get as an output the text file, while i want to get the number of its lines. e.x. 3. ```python
with open('test.txt') as f:
lines = f.readlines()
emb=nextcord.Embed(title="Ainta test", description=f"", color=color, timestamp=datetime.now())
emb.add_field(name="RockStars", value=f'{lines}')
await channel.send(embed=emb)
Then get the length of the lines instead of a list of lines
len(lines)
ty it works. I also have a command which prints a random line from the file. How can i delete this line afterwards?
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
def check(m):
return m.author.id == message.author.id and m.message.id == message.id
any idea why this is raising this error?
The message_edit event has two arguments
https://docs.disnake.dev/en/latest/api.html?highlight=message_edit#disnake.on_message_edit
so im supposed to have before and after in place of m?
yep, each one being the message object before and after the edit
alright thanks
can anyone help?
when my bot connects to vc, how do i make it connect to voice?
bc it doesn't connect to voice for me
well, VoiceClient.play(source)
mhmm
it worked for me before when i played song.mp3 with the rickroll, but it doesn't
now*
!d discord.VoiceChannel
class discord.VoiceChannel```
Represents a Discord guild voice channel.
x == y Checks if two channels are equal.
x != y Checks if two channels are not equal.
hash(x) Returns the channel’s hash.
str(x) Returns the channel’s name.
ah ok
Well I have never worked with voice channels and discord bots so this is beyond me
an hour ago, when bot joined a vc it had a green circle around it and it played teh .mp3, now it don't
how do i install disnake
Hey. i have this but i want to delete acc after usage.
user = ctx.author
with open('accounts.txt', "r+") as f:
lines = f.readlines()
acc = "".join(random.choice(lines) for i in range(1))
channel = ctx.message.channel
hwid_stmt = "SELECT COUNT(*) FROM customers WHERE name = %s"
cursor = mydb.cursor()
cursor.execute(hwid_stmt, (user.name,))
hwid_count = cursor.fetchone()[0]
if hwid_count == 0:
emb=nextcord.Embed(title="Invalid license", description=f"You are not a customer!", color=0x9f1414, timestamp=datetime.now())
await channel.send(embed=emb)
else:
emb=nextcord.Embed(title="Ainta Gen", description=f"{acc}", color=color, timestamp=datetime.now())
await channel.send(embed=emb)
plspls help
pip install disnake i think
Here it shows that it's being installed on Python 3.10, but in your last screenshot it shows you are running it with Python 3.9
Two different interpreters
alr how do i install python 3.10
You already have it installed, as shown here
No, you don't need to install anything
You just need to run your code with the 3.10 installation instead of the 3.9
Or, install disnake on the 3.9
can someone?
alright
await ctx.delete()
i think or await ctx.message.delete()
and dont forget to mention it on top
so like (ctx, message)
hey all when you get a bit can you go to #help-dumpling
Does anyone know how to check if a reaction has been removed (discord py) i cant find it in api or im just blind
!d disnake.VoiceClient
!d discord.on_reaction_remove
discord.on_reaction_remove(reaction, user)```
Called when a message has a reaction removed from it. Similar to on\_message\_edit, if the message is not found in the internal message cache, then this event will not be called.
Note
To get the message being reacted, access it via [`Reaction.message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Reaction.message "discord.Reaction.message").
This requires both [`Intents.reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.reactions "discord.Intents.reactions") and [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
Note
Consider using [`on_raw_reaction_remove()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_remove "discord.on_raw_reaction_remove") if you need this and do not want to enable the members intent.
hmmm
Thanks!
!d disnake.VoiceClient
class disnake.VoiceClient```
Represents a Discord voice connection.
You do not create these, you typically get them from e.g. [`VoiceChannel.connect()`](https://docs.disnake.dev/en/latest/api.html#disnake.VoiceChannel.connect "disnake.VoiceChannel.connect").
Warning
In order to use PCM based AudioSources, you must have the opus library installed on your system and loaded through [`opus.load_opus()`](https://docs.disnake.dev/en/latest/api.html#disnake.opus.load_opus "disnake.opus.load_opus"). Otherwise, your AudioSources must be opus encoded (e.g. using [`FFmpegOpusAudio`](https://docs.disnake.dev/en/latest/api.html#disnake.FFmpegOpusAudio "disnake.FFmpegOpusAudio")) or the library will not be able to transmit audio.
left = 5
@j1mk0l.command()
async def gen(ctx):
user = ctx.author
left -= 1
```it doesnt recognise it. How can i fix that?
Recognise what?
left
maybe global or use it as a local variable
Command raised an exception: UnboundLocalError: local variable 'left' referenced before assignment
it can't be accessed through the function
so what should i do?
what are you trying to do?
everytome i use the command, it removes 1 from left
solution depends, I'm trying to delay using global as much as possible
!d global then
7.12. The global statement
global_stmt ::= "global" identifier ("," identifier)*
``` The [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement is a declaration which holds for the entire current code block. It means that the listed identifiers are to be interpreted as globals. It would be impossible to assign to a global variable without `global`, although free variables may refer to globals without being declared global.
Names listed in a [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement must not be used in the same code block textually preceding that `global` statement.
Names listed in a [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement must not be defined as formal parameters, or as targets in [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statements or [`except`](https://docs.python.org/3/reference/compound_stmts.html#except) clauses, or in a [`for`](https://docs.python.org/3/reference/compound_stmts.html#for) target list, [`class`](https://docs.python.org/3/reference/compound_stmts.html#class) definition, function definition, [`import`](https://docs.python.org/3/reference/simple_stmts.html#import) statement, or variable annotation.
I've never needed to use global
man uses JSON for his variables 🥱
!d disnake.Guild.voice_client
property voice_client: Optional[VoiceProtocol]```
Returns the [`VoiceProtocol`](https://docs.disnake.dev/en/latest/api.html#disnake.VoiceProtocol "disnake.VoiceProtocol") associated with this guild, if any.
?
like this ```python
def test():
global left
left = 5
test()
more like
def test():
global left
# what you want to do with left
test()
i still get "left" is not defiened
let's see the code
def test():
global left
left = 5
test()
@j1mk0l.command()
async def gen(ctx):
user = ctx.author
left -= 1
well...you didn't define left
you have to define it first
before accessing it from the function
and if you want left with gen() you'd also need to 🤮 global t
!global
When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.
Instead of writing
def update_score():
global score, roll
score = score + roll
update_score()
do this instead
def update_score(score, roll):
return score + roll
score = update_score(score, roll)
For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.
!d global ?? what
7.12. The global statement
global_stmt ::= "global" identifier ("," identifier)*
``` The [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement is a declaration which holds for the entire current code block. It means that the listed identifiers are to be interpreted as globals. It would be impossible to assign to a global variable without `global`, although free variables may refer to globals without being declared global.
Names listed in a [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement must not be used in the same code block textually preceding that `global` statement.
Names listed in a [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement must not be defined as formal parameters, or as targets in [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statements or [`except`](https://docs.python.org/3/reference/compound_stmts.html#except) clauses, or in a [`for`](https://docs.python.org/3/reference/compound_stmts.html#for) target list, [`class`](https://docs.python.org/3/reference/compound_stmts.html#class) definition, function definition, [`import`](https://docs.python.org/3/reference/simple_stmts.html#import) statement, or variable annotation.
What
Yes, why?
@river flare Check this out
Well d is an aliases for docs which is short form for documentation
yeah ik
So I sent the tag on global where as you sent the documentation
o
I don't really think you should be advertising globals to people unless the solution is unnecessarily complex
I tried to delay it as long as possible
wtf is that bot variable name
no matter what i use, i still cant fix "left" is not defiened
instead of client = commands.Bot(command_prefix="!") you can put any name you want and it would be the same. Mine is j1mk0l = commands.Bot(command_prefix="!")
It's bad practice
bot 😎
!botvar use this
Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"
@bot.command()
async def get(ctx: commands.Context):
"""A command to get the current value of `test`."""
# Send what the test attribute is currently set to
await ctx.send(ctx.bot.test)
@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
"""A command to set a new value of `test`."""
# Here we change the attribute to what was specified in new_text
bot.test = new_text
This all applies to cogs as well! You can set attributes to self as you wish.
Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!
Actually both of the examples he has shown are bad practice
icy...is that you?
yeah
yeah ik
amazing
lmao
Seems you already solved it
I have an idea
wait no
nvm I forgot it
make your own API for discord @final iron
discord already has an api
there are tons of api wrappers for discord out there, what makes yours unique from others if you make one
I'm not that bored
any help
nice
are you using PIL?
yes
Any other ideas?
@client.command()
async def test(ctx, reason):
mc = Image.open("miencraft.jpeg")
title_font = ImageFont.truetype('playfair/playfair-font.ttf', 200)
asset = ctx.author.avatar_url_as(size = 128)
data = BytesIO(await asset.read())
pfp = Image.open(data)
image_editable = ImageDraw.Draw(mc)
title_text = f'{reason}'
pfp = pfp.resize((93,93))
mc.paste(pfp, (103,34))
mc.paste(image_editable.text((103,34), title_text, (237, 230, 211), font=title_font))
mc.save("profile.jpeg")
await ctx.send(file = discord.File("profile.jpeg"))```
is this file structure?
no your file structure
oh okay
wtf am I talking about
alsothat's your code
file structure is like
my folder
-- some_file.txt
--something_else.txt
so is it the path to my folder or all the files in my folder
C:\Users\notvi\OneDrive\Desktop\Mjc project
looks like title_font is causing the error
nvm Kayle is gonna help you
I need to deal with sleep paralysis demons
ye because i did it with the image first and it worked
its jsut the text is not working
nice to know
how to inline embed field?
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
i have this
embed.add_field(name=f'EST+0 {est.strftime(format)}', value=esttz, inline=True)
but this is the result
wait
waiting
can you try moving playfair into the current directory
its in my folder
im having sleep paralysis demons
just tell me what you want it to look like
is there an event when the bot leaves a vc?
i want it to be column
c...column?
try removing playfair/ from the truetype method
sure
like this
you gotta do inline=False at the 4th field to do that, and so on
ok xd
!d discord.on_voice_state_update you can use this
I get a different error now
discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").
The following, but not limited to, examples illustrate when this event is called...
show full error
inline=False still looks like this
probably cause ur on phone
kk
if ur not on phone then the code is wrong
It’ s supposed to, isnt it?
yea
and inline = True should be in the same line
Yes
hm idrk you could check google for this iirc your error is related to the paste method
oh kk
What are u trying to do
With pillow?
yes
so the tutorial im watching
is only for python
and im trying to kinda change the code a bit
to send it in discord
Lemme see
You should pass image object to paste method
how?
Try to remove .text
in the Image.draw() i remove () am i right
What happens if you try to draw text directly to mc inage
No
Where u just removed .text
U didnt remove (103…)
B4 you passed image_editable.text…
Now just pass image_editable
I wanna see what happens
without the paramaters?
i already did pass it and i got this error
i dont think i understand
It’ s not a function
The (103,14)
Try
Yea nvm, I just checked how It’ s done
Are you using pil?
yes i am
You do
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
font = ImageFont.truetype("times-ro.ttf", 24)
img = Image.new('RGB', (600, 400), color = 'red')
draw = ImageDraw.Draw(img)
draw.text((300, 200),"Hello World !",(0,0,0),font=font)
img.save('pil_red.png')
This is an example
You get a draw object and then do draw.text
This is an example, that line creates a red image
Just red background
Than you slap text on that red background
oh ok
But that image could be anything
Maybe I should learn pillow for a welcome card?
Any reason pillow is preferred over opencv?
Because I know opencv
I did that shit once and it was a pain in the ass
To turn the mf square into a circle
?
then how do i
draw.text adds text
slap it on the backgroind
I’ m guessing
hey, I got this error not sure how to fix and have already tried a few things but it didnt solve the problem
@commands.Cog.listener() # this is a decorator for events/listeners
async def on_guild_join(self, guild):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes[str(guild.id)] = '?'
with open('prefixes.json', 'w') as f:
json.dump(prefixes, f, indent=4)
embed = discord.Embed(
desscription=f"Hi everyone, I'm {self.bot} I hope you all are going to be pleased with my service, "
f"if you have any questions you can use the command `?help` or if you got something to "
f"report/suggest you can then tell my owner Physalia77 about it on github. \n `Current "
f"ping: {bot.latency * 1000} ms \n \n **OBS: THIS IS NOT A FINISH PROJECT, AND "
f"MANY THINGS CAN AND WILL BE CHANGED LIKE COMMANDS, BOT NAME, PROFILE PICTURE AND MORE",
color=0x3498DB),
await guild.text_channels[0].send(embed=embed)
OBS, problem is that the bot doesnt send the embed when it joins a new server
embed is a tuple, remove the last , comma
\n is a thing
!e print("hello\nworld")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | hello
002 | world
aids
ooooohh, jeez I didnt see that, thx do XD
They have that
That was almost 24 hours ago?
also how would i centre the text
Fastest response time ever 😂
how can i have my bot upload emojis?
Mby resize the image b4 and then slap tge text in the middle
!d discord.Emoji
class discord.Emoji```
Represents a custom emoji.
Depending on the way this object was created, some of the attributes can have a value of `None`...
but how does it upload them... 
I’ m reading the docs rn, ill lyk when I find it
kk
!d discord.Guild
class discord.Guild```
Represents a Discord guild.
This is referred to as a “server” in the official Discord UI.
x == y Checks if two guilds are equal.
x != y Checks if two guilds are not equal.
hash(x) Returns the guild’s hash.
str(x) Returns the guild’s name.
they edited the msg
Didnt realise
lol
btw, is the before the voice state before and after?
I did change that and still got the same error, any other thoughts what the problem could be?
is disnake
the best option
or should i get discord py 2.0,
pycord... blah blah blah
Yes
Might have something to do with you resizing it
But I have never used pillow so idk
Why do you have discord.ActivityType[act]
both
bc its for someone
Not sure if this is the right channel, it's been a while and I'm rusty. How do I get the bot to react to a specific users message. pls mention or reply thanks
and they dont know to much about programming and i want to make it simple
Well thats not how you're supposed to do it
!d discord.Message.add_reaction get message object then use this
await add_reaction(emoji)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Add a reaction to the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").
You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
alright bro
Its just
Don't randomly ping me
!d discord.ActivityType.watching just use this
A “Watching” activity type.
async def on_ready():
print("Bot is ready!")
await bot.change_presence(status=discord.Status.online,
activity=discord.Game("%help"))``` @slate swan
u could do this
You shouldn't be doing anything in on_ready
i want it like this
never change a bots presence in on_ready
and also thats cursed
why
You were just shown how
it works doesnt it
e
?
discord has a chance to disconnect your bot if you do that
why do you need to index discord.ActivityType
hello discord bot channel I have a question i defined the earnings amount in my code but it says it is not defined here is a screenshot of error and the code https://paste.pythondiscord.com/ohuhoseyax.py
define it then?
i did though
Consider actually learning a real database language like SQL
define it inside the method you wanna use it
that isn't a data base
yeah why use json
JSON isn't meant to be used for a database
they probably meant an SQL driver
Idk it's stating it's not defined
What is earning defined as in your code
earnings = random.randint(10,100)```
In the function or outside?
If earning is part of another function and you want to call it in your current function. I suggest making it a global variable
Basically means so that all your functions can access the variable
Should you really be recommending global variables?
Just define it in the method you want to use it in
He stated it's in a function above it, so I assume he uses the variable earnings multiples times
Yes so in this case wouldn't it be better to define it as a global variable
No
ok just please tell me how to fix it
Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"
@bot.command()
async def get(ctx: commands.Context):
"""A command to get the current value of `test`."""
# Send what the test attribute is currently set to
await ctx.send(ctx.bot.test)
@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
"""A command to set a new value of `test`."""
# Here we change the attribute to what was specified in new_text
bot.test = new_text
This all applies to cogs as well! You can set attributes to self as you wish.
Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!
i'm in a cog bruh
So?
show me example
This is a good example
You defined the client or bot in the cog right?
Should be in your __init__ function
Yes
global is real python
stop feeding people dpy garbage thats not teaching them anything
So what you'd do is ```py
self.client.test = "This is a string"
Jalyx is correct
so i need to add a self to it
Then you call it similar to here
ok
Yep pretty much
Hm?
how do i define as like wut bot = random.int(10,100)
Ok if you are going to use earnings multiple times, and the value is going to stay constant. I suggest defining the self.client.earnings = x variable in the __init__
oh
ok and then for the embed
how does it go in the embeds
same way?
because it tells me self is not defined
on what you told me
what are you trying to do
earnings not defined https://paste.pythondiscord.com/ohuhoseyax.py
when i define it
self.earnings
so everything in your class can access the var
then it tells me that self is not defined
show how you did it
define self in function too btw
@client.command()
async def bold(ctx, text):
ff.boldTEXT(text)
await ctx.reply(text)
I have that in my main file and
def boldTEXT(text):
text = text.replace("a", "𝗮")
text = text.replace("b", "𝗯")
text = text.replace("c", "𝗰")
text = text.replace("d", "𝗱")
text = text.replace("e", "𝗲")
text = text.replace("f", "𝗳")
text = text.replace("g", "𝗴")
text = text.replace("h", "𝗵")
text = text.replace("i", "𝗶")
text = text.replace("j", "𝗷")
text = text.replace("k", "𝗸")
text = text.replace("l", "𝗹")
text = text.replace("m", "𝗺")
text = text.replace("n", "𝗻")
text = text.replace("o", "𝗼")
text = text.replace("p", "𝗽")
text = text.replace("q", "𝗾")
text = text.replace("r", "𝗿")
text = text.replace("s", "𝘀")
text = text.replace("t", "𝘁")
text = text.replace("u", "𝘂")
text = text.replace("v", "𝘃")
text = text.replace("w", "𝘄")
text = text.replace("x", "𝘅")
text = text.replace("y", "𝘆")
text = text.replace("z", "𝘇")
text = text.replace("A", "𝗔")
text = text.replace("B", "𝗕")
text = text.replace("C", "𝗖")
text = text.replace("D", "𝗗")
text = text.replace("E", "𝗘")
text = text.replace("F", "𝗙")
text = text.replace("G", "𝗚")
text = text.replace("H", "𝗛")
text = text.replace("I", "𝗜")
text = text.replace("J", "𝗝")
text = text.replace("K", "𝗞")
text = text.replace("L", "𝗟")
text = text.replace("M", "𝗠")
text = text.replace("N", "𝗡")
text = text.replace("O", "𝗢")
text = text.replace("P", "𝗣")
text = text.replace("Q", "𝗤")
text = text.replace("R", "𝗥")
text = text.replace("S", "𝗦")
text = text.replace("T", "𝗧")
text = text.replace("U", "𝗨")
text = text.replace("V", "𝗩")
text = text.replace("W", "𝗪")
text = text.replace("X", "𝗫")
text = text.replace("Y", "𝗬")
text = text.replace("Z", "𝗭")
text = text.replace("|", "┃")
text = text.replace("-", "━")
in ff.boldTEXT. but the text is normal when the cmd
is run.
bruh
?
!e
a = "lol"
for element in a:
print(f"**{element}**")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | **l**
002 | **o**
003 | **l**
@slate swan :white_check_mark: Your eval job has completed with return code 0.
**lol**
it will make it bold
ok first of all, im not doing what you suggested... im doing it this way so it can be put in channel names
just add it to the start and the end it will make the whole text bold?
it wont let you put it in the channel name and it still be bold though
!e
channelname = "coolchannelname"
print(f"**{channelname.upper()}**")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
**COOLCHANNELNAME**
What are you trying to do?
so i saw a bot that had a bold command, and it turned your text into a "bold" text, but it let you set it as channel names. (unlike regular discord bolding) I tried adding it to my code without adding too many lines to main.py, but it doesnt work
you cant make channel names bold
Are channel names not bold by default?
no only when you have unread msgs
you can using the command that im trying to re-create -_-
no
wut
what are you trying to do make any msg bold?
like a bold command and it will make everything you said bold
-_- urd
and all caps?
-_- bruh
Is this not bold?
not sure i tried it manually and i couldnt
I mean, I just did
can yall just stop trying to prove me wrong, and help me fix it?
how am i trying to prove you wrong?
im asking you simple questions?
Did you type in ** or the actual characters?
Lets see a screenshot of the channel name
can you just help me fix it? ;-;
No because I need to see its possible
oh he wants to replace each letter for a font
it is
@frank tartan Is this what you're trying to do?
well ofc that wont work
youre setting a value then setting a new value and so on
!e
a = 1
a = 2
a = 3
print(a)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
3
see only the last value is valid
i know... and when i put all that in main.py guess what? it works
i recommend you make them all different vars
so just add numbers to each var and you will be good
but guess what? it WORKS
ok?
ok your not helpful, ima go figure it out on my own 😦
meaning it works doesnt mean its good?
if user.activities:
for activity in user.activities:
if activity.type == discord.ActivityType.listening and activity.name == "Spotify":
embed=discord.Embed()
embed.title = "**{}**".format(activity.title)
embed.description = "Song started at {}".format(activity.created_at.strftime("%H:%M"))
embed.color = activity.color
embed.url = "https://open.spotify.com/track/{}".format(activity.track_id)
embed.add_field(name="Artists", value=", ".join(activity.artists))
embed.add_field(name="Album", value=activity.album)
embed.add_field(name="Duration", value=str(activity.duration)[3:].split(".", 1)[0])
embed.set_thumbnail(url=activity.album_cover_url)
embed.set_footer(text="{} - is currently playing this song".format(user.display_name), icon_url=user.avatar.url)
await ctx.reply(embed=embed, mention_author=False)
d.py v2
!e
a = None
print(a.strip(" "))
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'strip'
???
Do they have a default avatar?
yuh
!d discord.User.avatar
property avatar: Optional[discord.asset.Asset]```
Returns an [`Asset`](https://discordpy.readthedocs.io/en/master/api.html#discord.Asset "discord.Asset") for the avatar the user has.
If the user does not have a traditional avatar, `None` is returned. If you want the avatar that a user has displayed, consider [`display_avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.display_avatar "discord.User.display_avatar").
lol
Check the docs
If the user does not have a traditional avatar, None is returned
Might be ot for this channel but if I wanted to make a welcome card what should I learn in PIL to make my ride smooth sailing?
image manipulation right
Yeah
if user.avatar():
embed.set_footer(text="{} - is currently playing this song".format(user.display_name), icon_url=user.avatar.url)
else:
pass
do i have to use the bool?
!f-strings
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
Does this guild offer BetterDisco support
help yes
i don't think i need a bool
how can i make my embed code can use global like i can use it on every command
!bot-var
Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"
@bot.command()
async def get(ctx: commands.Context):
"""A command to get the current value of `test`."""
# Send what the test attribute is currently set to
await ctx.send(ctx.bot.test)
@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
"""A command to set a new value of `test`."""
# Here we change the attribute to what was specified in new_text
bot.test = new_text
This all applies to cogs as well! You can set attributes to self as you wish.
Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!
thx
How do i run a script when someone joins or leaves a voice channel?
@client.event
async def ???(ctx?):
#do stuff here
i want to add buttons
can someone help
tryna use discord py 2.o
ive been trying for a couple hours
please help me
how do i upload an emoji that is in a different folder? (like a folder in the same folder main.py is in)
ok but ive tryed
can u send me an example
ive been trying to get buttons for hours
and im really unmotiviated to try 12313 more times
@cedar smelt bot = commands.Bot(command_prefix=prefix,
activity=discord.Activity(type=discord.ActivityType[act].value, name=act_desc),
status=discord.Status.online)
this doesnt work for disnake
bc of (discord.activity)
i installed disnake btw
how to make a timeout cmd?
which one
ok i changed everyhting to discord
@cedar smelt lets gooo
its great and all but
idk how the code works
so its really useless
activity not working
its complete dumb to use something like this when disnake already has timeouts
!d disnake.Member.timeout
await timeout(*, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Times out the member from the guild; until then, the member will not be able to interact with the guild.
Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.
You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.
New in version 2.3.
thanks! do you know how to do it using hikari?
did you define act and act_desc?
yes
act = "watching" # Choose one (no caps): watching, streaming, listening, playing
act_desc = "Dia+ GateKeepers" # Activity description
you gotta do ```py
@GatewayBot.listen(hikari.VoiceStateUpdateEvent)
!d discord.ActivityType.watching
A “Watching” activity type.
can i make my embed as variable?
yes, sure
this dont work???
no
ActivityType.watching
this is what happen when i make my embed as variable xd
```py
embed = discord.Embed(*kwargs)
await send(embed=embed)
kk
not working
@client.event
async def on_ready():
print(f"{client.user.name} is ready to go!")
async def timeout_user(*, user_id: int, guild_id: int, until):
headers = {"Authorization": f"Client {client.http.token}"}
url = f"https://discord.com/api/v9/guilds/{guild_id}/members/{user_id}"
timeout = (datetime.datetime.utcnow() + datetime.timedelta(minutes=until)).isoformat()
json = {'communication_disabled_until': timeout}
async with client.session.patch(url, json=json, headers=headers) as session:
if session.status in range(200, 299):
return True
return False
@client.command()
async def timeout(ctx: commands.Context, member: discord.Member, until: int):
handshake = await timeout_user(user_id=member.id, guild_id=ctx.guild.id, until=until)
if handshake:
return await ctx.send(f"Successfully timed out user for {until} minutes.")
await ctx.send("Something went wrong")
it was my script btw error is coming bot object has no attribute sessions+_+ how is that
nope
move to some fork already , dpy is extremely outdated.
you use disnake instead of discord
just replace every discord with disnake.
yea that would do the job
import disnake as discord in replit
i am installing it manually so
go to package bar, search for disnake
and add it
yep
ok
from disnake.utils import find
from disnake.ext import commands, tasks
will this all too work?
ok
class eco(commands.Cog):
def __init__(self,bot):
self.bot = bot
def num(self,number):
num = "{:,}".format(number)
cur = f"${num}"
return cur
async def open_data(self):
with open("economy.json","r") as f:
users = json.load(f)
return users
async def close_data(self, users):
with open("economy.json","w") as f:
json.dump(users,f)
await self.close_data(users)
async def update_wallet(self,ctx,member,op,am):
users = await self.open_data()
if op == "-":
users[str(ctx.guild.id)][str(member.id)]["wallet"] -= am
elif op == "+":
users[str(ctx.guild.id)][str(member.id)]["wallet"] += am
await self.close_data(users)
return users[str(ctx.guild.id)][str(member.id)]["wallet"]
@commands.command()
@cooldown(1,20,BucketType.user)
async def beg(self, ctx):
user = ctx.author
await self.open_account(ctx,user)
users = await self.open_data()
num = random.randrange(0,101)
quote = [f"A stranger gives you {self.num(num)}.", f"A mysteriously man knows that you have money, but he still gives you {self.num(num)}", f"I'm poor, but I still give you {self.num(num)}", f"Stop being a beggar!! {self.num(num)}"]
await ctx.send(random.choice(quote))
await self.update_wallet(ctx,user,"+",num)
await self.close_data(users)
``` Can someone tell me why the beg command won't work?
ok i did it and now how to make timeout cmd?
it worked btw thanks , btw how to make timeout
you can just use asyncio
!d disnake.Member.timeout
await timeout(*, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Times out the member from the guild; until then, the member will not be able to interact with the guild.
Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.
You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.
New in version 2.3.
the duration will be in seconds
help
that'll be more complicated
simply use a calculator to convert minutes into seconds
@client.command()
@disnake.ext.commands.has_permissions(manage_nicknames=True)
async def timeout(ctx, member: disnake.Member,time: float, *, reason=None) -> None:
await member.timeout(duration=time, reason=reason)
await ctx.send(f"{member.mention} has been timed out for {time} Seconds, With the reason of {reason}")```
That'll only take time in seconds, and won't even support stuff like s or m
channel is none
abe proton+_= kaha se mila bro rao ka proton hai kya
how do i upload an emoji that is in a different folder? (like a folder in the same folder main.py is in)
Means?
await channel.send() here the channel is returning None
@slate swan@cedar smelt it worked thanks
time = "10m"
if time[-1] == "m":
num = int(time[:-1])
final = num*60
print(final)
you can add this if you want
or something along these lines





