#discord-bots

1 messages ยท Page 686 of 1

rare saddle
#

I have to reinstall python?

visual island
#

no

silent ermine
visual island
#

just the git

#

it will surely be useful in the future for you (and for now ig)

rare saddle
#

thanks

silent ermine
#

Is there a way to variable Discord buttons? Like

button1 = Button(style=ButtonStyle.blue, label=":yawning_face:"),?

visual island
#

yea, but remove the last ,

silent ermine
silent ermine
rare saddle
#

@visual island

visual island
visual island
#

not None and not empty string

rare saddle
silent ermine
#

wait

#

ignore what i said

visual island
#

ah yea, None is actually possible too

silent ermine
visual island
visual island
silent ermine
visual island
#

!d discord.TextChannel.create_thread

unkempt canyonBOT
#

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.
visual island
#

message is Optional

silent ermine
slate swan
#

is this how you would do a custom decorator with async

async def a():
    async def b():
        ...
visual island
#

can you?

#

Ill try

slate swan
#

i think so

magic ore
#

the outer function wouldn't be async

slate swan
#

thought so

#

alr thank you

rare saddle
visual island
#

or just message = message is enough

rare saddle
visual island
#

the message should be in that channel ig

rare saddle
visual island
#

send the content to the channel, then create thread with that message

visual island
#

no, pass message kwarg to be msg or discord.Object(msg.id)

rare saddle
visual island
#

no worries CH_ThumbsUpSmile

heavy folio
#

eh i know this isnt related to dpy but how can i get this type of greentext

slate swan
#

I only get that in a str๐Ÿšถ

#

Like in my ide

heavy folio
#

nah i mean using discord's codeblock

slate swan
#

Oh

#

Well idk

visual island
#
<title>

</title>
heavy folio
#

hmm that's not the one tho

#

im trying to use codeblock with colors for my help command

heavy folio
#

e.g. ```
Subcommands
sub1 - First subcommand
sub2 - Second subcommand

visual island
#

cant you just loop through group.commands then do f"{sub.name} - {command.description}"?

#

@heavy folio group.commands

heavy folio
#

yeah

harsh abyss
#

can some body help me with something

visual island
#

ID

#

username may change, ID won't

slate swan
#

How do i load multiple cogs like this?

bot.load_extension("cog","cog0","cog1")
#

Or a for loop?

heavy folio
slate swan
heavy folio
#

also if someone could help ^

silk rock
#

what are cogs

slate swan
# silk rock 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?

slate swan
#

nothin tbh , you can just import the cog class and use add_cog(CogClass)

cobalt jacinth
#

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")
spring verge
#

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

upbeat otter
spring verge
#

@slate swan

#

yes I found one lesgo

jade tartan
#
  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'```
full valley
#

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
jade tartan
#
    if filename.endswith('.py'):
        client.load_extension(f"cogs.{filename[:-3]}")```
upbeat otter
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

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").
full valley
#

thats a loop though

upbeat otter
jade tartan
#

lms

upbeat otter
#

Code?@full valley

full valley
jade tartan
#

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")```
jade tartan
#

i need help

quick gust
#

they asked, send your dir ss

upbeat otter
#

Exactly

quick gust
tiny ibex
#

Is it possible to control spotify from discord?

upbeat otter
tiny ibex
upbeat otter
#

Spotify's services are highly encrypted so...

tiny ibex
upbeat otter
tiny ibex
upbeat otter
upbeat otter
tiny ibex
#

I am just curious how the plugin does that

upbeat otter
tiny ibex
upbeat otter
upbeat otter
analog sparrow
#

most things are quite similar

#

classes are VERY weird compared to python though

cyan nymph
#

hello bot

#

@silk lotus hello

analog sparrow
cyan nymph
#

lol

analog sparrow
#

?

pliant gulch
tiny ibex
#

Still.......

maiden fable
#

what tf happened here

tawdry perch
#

what did not happen here

#

I thought this was off topic first

shadow wraith
#

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

tawdry perch
#

any tracebacks?

shadow wraith
#

i have an on_message event, used @bot.listen() to create it tho

shadow wraith
#

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)
tawdry perch
#

does the commands work?

shadow wraith
#

no.

#

because the bot hasn't started smh, i tried running it

tawdry perch
#

