#discord-bots

1 messages Β· Page 534 of 1

final iron
#

I won't be getting an issues if I use display_avatar right

pale zenith
#

nope

#

for a user-info you could also display both rooPog

final iron
#

Tbh I don't really want to do that

#

Im just going to go with the discord pfp

pale zenith
#

fair enough lol

pliant compass
#

I was making my Discord bot when I got this:

discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being rate limited.
```I think that its because I have just been turning my bot on and off heaps when debugging. Is it anything to worry about?
final iron
#

And im already done refactoring

#

I love pycharm

grave abyss
#

so contact discord about your bot

#

someone must of have reported it

#

πŸ‘

pliant compass
slate swan
#

orr if your using replit it change your replit name and use a vpn

#

or just use a vpn in general

pliant compass
grave abyss
outer basalt
#
    async def send_log(self, webhook, embeds, bot):
        print("Send logs", embeds)
        to_send = discord.Webhook.from_url(webhook, session=bot.session, bot_token=bot.http.token)
        await to_send.send(embeds=embeds, username=f"LogRack Logging", avatar_url=bot.user.avatar.url)
Send logs [<discord.embeds.Embed object at 0x0635D8E0>, <discord.embeds.Embed object at 0x0635DA00>]

but this is only sending first embed and not the second

final iron
#

What is the code for embeds

final iron
#

Not for documentation

#

I know how to make an embed

gray viper
#

😭 i was trying to be helpful

#

sorry i guess

final iron
#

Not trying to be demeaning

#

Sorry if I sounded that way

outer basalt
#

wdym

slate swan
final iron
#

embeds is defined. What is the code for it?

outer basalt
#

    async def send_log(self, webhook, embeds, bot):
        print("Send logs", embeds)
        to_send = discord.Webhook.from_url(webhook, session=bot.session, bot_token=bot.http.token)
        await to_send.send(embeds=embeds, username=f"LogRack Logging", avatar_url=bot.user.avatar.url)

    @tasks.loop(seconds=5)
    async def send_webhooks(self):
        async with self.batch_lock:
            if self.logging_batch:
                for webhook, embeds in self.logging_batch.items():
                    if embeds:
                        first_ten = embeds[:10]
                        
                        try:
                            self.bot.loop.create_task(self.send_log(webhook, first_ten, self.bot))
>>> Send logs [<discord.embeds.Embed object at 0x0635D8E0>, <discord.embeds.Embed object at 0x0635DA00>]
``` it prints this (2 embeds) but only send 1st one
final iron
#

Trolling is not funny

gray viper
#

πŸ€“

boreal ravine
#

bruh

#

theres no event called on_guild_event

#

makes sense why it didnt send

patent surge
#

How to add buttons like this

boreal ravine
dapper cobalt
unkempt canyonBOT
lament flower
dapper cobalt
#

What do you mean "are allowed"?

boreal ravine
lament flower
dapper cobalt
#

They are just extensions, but also their use is what decides whether they're okay to use. You cannot use a 3rd party library that supports self-botting and say it's just an extension so it's allowed, no.

boreal ravine
#

do u get

#

what libraries are

#

an an application

dapper cobalt
lament flower
#

gotcha

lament flower
#

didnt know libraries that allow alterations to the client didnt count for that

boreal ravine
#

what client?

lament flower
#

the discord client itself

boreal ravine
#

your not altering anything

lament flower
#

those buttons arent native to the client though right?

boreal ravine
#

they are

lament flower
#

oh mb

boreal ravine
#

check the api

boreal ravine
sick birch
#

though it's in beta

#

works pretty well with minimal bugs, just my experience though yours might differ

boreal osprey
pliant compass
boreal osprey
boreal ravine
#

hm

final iron
#

Is there any point of using ctx: commands.Context instead of using just ctx?

boreal osprey
#
@bot.event
async def on_message(message):
    badword = ["fuck", "shit"]
    if badword in message.content:
        await message.delete()
    await bot.process_commands(message) 
boreal ravine
final iron
#

Its shown in the discord.py button documentation so im not sure

boreal ravine
#

Its optional

#

I think

#

πŸ‘

boreal osprey
#

hmm

patent surge
#

ok thanks guys

boreal osprey
boreal ravine
#

@boreal osprey try using the any() function in the if statement

#

hm

patent surge
boreal ravine
patent surge
boreal ravine
patent surge
odd walrus
#

should be working no? weird

dapper cobalt
odd walrus
#

yea that shouldnt work

dapper cobalt
#
for word in badword:
  if word in message.content:
    ...
boreal osprey
odd walrus
#

dafuq

dapper cobalt
#

Try to say a longer sentence that includes an item from badword list.

#

Say "this shit" and see if it does anything.

boreal osprey
boreal osprey
#

Ye i did

covert igloo
#

@dapper cobalt how do you use dislash in a cog

#

is it the same

gloomy coral
#

how to add a cooldown to this slash command

