#discord-bots
1 messages · Page 87 of 1
generally speaking, __new__() is the allocator, __init__() is the initializer, but both are constructors (__new__() can do __init__()'s job as well).
Initiate is the same thing as construct though
super simple.
Can you define whats initiate and construct, in your eyes?
Because in my eyes, constructor is like building a house, while an initater is actually painting and making the house look actually great and "liveable".
Poor analogy
Folks I love the discussion but could we move it to either an OT or maybe #internals-and-peps? thanks
Oh, sorry.
Its not that bad, its just not related to programming at all kek
Lol that's why it's a poor analogy
I do kind of see your point but still not gonna give it to you
ok
bot = commands.Bot(command_prefix='/')
this is causing a error did i format it wrong?
or is it all wrong
If I needed help with my python discord bot would I get it here?
This analogy does not work, simply for the fact that a “house” is a term which means a collective of other things. A house has plumbing, walls, foundations and rooms. Let’s take this into programming terms, where does dict come into place? Where does the bases come from? Where does the name come from? It comes from new but what are they? They are attributes. Yes crazy the constructor declares variables into the class namespace. What does the init do? It declares variables into the instance namespace. Now what if we take what you said to the extreme? Constructor makes the house, but what is the house without its “attributes”? Is this just foundation, is this just pavement? Can it then be truly called a house?
I usually do = commands.Bot(command_prefix= prefix, intents=intents) and it works just fine
Yessir.
you would need intents
Can you help me?
Can you show more code? It's likely the syntax is invalid elsewhere and the compiler does not understand it.
as they are a new feature in discord's api that allow you to even start the bot
?
Anyone can help you if you ask questions here.
But I will try, yes :)
Intents dont even exist in the discord REST API
the rest of the code is hypixel auctionhouse api lol
ty, I keep getting this error:
I don't know what this means sorry lol
What are you trying to do? And why are you trying to do this import?
im using VSCode so if you want a Live Share link I can DM you one
what exactly is default_permissions for
That's not safe.
that's my question
!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.
do you mean to import intents?
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
@commands.cooldown(1,10,commands.BucketType.channel)
@default_permissions(manage_messages=True)
async def purge(ctx, amount_to_delete: int = 0):
if amount_to_delete < 1 or amount_to_delete > 200:
await ctx.send('You need to enter a value between 1 and 200')
else:
await ctx.channel.purge(limit=amount_to_delete)
await ctx.response.send_message(content=f"Sucsessfully purged {amount_to_delete} messages!", ephemeral=True)```
Why not?
Stuff can go wrong, you can handle permissions wrong, expose secrets/tokens, etc.
I can always reset the token after
so like
command = commands.Bot(command_prefix= /, intents=intents)
idk how to work with intents
well yes but you would need to define intents
intents = discord.Intents.all()
!d discord.ext.commands.has_permissions
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.
Note that this check operates on the current channel permissions, not the guild wide permissions.
The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Did you mean to use this instead?
ty good sir
I'm a ma'am :p
No clue
sorry
so from discord.ext.commands import default_permissions?
The word "house" doesnt really mean a collective of things precisely, but it doesnt contain the things mentioned, I wouldnt really say that __init__ declares variables to a instance "namespace"? You mean the object? Well a house without its "attributes" is just a building with no rooms etc, that actually make it a home. I do understand your point but i wouldnt say its wrong or right either
its ok
well
are you trying to check the permissions of a user
then yes what @slate swan posted above
I can send you the code part I use it in
@commands.has_permissions(manage_messages=True)
Just use the commands module object to access it?
so it should look like
command = commands.Bot (command_prefix= /,intents = discord.Intents.all())?
Are walls not an attribute as well? And no I did mean the namespace, you access instance attributes after all using the namespace via dot notation
yes
I think so
The whole point is that, a house is only a house with all its attributes
@valid void
hello
Hell, my points of name, dict and bases
Im new to discord.py so I got no clue what you mean
dms i'll explain
@slate swan
from discord.ext import commands
@commands.has_permissions(...)
Like this.
got a question, when I have a discord bot and its coding, there's an API I made with it, am I allowed to ask for help here?
Yes I have that import already
.
You didn't understand it, so I elaborated.
oh
ic
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
You can view the Discord.py docs there.
the commands extension is like this:
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.command(name="hello")
async def hello(ctx):
await ctx.send("Hello")
this is what they mean
What if I wanted a / command?
for a slash command, it would be this:
What does the init do? It declares variables into the instance namespace.
This is a quite generically worded statement, i would say.
I mean that is exactly what __init__() does usually
bc this is one of my / commands
@client.slash_command(guild_ids=GIDS, description='Bye-bye, Messages..')
@commands.cooldown(1,10,commands.BucketType.channel)
@commands.has_permissions(manage_messages=True)
async def purge(ctx, amount_to_delete: int = 0):
if amount_to_delete < 1 or amount_to_delete > 200:
await ctx.send('You need to enter a value between 1 and 200')
else:
await ctx.channel.purge(limit=amount_to_delete)
await ctx.response.send_message(content=f"Sucsessfully purged {amount_to_delete} messages!", ephemeral=True)```
Okay, you can try to argue otherwise and have valid points, I could do whatever I wanted in new and have it not construct a class at all
I’m still wondering what you have to say with “houses” though?
(I use @client instead of @bot)
But a constructor is like the outside walls of the class while the design of the rooms etc is the attributes which you can change and are unique depending ofc, In my eyes maybe you can give your opinion on mine to clear any confusion i may possess?
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.event
async def on_ready():
print(f"{bot.user} is ready")
bot.tree.sync()
tree = bot.tree
@tree.command(name="hello")
async def hello(interaction:discord.Interaction):
await interaction.response.send_message("Hi")
ok
bot.tree.sync is to sync all your slash commands so it works
I like houses, sorry
string concatenation 😔
Okay, so when new constructs a class with bases or whatever it’s double under is, what is that then? Is that not an attribute or is that a wall? Can you access it via the namespace or not?
can anyone answer this for me
here I'll make it simpler with f strings
And why is a wall not an attribute??
there
Would it fix this error?
like-
For the import I have to do?
You can have a house with no plumbing sure, you can have a house with no doors, sure. You can have a house with no walls, no roof sure. Then what is a house exactly? The point I’m asking you is. Is a class really a class without state, without dict without name, etc
that does not exist
My point being a class is not one thing rather a collection of things
Hence namespace .
wat?
@client.add_command(guild_ids=GIDS, description='Bye-bye, Messages..')
@commands.cooldown(1,10,commands.BucketType.channel)
@default_permissions(manage_messages=True)
async def purge(ctx, amount_to_delete: int = 0):
if amount_to_delete < 1 or amount_to_delete > 200:
await ctx.send('You need to enter a value between 1 and 200')
else:
await ctx.channel.purge(limit=amount_to_delete)
await ctx.response.send_message(content=f"Sucsessfully purged {amount_to_delete} messages!", ephemeral=True)```
???
exactly, i use __init__() to initialize my object, not for touch-ups lol
Exactly why init is a constructor
that's kind of what "__init__() is not a constructor" sounds like to me
Same with new
__new__() exists just to shit on __init__() /s
default_permissions doesn't exist. the error is saying that there is no module to be found in discord.ext
it can do everything __init__() can and more kek
you would need to import commands like timtoy said
It was fine like a week ago tho..
And when you subclass builtins if your feeling spicy
immutable ones
So wat would this change to?
Yep or the cursed way. Ctypes
I don't touch that module, it makes no sense to me
I understand C better than the ctypes module
I like touching it, only to say I can
The only thing I use it for it to override built ins
Make pointers
ctypes is just a wrapper around c for a language built with c. nice.
from discord import app_commands
tree = client.tree
@tree.command(guild_ids=GIDS, description='Bye-bye, Messages..')
@app_commands.cooldown(1,10,commands.BucketType.channel)
@app_commands.has_permissions(manage_messages=True)
@app_commands.describe(
amount_to_delete = "The amount of messages to purge"
)
async def purge(interaction:discord.Interaction, amount_to_delete: int = 0):
if amount_to_delete < 1 or amount_to_delete > 200:
await interaction.response.send_message('You need to enter a value between 1 and 200')
else:
await interaction.channel.purge(limit=amount_to_delete)
await interaction.response.send_message(content=f"Sucsessfully purged {amount_to_delete} messages!", ephemeral=True)
Say that to the language I made in python to transpile into python bytecode
hold on my brain is hurting
I know ironic
I have other commands too
it'll suck
but you'll get the hang of it
unforgiving and disorienting
absolutely hammering
yeah you'll get the hang of being completely disoriented and astonished with (usually your terrible) code
i still write terrible code and i've been doing this for long enough
AAA it was just working a week ago
Ok so let me give an example on my view of my point
class House:
...
This is a declaration of the class object House this is the blueprint, while __new__ is like the employees that create the base stucture like walls and the floor and roof etc, while __init__ is like the architect that creates the design of the actual house like its inside stucture and/or the mapping of the rooms which would be the names set to that unique home/instance that point to something like a variable that may contain a container type.
How is that project doing, did you fix your compiling issue(s)?
Okay so answer this for me, is a wall a house?
Is a floor a house?
Is a roof a house?
Also using your logic, that means the employees create the foundation, the walls etc before an architect even designs them. Devastating
why is so much wrong w/ my coddee
Let's say I have a "house" with 4 walls, 1 in each direction. What is the wall to the west? Is it a house, no. Is it a wall? Yes. Then what about all the walls in total, are they are house? Sure. My point being here, a wall is not a house but a house is a wall(s) (sounds weird but if you think about it long enough). I'm using this analogy also for classes, you have a class yes py class House: ... so then, let's break this down. py House.__name__ # A name, but not a house House.__mro__ # The bases, but not a house House.__dict__ # The namespace, but not a house So then, what happens if you just do ```py
House
so do i, i feel horrible with my output sometimes
Hey @slate swan!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
a
This is my code but it gives this error
well i checked it out
what error is being thrown
This one
add_command is not a decorator
Maybe you're looking for @client.command()?
well it says that there's an unexpected argument called "guild_ids"
But I needed that last week-
..do you still need it?
I dunno
url = "https://discord.com/api/v8//users/@me/channels"
Guys i am send dm through api using requests
Where do I need to pass it user id?
Are you trying to make a slash command or a text command?
From guild_ids I can infer you're making a slash command
From @client.command() I can infer you're making a text commands
Pls help anyone
That is completely the wrong endpoint to be using for DMs
And in fact, that would only make "sense" if you were self-botting
Thinking to DM users in your DMs
Are you saying this to me?
Yes
I am not self botting and I'll use this api in my website to make a contact page
Bro this for sending message to channel not to dm a user
"Post a message to a guild text or DM channel" - the docs
Wait no ignore this
I am totally wrong lmao
Were you talking to me?
No my own message
That was my fault, let me re word it, The architect would be the person creating the class object, so the blueprint, while the __new__ creates its base structure, which yes, __new__ can make other things as you said, its not always the base structure for a building and then the __init__ method would "hire" the plumbers and electricians that come and make it a functional building and then since you planned out attributes, rooms and other designs, __init__ would hire other employees and to set attributes to that just created building/instance, making it a building/instance with attributes, building as in structure that may have offices/attributes etc
I said that @me/channels was wrong but that creates the DM channel object
It's been a while since I touched DAPI
I believe https://discord.com/developers/docs/resources/channel#create-message is the right endpoint, however
@robust fulcrum you'd just use a user's ID instead of a channel id in https://discord.com/developers/docs/resources/channel#create-message
You are not understanding my point
I did, im reading your other message currently
Okay one last analogy then let's switch the perspective into something less abstract than houses okay?
Oh k thanks for help 😃
Is a wall, a house?
Okay now let's talk OOP
OOP consists of a few key points, polymorphism, encapsulation to name a few
Now, let's say we have a "class" but it has no __mro__, tell me, is polymorphism still possible?
Now lets say we have no methods, no setters, no attributes, is encapsulation still possible?
Is this truly what a class is, considering OOP principles?
I don't really see the point in saying any more, just know my key point here is, __init__ is a constructor, because: It sets attributes, basically the state of the instance being created, and without that you have lost most of the OOP principles
Attributes are very important here, you have no class without attributes really
You can argue all you want and say, okay well __new__ allocates memory for the class, but then if you really go to that level, the class is really no longer a class in OOP but rather just allocated heap memory
Ok so i got your point but i'm still confused on, how you said:
__init__is a constructor, because: It sets attributes, basically the state of the instance being created
Doesnt a constructor create an instance? over __init__ setting it to an already created one? I would say thats my main point
I would just like to make it clear I am not discrediting __new__. Also my point being again if you read my last clause, okay let's construct an instance, now we have heap memory great what now?
You have to use __new__ and __init__ together by design
But you're missing a lot without __init__ so thats enough for me to call it a constructor
here’s a better one: the type is the blueprint for the house. __new__() is the plotting, allocated materials, and building the structure/skeleton for the house. __init__() is installing features like plumbing and wiring into the house and the other internal decorations/furniture.
(i can’t type in on a phone lol give me a break)
aligns with this
and this
and please not the house analogy, it’s been going on for too long lol
this madness has been going on for 1.5 hrs
stahp
I've had enough of programming talk for a night lol
I'm ready to put this to a close
I understand your point:
What is an instance without its attributes?
Is your point?
I'm not saying __init__ doesnt help with encapsulation, but i wouldnt refer to it as a constructor because it specifically doesnt create the instance but it does encapsulation and sets namespaces etc, yes.
I'm waiting for fiona to hit so i my electricity can go poof gone
😔
init and new are constructors bruh
fight me👊
they are both constructors
I'm not arguing towards the __init__ specifically, rather closer to the abstraction of setting state
Without state you have no OOP, therefor you have no class
especially if you’ve used languages where the constructor itself doesn’t handle the creation of the object
C be like ```py
malloc(sizeof Struct FOO)
python simply gives you more control over that process
😩
which is why new exists
init and new are both constructors, end of discussion i think
Yes
You got me their, now i go sleep
Anyways thanks for the discussion
how to edit another user's message in discord.py?
You can't
manually, that can be done, right?
Nope
You've never been able to edit other user's message, manually or via bot
mandela effect?
Probably :P
how is a timeout removed though
Imagine what kind of hell would happen if everyone was able to edit anyone's message — clowns and selfbots would start to edit all the messages to like "I have an attraction to cheese"; such ability makes no sense
i just wanna edit spam messages
Why not just delete them
You can resend edited message with bot and put the author of original message to somewhere
That's what I did for my word filter, for example if someone says "this fricking thing is stupid" and "stupid" and "frick" are blacklisted, it will resend author's message like "this #####ing thing is ######"
webhooks?
what do you mean
like edit other peoples messages?
if so, that fortunately cannot be done
people would be erratic like this person also said^
Can anyone could help me with some errors?
Well i have a similar error with it Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000017DFFA45F30> Got this message after intents = discord.Intents.all()
You can interaction.followup.send only after interaction.response.send iirc
This is not similar at all, could you show the full code
It is,
Do you use a database

I don't think so
This is the error.
Nah instead of interaction.followup.send do interaction.response.send
Once again, do you use a database?
What's a database?
Seems like you don't
This error commonly occurs if you have unclosed connections when shutting down the bot
But this code is definitely not a full one because the bot doesn't even get run here
It is a full code, only to make the bot online.
is that all the error you get? please send the full traceback
!d discord.InteractionResponse.send_message
await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., view=..., tts=False, ephemeral=False, allowed_mentions=..., suppress_embeds=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Responds to this interaction by sending a message.
Put the interaction.response.defer at the top of the command
or, edit_response if it was deferred
And use interaction.followup.send to respond
Yup 🫠
whats ur dpy version and are you connected to internet?
2.0.1, Yes in 5G
enable all the intents from your bot's dev page
and reset your token because it appears in the error above
@commands.cooldown(1,10,commands.BucketType.user)
@bot.command(aliases=["coinflip"])
async def cf(message, sayi=int):
id = str(message.author.id)
if id in data:
if data[id]['cash'] < sayi:
await message.reply("You don't have that much money.")
elif sayi <= data[id]['cash']:
data[id]['stats']['gamble'] += 1
sonuc = random.randint(1,2)
if sonuc == 1:
embed=discord.Embed(color=0xfbff00)
embed.add_field(name=f"Coin landed on head!", value=f"You won $**{sayi}**.", inline=True)
await message.reply(embed=embed)
data[id]['cash'] += sayi
data[id]['sccsgamble'] += 1
data[id]['max money'] += sayi
else:
embed=discord.Embed(color=0x740202)
embed.add_field(name=f"Coin landed on tail!", value=f"You lost $**{sayi}**.", inline=True)
await message.reply(embed=embed)
data[id]['cash'] -= sayi
data[id]['losted money'] += sayi
with open("values.json", "w") as f:
json.dump(data,f,indent=4)
else:
await message.reply("You dont have an account yet, you can start your journey with `.start`")
@cf.error
async def cf_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.reply(f'Command is on timeout, you have to wait `{round(error.retry_after * 1)}` more seconds.',delete_after=error.retry_after)```
that command is not working, im not getting any errors but bot does not respond with anything, can somebody help me please?
whtas problem ?
add an else statement in the @cf.error and print out error
you have the external asyncio lib that was for python versions when it didn't even have the async and await keywords, that is what's causing the issue
I did not get
await ctx.send(" **You do not have the required permissions to use this command.**")``` How can i mention the author of the command?
ctx.author.mention
it says
Command raised an exception: TypeError: '<' not supported between instancesof 'type' and 'int' how can i fix it?
(sorry for ping)
thats what cash looks like
isnt it int too?
typehint sayi with int
typehint
what is that
hinting types
sayi is literally an int class holder
!e
def uwu(_=int):
print(_)
uwu()
@slate swan :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'int'>
data[id]['cash'] < int(sayi)
!typehint
Type Hints
A type hint indicates what type a variable is expected to be.
def add(a: int, b: int) -> int:
return a + b
The type hints indicate that for our add function the parameters a and b should be integers, and the function should return an integer when called.
It's important to note these are just hints and are not enforced at runtime.
add("hello ", "world")
The above code won't error even though it doesn't follow the function's type hints; the two strings will be concatenated as normal.
Third party tools like mypy can validate your code to ensure it is type hinted correctly. This can help you identify potentially buggy code, for example it would error on the second example as our add function is not intended to concatenate strings.
mypy's documentation contains useful information on type hinting, and for more information check out this documentation page.
oh
typehinting is a must to learn because even dpy expects typehints to parse arguments into specific objects
for example
@bot.command()
async def uwu(ctx: commands.Context, member: discord.Member):
...
where dpy will convert member to Member if applicable, if member was not typehinted with Member, member would have been an str
so what should i do now
guys I need help
I did async def topic and wrote a massive list of responses
how do I make it send a random sentence from that list?
try random.choice(list)
await ctx.send(random.choice(list)) ??
yes ig
await ctx.send(random.choice(responses))
Aborting automatic restart, last crash occurred less than 60 seconds ago.
didn't work
lemme send the full code @gusty shard
!e
import random
list = ["a","b"]
print(random.choice(list))```
@gusty shard :white_check_mark: Your 3.11 eval job has completed with return code 0.
a
async def topic(ctx, *):
responses = ["What songs do you like?", "What is your favorite movie/film/series?", "What was the most embarrassing thing you have ever done?", "What's one thing that can instantly make your day better?", "What's the best joke you've ever heard?", "What's the phone app you use most?", "What was the craziest thing you have ever done?", " Is there one job you’d never ever do?", "Do you play any games?", "What time do you sleep?", "What do you like the most about naruto?", "who's the best girl in naruto?", "What is your favorite character in naruto?", "What is your favorite Ninjutsu?", "What is your favorite Dojutsu?", "What was the funniest thing in naruto?", "Do you like boruto?", "Do you like any animals?", "What's the most expensive thing you have bought?", "What's the cheapest thing you have bought?"]
await ctx.send(random.choice(responses))```
@gusty shard
can you send the error?
plz Help meee
!e
import random
responses = ["What songs do you like?", "What is your favorite movie/film/series?", "What was the most embarrassing thing you have ever done?", "What's one thing that can instantly make your day better?", "What's the best joke you've ever heard?", "What's the phone app you use most?", "What was the craziest thing you have ever done?", " Is there one job you’d never ever do?", "Do you play any games?", "What time do you sleep?", "What do you like the most about naruto?", "who's the best girl in naruto?", "What is your favorite character in naruto?", "What is your favorite Ninjutsu?", "What is your favorite Dojutsu?", "What was the funniest thing in naruto?", "Do you like boruto?", "Do you like any animals?", "What's the most expensive thing you have bought?", "What's the cheapest thing you have bought?"]
print(random.choice(responses))```
@gusty shard :white_check_mark: Your 3.11 eval job has completed with return code 0.
who's the best girl in naruto?
whats the problem
remove the asterisk after ctx in the parameter definition, that's the error
dang
!e
def _(arg, *):
...
_()
@slate swan :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | def _(arg, *):
003 | ^
004 | SyntaxError: named arguments must follow bare *
remove it from async def topic, right?
yes
alr
I did but still crash
@slate swan
why print bro, I need it to send in discord
I edited it to this
async def topic():
responses = ["What songs do you like?", "What is your favorite movie/film/series?", "What was the most embarrassing thing you have ever done?", "What's one thing that can instantly make your day better?", "What's the best joke you've ever heard?", "What's the phone app you use most?", "What was the craziest thing you have ever done?", " Is there one job you’d never ever do?", "Do you play any games?", "What time do you sleep?", "What do you like the most about naruto?", "who's the best girl in naruto?", "What is your favorite character in naruto?", "What is your favorite Ninjutsu?", "What is your favorite Dojutsu?", "What was the funniest thing in naruto?", "Do you like boruto?", "Do you like any animals?", "What's the most expensive thing you have bought?", "What's the cheapest thing you have bought?"]
await message.send(random.choice(responses))```
where did message tp from
u said to remove ctx

when did I...
..
remove the *
I did that but it still showed an error
async def topic(ctx):
^
we very much can't help without errors
async def topic(ctx):
responses = ["What songs do you like?", "What is your favorite movie/film/series?", "What was the most embarrassing thing you have ever done?", "What's one thing that can instantly make your day better?", "What's the best joke you've ever heard?", "What's the phone app you use most?", "What was the craziest thing you have ever done?", " Is there one job you’d never ever do?", "Do you play any games?", "What time do you sleep?", "What do you like the most about naruto?", "who's the best girl in naruto?", "What is your favorite character in naruto?", "What is your favorite Ninjutsu?", "What is your favorite Dojutsu?", "What was the funniest thing in naruto?", "Do you like boruto?", "Do you like any animals?", "What's the most expensive thing you have bought?", "What's the cheapest thing you have bought?"]
await ctx.send(random.choice(responses))```
so like this
yea
yes that will work
Aborting automatic restart, last crash occurred less than 60 seconds ago.
still crashed
error.
there is no error tho, I'm on daki.cc
why don't you debug and then deploy apps
yeah