interesting

shadow wraith
#

its been a few mins no on_ready msg

quick gust
shadow wraith
#

:c

#

why my bot no starting, no on_ready msg

#

no error

#

all i just did was click that run button in vsc man

tawdry perch
#

run the bot via terminal

shadow wraith
#

sure

#

but first i am debugging it

#

wait nah doesn't work

tawdry perch
#

python main_file.py, and see if it works

#

oh

shadow wraith
#

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

tawdry perch
#

!pastr

unkempt canyonBOT
#

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.

shadow wraith
#

i finally got a traceback

tawdry perch
#

paste the whole thing to here using pastebin

shadow wraith
tawdry perch
#

never had ssl stuff

shadow wraith
#

โ˜ ๏ธ crap.

visual island
#

^^

shadow wraith
#

ok i did that icy on macos

#

but i still got the ssl certifi issue

shadow wraith
# visual island ^^

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

pine quest
#

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

slate swan
#

i mean first learn basic python

pine quest
#

How do I do that lol

slate swan
unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

slate swan
#

and good command ideas , unlike me

upbeat otter
shadow wraith
#

i know functions tho

#

which covers asynchronouns, never really plan to do much with asyncio

#

except asyncio.sleep โ˜ ๏ธ

spice bluff
#

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

tough lance
#

Pil functions also

coral flame
shadow wraith
#

yeah, aiohttp makes getting images of api's much more easier, like you can work with reddit, etc...

spring verge
#

is there a way to paste unicode emojis using pillow lib python?

marble rampart
#

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'

slim dragon
#

Hey guys, I'm facing a creepy error in my bot code. If anyone know sqlite3 then please DM me...

slate swan
#

How do I set image (embed) from my local file

boreal ravine
marble rampart
marble rampart
#

the bot pfp

tiny ibex
#

WTF

marble rampart
#

yes

tiny ibex
#

How to?

visual island
marble rampart
tiny ibex
#

Can you change about me and name as well?

boreal ravine
visual island
#

about me no

boreal ravine
#

thats self botting

marble rampart
tiny ibex
marble rampart
marble rampart
manic wing
#

!d discord.Client.wait_until_ready

unkempt canyonBOT
#

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.
slate swan
visual island
boreal ravine
#

i thought edit was for the member though

manic wing
#

<3

marble rampart
boreal ravine
#

i dont even think you can edit your bots profile picture in dpy

slate swan
manic wing
#

you can

tiny ibex
slate swan
#

Guys how can I send local image in discord embed

manic wing
tiny ibex
manic wing
#

!embed-file

slate swan
manic wing
#

idk what it was

slate swan
#

!attachment

manic wing
#

yeah something like that

marble rampart
#

thx it works

untold token
boreal ravine
slate swan
#

!d attachment

unkempt canyonBOT
#

Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets.

untold token
#

!localfiles

unkempt canyonBOT
#

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.

tiny ibex
manic wing
boreal ravine
untold token
tiny ibex
boreal ravine
manic wing
untold token
#

It's a command actually

tiny ibex
boreal ravine
#

!tag

unkempt canyonBOT
#
Available tags

โ€ข
ยป args-kwargs
ยป async-await
ยป blocking
ยป botvar
ยป class
ยป classmethod
ยป codeblock
ยป comparison
ยป contribute
ยป customchecks
ยป customcooldown
ยป customhelp
ยป decorators
ยป defaultdict

slate swan
#
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
boreal ravine
#

what

untold token
#

Oh

tiny ibex
#

So I was showing him there is an about me

untold token
#

content=reply, embed=em

#

and use f strings

slate swan
marble rampart
#

what is the time cooldown for changing pfp ?

untold token
manic wing
#

who knows

marble rampart
#

i mean how many can i change in one min?

slate swan
untold token
#

you are not sending an URL

manic wing
untold token
#

it's just an attachment

#

!localfiles

unkempt canyonBOT
#

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.

tiny ibex
#
@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
untold token
#

Read that

marble rampart
tawdry perch
#

are ratelimits for discord API public info?

slate swan
marble rampart
untold token
#

You need pass a File object too

tiny ibex
#

OFC they are public

tawdry perch
#

I have not found them so far so that's why I asked

slate swan
#

ah

tiny ibex
untold token
#