#
@cog_ext.cog_slash(name="support", description="Gives you link for support server")
    async def _support(self, ctx:SlashContext):
        embed = discord.Embed(title="Support Server",
                              description="To visit our support server, click [here](link).\nNow you can see the latest updates!!",
                              color=discord.Color.random())
        embed.set_footer(text=f"Support Server requested by {ctx.author.name}")
        embed.set_thumbnail(url=ctx.author.avatar_url)
        await ctx.send(embed=embed)```
covert igloo
#

if a button is clicked

dapper cobalt
unkempt canyonBOT
#

Hey @naive vine!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

gloomy coral
#

welp

#

basically it runs but shows error.....

tranquil moss
#

how do you delete a message. I want to delete the users message

Current code:

    async def ping_command(self, ctx):
        start = d.timestamp(d.now())
        msg = await ctx.send(content='Pinging')
        await msg.edit(content=f'Ping: {(d.timestamp(d.now())-start) * 1000}ms.', delete_after=5)
        return
unkempt canyonBOT
#
Huh? No.

No documentation found for the requested symbol.

boreal ravine
#

hm

#

it's message.delete() lol couldn't find the documentation about it

covert igloo
#

!d discord.Message.delete

unkempt canyonBOT
#

await delete(*, delay=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Deletes the message.

Your own messages could be deleted without any proper permissions. However to delete other people’s messages, you need the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission.

Changed in version 1.1: Added the new `delay` keyword-only parameter.
covert igloo
boreal ravine
lilac latch
#

How to take a channel as an input?

boreal ravine
lilac latch
boreal ravine
lilac latch
tranquil moss
# unkempt canyon

could i add that to the origin code like this:

    async def ping_command(self, ctx):
        start = d.timestamp(d.now())
        msg = await ctx.send(content='Pinging')
        await delete(*, delay=None)
        await msg.edit(content=f'Ping: {(d.timestamp(d.now())-start) * 1000}ms.', delete_after=5)
        return

also does a variable replace the * or do you just keep it

visual island
#

await msg.delete() just do that

tranquil moss
visual island
#

await ctx.message.delete()then

tranquil moss
#

that works thanks

lilac latch
# boreal ravine `def a(arg1: discord.TextChannel)` ig
    if disnake.TextChannel is None:
        try:
            vc = ctx.author.voice.channel.id
            link = await together_control.create_link(vc, 'chess')
            await ctx.send(f"Click the link πŸ‘‡\n{link}")
        except:
            await ctx.send("Please join a VC or tag a channel and try again:smile:")
    else:
        vc = disnake.TextChannel.id
        link = await together_control.create_link(vc, 'chess')
        await ctx.send(f"Click the link πŸ‘‡\n{link}")```
#

Is that correct??

lilac latch
# boreal ravine ye ig
    async def testchess(ctx, disnake.TextChannel = None):
                                    ^
SyntaxError: invalid syntax```
boreal ravine
#

shouldn't be invalid

#

IDE problem?

lilac latch
boreal ravine
#

what IDE u using

lilac latch
boreal ravine
#

no

#

what IDE are you using right now for that command?

boreal ravine
#

then its a replit problem

lilac latch
#

Ran on VScode still the same

boreal ravine
#

idk then

lilac latch
boreal ravine
#

??

#

k

dapper cobalt
lilac latch
# dapper cobalt `channel:disnake.TextChannel`
@commands.cooldown(1,900,commands.BucketType.user)
async def testchess(ctx, channel:disnake.VoiceChannel = None):
    if disnake.VoiceChannel is None:
        try:
            vc = ctx.author.voice.channel.id
            link = await together_control.create_link(vc, 'chess')
            await ctx.send(f"Click the link πŸ‘‡\n{link}")
        except:
            await ctx.send("Please join a VC or tag a channel and try again:smile:")
    else:
        vc = disnake.VoiceChannel.id
        link = await together_control.create_link(vc, 'chess')
        await ctx.send(f"Click the link πŸ‘‡\n{link}")```
#

Huh?

dapper cobalt
#

Use channel not disnake.VoiceChannel.

lilac latch
dapper cobalt
#
@Yui.command()
@commands.cooldown(1,900,commands.BucketType.user)
async def testchess(ctx, channel:disnake.VoiceChannel = None):
    if not channel:
        try:
            vc = ctx.author.voice.channel.id
            link = await together_control.create_link(vc, 'chess')
            await ctx.send(f"Click the link πŸ‘‡\n{link}")
        except:
            await ctx.send("Please join a VC or tag a channel and try again:smile:")
    else:
        vc = disnake.VoiceChannel.id
        link = await together_control.create_link(vc, 'chess')
        await ctx.send(f"Click the link πŸ‘‡\n{link}")
lilac latch
#

Oh ok

#

Lemme check

dapper cobalt
#

But you cannot pass the object itself.

lilac latch
#

Huh?

dapper cobalt
#

Can you show the full traceback?

boreal ravine
#

or that ^

dapper cobalt
#

Ah wait.

#

vc = channel.id as kayle said.

boreal ravine
#

hm

lilac latch
# boreal ravine or that ^
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/disnake/client.py", line 483, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 58, in on_command_error
    raise(error)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/disnake/ext/commands/bot_base.py", line 547, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/disnake/ext/commands/core.py", line 901, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/disnake/ext/commands/core.py", line 180, in wrapped
    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'voiceChannelID' argument MUST be of type string or integer, not a "member_descriptor" type.```
dapper cobalt
lilac latch
# dapper cobalt <:this:470903994118832130>
@commands.cooldown(1,900,commands.BucketType.user)
async def testchess(ctx, channel:disnake.VoiceChannel = None):
    if not channel:
        try:
            vc = ctx.author.voice.channel.id
            link = await together_control.create_link(vc, 'chess')
            await ctx.send(f"Click the link πŸ‘‡\n{link}")
        except:
            await ctx.send("Please join a VC or tag a channel and try again:smile:")
    else:
        vc = channel.id
        link = await together_control.create_link(vc, 'chess')
        await ctx.send(f"Click the link πŸ‘‡\n{link}")```
#

Huh?

#

@boreal ravine or @dapper cobalt ?

dapper cobalt
#

What?

lilac latch
dapper cobalt
#

Try and see.

slate swan
#

is there a way to get random guilds

#

the bot is in??

boreal ravine
#

!d discord.ext.commands.Bot.guilds

unkempt canyonBOT
boreal ravine
#

you can use the random module to randomize that ^

slate swan
lilac latch
boreal ravine
slate swan
#

aight

slate swan
#

How can i enter a token from the python shell and run the token?with input?

boreal ravine
slate swan
boreal ravine
lilac latch
#

How do I send a DM?

manic wing
unkempt canyonBOT
#

await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
manic wing
#

its the same as ctx.send but just member.send

#

where member is an instance of discord.Member (can be found like ctx.author or guild.get_member)