ehm wat?
change bot.command into @bot.command
OH YES
IM SO DUMB
that shouldn't cause a crash though
yeah
unless the servers are quite shit
lets see now
OK DIDNT CAUSE A CRASH
nextcord.ext.commands.errors.CommandNotFound: Command "topic" is not found
it shows this tho why, @slate swan
code
@bot.command
async def topic(ctx):
responses = ["What songs do you like?", "What is your favorite movie/film/series?", "What was the most embarrassing thing you have ever done?", "What's one thing that can instantly make your day better?", "What's the best joke you've ever heard?", "What's the phone app you use most?", "What was the craziest thing you have ever done?", " Is there one job you’d never ever do?", "Do you play any games?", "What time do you sleep?", "What do you like the most about naruto?", "who's the best girl in naruto?", "What is your favorite character in naruto?", "What is your favorite Ninjutsu?", "What is your favorite Dojutsu?", "What was the funniest thing in naruto?", "Do you like boruto?", "Do you like any animals?", "What's the most expensive thing you have bought?", "What's the cheapest thing you have bought?"]
await ctx.send(random.choice(responses))
you're missing () after command, and bad indentation for the await ctx.send
I don't even want to comment at this point
works!!
thanks a lot! @slate swan and @slate swan
bro..
and you too @gusty shard