Also why requests

#

it's not asynchronous

tiny ibex
tiny ibex
untold token
#

It's not asynchronous and its blocking, don't use synchronous libraries in asynchronous code

tiny ibex
#

So that should not cause any issue rn

untold token
tiny ibex
untold token
#

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

tiny ibex
#

But for now tell me how to solve this please

tawdry perch
#

wht is the problem

tiny ibex
tawdry perch
#

nothing in it?

tiny ibex
#

Just executes the else:

tawdry perch
#

start debugging it

tiny ibex
#

Didn't find anything

tawdry perch
#

print statements etc and see if the values are what you expect

tawdry perch
#

did you try making request without bot?

tiny ibex
#

It acts like it sent the shit but it actually doesn't

tiny ibex
tawdry perch
#

what was the status code of response, value of response etc

untold token
tiny ibex
slate swan
#

@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)

untold token
#

!e

def func(a, *b):
   print(f"{a}, {b}")

func(1, 2, 3)
unkempt canyonBOT
#

@untold token :white_check_mark: Your eval job has completed with return code 0.

1, (2, 3)
tiny ibex
slate swan
#

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)
slate swan
#

like a list with all the lines and the list keeps getting regenerated

#

wait I am an idiot

untold token
#

For example

tawdry perch
#

@tiny ibex did you print the *args you passed?

untold token
#

!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

tiny ibex
untold token
#

Yes

tiny ibex
untold token
#

And use aiohttp

tiny ibex
untold token
#

Not requests

tiny ibex
#

Any easy way to convert?

#

Without changing the whole code again?

untold token
#

Well, you would need to change it a bit

quick gust
untold token
#

Lemme show you an example

tiny ibex
tiny ibex
untold token
#
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

untold token
#

Oh okay

slate swan
#

can i get help

untold token
#

Ask

slate swan
#

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

tiny ibex
#

BTW @untold token (ctx, *, args) still doesn't work

slate swan
#

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

unkempt canyonBOT
#

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.

slate swan
#

but is a error bro

tiny ibex
untold token
slate swan
tiny ibex
slate swan
#
  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
untold token
#

Reinstall it

slate swan
#

how do I make a function which picks random lines from a txt file and send but the lines are getting doubled

#

huh

slate swan
tiny ibex
tiny ibex
slate swan
# slate swan huh

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

tough lance
untold token
#

Yea

tiny ibex
#

NVM IG I found the issue

slate swan
#

still the same

tiny ibex
#

Sorry @untold token for disturbing

junior terrace
#

im trying to find the bots in my server, i have tried this bot = ctx.guild.members.bot but that doesnt work

untold token
#

Np

tiny ibex
#

Me dumb af

slate swan
#
  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)```
twin moon
#

how do I run the command only if its the owner

untold token
tiny ibex
#
if res['status']=='success':```
When it gives `200` instead of `success`
untold token
#

!d discord.Member.bot

unkempt canyonBOT
#

property bot```
Equivalent to [`User.bot`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.bot "discord.User.bot")
untold token
#

!d discord.ext.commands.is_owner

unkempt canyonBOT
#

@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").
slate swan
heavy folio
#

^^^

slate swan
junior terrace
# unkempt canyon

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")

untold token
#

Wtf

junior terrace
#

idk :(

untold token
#

No

#

That's entirely wrong

junior terrace
#

hmm

untold token
#

You should learn basic python

junior terrace
#

you don't know how much i know that

#

but i dont fucking have time

tiny ibex
#

@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.")```
untold token
#
for member in ctx.guild.members.
        if member.bot:
           ...  # your code here
slate swan
#

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)

untold token
#

@junior terrace that's how you would loop

slate swan
untold token
slate swan
#

hm

#

i have a bot.listen(),bot.event and 2 bot.command in the py file

tiny ibex
untold token
#

Hmm

tiny ibex
junior terrace
#

but how actually count them

untold token
#

Well the code is working, you are not getting the lyrics

untold token
slate swan
untold token
#

What I just said

tiny ibex
untold token
#

Try removing the +

tiny ibex
untold token
#

Don't replace it

#

Just try it

tiny ibex
untold token
#

Yes

tiny ibex
#

That's not a valid link

#

WTF

untold token
#

What

tiny ibex
#