lilac latch
#
await user.send(message)```
#

It doesn't work?

manic wing
manic wing
boreal ravine
#

try getting the user by guild

lilac latch
boreal ravine
lilac latch
manic wing
manic wing
manic wing
#

and if you entered a valid ID, then there is no point trying to get the user, because you wont be able to send a message to them

slate swan
#

Intents

boreal ravine
slate swan
#

Member intents and that too

boreal ravine
#

hm

manic wing
#

I don’t get the idea you’re helping

slate swan
boreal ravine
slate swan
manic wing
slate swan
#

Β―\_(ツ)_/Β―

lilac latch
#

I am sorry my wifi died

manic wing
lilac latch
#

And I don't think you need any other intents instead of default ones

manic wing
# lilac latch And I don't think you need any other intents instead of default ones
In[3438]: 2 discord.User
Out[3438]: ['__abstractmethods__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', '_abc_impl', '_copy', '_get_channel', '_public_flags', '_state', '_to_minimal_user_json', '_update', 'avatar', 'avatar_url', 'avatar_url_as', 'block', 'bot', 'color', 'colour', 'create_dm', 'created_at', 'default_avatar', 'default_avatar_url', 'discriminator', 'display_name', 'dm_channel', 'fetch_message', 'history', 'id', 'is_avatar_animated', 'is_blocked', 'is_friend', 'mention', 'mentioned_in', 'mutual_friends', 'mutual_guilds', 'name', 'permissions_in', 'pins', 'profile', 'public_flags', 'relationship', 'remove_friend', 'send', 'send_friend_request', 'system', 'trigger_typing', 'typing', 'unblock']

manic wing
#

its not failing on the send, its failing on the fact you have incorrectly used the get_user, and resulted in None.
a) your bot doesnt share a guild with the user
b) the user is not in your bots cache
c) the intents are incorrect
d) invalid id

boreal ravine
#

to get a member

manic wing
#

why dont you just use intents.all()

boreal ravine
#

^ intents = discord.Intents.all()

lilac latch
#

Or is it

boreal ravine
#

is it?

lilac latch
#

It's not after I edited the code

#

πŸ˜…

boreal ravine
#

what

manic wing
lilac latch
# boreal ravine what
bitly_key = config.get('bitly_key')
Yui = commands.Bot(command_prefix = prefix, test_guilds=[811634680302010449], intents = intents)```
#

What's wrong??

#

πŸ˜‘

lilac latch
#

TY it works

boreal ravine
#

ok

slate swan
#

And please follow Python's naming conventions

gloomy coral
slate swan
#

Maybe provide your code?

#

We can't really guess

#

You probably didn't acknowledged the interaction

gloomy quest
#

is anything OK?

#

wait a sec

#

wrong channel

unkempt canyonBOT
#

Hey @silk goblet!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

#

Hey @silk goblet!

It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

silk goblet
#

why doesnt this work?

#

i know its erman, sry, but the parameter should be able to read for you

tawdry perch
#

Can you tell what is being wrong?

#

And is it all for this code?

#

If you don't use event for it, then that is why

slate swan
#

And please copy paste the code somewhere, as this is woudl be way easier for us to read your code

#

!paste

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.

willow vine
#

when i run my code locally, its working fine, but when i deploy it on heroku it throws a file not found error

#

why is that

brave flint
#

@client.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member : discord.Member, *, reason = None):
await member.ban(reason = reason)

#

When i run that it show error

#

What is the problem?, I run at pycharm newest with discord.py newest version

willow vine
#

whats the error

brave flint
#

wait i check

#

Commands.has_permissions is not defined

brave flint
slate swan
#

hello guys, pls tale me how how to make sure that the person who registered the command could not press the buttons?

boreal ravine
boreal ravine
slate swan
#

how to register a new command programatically

#

You don't

#

how do I do it when I require it?

#

You use the library

#

nono

#

I mean

#

How do I fetch channels?

So I want to delete voice channels with certain name for example

if channel starts with voice, delete channel

#

I want to be able to let the user be able to make new commands

slate swan
#

You can't register a command like you want

slate swan
brave flint
# boreal ravine Show full error

line 26, in <module> structure
tructure
Structure

@bot_has_permission (ban_members = True)

NameError:

name 'bot_has_permission' is not defined
'bot_has_permission' is not defined
'bot_has_permission' is not defined

slate swan
slate swan
cloud dawn
slate swan
boreal ravine
slate swan
slate swan
brave flint
boreal ravine
# slate swan what?

Add a check to the command to see if the user who clicked the button is the author. I don't know how to do that though

cloud dawn
#

Saying what module you are using helps quite a bit aswell.

slate swan
#

How do I fetch channels?

So I want to delete voice channels with certain name for example

if channel starts with vc, delete that channel

heavy folio
#

dpy 2.0, anyone knows how to create a button, i dont understand how even after reading the docs

cloud dawn
slate swan
slate swan
boreal ravine
slate swan
cloud dawn
slate swan
heavy folio
#

ah ty

boreal ravine
slate swan
#

discord_components

boreal ravine
slate swan
#

Okay so my bot has a Auto Voice creation so if you join a voice, It will make another voice, And sometimes it doesn't delete it because the bot is offline, So when I turn on my bot I want to delete the left over voice channels, So the program should be like this,

for voice in guild:
  if voice.startswith("VC"):
    await voice.channel.delete

But I don't know how to do this...

boreal ravine
#

😐

heavy folio
slate swan
cloud dawn
heavy folio
boreal ravine
heavy folio
#

ohh alright

slate swan
heavy folio
#

no

#

im using dpy 2

slate swan
#

why?

slate swan
#

fuck forgot the buttons

heavy folio
#

whats view

cloud dawn
slate swan
#

there

slate swan
slate swan
#

an Item can be a Button or a SelectMenu

cloud dawn
slate swan
#