shithappens🫂
Help
code?
me ?
yes
code is currect
you sure ?
yes
ye its not safe if you put it in here
yes bro
and the error was this ?
this is eror
bro your python version ?
?
npc talk
ok
whats your python version
And you want the slash command to be seen only by owner?
yes and run only by owner
well i'm not sure if you can hide the command from others, but you can do a check inside slash command
for text commands it is @commands.is_owner() can it be that simple in slash commands ?
ok
ow
There's some stuff there regarding the permissions
ok thanks
But you can always do a is_owner check inside the command
you can hide it from everyone but not server owners & admins
k
guys I want to code an op economy bot, anyone wants to help?
ik I want to code an economy bot that has everything in it, and for example naruto question games that give money
What are you going to use as database?
idk
btw should I learn js?
or stick with python
Depends what do you want to do in the future
I just want to create economy bot for my server
naruto economy bot
I'd use Python for that
can u help me to make it?
no one will write code for your bot
no I mean help
code as much as you can and come here when you get stuck
Whats Wrong ?
are you still getting this error?
why you're calling a Bot instance Client 😩😩😩😩
and what's the error that you're getting
yes
did you install discord?
yes
wy ?
Coding an economy system is not an easy task. Currently still making one and it's taken me at the very least like 3-6 months to get the codebase to where I kinda want it
log timeout?
If u are gonna learn and use djs, u will also need to learn node.js. which is just pure magic for me despite me knowing js/ts
when user timed out
it's really easy though
hm how easy ?
like medium level?
it is mostly straight forward and easy to figure out. But it takes a ton of code and a ton of time to write
what is a good and cheap hosting service?
check the pins in #965291480992321536
wtf
I usually make helper functions for interacting with a db ¯_(ツ)_/¯
nice, ash
lmao why'd you see that
I usually just write like a whole entire separate utils lib that deals with db transactions. also probably should use redis for caching on my economy bot
make an API instead
the codebase for it is like 3-5K lines of code and probably would take more time to make a rest api instead
by api i mean a simple local interface, not a web tool
ah ok
Dayumm, what kind of features does your economy system have?
but still 3-6 months seem excessive if you got experience with python ¯_(ツ)_/¯
Mhm
not when ur out of ideas
lmao
I got a yellow line beneath the client, how can I fix? async def my_background_task(): await client.wait_until_ready() channel = discord.Object(id='992654876989460484') while not client.is_closed: await client.send_message(channel, "Task") await asyncio.sleep(5)
i can see 3 clients there, which one are you talking about
its not defined
how did you get that code then?
client there should be ur discord.Client or commands.Bot object
do you mean client.is_closed or client.send_message
how can i fix this ? any right approch ? me new
https://cdn.discordapp.com/attachments/559455534965850142/1021018765254742056/unknown.png
need an explanation of what's going on so we can help
you can't use decorator inside the range like that, its useless there
instead, create button classes inside the loop
how would i check
say like a string is 5e712ecf-2fbb-4f37-a462-155917378803 , how would i check how many "-" are in said string
? like any 2 3 code line how can i start ?
well i would use .split() and just get the length of a list
me blank
see how many strings are separated using .split("-")
!e ```py
print("ajak-kakaka-kka-lalal---".find("-"))
@slate swan :white_check_mark: Your 3.11 eval job has completed with return code 0.
4
well yes then you ave that too
thanks!
but i want the bot the bot to say its invalid when are three or less -
wait actual you need the number of occurrences
you should use badboom's method
thank you sarth
or count function exists too
probs count
well you can always use regexes for it
how?
but they're a pain in the ass ic so you would want to check how many there are
hmm
for i in range(x)
class myview(view)
....
like this ?
then how can i call loop ?
so my idea around going about it would be ```py
whatever = "fufu-f-e-fefe--fe".split("-")
if len(whatever) <= 3:
... # you can figure out the rest
!e print("yes" if "text with ---".count("-") > 3 else "invalid") #something like this
@slate swan :white_check_mark: Your 3.11 eval job has completed with return code 0.
invalid
yes or use a ternary operator
intents.typing = False
intents.presences = False
intents.message_content = True
client = commands.Bot(
command_prefix="!",
help_command= None,
intetns= intents,
sync_commands_debug= True
)```Why do I still get this warning: *MessageContentPrefixWarning: Message Content intent is not enabled and a prefix is configured* I also can't use the Prefix Commands on discord servers anymore, only in DM channels they're still working. I'am using disnake version 2.5.2 I also set the Privileged Gateway Intents in the discord developer Portal
use sarths method it is more line-saving
.all() should already define each intent
buttons = []
for emoji in list:
buttons.append(discord.ui.Button(args....))
there would be no need to define every other intent again
intents is spelled incorrectly too
no list comp 😔
well don't use that library, rewrite ur code in discord.py 2.0
they need to set a callback to each of them as well so i didn't do that
how can i dscribe there intraction then ?
to use a command prefix you need the message content intent, the Bot need access to the messages content to check if a message start with your custom prefix
he also said it only worked in dm channels
maybe something to do with the command's checker aswell
obv, in dm channel you don't need message content intent, it's a private channel between a user and the Bot
I thought I already have the message_content intent by disnake.Intents.all
but it's not working
would you do me a favor and show me your code real quick
with all intents enabled
like the entire file without the token
Can I send the code in this channel?
yes
!d disnake.Intents.all
classmethod all()```
A factory method that creates a [`Intents`](https://docs.disnake.dev/en/latest/api.html#disnake.Intents "disnake.Intents") with everything enabled.
!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.
which command are you trying to call
class PanelView(discord.ui.Select):
def __init__(self):
options = []
for panel in config["Reaction Role Settings"]["Reaction Role Panels"]:
options.append(discord.SelectOption(label=panel["Name"]))
super().__init__(placeholder="Select a panel", options=options)
async def callback(self, interaction: discord.Interaction):
global currentpanel
currentpanel = self.values[0]
await interaction.response.send_message(f"Selected {self.values[0]}")
for panel in config["Reaction Role Settings"]["Reaction Role Panels"]:
if panel["Name"] == self.values[0]:
actualview = discord.ui.View()
roles = config["Reaction Role Settings"]["Reaction Role Panels"][panel]["Role ID List"]
for key in roles.keys():
actualview.add_item(label=key)```
this will work for buttons callback to ?
there's a spelling error on commands.Bot
its intents, not inents... or whatever you wrote
so the intents are not actually getting registered
for example the !help command is not working
okay haha
it would be intents=
I can't
Can you tell me what to do
if issues still persist come back here and i'll try to help
Okay thank you its working now 🙂
how can h create buttons in loop and also define callback for each ?
glad we could help!
the callback has to be same for all?
nope it store data for each differentlly
i'm confused, what exactly you are trying to do
!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.
i don't really work with interactions/slash commands you should ask snipy or sarth as they have more knowledge
to add a callback to buttons of a list it should be
buttons_list = [buttonObj1, ...]
for i in button_list:
i.callback = your_function
idk if that works properly but you can try it, if there's an error we'll fix it later
was he just trying to add callback buttons to a list?
if so what you can do is you can just use snipy's method
from what I 've understood yes
yeah i was a bit confused
okay were you trying to loop over buttons and store them in a list? @limber bison
yes , like i want n number of buttons in message and all have similer callback , so for n i loop in range n and create that buttons
use snipy's method then
trying
hmm hmm thanks
btw there's a limit on how much buttons you can have
i defo need to learn how to use buttons and interactions
but what you could do is
you could just loop over the list of buttons
yes
it's 5 buttons per Action Row, you can have a maximum of 5 Action Row per message
so it's 0 <= n <= 25
got it
and a select menu counts as 5 buttons
i stuck here
Don't use repl
So if I don’t need to read/react to a channel, but only to send text into a channel from time to time, I don’t need a bot? Just some code to make a post to some discord url? If so, can someone point me to examples in python please?
you could use webhooks
you would need a bot but not the gateway
Somehow I thought I heard otherwise. Thanks.
you just need a webhook and the rest api tbf
Aha! Any examples out there?
e = await ctx.respond(embed=discord.Embed(description="**Checking the API**",color=0x81fe8f))
e = await message.delete()
why this doesn't work?
Bc your not suppose to update how e is defined
e = await ctx.respond(embed=discord.Embed(description="**Checking the API**",color=0x81fe8f))
await message.e.delete()
``` ik im very bad to python but i really need help because im fighting with this shit for like ~2 days
still doesn't work 😢
Bro no offence but, you have to be doing this on purpose
i don't ...
im very bad at python
You need message in .delete()
????
message = await ctx.respond(embed=discord.Embed(description="**Checking the API**",color=0x81fe8f))
await message.delete()
lemme test
File "C:\Users\i\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1009, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\i\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 359, in invoke
await injected(ctx)
File "C:\Users\i\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 135, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'delete'
it's not commands.Context, he's using ctx for interaction
maybe it's disnake
no
u can just use m = interaction.response.send_message()
then m.delete()
thanks!
f whats discord.Bot?
sus
its needed for my bot
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, *, help_command=<default-help-command>, tree_cls=<class 'discord.app_commands.tree.CommandTree'>, description=None, intents, **options)```
Represents a Discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
Unlike [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client"), this class does not require manually setting a [`CommandTree`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.CommandTree "discord.app_commands.CommandTree") and is automatically set upon instantiating the class.
async with x Asynchronously initialises the bot and automatically cleans up.
New in version 2.0.
discord.Client doesn't work for my code
only discord.Bot
wth
?
he's using discord.Bot and it's not a thing on discord.py, or am I wrong?
nope its not a thing
u are not using dpy even
with discord.Client
bruh
discord.Client has nothing to do with this
thats just declaring a bot instance
its the command thats problematic ie u are not responding to the interaction
i suggest u learn some python before attempting advanced projects such as discord bots
i just asked for delete message not dpy or anything like that
😢
anyways just use this it teaches how to make slash commands
its like asking someone to teach u calculus when u don't know basics of maths it just doesn't happen even if we wrote it down for u u will only be copy pasting
how can i accsess this leng in for loop
that code wont even get executed as u want it to
its better to put it in a function and acess it using the class instance
How would i check if a message exists only through its ID ?
u want to fetch the message?
like
def xyz(self)
for in ,,,, ?
this way ?
yeah
i read about fetch but what i read was i needed to know the channel it was sent in
in the class
async needed ?
depends on what u are doing in the function
if u need to use await then make it async
if not just def is enough
got it boss , and how can i call a asyc fun ?
class instance?
well ?
if it cannot be done with only message id, i should store channel id as well ?
await it thats it
u need channel id also yes
yo, this bot event doesnt allow any other comands to work
discord.py docs dont mention how to integrate it
it does use process_commands()
ok thanks
hey hey I need help on one thing
I want my bot to send a message from the list but send it at random time
like send it every 2-5 hours
how to tag the user who used a slash command
how do i make my bot say in terminal logged in as bots name
#bot-commands
nvm i did it
interaction.author.mention
Use tasks and randomize the cooldown
??
it's interaction.user for dpy
oh
!d discord.ext.tasks.Loop
!d discord.ext.tasks.loop
@discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
@shrewd apex
@glad cradle@wanton fractal
that's such a messy impl ngl
what do you mean
mhm
hey how did the code go, does it work? @shrewd apex
i think he pinged by mistake 👀
yeah i did a few tweaks it works now
that's good
i don't know the lib you were using very well but it was similar to sqlite3
kek its their in my repo u can take a look
okay sure thing
tell if u have any suggestions its apiprojects
noice
code looks great @shrewd apex
i see nothing wrong with it
you did good bro, i'm proud of you
does anyone knows why my bot wont send a embed after i put a on_message command below it
is there reason?
!pate
» windows-path
» relative-path
» pathlib
!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.
paste it onto there and we can help
@client.event
async def on_message(message):
if message.content == ("hello"):
if message.channel != 1021057023955181678:
await message.channel.send("wrong channel ")
@client.command(aliases=['do'])
async def d(ctx):
embedVar = discord.Embed(title="TESTING AUTOMAION BOT", description="**this is a test embed by magic", color=0x0096FF)
await ctx.send(embed=embedVar)
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.
async def on_message(message):
if message.content == ("hello"):
if message.channel != 1021057023955181678:
await message.channel.send("wrong channel ")
@client.command(aliases=['do'])
async def d(ctx):
embedVar = discord.Embed(title="TESTING AUTOMAION BOT", description="**this is a test embed by magic", color=0x0096FF)
await ctx.send(embed=embedVar)
well
on_message isnt really necessary if you are registering client.command()
it's only needed if you want to use chain commands
aka if/else chains
client.command() is better to use
@client.command(aliases=['do'])
async def d(ctx):
embedVar = discord.Embed(title="TESTING AUTOMAION BOT", description="**this is a test embed by magic", color=0x0096FF)
await ctx.send(embed=embedVar)
``` your code would look like this
you would just need this
not the on_message event
very true
any errors?
wait so 1 of them has to go
which would be on_message, yes
alr ty
let me know if there's any errors
there isnt
does the command run perfectly?
yah
glad i could help man!
yah like in ss
italic font, do you want a visual studio font?
question, do you have any eye problems?
yes
the curved f is apart of what i said
would you like a visual studio code theme?
no im asking is that like something speical in python
oh no no it depends on the theme
oh alr
if you want that i have one for you
uwu theme 😳
i cant import Options, any fix ?
typing.Optional?
or are you importing something else
discord.Option
maybe use from?
indeed, Option doesnt exist, is the issue
hmm well are you trying to do anything specific or?
in almost every slash_command, Option is used, isnt it ?
i have no idea, i don't use slash commands
i'm gonna learn how to implent them tho
ic
well do you need some assistance?
indeed
!d discord.SelectOption
class discord.SelectOption(*, label, value=..., description=None, emoji=None, default=False)```
Represents a select menu’s option.
These can be created by users.
New in version 2.0.
uh
i know its usage 😅
then?
i updated the version to fix TextChannel doesnt have news attribute error and now it doesn't exist meanwhile the docs say it does
first check ur version of dpy and if its up to date then use dir to print all methods of the object and see if it exists or not
doesnt
smh use print(dir(object)) and send the ss here
and send the link where it exists in docs
anyone please help me
how do I make it send message from my list like every 2 hours?
it wont send anything when someone joins
I need my bot to send message from the list every 2 hours
but I don't know how
pycord and just a version thing i guess, fixed by installing diff version so nvm
??
🤔
so how do I d o it?
!d discord.ext.tasks.loop
@discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
reminds me of the function symbol in meths which looks like the symbol of integration but strikethrough version
kek
anyone can fix?
😭
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default discord.py has all intents enabled except for Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
oh wait
oh and its not a command kek
yah just realised
still isnt working lol
intents
i already added them all
Can you show your code?
intents and join
@client.event
async def on_member_join(member):
channel = member.guild.system_channel
await channel.send(f"{member.mention} hello welcome to my server")
Your intents are all messy
how so
remove the value that overwrites the variable
make it like this?
yes
lemme try it now
Intents.all() is better, reduces no. of lines
works ty 👏
like this?
intents = Intents.all()
yes
Yeah but then he needs to activate the presences intent, which is not really needed and it's a waste of gateway events as the bot doesnt handle them
well yes
it's just a waste of resources to enable unused events
from discord import Intents
intents = Intents.default(); intents.members = True; intents.message_content = True
reduced the number of lines too
But cant you do
discord.Intents(members=True, message_content=True)
?
yes you can, surely
semi colons😡
I love js dw
I love C++ so i dont hate semi colons much
laughs with HTTP bot
wha-
Can Anyone help me?
I don't even wanna discuss that ngl
Hes talking about HTTP interactions only
don't use external libraries, use discord.py itself
oh lmao
no?
HTTP is 😎
all protocols should be written in caps lol
smh, I wanna jump off a building at this point
noid you're annoying for no reason lmao
skill issue
Like i said to asher, i correct every single mistake of you because i want you to suceed
!d discord.ext.tasks.loop
@discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
so how will I use that?
ehm.. didn't really understand
can u show an example please?
bot = commands.Bot(...)
bot.responses = [...]
@tasks.loop(hours=2)
async def t():
channel = ...
await channel.send(random.choice(bot.responses))
t.start()
there's plenty examples in the docs idk
thanks!
oh btw @slate swan what should I import?
tasks from discord.ext
thanks
ehm @slate swan
AttributeError: 'str' object has no attribute 'send'```
how did u define channel
channel = "986712676019359835"
Yo I need some help
!d discord.ext.commands.Bot.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
Changed in version 2.0: `id` parameter is now positional-only.
OH RIGHT
WITHOUT THIS "
await channel.send(random.choice(bot.responses))
AttributeError: 'int' object has no attribute 'send'
Can you someone help me use cryptlex API
I’m confused by it
@honest shoal
not like this
@honest shoal could you help me rq
follow here
wdym
sure
channel = bot.get_channel(id)
oof, I keep forgetting basic stuff
and now shows this await channel.send(random.choice(bot.responses))
AttributeError: 'NoneType' object has no attribute 'send'
@honest shoal
what is that
show code
import discord
import random
from discord.ext import tasks
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='2?', intents=intents, help_command=None)
bot.responses = ["WRHEGIRHGH", "GRWHUGRHEAGUH", "FHSUGHUAGU", "FREHUGHEU", "RWGHUEHGU", "GREHIUGHA", "RIGEWFWUAN",
"GHERIGHWOD", "GERIAGHI", "GHDIAGH", "GHFDSIGH", "GREGQJOF", "GWEGHUSI", "GWRHGUIHA", "HGIHIGRIS"]
@tasks.loop(hours=2)
async def drops():
channel = bot.get_channel(986712676019359835)
await channel.send(random.choice(bot.responses))
drops.start()```
I’m trying to use that API to create keys, I am not understanding it
sorry, it's not related to this channel
It is lmao, I need to add it via discord bot
get_channel is returning None i.e. channel isn't in cache. you can make a getch in this case
channel = bot.get_channel(channel_id) or await bot.fetch_channel(channel_id)
it still doesn't make it discord related
it's not
wdym
uhh I'm a little dumb today
does anyone know how i can make the bot stauts watch the time
you need to make an API call to get that channel
which is done by fetch
she posted the code above
stauts?
this one?
you should be starting the task after the cache is ready
yeah i want the bot to watch the time
ohh
like this
add bot.wait_until_ready() in the first line of the task loop
and how do I do that..
using tasks.loop
I haven't coded in a while.. and now trying to add new thing to bot
just answered above
is there a docs for it
async def drops():
bot.wait_until_ready()
channel = bot.get_channel(986712676019359835)
await channel.send(random.choice(bot.responses))```
like this?
yeah, await it tho
and now it shows this
C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\nextcord\health_check.py:23: DistributionWarning: discord.py is installed which is incompatible with nextcord. Please remove this library by using `pip3 uninstall discord.py`
warn(message, DistributionWarning, stacklevel=0)
C:\Users\hp\PycharmProjects\Dragon_Bot\main.py:15: RuntimeWarning: coroutine 'Client.wait_until_ready' was never awaited
bot.wait_until_ready()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unhandled exception in internal background task 'drops'.
Traceback (most recent call last):
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\nextcord\ext\tasks\__init__.py", line 156, in _loop
await self.coro(*args, **kwargs)
File "C:\Users\hp\PycharmProjects\Dragon_Bot\main.py", line 17, in drops
await channel.send(random.choice(bot.responses))
AttributeError: 'NoneType' object has no attribute 'send'```
read what it says
you can either use dpy or nextcord
ughhh my brain not working today
just please tell me how I'll gtg after few mins
@slate swan
you sure that the channel id is correct? also you didn't await the bot.wait_until_ready 🗿
yes I'm sure that id is correct and wdym by I didnt
just please tell me already I'm really hurrying up
ughh why everyone in this server likes to do this.. @slate swan
??????
noones here to spoonfeed, we can provide help to you but noones going to write code
just tell me where do I have to put the code
do await bot.wait_until_ready()