Invalid link

quick gust
tiny ibex
slate swan
untold token
#

Oh you are passing it as an url

#

Then it's an issue with the API itself

tiny ibex
#

Visit it yourself if you think it's issue with the API

untold token
#

Hmm

quick gust
#

manual request works

quick gust
tiny ibex
quick gust
#

...

tiny ibex
#

OFC it is legal

untold token
#

Works for me too yes

slate swan
#

free premium dude

tiny ibex
tiny ibex
tough lance
#

There are tons of

untold token
tough lance
#

Use aiohttp

untold token
#

What's the status code

tiny ibex
untold token
tiny ibex
untold token
tiny ibex
junior terrace
#
    for member in ctx.guild.members:
        if member.bot:
            await ctx.send(len([member]))
            break``` @untold token
quick gust
untold token
#

yeah res.status

slate swan
#
  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
untold token
#

no it would be r.status

#

not res

quick gust
#

whatever they are using yeah

#

r.status

tiny ibex
quick gust
#

can u try what I said though?

untold token
#

Just try it lol

tiny ibex
untold token
#

You seriously need to learn basic python

junior terrace
#

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
quick gust
#

because you are breaking??

junior terrace
#

oh

quick gust
#

no I'm not sure that's why I added a ?

slate swan
# tough lance ```py from discord.ext import tasks ```

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)

manic wing
#

the way he just says โ€˜ohโ€™ xD

tough lance
slate swan
#

i did it

untold token
#

Lol

slate swan
tiny ibex
# quick gust can u try what I said though?
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'
tough lance
quick gust
#

try res.status

#

if it doesn't work, i have no clue

dapper cobalt
quick gust
tiny ibex
quick gust
dapper cobalt
quick gust
#

ยฏ\_(ใƒ„)_/ยฏ

tiny ibex
# quick gust try res.status
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'```
quick gust
#

yeah nvm

untold token
#

res a dict yes

tiny ibex
dapper cobalt
#

Try res["status"] since it's a dict.

slate swan
# tough lance Update
  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
tiny ibex
#

OFC it is

tiny ibex
untold token
#

Print it

quick gust
#

the did try that

heavy folio
#

^

untold token
#

See what you get

tiny ibex
tiny ibex
#

@dapper cobalt

slate swan
tough lance
untold token
#

Hmmm it's a success

tiny ibex
tiny ibex
quick gust
#

it should work this is so weird

tiny ibex
untold token
#

What's the type of the response, a string?

unkempt canyonBOT
untold token
#

Or an int

untold token
#

See its type

tiny ibex
#
{"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

untold token
#

LOL

slate swan
heavy folio
#

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)

tiny ibex
west shuttle
#

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

raven gust
#

Are you using psycopg2?

tiny ibex
#

WTF

earnest ferry
#

tell me code of a bot full code

slate swan
tiny ibex
tiny ibex
untold token
#

Lmao

tiny ibex
#

Me dumb af

slate swan
west shuttle
#

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

tough lance
#

Use indexing

west shuttle
tough lance
#

list[0][0]

slate swan
#

so what should i do to make my bot working

west shuttle
slate swan
#

cuz of the error my bot cannot be online

dapper cobalt
brittle jay
#

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.
tough lance
brittle jay
dapper cobalt
#

Did you copy that code?

brittle jay
manic wing
#

,*args

dapper cobalt
#

Remove that, and typehint channel as discord.TextChannel.

tawdry perch
#

What is the use of passing parameter *args?

#

For multiple values ?

manic wing
#

packs it

tawdry perch
#

I see

velvet tinsel
#

Hi

tawdry perch
manic wing
brittle jay
manic wing
#

someone helps: Uh no,

velvet tinsel
#

someone helps: who asked

manic wing
#

its not woking in the way you want it to

heavy folio
#

!d discord.ext.commands.Greedy

unkempt canyonBOT
#

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`...
heavy folio
prisma spoke
#
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```
brittle jay
tiny ibex
velvet tinsel
#

Greedy ๐Ÿ˜ณ

cinder horizon
#

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

manic wing
#

wdym by follow?

#

as in, they get a role with @announcements?

velvet tinsel
#

Yeah

#

I think they get a ping each time there is a new announcement

#

Or something ๐Ÿ˜

barren oxide
#