you can either subclass on of those items and then add them to the view, or you can just add them in the view using the decorator

heavy folio
#

or its basically a @bot.command()

slate swan
slate swan
merry sleet
#

WELL... DISCORD.PY WILL DIE.. SO CAN SOMEONE ELSE HELP WITH WHAT LIBRARY I SHOULD USE? ALSO MY CAPS LOCK IS BROKEN SOOO I DO NOT WANT TO TYPE IN CAPS BUT... IT IS STUCK...

merry sleet
#

OK THANKS A LOT!

slate swan
#

yw

merry sleet
#

AND WHAT ABOUT HIKARI?

slate swan
#

never tried hikari but it should be good too

#

although the syntax and everything is different from dpy or dpy forks

cloud dawn
brave flint
#

@bot.has_permission(ban_members = True)
AttributeError: 'Bot' object has no attribute 'has_permission'
any tips?

slate swan
#

yw

brave flint
#

that is what i got

slate swan
#

Await allowed only within async function...

cloud dawn
heavy folio
slate swan
#

ends with a s

slate swan
slate swan
heavy folio
heavy folio
cloud dawn
slate swan
heavy folio
#

oh

slate swan
cloud dawn
#

less popular == less support

slate swan
#

just because it's less popular doesn't always mean less support

cloud dawn
#

Optional is indeed a nice touch.

slate swan
#

ikr

boreal ravine
brave flint
slate swan
#

the disnake devs are always helping people with their lib daily and so are some of the people that are in there and have some experience with the lib

cloud dawn
slate swan
#

^

boreal ravine
#

disnake still .url right?

cloud dawn
slate swan
boreal ravine
#

@slate swan whats the difference between dislash & disnake?

cloud dawn
slate swan
#

dislash is a 3rd party lib while disnake isn't

cloud dawn
slate swan
#

no?

cloud dawn
slate swan
#

a lib

cloud dawn
#

first or third party?

boreal ravine
slate swan
#

first

#

what

slate swan
#

it's an API wrapper

cloud dawn
slate swan
#

So yeah not reall first

slate swan
#

alr alr i see where you're going

#

then lemme rephrase

cloud dawn
slate swan
#

First party would be that it's made by Discord

cloud dawn
slate swan
#

dislash is a 3rd party for dpy while disnake isn't

#

discord.py is a third party api wrapper for Discord

cloud dawn
#

so dislash is a 4th party py_guido

slate swan
#

πŸ˜‚

cloud dawn
#

disnake is looking to replace d.py and dislash is just an slash, menu and button implementation meant to work with d.py

slate swan
#

Β―_(ツ)_/Β―

slate swan
upbeat otter
#

guys why does this not send anything?

@client.command(name="coinflip", aliases=["cf"])
# @commands.cooldown(1, 30, commands.BucketType.user)
async def coinflip(ctx, amount=None):
  if amount is None:
    await ctx.message.reply("Bet some money!")
    return
  else:
    await open_account(ctx.author)
    with open("mainbank.json", "r") as f:
      users = json.load(f) 
    user = ctx.message.author
    if users[str(user.id)]["wallet"] >= amount:
      decide = random.randint(1, 2)
      msg = await ctx.message.reply(f"flipping a coin for ye...")
      if decide == 1:
        await asyncio.sleep(2)
        await msg.edit(content=f"ye lost the coin flip, better luck next time!")
        user = ctx.message.author
        users[str(user.id)]["wallet"] -= amount
        with open("mainbank.json", "w") as f:
          json.dump(users, f)
      elif decide == 2:
        await asyncio.sleep(2)
        await msg.edit(content=f"ye won {amount} coins :coin:!")
        user = ctx.message.author
        users[str(user.id)]["wallet"] += amount
        with open("mainbank.json", "w") as f:
          json.dump(users, f)
    else:
        await ctx.message.reply(f"Ye don't have enough coins!")
#

it worked properly before but now it doesnt even respond or print any error

cloud dawn
slate swan
#

@cloud dawn I did this

guild = guild = client.get_guild(756504534897000528)

