#discord-bots
1 messages ยท Page 686 of 1
no
thanks
Is there a way to variable Discord buttons? Like
button1 = Button(style=ButtonStyle.blue, label=":yawning_face:"),?
yea, but remove the last ,
Ok! Would I have to do compontents = [.....]
or can I just create a new line with this
@visual island
you can store the variable as list of components [Button(...), ...]
message is required
not None and not empty string
ah yea, None is actually possible too
Do you need the message?
sorry, its ChannelType.private_thread
no
Oh
!d discord.TextChannel.create_thread
await create_thread(*, name, message=None, auto_archive_duration=..., type=None, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a thread in this text channel.
To create a public thread, you must have [`create_public_threads`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.create_public_threads "discord.Permissions.create_public_threads"). For a private thread, [`create_private_threads`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.create_private_threads "discord.Permissions.create_private_threads") is needed instead.
New in version 2.0.
message is Optional
got it
is this how you would do a custom decorator with async
async def a():
async def b():
...
i think so
the outer function wouldn't be async
I wrote to the dm bot and here it is
the message should be in that channel ig
Is there any way you can make the message go from the dm channel?
send the content to the channel, then create thread with that message
so?
no, pass message kwarg to be msg or discord.Object(msg.id)
thanks you so much
no worries 
eh i know this isnt related to dpy but how can i get this type of greentext
nah i mean using discord's codeblock
what about html?
<title>
</title>
hmm that's not the one tho
im trying to use codeblock with colors for my help command
also regarding the help command, do you know how to combine the subcommand description with its name
e.g. ```
Subcommands
sub1 - First subcommand
sub2 - Second subcommand
cant you just loop through group.commands then do f"{sub.name} - {command.description}"?
@heavy folio group.commands
yeah
can some body help me with something
How do i load multiple cogs like this?
bot.load_extension("cog","cog0","cog1")
Or a for loop?
loop through os.listdir()
Alr thx
what are cogs
Basically extensions that have clases like commands etc that are used to make code more organized or little
What the difference if i import a local file or i load a cog? Is it slower or not really?
nothin tbh , you can just import the cog class and use add_cog(CogClass)
folks...is it wise to create a global dictionary and use key as server id and pair as the value i want for each server to have. in my case google sheets api account. i dont want the api to load each time command is used. want to preload it for all servers when bot starts
gc = gspread.service_account(filename='config.json')
mybook = gc.open("mybook")
alr lol
if a discord user gets deleted
and we fetch the user object from its stored id\
then what discriminator will we get
I was searching for a user which is deleted in this server to test but cant find rip
output will be None
I see ..btw do u know any deleted user ๐ฅฒ
@slate swan
yes I found one lesgo
File "c:\Users\thoma\Desktop\discord.py\python\bot.py", line 318, in <module>
client.load_extension(f"cogs.{filename[:-3]}")
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 674, in load_extension
spec = importlib.util.find_spec(name)
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\importlib\util.py", line 94, in find_spec
parent = __import__(parent_name, fromlist=['__path__'])
ModuleNotFoundError: No module named 'cogs'```
Task saying it only takes 2 arguments when it takes 4
Traceback (most recent call last):
File "D:\6Mans\Heps6Mans\Main\main_v11.py", line 204, in queue
task_result = await task
File "C:\Users\~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 374, in __call__
return await self.callback(*args, **kwargs)
TypeError: qtimer() takes 2 positional arguments but 4 were given
if filename.endswith('.py'):
client.load_extension(f"cogs.{filename[:-3]}")```
An ss of your dir
!d discord.ext.tasks.loop
discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
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/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
thats a loop though
What you trying
ohh it might be beacuse i havent installed the module thats why
lms
Code?@full valley
nvm
@client.command()
async def load(ctx, extension):
client.load_extension(f'Cogs.{extension}')
@client.command()
async def unload(ctx, extension):
client.unload_extension(f'Cogs.{extension}')
@client.command()
async def reload(ctx, extension):
client.unload_extension(f'Cogs.{extension}')
client.load_extension(f'Cogs.{extension}')
for filename in os.listdir('.\Cogs'):
if filename.endswith('.py'):
client.load_extension(f'Cogs.{filename[:-3]}')
from discord.ext import commands
class TestCog(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@commands.is_owner()
async def reload(self, ctx, cog: str):
try:
self.bot.unload_extention(cog)
self.bot.load_extention(cog)
except Exception as e:
await ctx.send("Could not reload cog")
return
await ctx.send("Cog reloaded")
def setup(client):
client.add_cog(TestCog(client))
print(f"Background is loaded")```
they asked, send your dir ss
Exactly
it's not properly code blocked so can't really see if the indent is right
Lol no
No way at all?
Spotify's services are highly encrypted so...
I saw a plugin of BetterDiscord doing that so...
The bots which have spotify support dont really play audio from spotify, you know?
Not asking bout playing or downloading songs
Why to, when you can control it using spotify itself
Just cool
i was giving an example of encryption but fine
I am just curious how the plugin does that
Source code ,-,
It's in JS
Of course, discord is written in JS
Hmm...okay
that's me, but not this account
lol
?
Probably since JS is a multi-paradigm language whilst python is more focused on OOP but it is also a multi-paradigm language, so their classes are more robust imo
Still.......
what tf happened here
dude my bot won't start for some reason
whenever i run it, it doesn't print the on_ready message in a few seconds/minutes
any tracebacks?
i have an on_message event, used @bot.listen() to create it tho
no, errors, at all.
but apparently this happened when i added my help cmd
its basically just this
class MyNewHelp(commands.MinimalHelpCommand):
def __init__(self):
super().__init__()
self.no_category = 'Commands'
self.dm_help = True
async def send_pages(self):
destination = self.get_destination()
for page in self.paginator.pages:
Helpemby = discord.Embed(description=f"{page}", color=0xCD08FF)
await destination.send(embed=Helpemby)
does the commands work?
interesting
its been a few mins no on_ready msg
I doubt u can do it with a bot, the plugin is on the users pc so maybe it can modify data
:c
why my bot no starting, no on_ready msg
no error
all i just did was click that run button in vsc man
run the bot via terminal
huh
looks liek this looks like an ssl certificate
s/discord/client.py", line 605, in start
await self.login(token)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/client.py", line 473, in login
data = await self.http.static_login(token.strip())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/http.py", line 380, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/http.py", line 273, in request
async with self.__session.request(method, url, **kwargs) as response:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/aiohttp/client.py", line 1117, in __aenter__
self._resp = await self._coro
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/aiohttp/client.py", line 520, in _request
conn = await self._connector.connect(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/aiohttp/connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
raise last_ex`.c:997)')
cant send whole thing
!pastr
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 finally got a traceback
paste the whole thing to here using pastebin
https://paste.pythondiscord.com/xawicowixi.sql oh yeah and if you see bot.run() py told me it was a token so i removed it, not the main issue and isn't an issue
never had ssl stuff
โ ๏ธ crap.
I found this but I have no idea if this is 100% correct: https://exerror.com/certificate-verify-failed-unable-to-get-local-issuer-certificate/#How_To_Solve_certificate_verify_failed_unable_to_get_local_issuer_certificate_Error
^^
hey so i use a mac and did it for mac, but i still got the ssl certificate issue
oh wait
nevermind i fixed the issue it was a coding issue the whole time ๐
the traceback didn't show it tho
How do you actually make the bot in python?
I am trying to learn python bot coding lol
But first I need to make the bot thing work
i mean first learn basic python
How do I do that lol
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
All you need for dpy is oop,asynchronous and basic python knowledge
and good command ideas , unlike me
You can make a basic bot without oop too tho
idk oop or asynchronous
i know functions tho
which covers asynchronouns, never really plan to do much with asyncio
except asyncio.sleep โ ๏ธ
You need async libs if you are performing DB / SQL functions, GET requests etc.
everything you do ideally needs to be async otherwise run blocking functions in executor
Pil functions also
its not that hard really, use await function() if it's a coroutine, and async def ... to make commands and stuff
yeah, aiohttp makes getting images of api's much more easier, like you can work with reddit, etc...
is there a way to paste unicode emojis using pillow lib python?
how can i change my bot pfp from the code ? whan i do bot.user.edit...... it gives me this error AttributeError: 'NoneType' object has no attribute 'edit'
Hey guys, I'm facing a creepy error in my bot code. If anyone know sqlite3 then please DM me...
the bot isn't ready yet
How do I set image (embed) from my local file
Wait you can edit the client's profile picture?
ho
yes
How to?
ho?
1 sec
Can you change about me and name as well?
no
about me no
thats self botting
await bot.user.edit(avatar=open().read())
Docs please
il add wait until bot is ready and it will work ?
idk
yes
!d discord.Client.wait_until_ready
await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the clientโs internal cache is all ready.
client=discord.Client()
-------------------
await client.user.edit(username="blank", avatar=io.BytesIO(requests.get("image url").content))```
stealing my "yes"
i thought edit was for the member though
<3
search on google
i dont even think you can edit your bots profile picture in dpy
not about me
you can
Ah alr
bots aint got about me
Guys how can I send local image in discord embed
odd code considering this would have to be inside an asynchronous function
Oh really?
there was a command
!embed-file
?
idk what it was
!attachment
yeah something like that
thx it works
You can run them in executor
there wasnt a command
!d attachment
Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets.
!localfiles
Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:
# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")
# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
file = discord.File(f)
When using the file-like object, you have to open it in rb mode. Also, in this case, passing filename to it is not necessary.
Please note that filename can't contain underscores. This is a Discord limitation.
discord.Embed instances have a set_image method which can be used to set an attachment as an image:
embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png") # Filename here must be exactly same as attachment filename.
After this, you can send an embed with an attachment to Discord:
await channel.send(file=file, embed=embed)
This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.
What is that then?
yes there was, a! just did it xD
bot description
You can set that as bot desc
Bot's About Me
its a tag but ok
you change that in the developer portal
It's a command actually
I already know
!tag
โข
ยป args-kwargs
ยป async-await
ยป blocking
ยป botvar
ยป class
ยป classmethod
ยป codeblock
ยป comparison
ยป contribute
ยป customchecks
ยป customcooldown
ยป customhelp
ยป decorators
ยป defaultdict
image=random.choice(['gd.gif', 'hd.gif', 'he.gif', 'an.gif', 'ap.gif'])
reply=random.choice(['Blan...you mean, Kami sama!? He gave me life ๐ฅฒ', "You can't become cool like him ๐", 'I worship him every day ๐', 'Call him Blank sama ๐' "He resides my 'aura'๐ฅฐ", "No game, No life ๐ฎ"])
em=discord.Embed().set_image(url="attachment://images/"+image)
await msg.reply(reply, embed=em)```This is not working somehow
what
Oh
He told bot doesn't have an about me
So I was showing him there is an about me
first, you need to pass reply into content arg
content=reply, embed=em
and use f strings
It send reply but send empty embed
what is the time cooldown for changing pfp ?
Well it would
who knows
i mean how many can i change in one min?
how to fix
you are not sending an URL
they probably leave it ambiguous
Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:
# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")
# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
file = discord.File(f)
When using the file-like object, you have to open it in rb mode. Also, in this case, passing filename to it is not necessary.
Please note that filename can't contain underscores. This is a Discord limitation.
discord.Embed instances have a set_image method which can be used to set an attachment as an image:
embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png") # Filename here must be exactly same as attachment filename.
After this, you can send an embed with an attachment to Discord:
await channel.send(file=file, embed=embed)
This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.
@bot.command(aliases=['lyrixs', 'lyrix', 'lyric'])
async def lyrics(ctx, *args):
track = args.replace(" ", "+")
wait = await ctx.reply(f":mag: Please hold on, searching for `{track}`")
r=requests.get(f'https://some-cool-api.herokuapp.com/lyrics/?lyrics={track}')
res=r.json()
if res['status']=='success':
title = res['title']
artist = res['artist']
lyrics = res['lyrics']
source = res['source']
embed = disnake.Embed(title=f"**{title}**", description=f"**{artist}**\n\n\n{lyrics}", color=bot_embed_color)
embed.set_footer(text=f"Source: {source}")
await wait.edit(embed=embed)
else:
await wait.edit(content=f"Couldn't find any lyrics for `{track}`. Please try giving a more detailed search.")```
Can someone tell what's wrong in this
Read that
what is ambiguous ?
are ratelimits for discord API public info?
file name is correct
cause i dont speack English very well
You need pass a File object too
Why should they be private
OFC they are public
I have not found them so far so that's why I asked
ah
Any error?
No
My wish
I am not using them a lot
It's not asynchronous and its blocking, don't use synchronous libraries in asynchronous code
So that should not cause any issue rn
Using them a lot doesn't matter
Still that's not an issue
If you make a single request and that request takes a long time to to resolve, your bot will not function at all
until it resolves
So it's an issue
You should use aiohttp
I'll do that later
But for now tell me how to solve this please
wht is the problem
It just doesn't work
nothing in it?
Just executes the else:
start debugging it
Didn't find anything
print statements etc and see if the values are what you expect
I tried already
did you try making request without bot?
It acts like it sent the shit but it actually doesn't
No.
what was the status code of response, value of response etc
200 ofc
*args packs all the values together, when you pass it
I am just taking one value IG
@untold token py image=random.choice(['gd.gif', 'hd.gif', 'he.gif', 'an.gif', 'ap.gif']) reply=random.choice(['Blan...you mean, Kami sama!? He gave me life ๐ฅฒ', "You can't become cool like him ๐", 'I worship him every day ๐', 'Call him Blank sama ๐' "He resides in my 'aura'๐ฅฐ", "No game, No life ๐ฎ"]) file=discord.File("images/"+image) em=discord.Embed().set_image(url="attachment://Blank.gif") await msg.reply(content=reply,file=file, embed=em)
!e
def func(a, *b):
print(f"{a}, {b}")
func(1, 2, 3)
@untold token :white_check_mark: Your eval job has completed with return code 0.
1, (2, 3)
I am just taking in 1 value
i have dis command which sends an random line from a txt file since its random sometimes the lines get doubled how do I make it such a way that it doesnt gets doubled
with open('image_urls.txt', 'r') as f:
lines = f.readlines()
g = random.choice(lines)
e = discord.Embed(title='Hello, Goshujin-sama',
description='**Arigato Gosaimushta for Voting Me Here Is The Reward**', color=0xcf24ff)
e.set_image(url=f'{g}')
e.set_footer(text='Goshujin-sama The Above Image Is Fan-Art By Its Respective Anime Community, I or Creator-Sama Has 0 Contributions In It')
user = await bot.fetch_user(message.content)
await user.send(embed=e)
bro
like a list with all the lines and the list keeps getting regenerated
wait I am an idiot
No,when you are passing values, it is packing them together in a tuple
For example
@tiny ibex did you print the *args you passed?
!lyrics soulja boy crank that
This isn't taking all the arguments as one, but they are separate and *args is packing them together
use ,* , (consume rest operator)
It will take all the values, as one
So what bout (ctx, *, args)
Yes
Lemme see if it works
And use aiohttp
BRUH
Not requests
Well, you would need to change it a bit
not the whole code, most of the part will remain the same
Lemme show you an example
^
BTW didn't work
Prolly a lot
import aiohttp
url = "someapi.url"
# creating an Aiohttp ClientSession
# A Client session is basically an instance of an aiohttp client that you can use to make HTTP requests to an API
async with aiohttp.ClientSession() as session:
# using context managers, that will handle the ClientSessions aka creating and closing a Client session instance
async with session.get(url=url) as resp:
# making an GET HTTP request to an API
response = await resp.json() # let's assume the API is returning json data
print(response) # printing the response returned from the API
A simple example of aiohttp
I used ClientSession session here
I already know how it works
Oh okay
can i get help
Ask
Traceback (most recent call last):
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 3, in <module>
from discord.ext import commands, tasks
ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location) i got something like that when i run the bot
BTW @untold token (ctx, *, args) still doesn't work
Traceback (most recent call last):
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 3, in <module>
from discord.ext import commands, tasks
ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location) i got something like that when i run the bot can sameone help
!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.
but is a error bro
Doesn't matter
wdym did not work, errors, did you print the args and saw what you got?
UGH
When entered k391 aurora I got k391+aurora
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 3, in <module>
from discord.ext import commands, tasks
ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location)``` i got something like that when i run the bot can sameone help
discord.py didn't install properly
Reinstall it
how do I make a function which picks random lines from a txt file and send but the lines are getting doubled
huh
bot how to reinstall
Well API is working properly
pip install discord
like
making a list
make the lines into a list and when the lines one by one and later when the list is finished regenerate another list and send it from there
how do I do that
Ya asyncio.loop.run_in_executor
Yea
NVM IG I found the issue
still the same
Sorry @untold token for disturbing
im trying to find the bots in my server, i have tried this bot = ctx.guild.members.bot but that doesnt work
Np
Me dumb af
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 3, in <module>
from discord.ext import commands, tasks
ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location)```
how do I run the command only if its the owner
You need loop through members and check if the member is the bot
if res['status']=='success':```
When it gives `200` instead of `success`
!d discord.Member.bot
property bot```
Equivalent to [`User.bot`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.bot "discord.User.bot")
Use the is_owner() check
!d discord.ext.commands.is_owner
@discord.ext.commands.is_owner()```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that checks if the person invoking this command is the owner of the bot.
This is powered by [`Bot.is_owner()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.is_owner "discord.ext.commands.Bot.is_owner").
This check raises a special exception, [`NotOwner`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NotOwner "discord.ext.commands.NotOwner") that is derived from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
file = open("filename", "r")
d = file.read().split()
x = d[random.randint(int, int)]
^^^
ints are amount of lines 1, end
like this? py TotalMembers = ctx.guild.member_count for TotalMembers in ctx.guild if ctx.guild.members is discord.Member.bot: await ctx.send("u")
Wtf
idk :(
hmm
You should learn basic python
@untold token Not working yet
@bot.command(aliases=['lyrixs', 'lyrix', 'lyric'])
async def lyrics(ctx, *, args):
track = args.replace(" ", "+")
wait = await ctx.reply(f":mag: Please hold on, searching for `{args}`")
r=requests.get(f'https://some-cool-api.herokuapp.com/lyrics/?lyrics={track}')
res=r.json()
if res['status']=='200':
title = res['title']
artist = res['artist']
lyrics = res['lyrics']
source = res['source']
embed = disnake.Embed(title=f"**{title}**", description=f"**{artist}**\n\n\n{lyrics}", color=bot_embed_color)
embed.set_footer(text=f"Source: {source}")
await wait.edit(embed=embed)
else:
await wait.edit(content=f"Couldn't find any lyrics for `{track}`. Please try giving a more detailed search.")```
for member in ctx.guild.members.
if member.bot:
... # your code here
i still got this error Traceback (most recent call last): File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 3, in <module> from discord.ext import commands, tasks ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location)
@junior terrace that's how you would loop
error(which is unusual)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In user_id: Value "!hgif" is not snowflake.
You are adding a + whenever there is a space
That's how I am supposed to pull request
can sameone help
Hmm
So what to do?
oh thanks
but how actually count them
Well the code is working, you are not getting the lyrics
Figure that out yourself
I guess it means there is no thing as tasks in discord.py library try just "task"
What I just said
So how to solve it?
Try removing the +
Why remove it?
so you think k391 aurora will work?
Yes
What
https://some-cool-api.herokuapp.com/lyrics/?lyrics=k391 aurora
Invalid link
urls can't contain spaces
Yes
does anyone have scrolller.com api
Visit it yourself if you think it's issue with the API
Hmm
manual request works
Yup
...
OFC it is legal
Works for me too yes
free premium dude
So what to do?
Wait you're using requests
There are no issues due to that
There are tons of
!d requests.Response.status
Use aiohttp
What's the status code
200 IG
I told them multiple times
Not any currently
Print it and see
I told you I will convert later
for member in ctx.guild.members:
if member.bot:
await ctx.send(len([member]))
break``` @untold token
change the if statement to
if r.status == 200:```
then try
yeah res.status
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 11, in <module>
from discord import tasks
ImportError: cannot import name 'tasks' from 'discord' (unknown location)``` ugh still i got this error
I don't think res['status'] is wrong
can u try what I said though?
Just try it lol
from discord.ext import tasks
Alr
Uh no....
You seriously need to learn basic python
idk but this gives me 1 as result, but my bot are 10
for member in ctx.guild.members:
if member.bot:
await ctx.send(len([member]))
break
because you are breaking??
oh
no I'm not sure that's why I added a ?
still i got this error Traceback (most recent call last): File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 11, in <module> from discord.ext import tasks ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location)
the way he just says โohโ xD
Open CMD and do pip install discord
i did it