hi

maiden fable
#

๐Ÿ‘‹

barren oxide
#

how to code in python

maiden fable
unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

barren oxide
#

thx

upbeat otter
maiden fable
#

@heavy folio bot.get_command(...).name

barren oxide
#

~ok~

heavy folio
#

oh

maiden fable
#

U need a commands.Command object tho

upbeat otter
heavy folio
#

so just loop throuth it?

maiden fable
#

Wym

barren oxide
#

ok

maiden fable
#

u can do

for cmd in bot.commands:
    print(cmd.name) 
barren oxide
#

!recources

maiden fable
#

resources*

heavy folio
#

hmm

barren oxide
#

!resources

#

it has privacy error

maiden fable
#

???

barren oxide
#

i cant open it

#

privacy error

slate swan
#
  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
tiny ibex
slate swan
heavy folio
# maiden fable u can do ```py for cmd in bot.commands: print(cmd.name) ```
        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

valid barn
#

when i try to run my code this error shows :(

boreal ravine
#

just wait 1~ hour

valid barn
craggy cloak
#

Why is icon_url=ctx.author.avatar_url not working anymore in my embed commands?

faint monolith
#

Help we how to import this salt(pynacl) for voice support in my bot.

placid belfry
#

in the terminal

faint monolith
#

I installed that

#

Both in heroku and my system

placid belfry
#

import pynacl

#

in code?

faint monolith
#

It didn't work

twin moon
#

how do I make a string like this
"idk"
to
idk

manic wing
#

what?

manic wing
#

!e print('"idk"'.replace('"', ''))

unkempt canyonBOT
#

@manic wing :white_check_mark: Your eval job has completed with return code 0.

idk
heavy folio
#

what

craggy cloak
# heavy folio what isnt working

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

twin moon
craggy cloak
#

1.7.3

manic wing
#

prob because you have a shit error handler

twin moon
#

for nextcord

heavy folio
#

they're not on nextcord

#

which part of their sentence told you theyre on nextcord

heavy folio
#

you have any global error handlers?

sinful pasture
#
@client.command()
AttributeError: 'Client' object has no attribute 'command'

why :c

twin moon
sinful pasture
#

discord.Client

heavy folio
#

that doesnt tell us anything

twin moon
sinful pasture
#
client = discord.Client()
twin moon
sinful pasture
#

kk

heavy folio
#

also naming it client isnt a good var name cheems

sinful pasture
#

:0

heavy folio
#

use bot

sinful pasture
#

alr

twin moon
#
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```

twin moon
heavy folio
maiden fable
boreal ravine
# twin moon ?

you set it using the equal sign, the same way you make a var, you dont call it (discord.Embed.title returns a string)

maiden fable
#

It's a property, not a method ^^^

slate swan
#

why would someone try hyperlinking the text in titles with [text](url) tho

maiden fable
#

This is what kayle means

maiden fable
boreal ravine
#

@twin moon just do ```py
embed.title = ...

maiden fable
heavy folio
#

eh get back to you in awhile

maiden fable
#

Sure

dire folio
#

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
slate swan
maiden fable
dire folio
#

the thing is i didn't change anything and it worked a minute before this error

boreal ravine
#

second field value is empty

boreal ravine
dire folio
#

no

boreal ravine
#

what does the field value contain then

tacit horizon
#
if ctx.author.id == 499973767846428694 or 799560804864229416:
``` ''or'' will work ?
dire folio
#

its just an item from a list

#

maybe the bot glitched and it just didn't pick up my msg

#

thats my best guess

boreal ravine
unkempt canyonBOT
#

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.")
dire folio
boreal ravine
tacit horizon
visual island
boreal ravine
visual island
#

!e
id = 10
print(id == 11 or 12)

unkempt canyonBOT
#

@visual island :white_check_mark: Your eval job has completed with return code 0.

12
tacit horizon
#
if ctx.author.id in (499973767846428694 ):
```this is ok ?
visual island
#

oops

#

!e
id = 10
print(bool(id == 11 or 12))

unkempt canyonBOT
#

@visual island :white_check_mark: Your eval job has completed with return code 0.

True
visual island
#

there

tacit horizon
#

Ya thx !

obsidian ledge
#

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)
tacit horizon
#

@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
tacit horizon
#