@client.event
async def noob():
    for invalid_guilds in list(filter(lambda x: x.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
        import asyncio
        await asyncio.sleep(1)
#

And it's not working...

#

Okay so

#

First things first

#

There is no event called noob

slate swan
#

Second thing, your guild variable should be put in the method and not outside

#

Third thing, why do you do guild = guild = ...

slate swan
#

omg please dude

#

use <> for your links

slate swan
#

Just do guild = ... what

slate swan
#

Fourth thing, you don't import things randomly in your code, you do it at the top of your file

slate swan
slate swan
wintry shore
pliant gulch
#

forks will be forks, you should use a different wrapper instead

slate swan
#
@client.event
async def on_ready():
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
        await asyncio.sleep(1)

Good enough?

slate swan
#

Better now at least

#

Do you even know what a lambda does? Because with the apparent knowledge you show I don't think you do.

slate swan
# slate swan

You made those circles really aggressively πŸ˜„

#

If you don't, don't just use copy paste code

#

Oh sorry, was just means to show x)

slate swan
slate swan
# slate swan If you don't, don't just use copy paste code
Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "D:\Desktop\MaxTheBot\bot.py", line 23, in on_ready
    for invalid_guilds in list(filter(lambda x: x.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
  File "D:\Desktop\MaxTheBot\bot.py", line 23, in <lambda>
    for invalid_guilds in list(filter(lambda x: x.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
AttributeError: 'VoiceChannel' object has no attribute 'lower'

Nice...

#

Is it because πŸ“‘γƒ»Room # is not lower?

#

Might want x.name.lower()

slate swan
#

It didn't give me an error now

#

But the voice channel is still there...

#

And it ignored my other on_ready event

#

Don't have 2 events

#

Just one

#

Put the code together

#

It's still there (the vc)

#

Save your lambda thingy in a variable and print it

#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
        await asyncio.sleep(1)

I did this

slate swan
#

Just copy paste your thingy after the in keyword

#

and

#

So copy list(filter(lambda x: x.name.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)) and save in a variable

#

Then print it

#

So we can call it, Boop = list(filter(lambda x: x.name.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels))

#

Naming conventions, but yeah

#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
        await asyncio.sleep(1)
    boop = list(filter(lambda x: x.name.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels))
    print(boop)
#

like this? or outside that event?

#

like that

#

boop

#

It's a []

#

dictionary ? it was called?

#

list

#

list yeah

#

So you have no channel in that guild that starts with this name

#

Well I do...

#

"prv rooms"

#

Can the bot see them KryptonThink

#

That's a category

#

Yes

#

So no permissions misconfiguration

#

First: Everyone can see them
Second: The bot has administrator perms

#

Oh okay

#

So what's wrong?

cloud dawn
slate swan
#

Sure

#

Yeah i got to eat

#

We need another thing for that

#

Interesting how the emotes are being displayed

cloud dawn
#

Yeah that's prob why

slate swan
#

Yeah, I don't care about that one

#

Wait..., I have to care then?

wintry shore
slate swan
#

Well, you compare an emote that looks 'normal' with a weird looking emote that is displayed for you

slate swan
slate swan
#

utf 8

#

Or mabye it's windows, idk

#

Can't we do

boop = list(filter(lambda x: x.name.lower().contains('πŸ“‘γƒ»Room #'), guild.voice_channels))
cloud dawn
#

!charinfo πŸ“‘

unkempt canyonBOT
cloud dawn
#

this emoji doesn't match yours

slate swan
#

-_-

cloud dawn
#

Copy your channel emoji and do charinfo here

wintry shore
slate swan
#

!charinfo πŸ“‘

unkempt canyonBOT
slate swan
#

IT'S THE SAME THING! (thanks python)

wintry shore
#

Its just twemoji rendering in chat and the channel is os dependent

slate swan
#

^

#

Okay... I'm gonna remove the emoji

#

But wallahi if it doesn't work, I'm gonna mission abort

wintry shore
#

You can also do slicing and omit the emoji...

slate swan
cloud dawn
#

You just need to decode the emoji etc

slate swan
#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.lower().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
        await asyncio.sleep(1)
    boop = list(filter(lambda x: x.name.lower().startswith('Room #'), guild.voice_channels))
    print(boop)
    print(guild.voice_channels)
#

Let's see if this works

#

IT'S STILL THERE

cloud dawn
#

Well you did not change to for loop

wintry shore
#

Like x.name.lower()[1:].startswith("Room #")

slate swan
#

Wtf I did

#

oh

#

It still doesn't work

#

I'm still getting

#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.lower().startswith('Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
    boop = list(filter(lambda x: x.name.lower().startswith('Room #'), guild.voice_channels))
    print(boop)
#

Any other suggestions?

cloud dawn
#

yeah since this will never work

slate swan
#

Why it won't?

cloud dawn
#

since x is the whole class

slate swan
#

omfg

#

πŸ˜‚

cloud dawn
#

not class record mb

slate swan
#

How u don't see the issue yet

#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x["name"].lower().startswith('Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
    boop = list(filter(lambda x: x.name.lower().startswith('Room #'), guild.voice_channels))
    print(boop)
#

So like this?

cloud dawn
slate swan
#

You have a .lower which will convert the string to lower but you're checking if it starts with Room

#

R is uppercase, you converted the string to lowercase

#

nice

#

Yeah I told someone that AND THEY SAID IT WAS OK

#

I know that I'm not dumb

cloud dawn
#

panic

slate swan
#

Whoever they were must be dumb

#

Was it you Panda?

#
Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "D:\Desktop\MaxTheBot\bot.py", line 20, in on_ready
    for invalid_guilds in list(filter(lambda x: x["name"].lower().startswith('room #'), guild.voice_channels)):
  File "D:\Desktop\MaxTheBot\bot.py", line 20, in <lambda>
    for invalid_guilds in list(filter(lambda x: x["name"].lower().startswith('room #'), guild.voice_channels)):
TypeError: 'VoiceChannel' object is not subscriptable

NEW ERROR!

breaking news

cloud dawn
#

Please don't use ableist here Kraots

slate swan
#

You can't index a class

slate swan
#

BREAKING NEWS AGAIN

#

?

#

It worked.. πŸ™‚

cloud dawn
#

No? But it doesnt matter.

slate swan
#

Β―\_(ツ)_/Β―

#
for invalid_guilds in list(filter(lambda x: x.name.upper().startswith('Room #'), guild.voice_channels)):

Please tell this will work

cloud dawn
#

no

slate swan
#

Urgh

#

It won't work

#

I want Room not room

#

Because you have Room

#

-_-

#

Then use .title

cloud dawn
#

for invalid_guilds in list(filter(lambda x: x.name.lower().capitalize().startswith('Room #'), guild.voice_channels)): this will tough

slate swan
#

Or that

#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.title().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()
#

And it works πŸ™‚

#

Thank you guys!

#

I really appreciate it

cloud dawn
#

But do you know how filter works?

slate swan
#

No. πŸ™‚?

cloud dawn
#

sight

slate swan
#

sighs

fathom hamlet
#

what am i doing wrong?

slate swan
maiden fable
slate swan
maiden fable
#

Also u need to call the method lol

boreal ravine
#

Can someone send me an invite to the discord api server?

cloud dawn
# fathom hamlet

using repl.it, making commands in on_message indexing a string with a string, using format in python 3.9 using json in an async library.

wintry shore
# fathom hamlet

Dont use replit, its the worst online ide to ever exist, and its not even good for discord bots

fathom hamlet
slate swan
boreal ravine
#

thats danny's server

maiden fable
#

It was handed over to Danny...

boreal ravine
#

hm

wintry shore
maiden fable
#

By Voltana if I remember the correct name

boreal ravine
pliant gulch
#

Implemented cooldowns into my API wrapper yesterday what should the error have access to? Prob time till reset

wintry shore
pliant gulch
#

I don't see what cooldowns have to do with the API

cloud dawn
#

Why are people so fixated by badges.

maiden fable
#

.....?

pliant gulch
#

By cooldowns I mean command cooldowns, this is separate from the actual wrapper

wintry shore
pliant gulch
#

I did

#

But I'm making an extensions now

slate swan
#
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.title().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        await invalid_guilds.delete()

Can we do so if there are people in the voice channel, Don't delete it? or pass?

grim oar
#

copying my idea

pliant gulch
#

Nova shut up

#

Your plugins idea was dumb

grim oar
#

:'(

pliant gulch
#

I'm joking

grim oar
#

:)

thick sigil
#

Python Kek

slate swan
cloud dawn
boreal ravine
slate swan
wintry shore
# pliant gulch I did

Good for you u have contributors, i have to single handedly handle all the stuff like rate limits, ws connections, sharding, events .....

torpid latch
#
import discord
from discord import message
from discord import guild
from discord.ext import commands
import random
import os

from discord.member import Member

class helping(commands.Cog):
    def __init__(self, client):
        self.client=client
    @commands.command()
    async def utils(self, ctx):
      embed = discord.Embed(title="Help Commands", description="These are the commands available on the Annoyed Power discord bot",color="#11806A")
      embed.add_field(name=":judge: Moderation Commands", value="ban,kick,mute,unmute")
      embed.add_field(name=":video_game: Game commands",value="8ball")
      embed.set_footer(name="Annoyed Power") 
      await ctx.send(embed=embed)

def setup(client):
    client.add_cog(helping(client))

Can anyone help me i dont know the problem w this code these is no display for the utils command

slate swan
# cloud dawn Yeah i know how to do it
@client.event
async def on_ready():
    change_status.start()
    cog_status.start()
    print("Bot Is Now Online!")
    guild = client.get_guild(756504534897000528)
    for invalid_guilds in list(filter(lambda x: x.name.title().startswith('πŸ“‘γƒ»Room #'), guild.voice_channels)):
        if len(invalid_guilds.members) == 0:
            await invalid_guilds.delete()
        else:
            pass

? πŸ™‚

pliant gulch
pliant gulch
thick sigil
pliant gulch
#

No I have rate limits done

wintry shore
pliant gulch
#

I'm talking about command cooldowns, for the error what attributes should I give it

wintry shore
#

Dont crush me with commits

slate swan
#

@cloud dawn IT WORKED πŸ˜„

pliant gulch
thick sigil
slate swan
#

I'm getting better πŸ˜„

thick sigil
#

Just read the docs lol

slate swan
#

I can't understand it...

boreal ravine
slate swan
thick sigil
#

youre looking for a VoiceChannel object, then u look for it in the docs and u get all the attributes

cloud dawn
wintry shore
pliant gulch
#

Kai do a PR for me

thick sigil
#

Ok

pliant gulch
#

We need voice websocket

pliant gulch
#

πŸ‘οΈπŸ‘…πŸ‘οΈ

thick sigil
#

lemme do it

boreal ravine
slate swan
#

The thing is

torpid latch
slate swan
#

I don't know what are (args, kwargs, classes, return type, pos arg)

boreal ravine
#

you dont have to import anything after that

torpid latch
pliant gulch
# thick sigil lemme do it

Actually I prob wouldn't do that yet to early but I was gonna do sharing but you can do that if you want instead

wintry shore
#

Also @pliant gulch use create_task instead of gather imo that's better

hot cobalt
wintry shore
pliant gulch
#

I don't need create task there

boreal ravine
slate swan
pliant gulch
#

Its used cause I like how it looks better and there's no point for create_task

#

Heartbeat is a loop already as well

slate swan
hot cobalt
#

Myself included

boreal ravine
torpid latch
#

@boreal ravine it still doesnt work

boreal ravine
#

what doesnt

torpid latch
#

the message isnt sending

#

like the embed

slate swan
#

I want to go to IT (It's %95)

cloud dawn
#

Why so high just use google and the docs and you can make anything

boreal ravine
#

^

slate swan
#

I did google it before coming here

#

I couldn't find an answer

hot cobalt
torpid latch
queen ingot
#

sorry for interrupting your conversation, but as a beginner what video/course would you recommend for learning discord.py from scratch

boreal ravine
cloud dawn
boreal ravine
hot cobalt
#

Yep, this'll have classes and other OOP concepts

slate swan
queen ingot
hot cobalt
#

Sounds like you need to change your learning strategy

slate swan
boreal ravine
#

@slate swan cool

thick sigil
cloud dawn
queen ingot
slate swan
hot cobalt
slate swan
#

But I forgot

cloud dawn
queen ingot
hot cobalt
#

Odd, it works fine for me

cloud dawn
thick sigil
#

what is that 800x600 monitor

slate swan
#

lol

cloud dawn
#

πŸ˜‚

boreal ravine
slate swan
#

Boop

hot cobalt
#

But if school is getting too heavy, don't feel too bad. I have done very little work on projects this year just due to it being the last year of highschool so I've had little time extra to work on things. @slate swan

slate swan
boreal ravine
#

hm

torpid latch
#

pls help me im hella confused

cloud dawn
boreal ravine
slate swan
thick sigil
#

w11

queen ingot
#

i don't think w11 is a thing to be flexed

cloud dawn
#

You can't flex on w11 lol

slate swan
thick sigil
#

your else:
pass isnt necessary tho

slate swan
#

I've had win11 since 2 monthes

slate swan
cloud dawn
boreal ravine
slate swan
queen ingot
boreal ravine
#

the color is supposed to be an int not a string please change it @torpid latch

slate swan
thick sigil
#

Code on phone its better

slate swan
cloud dawn
slate swan
thick sigil
cloud dawn
#

Code on phone is better and you want to learn c++?

queen ingot
#

could anyone provide another discord.py tutorial link please?

thick sigil
thick sigil
#

I code on everything buddy

slate swan
slate swan
cloud dawn
#

I code on a pregnancy test.

queen ingot
boreal ravine
boreal ravine
thick sigil
cloud dawn
queen ingot
#

should i tor

boreal ravine
#

hm

slate swan
boreal ravine
boreal ravine
slate swan
slate swan
queen ingot
#

tor

boreal ravine
queen ingot
#

it opened with tor thanks

slate swan
#

I learned Python by following Lucas's videos on how to make a Discord bot

slate swan
#

That's why I don't know args and kwargs

boreal ravine
slate swan
boreal ravine
#

Cool.

cloud dawn
slate swan
boreal ravine
pliant gulch
#

Switch to cpp?

slate swan
#
@tasks.loop(seconds=10)
async def cog_status():
    guild = client.get_guild(756504534897000528)
    channel = guild.get_channel(877560418162343956)
    message = await channel.fetch_message(879092447613972590)
    embed = discord.Embed(title = 'Monitoring', description="Updates every 10 seconds", color=discord.Colour.random())
    for filename in os.listdir('./cogs'):
        if filename.endswith('.py'):
            try:
                client.load_extension(f"cogs.{filename[:-3]}")
            except commands.ExtensionAlreadyLoaded:
                status = '🟒 Working'
            else:
                status = 'πŸ”΄ Not Working'
                client.unload_extension(f"cogs.{filename[:-3]}")
            embed.add_field(name=f"{filename[:-3]}", value=f'{status}', inline=True)
            embed.timestamp = datetime.datetime.utcnow()
            embed.set_footer(text="Last updated: ")
    await message.edit(embed=embed)

I have this on my bot

#

I didn't write it, But now I can understand how it's made

boreal ravine
#

write it*

cloud dawn
# slate swan I don't know much about em

!e ```py
class Discord(object):
def init(self, needed: str, *args, optional: str = None):
self.needed = needed
self.optional = optional

def test(self) -> str:
    return self.needed

obj = Discord('some needed arg')

print(obj.test())

obj2 = Discord()

unkempt canyonBOT
#

@cloud dawn :x: Your eval job has completed with return code 1.

001 | some needed arg
002 | Traceback (most recent call last):
003 |   File "<string>", line 13, in <module>
004 | TypeError: Discord.__init__() missing 1 required positional argument: 'needed'
slate swan
boreal ravine
cloud dawn
boreal ravine
#

oh

slate swan
#

-_-

pliant gulch
#

Why are you subclassing object

#

What is this python 2

cloud dawn
#

It was meant for Sam so he could see what args and kwargs are.

boreal ravine
#

i already explained

thick sigil
pliant gulch
#

I learned a bit of cpp

cloud dawn
slate swan
boreal ravine
thick sigil
cloud dawn
slate swan
#

Guys I have an idea for my bot, Is there a way to turn off my bot with a command in the console?

#

Or if I press the X button it will do some stuff and then close?

boreal ravine
pliant gulch
# thick sigil useful for cpython

Ye I wanna bind some C code to my string parser for the commands ext. It runs at 640 nano seconds if the prefix isn't a tuple and with it runs at 1 microsecond

slate swan
pliant gulch
#

I could get it way lower

cloud dawn
slate swan
#

So why he is talking about *args and arguments

slate swan
thick sigil
pliant gulch
#

No regex wouldn't be good for this

#

And I want it fast cause it is dependent on the users set prefix

thick sigil
#

Nah ure just bad at regex, so I am

pliant gulch
#

If they have a tuple of 20 strings it would take longer

#

I find doing string slicing here more effective then regex

#

And more consistent

boreal ravine
slate swan
cloud dawn
#

regex is pretty slow and cpu bound

boreal ravine
#

who

slate swan
#

Panda

thick sigil
pliant gulch
#

Fast but it could be faster

slate swan
#

is 640 nano seconds 0.64ms ?

boreal ravine
slate swan
#

6.4?

boreal ravine
#

theres a difference between miliseconds

#

and nano seconds

thick sigil
slate swan
#

Yeah, But nano seconds are smaller

boreal ravine
slate swan
cloud dawn
#

Well if you are trading stocks that is pretty slow

pliant gulch
#

It could be way faster

odd pendant
pliant gulch
slate swan
boreal ravine
thick sigil
#

ok schumacher

odd pendant
#

python is slow as shit

#

especially for expensive computations

thick sigil
#

imagine ppl loving java or js

cloud dawn
#

Well it is a lot faster than python sometimes even faster than C

thick sigil
boreal ravine
#

@odd pendant didnt u reply to me earlier

odd pendant
#

yeah I misread your message

boreal ravine
#

oh cool

odd pendant
#

I thought you said there were no difference between milliseconds and nanoseconds

#

But you said there is a difference

boreal ravine
#

oh ok

slate swan
maiden fable
#

Nanosecond is smaller than ms

slate swan
wintry shore
#

Why

odd pendant
slate swan
boreal ravine
#

oh

slate swan
#

Okay here's what I want to do

#

These are my cogs ok?

cloud dawn
#

Andy stopping when run time is 1 femtosecond

slate swan
# slate swan These are my cogs ok?

And I have

@tasks.loop(seconds=10)
async def cog_status():
    guild = client.get_guild(756504534897000528)
    channel = guild.get_channel(877560418162343956)
    message = await channel.fetch_message(879092447613972590)
    embed = discord.Embed(title = 'Monitoring', description="Updates every 10 seconds", color=discord.Colour.random())
    for filename in os.listdir('./cogs'):
        if filename.endswith('.py'):
            try:
                client.load_extension(f"cogs.{filename[:-3]}")
            except commands.ExtensionAlreadyLoaded:
                status = '🟒 Working'
            else:
                status = 'πŸ”΄ Not Working'
                client.unload_extension(f"cogs.{filename[:-3]}")
            embed.add_field(name=f"{filename[:-3]}", value=f'{status}', inline=True)
            embed.timestamp = datetime.datetime.utcnow()
            embed.set_footer(text="Last updated: ")
    await message.edit(embed=embed)
odd pendant
#

what on earth is the point of that

slate swan
#

Wait

pliant gulch
cloud dawn
#

Pretty sure if it does not work it crashesπŸ˜‚

odd pendant
#

an extension won't just unload itself during runtime

pliant gulch
#

How can I achieve this

#

Inb4 I need to write asm

cloud dawn
slate swan
pliant gulch
#

If it's possible I will get it

#

πŸ‘οΈπŸ‘…πŸ‘οΈ

cloud dawn
#

I mean you could build an OS that only runs on the discord API

pliant gulch
#

Hmmmm I've tried making my own OS already

#

Should be possible

slate swan
#

How do I make the number go up by 1 every 5 minutes?

odd pendant
cloud dawn
#

Own os is so much work tough..

cloud dawn
slate swan
#
@tasks.loop(seconds=10)
async def cog_status():
    guild = client.get_guild(756504534897000528)
    channel = guild.get_channel(877560418162343956)
    message = await channel.fetch_message(879092447613972590)
    embed = discord.Embed(title = 'Monitoring', description="Updates every 10 seconds", color=discord.Colour.random())
    for filename in os.listdir('./cogs'):
        if filename.endswith('.py'):
            try:
                client.load_extension(f"cogs.{filename[:-3]}")
            except commands.ExtensionAlreadyLoaded:
                status = '🟒 Working'
            else:
                status = 'πŸ”΄ Not Working'
                client.unload_extension(f"cogs.{filename[:-3]}")
            embed.add_field(name=f"{filename[:-3]}", value=f'{status}', inline=True)
            embed.timestamp = datetime.datetime.utcnow()
            embed.set_footer(text="Last updated: ")
    await message.edit(embed=embed)

Can I do the on_disconnect event here?

pliant gulch
odd pendant
cloud dawn
pliant gulch
#

Doit

cloud dawn
pliant gulch
cloud dawn
pliant gulch
#

πŸ‘

cloud dawn
reef dock
#

LMAO

slate swan
#

@odd pendant

@client.event
async def on_disconnect():
    guild = client.get_guild(756504534897000528)
    channel = guild.get_channel(877560418162343956)
    message = await channel.fetch_message(879092447613972590)
    embed = discord.Embed(title = 'Monitoring', description="Updates every 10 seconds", color=discord.Colour.random())
    for filename in os.listdir('./cogs'):
        if filename.endswith('.py'):
            status = 'πŸ”΄ Not Working'
            embed.add_field(name=f"{filename[:-3]}", value=f'{status}', inline=True)
            embed.timestamp = datetime.datetime.utcnow()
            embed.set_footer(text="Last updated: ")
    await message.edit(embed=embed) 

Will this work

slate swan
cloud dawn
#

I know it absurd

pliant gulch
slate swan
slate swan
slate swan
odd pendant
#

there might be another event for it this probs not what you need

cloud dawn
odd pendant
#

or just make your own event

pliant gulch
slate swan
odd pendant
slate swan
#

oh , no it works

#

wdym, how?

#

nah , i thought its meant only for sharded bots

#

-_-

#

What's the right limit for changing role color?

#

im sure you cannot edit the embed after the bot disconnects tho

slate swan
#

It's not possible because it's a local host right?

hasty iron
#

use bot.close

cloud dawn
#

Could you please only ask one question at a time.

slate swan
unkempt canyonBOT
#
Not gonna happen.

No documentation found for the requested symbol.

hasty iron
#

its close in 2.0

slate swan
#

um

#

oh

hasty iron
#

logout was removed iirc

boreal ravine
#

!d discord.Client.close

unkempt canyonBOT
#

await close()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Closes the connection to Discord.
boreal ravine
#

bot.close()

slate swan
#

its a coro

boreal ravine
#

oh

#

I didn't see it

#

must be why it didnt close my bot

slate swan
#

yea u just need to await it

slate swan
hasty iron
#

it returns a coroutine

slate swan
#

Nice

slate swan
#

also , you miss parantheses
@client.command()

boreal ravine
#

^

odd pendant
slate swan
#

its preferrable to add is_owner check too , just saying

#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 690, in _parse_arguments
    next(iterator)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 979, in on_message
    await self.process_commands(message)
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 976, in process_commands
    await self.invoke(ctx)
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 855, in invoke
    await self.prepare(ctx)
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 789, in prepare
    await self._parse_arguments(ctx)
  File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 693, in _parse_arguments
    raise discord.ClientException(fmt.format(self))
odd pendant
#

obv add owner checks

pliant gulch
#

Type hinting everything makes python look so much better 😩

boreal ravine
pliant gulch
#

Esp when mypy doesn't scream at you

hasty iron
#

no its pain

boreal ravine
hasty iron
#

mypy is shit

odd pendant
#

type hinting makes python actually look like a programming language

slate swan
#

wtf it worked

#

How did it work

#

why wont it?

hasty iron
#

magic

slate swan
#

It closed a window with a command In discord? (eksplain america)

hasty iron
#

what

odd pendant
#

what

cloud dawn
#

Type hinting is fine but why typehint a None type.

hasty iron
boreal ravine
cloud dawn
slate swan
#
@client.command()
@commands.check(is_it_me)
async def close(ctx: commands.Context) -> None:
    await client.close()

Hello?

slate swan
boreal ravine
hasty iron
slate swan
boreal ravine
#

cool

cloud dawn
hasty iron
#

!e

def foo(): pass
print(foo())
unkempt canyonBOT
#

@hasty iron :white_check_mark: Your eval job has completed with return code 0.

None
boreal ravine
#

nice

slate swan