Lol
i did it
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 175, in wrapped
ret = await coro(*args, **kwargs)
File "d:\All Shit Things\Python Files\Discord Shit\some-random-shit\main.py", line 930, in lyrics
if r.status=='200':
AttributeError: 'Response' object has no attribute 'status'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\client.py", line 505, in _run_event
await coro(*args, **kwargs)
File "d:\All Shit Things\Python Files\Discord Shit\some-random-shit\main.py", line 99, in on_command_error
raise(error)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\bot_base.py", line 560, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 929, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 184, in wrapped
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Response' object has no attribute 'status'
Update
And res is replacing r?
did u first uninstall?
Alr
yeah ig
Then it's the same thing. Just changing of the variable name.
ยฏ\_(ใ)_/ยฏ
Traceback (most recent call last):
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 175, in wrapped
ret = await coro(*args, **kwargs)
File "d:\All Shit Things\Python Files\Discord Shit\some-random-shit\main.py", line 930, in lyrics
if res.status=='200':
AttributeError: 'dict' object has no attribute 'status'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\client.py", line 505, in _run_event
await coro(*args, **kwargs)
File "d:\All Shit Things\Python Files\Discord Shit\some-random-shit\main.py", line 99, in on_command_error
raise(error)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\bot_base.py", line 560, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 929, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 184, in wrapped
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'dict' object has no attribute 'status'```
yeah nvm
res a dict yes
Yup
Try res["status"] since it's a dict.
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 11, in <module>
from discord.ext import tasks
ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location)``` nope still
OFC it is
I was doing that only
Print it
the did try that
^
See what you get
Alr lemme see
bro wtf is ur terminal
Is python on path?
Yeah
OFC it is
IG the same
What's the type of the response, a string?
Hey @slate swan!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Or an int
Yup
See its type
{"status": 200, "title": "Aurora", "artist": "K-391", "lyrics": "I\u2032ve been looking through my memories\nI've been tryna see your face\nBut you\u2032re moving like a mystery\nAnd you look the other way\n\nIf you found me in the pouring rain\nWould you let me in?\nWould you look into your memories?\nTell me where you've been?\n\nWhen the sun is going down\nI feel you coming closer\nCounting in the dark, I feel at home (home, home)\n\nI see you light up the sky, a dance in the night, Aurora\nI see the stars in your eyes, believe in your lies, Aurora\nMine for a moment, then you're gone, and I\u2032m still holding on\nTo a light in the sky, a dance in the night, Aurora\u3164\n\nFeeling almost like a secret\nHidden in an emerald sea\nAnd I\u2032m drowning in your green eyes\nGot that power over me\n\nIf I told you how I really feel\nWould you let me in?\nWould you tell me all your secrets?\nTell me where you've been?\n\nWhen the sun is going down\nI feel you coming closer\nCounting in the dark, I feel at home (home, home)\n\nI see you light up the sky, a dance in the night, Aurora\nI see the stars in your eyes, believe in your lies, Aurora\nMine for a moment, then you\u2032re gone, and I'm still holding on\nTo a light in the sky, a dance in the night, Aurora\n\nI see you light up the sky, a dance in the night, Aurora\nI see the stars in your eyes, believe in your lies, Aurora\nMine for a moment, then you\u2032re gone, and I'm still holding on\nTo a light in the sky, a dance in the night, Aurora", "source": "Musixmatch", "query": "k391 aurora"}```
NVM it's an int
LOL
https://paste.pythondiscord.com/ukawidodib.py the link to my bot code
using this ```py
for cog, commands in mapping.items():
filtered = await self.filter_commands(commands, sort=True)
command_signatures = [self.get_command_signature(c) for c in filtered] #
if command_signatures:
cog_name = getattr(cog, "qualified_name", "No Category")
embed.add_field(name=cog_name, value="\n".join(command_signatures), inline=False)
Dumb of me
https://paste.pythondiscord.com/ukawidodib.py check there
Hi, im using db and i ran into a problem. when i run the command its sending [(2,)] how do i make it just 2
Are you using psycopg2?
How can he check if python is in your path with your code?
WTF
tell me code of a bot full code
idk dont ask me
Oof
Well thanks that was the issue I didn't realize for a long time
Lmao
Me dumb af
yes i think
Hi, im using db and i ran into a problem. when i run the command its sending [(2,)] how do i make it just 2
Use indexing
wdym
list[0][0]
so what should i do to make my bot working
๐คจ
cuz of the error my bot cannot be online
We don't spoonfeed here.
Hi there
SO I'm making a discord bot. Here is my shortened code
import discord
from discord.ext import commands
bot = commands.Bot("!")
@bot.command()
async def test(ctx: commands.Context, *args, channel: discord.ChannelType = None):
if channel is None:
channel = ctx.channel
await channel.send("Testing...")
bot.run("TOKEN")
```So how can users access the `channel` argument here, or it is impossible? Thanks.
Type hint channel as discord.TextChannel
what do you mean?
Did you copy that code?
No I didn't
,*args
packs it
I see
Hi
Hello
^^^^^^^
args.
*packed
ello
Uh, that is a shortened version of my code.
There is another argument before *args and *args is also required
someone helps: Uh no,
someone helps: who asked
you should prob research *args
its not woking in the way you want it to
!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`...
^^^^ also if someone could help
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 168, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\admin\Downloads\underdev.py", line 81, in wallet
await bot.db.execute("INSERT INTO users WHERE user_id = ? AND bal = ?",(member.id,500))
File "C:\Python310\lib\site-packages\aiosqlite\core.py", line 184, in execute
cursor = await self._execute(self._conn.execute, sql, parameters)
File "C:\Python310\lib\site-packages\aiosqlite\core.py", line 129, in _execute
return await future
File "C:\Python310\lib\site-packages\aiosqlite\core.py", line 102, in run
result = function()
sqlite3.OperationalError: near "WHERE": syntax error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\nextcord\client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "c:\Users\admin\Downloads\underdev.py", line 65, in on_command_error
raise error
File "C:\Python310\lib\site-packages\nextcord\ext\commands\bot.py", line 1024, in invoke
await ctx.command.invoke(ctx)
File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 933, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationalError: near "WHERE": syntax error```
sorry ๐ฆ
show ur code
Very weird name lol
^^^
rebumping
Greedy ๐ณ
is it possible to make smtn like
Click here to follow the announcements channel
where if the user clicks they r prompted to follow tht channel....an announcement channel ofc
Yeah
I think they get a ping each time there is a new announcement
Or something ๐
hi
๐
how to code in python
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
thx
using python
@heavy folio bot.get_command(...).name
~ok~
oh
U need a commands.Command object tho
double ~
so just loop throuth it?
Wym
ok
u can do
for cmd in bot.commands:
print(cmd.name)
!recources
resources*
hmm
???
#python-discussion or #dev-contrib if there's something wrong with the website (;
File "C:\Users\PC\Desktop\Dadudeล Bot\Dadudeล Bot.py", line 14, in <module>
from discord.ext import tasks
ImportError: cannot import name 'tasks' from 'discord.ext' (unknown location)``` pls i need help i still have this error
If anyone can help please #help-cherries
im tryied some things but they dont help
for cog, commands in mapping.items():
filtered = await self.filter_commands(commands, sort=True)
commands = [self.context.bot.get_command(c).name for c in filtered]
if commands:
cog_name = getattr(cog, "qualified_name", "No Category")
embed.add_field(name=cog_name, value="\n".join(commands), inline=False)
```returned this error: ```py
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: argument of type 'Command' is not iterable
oh yeah im using a subclassed helpcommand btw
when i try to run my code this error shows :(
read the error, your api blocked
just wait 1~ hour
ok
Why is icon_url=ctx.author.avatar_url not working anymore in my embed commands?
Help we how to import this salt(pynacl) for voice support in my bot.
pip install pynacl
in the terminal
It didn't work
how do I make a string like this
"idk"
to
idk
what?
what isnt working
??
!e print('"idk"'.replace('"', ''))
@manic wing :white_check_mark: Your eval job has completed with return code 0.
idk
what
changed dpy version
u on 2.0 or 1.7.3
when i have an embed with icon_url=ctx.author.avatar_url the bot isn't sending the embed when i remove that the bot send the embed
f"text"
1.7.3
prob because you have a shit error handler
icon_url=ctx.author.avatar**.**url
for nextcord
@craggy cloak
you have any global error handlers?
@client.command()
AttributeError: 'Client' object has no attribute 'command'
why :c
maybe he has
@client.event
async def on_command_error(stuff)```
send your defined client
discord.Client
try commands.Bot
client = discord.Client()
do
client = commands.Bot(command_prefix = "prefix")```
kk
also naming it client isnt a good var name 
:0
use bot
alr
raw_posturl = r"{}".format(posturl)
embed.title(f"[{title}]({raw_posturl})")```
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/nextcord/ext/commands/bot.py", line 1024, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/nextcord/ext/commands/core.py", line 933, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/nextcord/ext/commands/core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'str' object is not callable```
Fixed this?
set it =
?
nope
Ah. Can u post the whole traceback?
you set it using the equal sign, the same way you make a var, you dont call it (discord.Embed.title returns a string)
It's a property, not a method ^^^
why would someone try hyperlinking the text in titles with [text](url) tho
This is what kayle means
meme
Just like the docs command, ig?
@twin moon just do ```py
embed.title = ...
What does filtered return?
eh get back to you in awhile
Sure
I have this embed and sometimes it works but sometimes it doesn't.
when it doesn't work i get
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 558, in apply
await channel.send(embed=emb3)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/abc.py", line 1065, in send
data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.fields.1.value: This field is required
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.fields.1.value: This field is required
nah , it won't work , Embed() takes a url kwarg which does that :)
Oh hmm. My bad ;-;
its empty
the thing is i didn't change anything and it worked a minute before this error
second field value is empty
are you using an api for this command/embed?
no
what does the field value contain then
if ctx.author.id == 499973767846428694 or 799560804864229416:
``` ''or'' will work ?
its just an item from a list
maybe the bot glitched and it just didn't pick up my msg
thats my best guess
list is empty then
sure
no
!or
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
it shouldn't which is weird
it'd work though
if i put or there then everyone can use that
it will work, but always return True
it'll only return true if the authors id is the one he used though
!e
id = 10
print(id == 11 or 12)
@visual island :white_check_mark: Your eval job has completed with return code 0.
12
if ctx.author.id in (499973767846428694 ):
```this is ok ?
@visual island :white_check_mark: Your eval job has completed with return code 0.
True
there
sure
Ya thx !
who would have guessed
my result
can someone tell me why this isnt sending?
@help.command()
async def Moderation(ctx):
embedVar = discord.Embed(title = "Moderation", color=0xffffff)
embedVar.set_author(name="Help Menu", icon_url="https://images-ext-2.discordapp.net/external/WIgCSXG983AyTaEI4KbhNW0y5QfTbQR52JBVTsxyVtg/%3Fsize%3D4096/https/cdn.discordapp.com/avatars/897787910550585345/0562acfe8adacbcebc99306f353007ca.png?width=676&height=676")
embedVar.add_field(name = "`kick :` Kicks a member from the guild.")
embedVar.add_field(name = "`ban :` Bans a member from the guild.")
embedVar.add_field(name = "`lock :` Locks a channel in the guild.")
embedVar.add_field(name = "`unlock :` Unlocks a channel in the guild.")
embedVar.add_field(name = "`mute :` Mutes a member in the guild.")
embedVar.add_field(name = "`unmute :` Unmutes a member in the guild.")
await ctx.send(embed=embedVar)
@client.command()
async def sapinuke(ctx, member: discord.Member, count: int):
if ctx.author.id in (499973767846428694):
c = 0
while True:
if message.content.startswith('Stop'): #how toooooo make thisss possible
break
```how to make it run
sapinuke
๐คจ
LOL
Is there a way to limit the embed field to only 2 columns?
As i remember , the value kwarg in the embed.add_field is a must for you to fill...
its a required argument that you must pass
What are you trying to do?
Anybody able to help me with this? I cant find anything in the documentation
I want "Servername" to be inline with "Played Time"
and only have 2 columns
how do I find the post url from reddit if I use a url like https://www.reddit.com/r/memes/new.json?sort=hot
Which server name
All of them lol
this is what I want it to look like without the tests.
hmm
!paste
Use hastebin
redit
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
how do I get the post url of the pic
hey hunter you there?
Well @drifting arrow you can try to have the server name and then have a few \n and then write the played time there
PRAWโฆ.hurrrrโฆlemme think
Hi
https://mystb.in/SituatedRevealsMtv.sql - full traceback
just dont wanna have command signature since it makes the help command messy
What's filtered
Praw doesent understand my password
Hunterโs smart
ยฏ_(ใ)_/ยฏ
[<discord.ext.commands.core.Command object at 0x000001EF30F7B040>, <discord.ext.commands.core.Command object
at 0x000001EF30F7B550>, <discord.ext.commands.core.Command object at 0x000001EF30F50160>, <discord.ext.commands.core.Command object at 0x000001EF30F50250>, <discord.ext.commands.core.Command object at 0x000001EF30F508B0>, <discord.ext.commands.core.Command object at 0x000001EF30F7B430>, <discord.ext.commands.core.Command object at 0x000001EF30F50FA0>]
[<discord.ext.commands.core.Command object at 0x000001EF30F7B640>]
[]
[<discord.ext.commands.core.Command object at 0x000001EF30F7BC10>, <discord.ext.commands.core.Command object
at 0x000001EF30F7B970>]
[]
[<discord.ext.commands.core.Group object at 0x000001EF30F8D070>]
[<discord.ext.commands.help._HelpCommandImpl object at 0x000001EF30F501F0>]
printed it
U already have the command objects
I am but how do I get it
Understand now?
got it
Haha cool
also when i do .help help it shows this weird stuff
Wym
HOW DO A I GET THE POST URL WITH THE REDDIT JSON API
Chill
Ah, its the docstring
!d discord.ext.commands.HelpCommand.attrs
oh
Bot is down
Explain?
Since when?
Do the mods know about it?
Yeah
Sir Lancelot wasnโt feeling very well
What error tho?
Sad. The cold is affecting everyone
alr
I knew it when he took about 10 seconds to respond
It was like a server down thing
Idk maybe itโs Linodeโs problem
how do I get a post like https://www.reddit.com/r/memes/comments/qwmsf3/here_is_a_meme/ with the reddit json api
*sniff*
Ezzz
eh how, i've tried to set it like the way i do in cogs: ```py
class MyHelp(commands.MinimalHelpCommand):
"""description"""
def init(self):
...
This is the most #ucked up person I know
Use self.command_attrs
Me?
Donโt be mean to hunter
maybe
I WANT MY ANSWER
Chill
Didn't I just tell u...
Just prefix /.json and boom
U get the JSON dicts of the webpage
hmm
@twin moon Please be respectful here. You can read our code of conduct here #code-of-conduct
Understood?
f'https://reddit.com/r/{subreddit}/hot/.json' I did this and subreddit var is default memes but if I change it it doesent work
what does ucked mean?
ducked?
not really sure how to use it
hucked
stop your shit post here
lucked?
use reddit api (praw)
should i have command_attrs in super()._init_?
self.command_attrs = {"description" = "Description"}
oh
And stuff
alr thanks
It takes all the kwargs a command takes
thanks
what's the error name for when a command is used in dms
Wym
.jpg not link to post
way easier using this
#
post = reddit.subreddit("hentai").random()
while post.url == None or "redgif" in post.url:
print("skip")
post = reddit.subreddit("hentai").random()
embed = discord.Embed()
embed.set_image(url=post.url)
await message.channel.send(content=None, embed=embed)
are you using a custom check or @commands.guild_only
nvm
It will always return the link, not the JPG. You gotta use io.BytesIO yourself to convert to JPG
h#ntai?????? wtf no
Hi
๐
I Like Python 
@maiden fable after i added command_attrs, the help command is gone
How About You ?
not sure what went wrong
asking if we like python in a python server, nice
Lmao show the code
reddit = ???
class MyHelp(commands.MinimalHelpCommand):
def __init__(self):
super().__init__()
self.command_attrs = {"description": "Shows the help command for the bot."}
self.show_hidden = False
reddit = ???
reddit yes
How About Django or Selenium or ...
? 
reddit is not defined
Try removing that line and just print command_attrs
u need the api
#python-discussion if u wanna chat, this is a topical chat (:
praw asyncpraw?
๐๐ถ
u need that
Ahem u should delete the code ngl
why
NSFW
good choice of language
(:
not
Not. Safe. For. Work.
but I mean its not really nsfw
And why did u even post it? U need help with it?
it was for @twin moon
O
alr
{'name': 'help', 'help': 'Shows this message'}
eh i find it weird tbh
that's the default description ig
hunter what ai module ur using for ur bot
Yea it is
what is "redgif"
I made my own AI API
Try setting the docstring
its a nsfw gif website that reddit uses, doesn't work on discord so I blocked it
shouldn't have a problem with that if ur bot is sfw reddit
nice
(:
also hunter i use group.callback.__doc__ and command.callback.__doc__, does it affect?
it still does the same
.jpg
huh
is there something like post.subreddit.url
its reddit.subreddit("subreddit's name").url
but I've made post = reddit.subreddit("hentai").random()
so for me its post.url
.random() picks a random post from the sub btw
I want to make a link to the post and not .jpg
if you want to post the link just put it in the title or description
dont use embed.set_image then
.url is the link for it but on .set_image it just uses the image from the post
hi guys, I would like to get some help regarding, how to get the server name through the bot, and how to know the server owner through the bot...???
I did embed description post.url and it gives me .jpg
how?
@maiden fable
where?
in the start
can anyone help me out with this one pls?
reddit var
huh
https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.name
https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.owner (returns a user object so you can use user attrs)
just place it after the reddit variable was defined'
same result
show the code and error
no error
@commands.command()
async def meme(self,ctx,subreddit="memes"):
reddit.read_only = True
post = reddit.subreddit(subreddit).random()
while post.url == None:
post = reddit.subreddit(subreddit).random()
embed = nextcord.Embed(description=f"[{post.title}]({post.url})")
embed.set_image(url=post.url)
embed.set_footer(text=f"Thanks to {post.author} for this meme.")
await ctx.send(content=None, embed=embed)``` links me a .jpg
oh
remove the embed.set_image
I mean what exactly are you trying to make? a link for a meme or the photo of the meme
Whyy
cuz i prefer using doc string
U know... command.description first checks if a docstring is set iirc
all my commands are literally like this: ```py
@command
async def _command(self, ctx):
"""Description"""
oh
what about for cogs
Same for cogs iirc
Sure haha
!d discord.ext.commands.Command.short_doc
property short_doc: str```
Gets the โshortโ documentation of a command.
By default, this is the [`brief`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.brief "discord.ext.commands.Command.brief") attribute. If that lookup leads to an empty string then the first line of the [`help`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.help "discord.ext.commands.Command.help") attribute is used instead.
Oh, hmm
hmm i tried command.help, it still doesnt show the description i set (for .help)
!e
def c():
"""Hi"""
pass
help(c)
@maiden fable :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 4, in <module>
003 | NameError: name 'help' is not defined
Tf
imagine a default python function not working
@maiden fable :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print(help(pass))
003 | ^^^^
004 | SyntaxError: invalid syntax
Hmmm
@maiden fable changed it self.command_attrs = {"name": "help", "help": "Shows the help command for the bot."}
from key "description" to "help" 
Okay
alr so i have send_cog_help but when i do it doesnt send cog help
the cog exists thoo
i'll send code sec
async def send_cog_help(self, cog):
embed = discord.Embed(
title="Help",
color=get_color(),
timestamp=datetime.datetime.now()
)
embed.set_author(
name=self.context.bot.user.name,
icon_url=self.context.bot.user.display_avatar.url
)
embed.add_field(name="Description", value=cog.help, inline=False)
get_commands = cog.get_commands()
if get_commands is not None:
commands_list = []
for cmd in get_commands:
commands_list.append(f"`{cmd.name}`")
embed.add_field(name="Commands", value=", ".join(commands_list), inline=False)
embed.set_footer(text=f"Run `{self.context.prefix}help <command>` to find out more about a command.")
channel = self.get_destination()
await channel.send(embed=embed)
@command(
description = "description"
)
async def cmd(....
"""
short help
"""
pass ```
`Command.short_doc `return the docstring similar to `cmd.__doc__` , `command.description` is the `description =` param
got that fixed ||i prefer using doc string instead of the kwargs in the deco||
ah great ||they are different things tho||
help for cog names are case sensitive
so its .help Misc
the only problem is you can't use fstring in docstrings
oh yeah
help could take from __doc__ if it's not provided, description will return None instead
I think thats the main difference
ohh
Hi
A link to the meme post
does anyone know is nsfw pfp for bots allowed or against TOS?
its for a nsfw bot and I really cant think of any good pfp
nice ||sarthak wdym """ strings are cooler||
" is way faster to use than '
rr = [for i in range(0,robauthordata)]
robfinee = random.choices(rr)``` syntax error
u can click shift + 2 for "
but u need to go way across the keyboard for '
(atleast on finnish layout)
on finnish layout its between รค and enter
i dont think cogs are case insensitive