LOL

drifting arrow
#

Is there a way to limit the embed field to only 2 columns?

drifting arrow
#

Aight

#

@gaunt ice how? XD

slate swan
#

its a required argument that you must pass

drifting arrow
velvet tinsel
#

Ok

#

Wdym two columns?

drifting arrow
#

I want "Servername" to be inline with "Played Time"
and only have 2 columns

twin moon
velvet tinsel
#

Which server name

drifting arrow
#

All of them lol

velvet tinsel
#

What

#

Ok

drifting arrow
#

this is what I want it to look like without the tests.

velvet tinsel
#

Alright

#

Show the code please

drifting arrow
#

!paste

velvet tinsel
#

Use hastebin

velvet tinsel
#

So you want a random pic?

twin moon
drifting arrow
twin moon
heavy folio
velvet tinsel
#

Well @drifting arrow you can try to have the server name and then have a few \n and then write the played time there

velvet tinsel
maiden fable
heavy folio
heavy folio
#

just dont wanna have command signature since it makes the help command messy

maiden fable
#

What's filtered

twin moon
heavy folio
#

oh yeah

#

sec

velvet tinsel
#

?

#

Wht

maiden fable
#

@twin moon just use the JSON API

velvet tinsel
#

Hunterโ€™s smart

maiden fable
#

ยฏ_(ใƒ„)_/ยฏ

heavy folio
# maiden fable What's filtered
[<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

maiden fable
#

U already have the command objects

twin moon
heavy folio
#

oh

maiden fable
#

Understand now?

heavy folio
#

got it

maiden fable
#

Haha cool

heavy folio
#

also when i do .help help it shows this weird stuff

maiden fable
twin moon
#

HOW DO A I GET THE POST URL WITH THE REDDIT JSON API

velvet tinsel
#

Chill

maiden fable
#

!d discord.ext.commands.HelpCommand.attrs

heavy folio
#

oh

velvet tinsel
maiden fable
#

Just set a description

#

Welp

maiden fable
maiden fable
velvet tinsel
#

Idk, 20, 30 mins ago?

#

It was working fine before it returned with an error

maiden fable
#

Do the mods know about it?

velvet tinsel
#

Sir Lancelot wasnโ€™t feeling very well

maiden fable
#

What error tho?

maiden fable
heavy folio
velvet tinsel
#

I knew it when he took about 10 seconds to respond

velvet tinsel
#

Idk maybe itโ€™s Linodeโ€™s problem

twin moon
velvet tinsel
heavy folio
twin moon
maiden fable
velvet tinsel
#

Donโ€™t be mean to hunter

twin moon
twin moon
velvet tinsel
#

Chill

maiden fable
#

Didn't I just tell u...

#

Just prefix /.json and boom

#

U get the JSON dicts of the webpage

heavy folio
slate swan
#

@twin moon Please be respectful here. You can read our code of conduct here #code-of-conduct

maiden fable
twin moon
# maiden fable Me?

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

heavy folio
twin moon
heavy folio
#

stop your shit post here

twin moon
heavy folio
maiden fable
heavy folio
#

oh

maiden fable
#

And stuff

heavy folio
#

alr thanks

maiden fable
#

It takes all the kwargs a command takes

heavy folio
#

thanks

shadow wraith
#

what's the error name for when a command is used in dms

twin moon
slate swan
heavy folio
#

nvm

maiden fable
twin moon
slate swan
#

u can use any reddit

#

its just from my autonsfw bot

twin moon
#

uhh

#

okkkkkkkkkkkk

lapis jacinth
#

Hi

maiden fable
#

๐Ÿ‘‹

lapis jacinth
#

I Like Python pixels_snek_2

heavy folio
#

@maiden fable after i added command_attrs, the help command is gone

lapis jacinth
#

How About You ?

heavy folio
#

not sure what went wrong

heavy folio
twin moon
slate swan
#

huh

#

reddit yes

heavy folio
#
class MyHelp(commands.MinimalHelpCommand):
    def __init__(self):
        super().__init__()
        self.command_attrs = {"description": "Shows the help command for the bot."}
        self.show_hidden = False
twin moon
lapis jacinth
#

How About Django or Selenium or ...
? python

twin moon
maiden fable
#

Try removing that line and just print command_attrs

slate swan
#

u need the api

maiden fable
twin moon
maiden fable
#

๐Ÿ˜๐Ÿ˜ถ

slate swan
#

u need that

maiden fable
#

Ahem u should delete the code ngl

slate swan
#

why

maiden fable
#

NSFW

twin moon
maiden fable
#

(:

slate swan
maiden fable
slate swan
#

but I mean its not really nsfw

maiden fable
#

And why did u even post it? U need help with it?

slate swan
#

it was for @twin moon

maiden fable
#

O

heavy folio
#
{'name': 'help', 'help': 'Shows this message'}
#

eh i find it weird tbh

#

that's the default description ig

slate swan
#

hunter what ai module ur using for ur bot

maiden fable
#

Yea it is

twin moon
maiden fable
maiden fable
slate swan
#

shouldn't have a problem with that if ur bot is sfw reddit

slate swan
maiden fable
#

(:

heavy folio
#

also hunter i use group.callback.__doc__ and command.callback.__doc__, does it affect?

twin moon
slate swan
#

huh

twin moon
slate swan
#

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

twin moon
#

I want to make a link to the post and not .jpg

slate swan
#

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

ruby lion
#

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...???

twin moon
slate swan
#

ah

#

change to read only

twin moon
#

how?

slate swan
#

reddit.read_only = True

#

use that variable

twin moon
slate swan
#

in the start

ruby lion
twin moon
slate swan
#

huh

slate swan
twin moon
slate swan
#

show the code and error

twin moon
slate swan
#

uh

#

so it does work?

twin moon
# slate swan uh
@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
slate swan
#

is subreddit defined?

#

nvm

twin moon
#

oh

slate swan
#

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

heavy folio
#

cuz i prefer using doc string

maiden fable
#

U know... command.description first checks if a docstring is set iirc

heavy folio
#

nope

#

it returns a none type if i use command.description

maiden fable
#

Hmm

#

Then it happens only in disnake

#

what about command.help?

heavy folio
#

all my commands are literally like this: ```py
@command
async def _command(self, ctx):
"""Description"""

#

oh

maiden fable
#

I think command.help is the docstring

#

Iirc

heavy folio
#

what about for cogs

maiden fable
#

Same for cogs iirc

heavy folio
#

hmm

#

oh yeah i need help with send_cog_help as well

maiden fable
#

Sure haha

slate swan
#

!d discord.ext.commands.Command.short_doc

unkempt canyonBOT
#

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.
maiden fable
#

Oh, hmm

heavy folio
#

hmm i tried command.help, it still doesnt show the description i set (for .help)

maiden fable
#

!e

def c():
    """Hi"""
    pass
help(c)
unkempt canyonBOT
#

@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
maiden fable
#

Tf

slate swan
#

imagine a default python function not working

maiden fable
#

Yes

#

!e print(help(pass))

unkempt canyonBOT
#

@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
maiden fable
#

Hmmm

heavy folio
#

@maiden fable changed it self.command_attrs = {"name": "help", "help": "Shows the help command for the bot."}

#

from key "description" to "help" allgood

maiden fable
#

Okay

heavy folio
#

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)
slate swan
heavy folio
#

got that fixed ||i prefer using doc string instead of the kwargs in the deco||

slate swan
#

ah great ||they are different things tho||

slate swan
#

so its .help Misc

heavy folio
#

oh

#

what's the diff beteen description and help kwarg tho

visual island
heavy folio
#

oh yeah

visual island
#

I think thats the main difference

heavy folio
#

ohh

velvet tinsel
#

Hi

slate swan
#

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

shadow wraith
#

nice ||sarthak wdym """ strings are cooler||

slate swan
#

" is way faster to use than '

prisma spoke
#
        rr = [for i in range(0,robauthordata)]
        robfinee = random.choices(rr)``` syntax error
slate swan
#

u can click shift + 2 for "

#

but u need to go way across the keyboard for '

#

(atleast on finnish layout)

shadow wraith
#

' and " are the same key โ˜ ๏ธ

#

on qwerty layout

slate swan
#

on finnish layout its between รค and enter

slate swan
shadow wraith
#

i use some-random-api with aiohttp, aiohttp too ez โ˜ ๏ธ

#

and it can work with discord bots so jackpot