#discord-bots

1 messages ยท Page 623 of 1

velvet tinsel
#

pip install okimii.py

slate swan
#

Who even are you.shipit

#

Never seen you๐Ÿ˜”

steep estuary
#

what discord.utils.timezone will do ?

maiden fable
#

!ot dudes and dudettes

unkempt canyonBOT
slate swan
#

Haha np, too much going on too, just came back cause of a school project

maiden fable
#

Ah cool

velvet tinsel
#

Python annoying as in the bot

slate swan
steep estuary
#

discord.utils.timezone what this will do /

slate swan
#

If it wasnt cuz of me this chat would be boring and deadjam_cavedude

#

!d discord.utils.utcnow

unkempt canyonBOT
#

discord.utils.utcnow()```
A helper function to return an aware UTC datetime representing the current time.

This should be preferred to [`datetime.datetime.utcnow()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow "(in Python v3.9)") since it is an aware datetime, compared to the naive datetime in the standard library.

New in version 2.0.
slate swan
slate swan
maiden fable
#

๐Ÿ˜Why can't y'all take this to an ot channel, just why

velvet tinsel
#

๐Ÿ˜ข

#

But we really should

slate swan
#
hunter = await ctx.send("!ot")
```![yert](https://cdn.discordapp.com/emojis/832277526809149461.webp?size=128 "yert")
maiden fable
#

You gonna get bothered when a mod comes?

velvet tinsel
manic wing
velvet tinsel
#

I'm still waiting for a question

maiden fable
#

Okay, let's try that. @novel apex here I come :D

slate swan
maiden fable
velvet tinsel
#

What's the question?

steep estuary
slate swan
#

@manic wing were just bored and having fun when people come we answer the question so please get your facts right

slate swan
slate swan
velvet tinsel
steep estuary
velvet tinsel
slate swan
#

Where? In your cmd or on frontend of discord?

velvet tinsel
slate swan
slate swan
#

Ive never used discord.utils is it just better for getting stuff like roles and channels?

velvet tinsel
#

discord utilities judging by the name

slate swan
sick birch
#

and a few other things i've never really used, i've only used utils.get

slate swan
slate swan
slate swan
slate swan
slate swan
#

Basically more efficient

sick birch
slate swan
#

๐Ÿ‘

#

Never used it but ill check it out

rotund nova
#

how do for bot delete all new messages in channel?

velvet tinsel
#

...I think

slate swan
#

That will cost a lot of requests for a lot of messages

#

If you need to delete a message instantly, use on_message

rotund nova
#

i want when someone write new message in channel bot delete message

rotund nova
slate swan
cerulean osprey
#
@client.event
async def on_message(message):
    if message.channel.id == <id>:
        await message.delete()

I think

#

Thats how I did it anyways, there could be a different easier better way

sick birch
slate swan
#

Is there any other way for deleting a message as it is sent in a channel?

sick birch
#

you can use a listener

slate swan
#

Im going to learn aiosqlite and discord utils so everybody have a good day laterpithink

#

Umm on_message is a listener..?

sick birch
#

events can be listeners

#

they should be listeners, in fact

slate swan
#

Oh you mean make it listener instead of event, yes

#

don't hardcode your events

cerulean osprey
slate swan
#

Whats the difference between listen and event someone saidnto me theirs no difference

sick birch
#

an on_message overrides commands so if you don't have the process_commands none of your commands will run

#

it's very easy to forget and a lot of people have issues with it

slate swan
#

I see๐Ÿค”

cerulean osprey
#

I had that issue, I just use await client.process_commands(message)

sick birch
#

plus the on_message event is better suited for things such as user blacklists (people the bot won't respond to), channel blacklists (channels the bot won't respond in), checking if the message author is a bot, etc...

pliant gulch
pliant gulch
#

No clue why discord.py decided to have .event instead of just listeners with an overwrite kwarg

sick birch
#

You also don't have to process_commands on a listener

slate swan
#

I see

#

Thx

#

Ok bye nowyert

cerulean osprey
#

So I currently have something under on_message

if message.channel.id == 909685766244945921 or '@everyone' in message.content:
        print('Success')
        if len(message.author.roles) <= 2:
            print('Check 1')
            await message.author.ban(reason = 'Softbanned bozo')
            await message.guild.unban(discord.Object(message.author.id))
            await mc.send(f'{message.author} has been softbanned')
            print('Check 2, softban successful')
        elif len(message.author.roles) > 2:
            await message.delete()
            print('Seems good')
    

Is this appropriate use of on_message?

steep estuary
#

why this is showing the bot's host time

#
thetiming = datetime.utcnow() + dt.timedelta(seconds=int(seccs))
    perfecttiming = thetiming.strftime("%I:%M %p | %d %b")
```this
#

when i use this in embed

#

it show my time

outer violet
#

how do i make this delete after 3 seconds? await ctx.message.delete()

slate swan
#

await ctx.message.delete(3)

outer violet
#

oh okay

brazen raft
#

I believe delete_after is a parameter in ctx.send

#

Or something like that

slate swan
modern fiber
#

How can I make a command where only stated users (IDs) can use a command like ?announce <message>, that will pop in all Server's system channels / dm the all users about it.

slate swan
modern fiber
#

How can then those scam bots do it and I can't do it in a useful non abusive way

#

Lol

outer violet
#

i tried the other way as well but it says command raised an exception: TypeError: delete() takes 1 positional argument but 2 were given

@commands.command(aliases=['poll'])
    @commands.cooldown(1, 5, commands.BucketType.user)
    @commands.is_owner()
    async def createpoll(self, ctx, hours: int, question: str, *options):
        await ctx.message.delete(3)```
slate swan
sullen shoal
outer violet
#

what?

sullen shoal
#

the indenting

outer violet
#

no

slate swan
#

working as intended

#

tho is it indented?

sullen shoal
#

ah i always get confused

slate swan
#

-to intent
-to indent
-to intend

#

lesgo

velvet tinsel
#

help me

#

nvm

slate swan
#

continues watching

sage niche
#

Can I somehow edit the color of an existing embed in a message but keep the same content?

sick birch
#

after all it's just a python class

sage niche
#

right

#

thanks

slate swan
#

!loop

slate swan
slate swan
#

!range

unkempt canyonBOT
#

Iterating over range(len(...)) is a common approach to accessing each item in an ordered collection.

for i in range(len(my_list)):
    do_something(my_list[i])

The pythonic syntax is much simpler, and is guaranteed to produce elements in the same order:

for item in my_list:
    do_something(item)

Python has other solutions for cases when the index itself might be needed. To get the element at the same index from two or more lists, use zip. To get both the index and the element at that index, use enumerate.

slate swan
sullen shoal
#

lurking + coding
perfect

wary ice
#

good evening guys do any of you know this code eg to write / twt and send the message you sent down the Twitter image date and time you sent it and above your name with the image and the tag does anyone know this code?

sullen shoal
#

I think you can make use of the twitter API for that

wary ice
#

that is, what do you mean by the Twitter application;

slate swan
sullen shoal
#

it will be smth like discord.User, discord.Member objects later

slate swan
#

But revolt.User and revolt.Member

#

Wut that๐Ÿ˜ญ

#

another chatting app

sullen shoal
#

๐Ÿง 

slate swan
#

Mhmmbrainmon

#

While I work also on another chatting app

#

๐Ÿ˜ญ

pliant gulch
#

Revolt basically just discord but open source and more privacy focused

#

It's cool, the UI is basically the same though

#

Other then allowing themes

sullen shoal
#

and pretty much free nitro

slate swan
#

Might just changelemonpeek

#

But not e2ee right?

sullen shoal
#

and without a shitty over complicated api

#

fuck that shit

pliant gulch
#

People alr made API wrappers for revolt iirc

sullen shoal
#

yeah

pliant gulch
#

I haven't checked out their API though, but might later

sullen shoal
#

its nice to work with

slate swan
#

HELP-
how to create gaps in range! like

  print(x)
1,2,3,4,5,7,8,9

so i have to create gaps like 2,4,6,8 like this (Multiplication table )

sullen shoal
#

no need of intents and all that crap

slate swan
sullen shoal
#

!e print([1,2,3,4][::2])

unkempt canyonBOT
#

@sullen shoal :white_check_mark: Your eval job has completed with return code 0.

[1, 3]
slate swan
sullen shoal
#

do you want me to spoonfeed your entire project

slate swan
#

How is that even related to discord bots?

sullen shoal
#

idek

slate swan
slate swan
slate swan
slate swan
velvet tinsel
#

make a for loop and then make a variable and then add the numbers into the variable and then print the variable easy

velvet tinsel
slate swan
velvet tinsel
sullen shoal
#

nah i use that crap windows and vscode

slate swan
#

it's a theme for windows

#

๐Ÿ˜ญ

velvet tinsel
slate swan
#

without theme actually

velvet tinsel
slate swan
#

just an extension

velvet tinsel
kind wind
#

how can you make public variables? like a money variable for a work command

sullen shoal
#

i use smth called glass

kind wind
#

...

sullen shoal
#

global variables bad

velvet tinsel
#

or use JSON

velvet tinsel
sullen shoal
#

set them as attribute of bot or the cog instead

slate swan
#

Anybody have a good aiosqlite tutorial i cant find one

slate swan
sullen shoal
velvet tinsel
kind wind
#

how can I make variables

sullen shoal
velvet tinsel
slate swan
velvet tinsel
#

๐Ÿคฃ

kind wind
#

I MEAN FOR A WORK COMMAND

sick bluff
velvet tinsel
slate swan
velvet tinsel
#

speaking of work commands I'm building a economy discord bot ๐Ÿ˜„

kind wind
#

OFC I KNOW HOW TO MAKE VARIABLE

velvet tinsel
kind wind
#

I MEAN ONE FOR A WORK COMMAND

velvet tinsel
#

Please use pseudo code to explain

slate swan
#

What is this man talking about?

velvet tinsel
#

I understand not, okimii.

sick bluff
slate swan
velvet tinsel
#

English I may not speak well, but bad English I understand notter

slate swan
#

What does he want?

velvet tinsel
#

๐Ÿคฃ

slate swan
velvet tinsel
#

pretending to be bad at english

kind wind
#

Mister "he" has a name

velvet tinsel
#

*miss

kind wind
#

I am talking about myself

sick bluff
#

._.

velvet tinsel
#

You were talking to Okimii, no?

sullen shoal
velvet tinsel
slate swan
velvet tinsel
#

Because we understand not what your code saying is trying to

slate swan
slate swan
velvet tinsel
slate swan
#

Anybody know my gender? ._.

velvet tinsel
#

I love english speaking broken

modern fiber
#

Hey. How can I make it so I can use a personal command that only choosed people (IDs) can use. For example; ?announce <text>, and it would send a message to every server the bot is in, in the system channel. Of course, with the delay like a minute, so it doesn't block the bot for multiple actions.

velvet tinsel
slate swan
#

Is it that hard to know?

slate swan
#

or snake

#

Yall too smart๐Ÿ˜ญ

velvet tinsel
#

That's why I prefer to make a big server and ping people

modern fiber
#

Oh, oky

velvet tinsel
#

speaking of pings I get 20+ messages because I'm in some kind of weird star wars discord server I joined only because i wanted guns in the game

slate swan
#
for x in range(2, 4 ,3):
  print(x) 

why its not working ๐Ÿ’ข

velvet tinsel
sullen shoal
slate swan
velvet tinsel
slate swan
#

Yes

slate swan
velvet tinsel
#

Amazing

velvet tinsel
velvet tinsel
slate swan
sullen shoal
# modern fiber Yep.

you may use a command check, to check if the author's id is in the array of your selected users. then, discord.ext.commands.Bot.guilds will give you the list of all the Guilds your bot is in, then just send them to the system channel

velvet tinsel
slate swan
#

!loops

#

For the people who havent noticed yea in a maleyert

slate swan
velvet tinsel
slate swan
velvet tinsel
slate swan
slate swan
velvet tinsel
slate swan
#

I'm a book, more precisely a winrar

slate swan
velvet tinsel
slate swan
slate swan
slate swan
velvet tinsel
slate swan
#

@slate swan to make commands use #bot-commands

slate swan
velvet tinsel
slate swan
velvet tinsel
slate swan
slate swan
velvet tinsel
slate swan
slate swan
slate swan
velvet tinsel
slate swan
#

@slate swan Get kids name one after me๐Ÿ˜”

velvet tinsel
slate swan
velvet tinsel
slate swan
#

LMAO

twilit dragon
velvet tinsel
#

Because I'm a programmer they do not experience any kind of love/affection for other, err...non-programmed subjects.

#

For example, humans.

slate swan
velvet tinsel
#

What even is a human?

slate swan
unkempt canyonBOT
slate swan
#

๐Ÿ˜ณ

modern fiber
#

.

velvet tinsel
#

๐Ÿง  ๐Ÿ”ซ

#

That will not work

#

Doing that will only make more files

slate swan
#

๐Ÿค”

#

mmh?

sullen shoal
#

!d pkgutil.iter_modules

unkempt canyonBOT
#

pkgutil.iter_modules(path=None, prefix='')```
Yields [`ModuleInfo`](https://docs.python.org/3/library/pkgutil.html#pkgutil.ModuleInfo "pkgutil.ModuleInfo") for all submodules on *path*, or, if *path* is `None`, all top-level modules on `sys.path`.

*path* should be either `None` or a list of paths to look for modules in.

*prefix* is a string to output on the front of every module name on output.

Note

Only works for a [finder](https://docs.python.org/3/glossary.html#term-finder) which defines an `iter_modules()` method. This interface is non-standard, so the module also provides implementations for [`importlib.machinery.FileFinder`](https://docs.python.org/3/library/importlib.html#importlib.machinery.FileFinder "importlib.machinery.FileFinder") and [`zipimport.zipimporter`](https://docs.python.org/3/library/zipimport.html#zipimport.zipimporter "zipimport.zipimporter").

Changed in version 3.3: Updated to be based directly on [`importlib`](https://docs.python.org/3/library/importlib.html#module-importlib "importlib: The implementation of the import machinery.") rather than relying on the package internal [**PEP 302**](https://www.python.org/dev/peps/pep-0302) import emulation.
slate swan
#

Too lazy for that

#

My thingy works

sullen shoal
#

bruh

slate swan
#

All what matters

sullen shoal
twilit dragon
#

`import os
import discord.py
from discord.ext import commands

client = commands.AutoShardedBot(commands.when_mentioned_or('$'))

from flask import Flask

from threading import Thread

app = Flask('')

@app.route('/')

def home():

return "I'm alive"

def run():

app.run(host='0.0.0.0',port=8080)

def keep_alive():

t = Thread(target=run)

t.start()

print("bot is online")

keep_alive()
client.run("Bot token")`

slate swan
#

nice

slate swan
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.

sullen shoal
slate swan
#

And might want to remove these useless new empty lines

#

@slate swan stop copying me bro๐Ÿคฌ lemonpeek

velvet tinsel
#

I got pinged 1000 times

slate swan
#

@velvet tinsel 1001

slate swan
velvet tinsel
#

damn he will pay

slate swan
#

๐Ÿค”

velvet tinsel
slate swan
#

And yeah, I'm not really into python anymore since a few months

velvet tinsel
#

Never check your DMs innit

slate swan
velvet tinsel
slate swan
slate swan
slate swan
velvet tinsel
#

Agree

slate swan
velvet tinsel
slate swan
#

Jk

twilit dragon
#

nothing else

slate swan
#

The bottom part is more useful

#

I don't get spammed of friend requests anymore, which is kind of nice

slate swan
twilit dragon
#

24/7

sullen shoal
slate swan
velvet tinsel
#

Oke

slate swan
#

My DMs are for more relevant stuff

slate swan
#

Yeah same basically

#

I have like 20 friends from which I talk to only like 5

slate swan
#

yikes verysadcat

#

Thats why you see me here๐Ÿ˜• ๐Ÿ˜”

#

Its lonely outhere๐Ÿ˜”

sullen shoal
slate swan
#

Yeah I mean, I talk actively to 2 people. 3 others are just school mate and we share homeworks

#

In the end it's not about how many but how good you feel with the ones you actively talk to

#

I mostly talk to the real ones you know

slate swan
slate swan
#

Python is the real one thopydis_peek

#

It will change sooner than what you can think

slate swan
#

I mostly just stay coding all the time

#

Anybody know a aiosqlite tutorial pls docs arent good๐Ÿ˜ญ

#

Never used it, sorry

wary ice
velvet tinsel
#

Pog

slate swan
slate swan
#

I just wanna learn a asyncdb ๐Ÿ˜”

wary ice
#

๐Ÿ˜ญ

slate swan
#

My bots never really needed any database

slate swan
velvet tinsel
#

Never used database

#

Literally

sullen shoal
#

i dont think its any different than synchronous dbs tho

velvet tinsel
#

What even is a database

sullen shoal
#

atleast not the syntax

velvet tinsel
#

Understand not I

slate swan
#

Is mongodb async?

velvet tinsel
#

I never used it before

#

Didnt see the purpose so I skipped it

slate swan
velvet tinsel
#

DownloadPython has been shot dead

slate swan
#

๐Ÿ˜ณ

velvet tinsel
#

:cri:

sullen shoal
#

there are many sources to learn mongodb, sqlite3 or whatever, the async extensions of it should include what change you have to make so that it works

velvet tinsel
#

:kek:

slate swan
#

At this point im not gonna even learn a db if im not gonna use it

slate swan
velvet tinsel
#

Oh wow

#

What a coincidence

slate swan
#

Lmao

velvet tinsel
slate swan
velvet tinsel
#

what have you been doing

slate swan
#

:(

#

๐Ÿ˜”

#

@slate swan yert

velvet tinsel
#

I need to be a contributor

viral mirage
#

hey, idk if it's a problem or a bug but the thing is
my public bot recently joined a server, and when i do the servers command it suddenly crashed saying NoneType has no attributes to name at guild.owner.name so i made an if, else statement to pass it and what i found is
the server has no name, no owners and actually no members (the member count is 0), i am not sure if that's a bug or something

slate swan
slate swan
#

need a new nickname

#

Time to get creative

viral mirage
#

ikr

velvet tinsel
#

Show me show me

#

Show me the server

sullen shoal
viral mirage
#

i can't lol

velvet tinsel
#

Wait ctx.guild

#

Innit

slate swan
#

dies

viral mirage
#

but i am doing for guild in client.guilds

velvet tinsel
#

exists

viral mirage
#

shouldn't it only show servers?

velvet tinsel
sullen shoal
#

it should

viral mirage
#
    for guild in client.guilds:
        if guild is None:
            text += f"Unknown Server????\n"
        else:
            if guild.owner is None:
                text += f"{guild.name} - {len(guild.members)} - {guild.owner}\n"
            else:
                text += f"{guild.name} - {len(guild.members)} - {guild.owner.name}\n"
    if len(text) <= 2048:
        embed = Embed(title=f"Total Count: {len(client.guilds)} server(s)",
                      description=text,
                      color=random_color())
        await ctx.send(embed=embed)
        return
    embed = Embed(title=f"Total Count: {len(client.guilds)} server(s)", color=random_color())
    await ctx.send(embed=embed)
    return```
velvet tinsel
#

ok, so it says Unknown Server????

#

Myxi can do this a lot faster than me so Iโ€™ll leave the final answer to him

sullen shoal
#

what is the result

#

does it pass if guild is None:

slate swan
#

Im going to use json as a db๐Ÿ˜ˆ

viral mirage
#

what comes is this

velvet tinsel
#

Sweet a discord developer

viral mirage
#

see the None - 0 - None

velvet tinsel
sullen shoal
#

so if guild is None: is False

velvet tinsel
#

^^

sullen shoal
#

check the type of Guild

viral mirage
#

i would have ignored it as i might have thought of it as a server and owner name but it shows 0 as member count which is weird

sullen shoal
#

type(guild)

viral mirage
#

alr

velvet tinsel
#

Ok myxi is going god mode here Ima sit back and watch this

slate swan
#

Anybody has some ideas for a bot๐Ÿ˜”

sullen shoal
#

i have a little doubt if its really a Guild object

velvet tinsel
slate swan
velvet tinsel
#

He is basically Sherlock Holmes when it comes to stuff like these

slate swan
velvet tinsel
#

Oh

viral mirage
sullen shoal
viral mirage
#

dir then

slate swan
#

I think im going to do a search bot with asyncpraw๐Ÿค”

velvet tinsel
#

Wait

sullen shoal
#

yes use it, would be better if you filter the dunder ones

velvet tinsel
#

You can just do embed.add_field(), no?

slate swan
#

See you guys have a good daypithink

velvet tinsel
#

I started using that recently, got addicted

viral mirage
#

['_PREMIUM_GUILD_LIMITS', '__annotations__', '__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__', '_add_channel', '_add_member', '_add_role', '_add_thread', '_banner', '_channels', '_clear_threads', '_create_channel', '_discovery_splash', '_filter_threads', '_from_data', '_icon', '_large', '_member_count', '_members', '_public_updates_channel_id', '_remove_channel', '_remove_member', '_remove_role', '_remove_thread', '_remove_threads_by_channel', '_resolve_channel', '_roles', '_rules_channel_id', '_splash', '_stage_instances', '_state', '_store_thread', '_sync', '_system_channel_flags', '_system_channel_id', '_threads', '_update_voice_state', '_voice_state_for', '_voice_states', 'active_threads', 'afk_channel', 'afk_timeout', 'audit_logs', 'ban', 'banner', 'bans', 'bitrate_limit', 'by_category', 'categories', 'change_voice_state', 'channels', 'chunk', 'chunked', 'create_category', 'create_category_channel', 'create_custom_emoji', 'create_integration', 'create_role', 'create_stage_channel', 'create_sticker', 'create_template', 'create_text_channel', 'create_voice_channel', 'created_at', 'default_notifications', 'default_role', 'delete', 'delete_emoji', 'delete_sticker', 'description', 'discovery_splash', 'edit', 'edit_role_positions', 'edit_widget', 'emoji_limit', 'emojis', 'estimate_pruned_members', 'explicit_content_filter', 'features', 'fetch_ban', 'fetch_channel', 'fetch_channels', 'fetch_emoji', 'fetch_emojis', 'fetch_member', 'fetch_members', 'fetch_roles', 'fetch_sticker', 'fetch_stickers', 'filesize_limit', 'get_channel', 'get_channel_or_thread', 'get_member', 'get_member_named', 'get_role', 'get_stage_instance', 'get_thread', 'icon', 'id', 'integrations', 'invites', 'kick', 'large', 'leave', 'max_members', 'max_presences', 'max_video_channel_users', 'me', 'member_count', 'members', 'mfa_level', 'name', 'nsfw_level', 'owner', 'owner_id', 'preferred_locale', 'premium_subscriber_role', 'premium_subscribers', 'premium_subscription_count', 'premium_tier', 'prune_members', 'public_updates_channel', 'query_members', 'region', 'roles', 'rules_channel', 'self_role', 'shard_id', 'splash', 'stage_channels', 'stage_instances', 'sticker_limit', 'stickers', 'system_channel', 'system_channel_flags', 'templates', 'text_channels', 'threads', 'unavailable', 'unban', 'vanity_invite', 'verification_level', 'voice_channels', 'voice_client', 'webhooks', 'widget']

viral mirage
#

feels like a ghost server, it is there but it isn't

sullen shoal
unkempt canyonBOT
sullen shoal
#

it isnt optional tho

velvet tinsel
#

Myxi comes to his conclusion, I was about to go through a wide variety of stuff

viral mirage
velvet tinsel
sullen shoal
#

looks like some bug to me, which version are you using

viral mirage
#

and 0 in the len(guild.members)

velvet tinsel
#

Weird, in fact, very weird

viral mirage
#

the one from the GitHub

velvet tinsel
#

Just delete it

viral mirage
#

sorry

velvet tinsel
#

Delete the None server if you can

sullen shoal
viral mirage
sullen shoal
#

i see

velvet tinsel
#

Ahhh

sullen shoal
velvet tinsel
#

I have never used Pycord, Iโ€™m a bit old fashioned

viral mirage
#

oh wait

viral mirage
velvet tinsel
#

Try for servers in member.servers

sullen shoal
#

fetch it and see if it works then

velvet tinsel
#

Iโ€™m just substituting stuff

viral mirage
velvet tinsel
#

Embed.add_field(member.servers)

sullen shoal
#

if you fetch it, it should update the cache

velvet tinsel
sullen shoal
velvet tinsel
#

Or for Guild

velvet tinsel
viral mirage
#

alr

velvet tinsel
#

idk try using myxiโ€™s idea

#

For member.servers I used it off bot.servers but idk if it works

slate swan
velvet tinsel
#

Does it work Yami?

viral mirage
#

so it showed the server name only

slate swan
velvet tinsel
velvet tinsel
sullen shoal
slate swan
viral mirage
#

apparently the server was an old server, when i checked the old messages i found it FUCKING SERVER XD - 5773 - Skwll
now it only shows FUCKING SERVER XD - 0- None

viral mirage
velvet tinsel
#

Oh god swear words but idk why it does that

sullen shoal
#

i guess the caching system of pycord is kinda fucked

velvet tinsel
viral mirage
#

the server name has always been like that

sullen shoal
#

maybe they made changes to it

velvet tinsel
#

Maybe, maybe

viral mirage
viral mirage
velvet tinsel
#

I use it for slash and buttons

viral mirage
#

aren't i already using it?

#

i am confused lol

velvet tinsel
viral mirage
#

oh

velvet tinsel
#

I recommend that since pycord is pretty new and we dont understand a lot of that

viral mirage
#

won't the functions be overlapped with each other

#

it's like you have discord(1).py somewhere

velvet tinsel
#

anyways have you tried a for loop?

sullen shoal
#

@viral mirageso when you fetched the guild by the id, only the name attribute was working or others were working too?

viral mirage
velvet tinsel
#

Ok, but I think theyโ€™ll mess up a lot of functions on git

slate swan
#

hello, anyone know how to DM a user? This didn't work out for me... dmUser is just a userID, pulled from a command, in string form that then gets transitioned to int. Error is:

AttributeError: 'NoneType' object has no attribute 'send'```
sullen shoal
slate swan
#

the literal discord.py documentation told me to do it this way

velvet tinsel
#

That should be a passing argument

viral mirage
velvet tinsel
#

Are you using an event or command?

slate swan
#

event

velvet tinsel
#

Ok

#

Show full code

slate swan
#

I'm doing it all wrong, I know

somber tree
#

Guys how do I make commands?

slate swan
#

but I need to do on_message for the way I set my code up

viral mirage
velvet tinsel
somber tree
#

ok

velvet tinsel
sullen shoal
velvet tinsel
#

@slate swan ?

slate swan
#

I will sry

velvet tinsel
#

Ok

slate swan
#

I'm trying to snip out a bit

#

the full code is a monster document

velvet tinsel
#

Itโ€™s ok, take your time ๐Ÿ˜Ž

slate swan
#

the bot is really poorly made since I started when I was learning how to code and just built on it, it needs refactoring

viral mirage
slate swan
#

here's a chunk

viral mirage
#

thanks for the help philosophia_Givingheart

slate swan
#

so messy, yes, I know

velvet tinsel
sullen shoal
#

๐Ÿ‘

velvet tinsel
#

But thatโ€™s not the problem

slate swan
#

more context

#

the first stuff is just for a certain server

velvet tinsel
#

Ahhโ€ฆ

#

Is there any errors?

slate swan
#

just the error I sent initially, when I try to run -dm command

velvet tinsel
#

Do you have Intents installed?

#

That may be the problem

kind wind
#

how can you put a cooldown in the commands and the bot says "Hey. You need to wait <remaining cooldown time> to work again!"

slate swan
#

don't think so

slate swan
#

i haven't run into any problems that weren't just stupid code bugs before this one though, and when you dive into the later sections of this bot it gets pretty lengthy

velvet tinsel
slate swan
#

I have paging embeds and the like

velvet tinsel
#

Commands.ext or discord.ext

slate swan
velvet tinsel
#

Nevermind

slate swan
kind wind
#

!d discord.ext.commands.cooldown

unkempt canyonBOT
#

@discord.ext.commands.cooldown(rate, per, type=discord.ext.commands.BucketType.default)```
A decorator that adds a cooldown to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")

A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based either on a per-guild, per-channel, per-user, per-role or global basis. Denoted by the third argument of `type` which must be of enum type [`BucketType`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").

If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandOnCooldown "discord.ext.commands.CommandOnCooldown") is triggered in [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") and the local error handler.

A command can only have a single cooldown.
kind wind
slate swan
#

the bot isn't actually being run off my computer, it's off another server

velvet tinsel
#

Yep.

slate swan
#

@client.event
and
async def
idk what these are they r so confusing

velvet tinsel
slate swan
velvet tinsel
#

read it

velvet tinsel
#

Remember that you also have to have it with command prefix

slate swan
#

oh sorry

velvet tinsel
#

@sullen shoal HELP ME

slate swan
#

missed that

velvet tinsel
#

I HAVE TO ANSWER TWO QUESTIONS AT ONCE

sullen shoal
velvet tinsel
# sullen shoal ?

Please help VDP I have to answer a lot of questions Iโ€™m crying

#

Or anyone else

sullen shoal
#

ah i never used cooldowns before

velvet tinsel
#

Commands.cooldown() no?

#

Buckettype?

sullen shoal
#

could be idk

velvet tinsel
#

I dont want to spoonfeed

kind wind
# velvet tinsel Yep.

Lets pretend I have typed the other stuff for the command
now the cooldown part

@bot.command()
async def work(ctx):
  discord.ext.commands.cooldown(1,300,type=<BucketType.default: 0>

I think that is correct

kind wind
#

oof

velvet tinsel
#

Bot.commands.cooldown(etc, etc)

#

Wait no commands.cooldown()

#

Sorry I misled you there a bit

#

commands.cooldown(*insert code here*)

velvet tinsel
slate swan
velvet tinsel
#

Ok

kind wind
#

it has 3 parameters
rate(int) - The number of times a command can be used before triggering a cooldown.
per(float) - The amount of seconds to wait for a cooldown when itโ€™s been triggered.
type (Union[BucketType, Callable[[Message], Any]]) โ€“
The type of cooldown to have. If callable, should return a key for the mapping.

slate swan
#

yes! it worked. Tysm

velvet tinsel
#

You donโ€™t really need that

kind wind
#

!d discord.ext.commands.cooldown

unkempt canyonBOT
#

@discord.ext.commands.cooldown(rate, per, type=discord.ext.commands.BucketType.default)```
A decorator that adds a cooldown to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")

A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based either on a per-guild, per-channel, per-user, per-role or global basis. Denoted by the third argument of `type` which must be of enum type [`BucketType`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").

If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandOnCooldown "discord.ext.commands.CommandOnCooldown") is triggered in [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") and the local error handler.

A command can only have a single cooldown.
velvet tinsel
kind wind
#

rate, per, type

velvet tinsel
#

Or whatever

#

I donโ€™t want to spoonfeed you

#

Damn I need to read stuff I keep doing the same mistakes

#

commands.BucketType.user is what you want, fill out the rest

wild oak
#

Bro what

#

It was just working i didnt even do anything

velvet tinsel
kind wind
#

but I will put it like with the discord.ext (maybe .commands is requiered) or I will put without it? like cooldown(1, 300, commands.BucketType.user

velvet tinsel
#

Show me the code

wild oak
#

Yessir

wild oak
#

gimme a sec

velvet tinsel
#

Should be it

wild oak
kind wind
wild oak
#

dont hate on me for using glitch

velvet tinsel
velvet tinsel
wild oak
#

I dont even know dude it worked before ๐Ÿ˜ญ

#

๐Ÿ˜‚

kind wind
#

I want to put that inside a command. Why does it have the @?

velvet tinsel
#

Do you do change_presence?

velvet tinsel
wild oak
#

@slate swan Do you think you can help lmao

velvet tinsel
#

He is offline

wild oak
#

Ik

velvet tinsel
#

Show me the code for status_task, I may be slower than the experts but Iโ€™ll try my best

wild oak
#

Hes the one who made it ๐Ÿ˜ฉ

velvet tinsel
kind wind
#
@bot.command()
async def work(ctx):
  @cooldown.command(1, 30, commands.BucketType.user)
#Other code goes below

Like this?

wild oak
#

No no no no you dont understand

velvet tinsel
#
@bot.command()
@commands.cooldown(1, 20, commands.BucketType.user)
Async def work(ctx):
    blah blah
kind wind
#

oh ok

wild oak
#

He made a template on github and i used it like last summer and it was perfect i used it a few days ago and it started to work amazing again then i dont even know what i changed and it started saying that

velvet tinsel
#

Yes Ipayforwinrar you have relieved me of my duty

velvet tinsel
#

Right.

wild oak
#

Bro what

kind wind
#

It works

velvet tinsel
#

Was it a module?

slate swan
# wild oak

Where is the status_task defined? Have you maybe removed it per mistake?

kind wind
#

I will ask more help tomorrow. I am going to sleep. Byeeeelemon_sleepy

velvet tinsel
#

That was what I was thinking

wild oak
#

Lemme check the log thingy

wild oak
#

OHHHHHH

#

I REMOVED THE STATUS THINGY

#

Im so slow dude omg

velvet tinsel
#

There we go

wild oak
#

lmaoo

velvet tinsel
#

Now put it back in

velvet tinsel
#

Ok

#

This is empty and thereโ€™s only me\

wild oak
#

What

#

No sorry i fixed it i removed the thing that changed the status on accident while i was at school

velvet tinsel
#

Ok

#

Itโ€™s only me now

slate swan
#

I mean, I'm half here and half looking at a video

velvet tinsel
#

Ok

wild oak
#

@slate swani fixed it lol

slate swan
#

Glad to hear that

#

am i ok i see no error with this i tried to debug it with the vsc debugger and nothing wrong and it never prints done or pass sub and yes i did the reddit var:


@bot.command()
@commands.cooldown(1, 120, commands.BucketType.user)
async def search(ctx,*arg):
    search = arg
    print("search command has been executed")
    all_subs = []
    multireddit = await reddit.multireddit("setups","supercars","AnimeGirls","anime","Minecraft","apexlegends")
    top = multireddit.top(limit = 500)
    async for submission in top:
        if not submission.is_self:
            sub = submission
            name = sub.title
            if search in name:
                all_subs.append(submission)
                url = sub.url
                em = disnake.Embed(title = name)
                if "jpg" in url or "png" in url:
                    em.set_image(url = url)
                    await ctx.send(embed = em)
                    print("done")
                    break
                else:
                    pass
            else:
                print("passed a sub")
                pass
#

i started using the multireddit instance and everything went downhill lmao

velvet tinsel
#

You have a cooldown

slate swan
velvet tinsel
#

Do you have PRAW?

slate swan
#

or else it will block my code

velvet tinsel
#

Ok

#

Never used asyncpraw only used praw

slate swan
#

its the same tbh just async

velvet tinsel
#

Ahhh

#

I see whatโ€™s the problem

slate swan
#

?

velvet tinsel
#

Itโ€™s because the reddit modules are broken af and it wont work so thats why it will never work. Happened to me before, never use reddit API

#

You dont

#

Or you search it up, youre in the wrong place

slate swan
velvet tinsel
#

Exactly, its broken. Never use it

#

I rate it 1 star

slate swan
#

cause i was using the single one and it worked like a charm

velvet tinsel
#

You download PyCharm

velvet tinsel
slate swan
#

dang ill figure something out

slate swan
velvet tinsel
#

Yay there we go

sullen shoal
#

btw, if "jpg" in url or "png" in url is basically, ("jpg", "png") in url

velvet tinsel
#

Why arenโ€™t you sleeping

slate swan
velvet tinsel
#

Yes

slate swan
#

Hey, my webhook doesn't work for some reason.. I get this error:

TypeError: Object of type Embed is not JSON serializable

velvet tinsel
#

Are you nocturnal like me?

slate swan
#

its 5pm lmao

velvet tinsel
#

Oh

slate swan
#

yeah

#

thx for the helps guys see ya

#

why isnt it working

sullen shoal
#

install discord

slate swan
sullen shoal
#

oh lol

slate swan
#

๐Ÿคฆ

sullen shoal
#

don't name your file discord

sullen shoal
slate swan
#

totally forgot lol

#

idk chief

#

he forgor

#

stop.

#

lmao

#

the dead memes gosh

sullen shoal
#

whats forgor

velvet tinsel
#

Itโ€™s forgot

sullen shoal
#

i thought its smth more than just a typo

slate swan
#

lmfaoooo

velvet tinsel
#

I have a problem

#
import friends
from friends import love

Apparently there is no module named friends, what do I do?

slate swan
#

go to another help channel

velvet tinsel
#

Ok

slate swan
#

๐Ÿ‘

velvet tinsel
#

Will they help me?

slate swan
sullen shoal
#

touch friends.py

slate swan
#

well you should give them more information than you gave us

velvet tinsel
#

Like pip install friends?

sullen shoal
#

should work

slate swan
#

never heard about a lib like that

sullen shoal
#

!pypi

velvet tinsel
#

K

unkempt canyonBOT
#
Missing required argument

package

velvet tinsel
#

!pypi friends

unkempt canyonBOT
slate swan
velvet tinsel
#

Yay!!!

slate swan
slate swan
velvet tinsel
#

Ohโ€ฆ

slate swan
#

damn

sullen shoal
#

check source code

slate swan
#

there's nothing I can do with python

#

๐Ÿ˜ฆ

#

other than discord bots

#

not even a snake game

sullen shoal
#

why tho

slate swan
#

cuz I can't

sullen shoal
#

why tho

slate swan
#

cuz I'm dumb

sullen shoal
#

i see

velvet tinsel
slate swan
#

and lazy to learn other libs

velvet tinsel
#

YES!!!

#

FOUND IT! TYSM GUYS

slate swan
#

np

velvet tinsel
#

Also its spelled pleasure

slate swan
#

np = no problem

#

lmao

velvet tinsel
#

No your status

slate swan
#

rip i needed to delete a whole bot with like 200lines cuz of asyncpraw wasnt working

#

for no reason

#

Anybody have any bot ideas ig?

manic wing
plush cosmos
manic wing
manic wing
plush cosmos
#

-.-

manic wing
#

<3

slate swan
slate swan
#

no errors at all debugged it just errors i cannot handle like bad requests from the api

slate swan
manic wing
#

we wouldnt want that, would we?

slate swan
slate swan
#

i was just asking for ideas no need too get toxicjam_cavedude

slate swan
#
@Blank.command(aliases=["whois"])
async def userinfo(ctx, member: discord.Member = None):
  await ctx.message.delete()
  if not member:
        member = ctx.message.author
  roles = ([role for role in member.roles[1:]])
  embed = discord.Embed(colour=discord.Colour.random(), title=f"User Info - {member}")
  embed.set_thumbnail(url=member.avatar_url)

  embed.add_field(name="ID:", value=member.id)
  embed.add_field(name="Display Name:", value=member.display_name)

  embed.add_field(name="Created Account On:", value=member.created_at.strftime("%a, %#d %B %Y, %I:%M %p UTC"))
  embed.add_field(name="Joined Server On:", value=member.joined_at.strftime("%a, %#d %B %Y, %I:%M %p UTC")+"\u0020")
    
  if roles == []:
     embed.add_field(name="Roles:", value="None")
     embed.add_field(name="Highest Role:", value="None")
     try:
        await ctx.send(embed=embed)
     except Exception:
        await ctx.channel.send("I don't have permission to send embeds in this channel")   
       
  else:
     embed.add_field(name="Roles:", value=", ".join([role.mention for role in roles]))
     embed.add_field(name="Highest Role:", value=member.top_role.mention)
     try:
        await ctx.send(embed=embed)
     except Exception:
        await ctx.channel.send("I don't have permission to send embeds in this channel")```

My whois command, how can I calculate the age of account and the age of user in server (days, months, years)
dusk dust
#

how to create a command from /disable <command>? Example: if the person types /disable shop the shop command is disabled...

visual island
hollow agate
#
@client.command()
async def mute(ctx, member: discord.Member, time=None, *, reason=None):
    format = datetime.now(tz=pytz.timezone('America/Tijuana'))
    formatted = format.strftime("%I:%M %p")
    b = DT.datetime.now().timestamp()
    modlogs = client.get_channel(872909569196707870)
    db = await aiosqlite.connect('database.db')
    cursor = await db.execute('SELECT * FROM mutes')
    rows = await cursor.fetchall()
    muted = discord.utils.get(ctx.guild.roles, name="Muted")
    farmer = discord.utils.get(ctx.guild.roles, name="Farmers")
    apprentice = discord.utils.get(ctx.guild.roles, id=907127783849861120)
    if ctx.message.author.guild_permissions.administrator:
        if member is None:
            e = await ctx.reply('You must mention someone to mute!')
            await asyncio.sleep(5)
            await e.delete()
            await ctx.message.delete()
            return
        if time is None:
            a = await ctx.reply('Please state a time for a timed mute or a reason for a permanent mute!')
            await asyncio.sleep(5)
            await a.delete()
            await ctx.message.delete()
            return
        if reason is None:
            if time[-1] in ['s', 'm', 'h', 'd']:``` This is quite messy, but is there a way that I can somehow determine if the `s`, `m`, `h`, and `d` are touching another letter, if so it does something?

```py
            if time[-1] in ['s', 'm', 'h', 'd']:``` after this line.
slate swan
#

Can someone explain me why this doesn't work?

await ctx.channel.edit(topic="test-topic")```
I don't know if there's an error because it's in a "try"-statement. But it doesn't change it
slate swan
#
except Exception as e:
print(e)
slate swan
# slate swan You can print the exception

I've tried it now. No errors. I even created a new command just to test it out and it doesn't work. Like it doesn't give me any errors but it doesn't change the Channel Topic I really don't understand

slate swan
#

No, I just wanted to check them. But it's very strange because yesterday it worked fine?

slate swan
#

Is there a way the code is bugging or smth? Should I restart my VS?

#

Because it seems like a bug for me

slate swan
#

ik this might sound dumb, but how do you delete bots message

slate swan
#
await ctx.send("This is a bot message", delete_after=20)```
This will delete the Bot's message after 20 seconds the message has been sent
slate swan
slate swan
slate swan
slate swan
slate swan
#

oh wait

slate swan
#

I think only msg.delete() right?

slate swan
slate swan
slate swan
#

If you dont add it it will be instant

#

all good

hollow hemlock
#

how to make it so the command can only run if te author is an admin or having permissions?

slate swan
hollow hemlock
#

thanks!

slate swan
#

Your welcome!

#

can anyone help me? my prefix command isnt working (changes prefix) not comfortable with sending source here cuz skids are always watching, if anyones willing to take it to dms lmk

lyric moat
#

how can i make a command like this?

#

?

slate swan
#

idk

slate swan
#

can anyone help me? my prefix command isnt working (changes prefix) not comfortable with sending source here cuz skids are always watching, if anyones willing to take it to dms lmk

lyric moat
cerulean osprey
boreal ravine
#

โ˜น๏ธ

slate swan
#

Dont know if theirs a better or different to be honest.

#

If its a public bot i am not familiar with invites.

patent lark
unkempt canyonBOT
#

@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.

Note that this check operates on the current channel permissions, not the guild wide permissions.

The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").

This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
patent lark
#

take a look at the documentations to see all the decorators for these kinds of things.

hollow hemlock
#

thanks!

slate swan
#

Na na na bro I am asking for age...

final iron
#

Shit

slate swan
final iron
#

Actually you could still use those and calculate the age

spring flax
slate swan
final iron
visual island
#

yeah, just do datetime.datetime.now() - Member.created_at

hollow agate
#
@client.command()
async def mute(ctx, member: discord.Member, time=None, *, reason=None):
    format = datetime.now(tz=pytz.timezone('America/Tijuana'))
    formatted = format.strftime("%I:%M %p")
    b = DT.datetime.now().timestamp()
    modlogs = client.get_channel(872909569196707870)
    db = await aiosqlite.connect('database.db')
    cursor = await db.execute('SELECT * FROM mutes')
    rows = await cursor.fetchall()
    muted = discord.utils.get(ctx.guild.roles, name="Muted")
    farmer = discord.utils.get(ctx.guild.roles, name="Farmers")
    apprentice = discord.utils.get(ctx.guild.roles, id=907127783849861120)
    if ctx.message.author.guild_permissions.administrator:
        if member is None:
            e = await ctx.reply('You must mention someone to mute!')
            await asyncio.sleep(5)
            await e.delete()
            await ctx.message.delete()
            return
        if time is None:
            a = await ctx.reply('Please state a time for a timed mute or a reason for a permanent mute!')
            await asyncio.sleep(5)
            await a.delete()
            await ctx.message.delete()
            return
        if reason is None:
            if time[-1] in ['s', 'm', 'h', 'd']:``` This is quite messy, but is there a way that I can somehow determine if the `s`, `m`, `h`, and `d` are touching another letter, if so it does something?

```py
            if time[-1] in ['s', 'm', 'h', 'd']:``` after this line.
slate swan
#

im having a weird issue , im making an embed ,
if i use color = 0x000000 ( black color) , the embed's color appear black
but , if i use something like color = 0x000000 or disnake.Color.red() it ignores the black color and sends the embed in red color

#

any idea why?

boreal ravine
#

!e

print(0x000000)
unkempt canyonBOT
#

@boreal ravine :white_check_mark: Your eval job has completed with return code 0.

0
boreal ravine
slate swan
#

i see , so basically its 0

boreal ravine
#

yes

slate swan
#

thanks !

boreal ravine
#

๐Ÿ‘

#

fuck discord autocorrect

#

smh

slate swan
#

mhm i just removed the or and got it to work

boreal ravine
#

yes

#
color = 0
red = "red"
print(color or red)
unkempt canyonBOT
#

@boreal ravine :white_check_mark: Your eval job has completed with return code 0.

red
late wigeon
#

Does anyone know how to delete an interaction response after a button is pressed?

boreal ravine
late wigeon
#

no the one where is says dismiss this message

#

cause I have another button selection in the response and I want it to close after you've clicked the button in it

#

I can't find any api doc on the discord py interactions

boreal ravine
#

you need to click it yourself

boreal ravine
#

Or you could just not respond, but I doubt thats what you want

late wigeon
#

no delete_after either?

boreal ravine
slate swan
#

as kayle just said^

late wigeon
#

that sucks though

#

then the other option, when I click one of the buttons how do i get it to stop loading and say the interaction failed without responding

#

is there like an interaction.completed() or something

slate swan
#

TypeError: Invalid permission(s): manage_server

#
from discord.ext import commands

@commands.has_permissions(manage_server=True)
#

Anyone know why?

patent lark
#

its manage_guild

slate swan
#

my fault

late wigeon
#

how do I get the interaction button to stop loading and say it failed after I pressed it

#

it get's the button press fine but thinks it never finished

#
while True:
      interaction = await self.bot.wait_for("button_click")
      if interaction.component.custom_id == 'team_add':
        await ctx.channel.send('Send player info')
dapper cobalt
#

Why the while loop?

late wigeon
#

true

gloomy coral
#

hi guys! for some reason when i run my bot, the tasks.py gets run twice and shows 2 reminders like this

#

also for some reason, after a while the status stops updating

patent lark
#

make sure there arent 2 instances of the bot running.

gloomy coral
#

i did

late wigeon
gloomy coral
#

everything else works one time.... all commands
but tasks.py works like this only ๐Ÿ˜ฆ

#

sometimes it works 2 times, sometimes once sometimes 4 times

#

also why does the status of bot stop updating after a while?

slate swan
#

can i make my bot repeat a message but in embed?

#

for example, if i do !announce hey

#

it responds with hey in an embed

gloomy coral
#

yes

patent lark
#

thats simple.

slate swan
#

I'm a little lost, i can do normal response but dont know how to put it in an embed

sullen shoal
#

just put an argument and put that as the title or smth

slate swan
#

how about this:

slate swan
patent lark
#
@bot.command() <- command decorator
async def repeat(ctx, *, message): <- function definition with parameters 
  embed = discord.Embed(description = message) <- embed object
  await ctx.send(embed = embed) <- sending the embed```
maiden fable
#

Snow pro

patent lark
#

nah

sullen shoal
#

btw, you dont need to add spaces to separate kwargs if you follow the pep8 styleguide

#
func(hello="world", oof="roblox")```
spring flax
patent lark
#

discord.Embed is an object

slate swan
#

Im sorry im trying to understand everything i do, sorry for bugging

patent lark
#

!d discord.Embed

unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if itโ€™s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
slate swan
maiden fable
#

!d object

unkempt canyonBOT
#

class object```
Return a new featureless object. [`object`](https://docs.python.org/3/library/functions.html#object "object") is a base for all classes. It has methods that are common to all instances of Python classes. This function does not accept any arguments.

Note

[`object`](https://docs.python.org/3/library/functions.html#object "object") does *not* have a [`__dict__`](https://docs.python.org/3/library/stdtypes.html#object.__dict__ "object.__dict__"), so you canโ€™t assign arbitrary attributes to an instance of the [`object`](https://docs.python.org/3/library/functions.html#object "object") class.
sullen shoal
slate swan
#

perfect, understood

maiden fable
#

Thought so

slate swan
#

thank u so much!

patent lark
#

๐Ÿ‘

lament mesa
#

Ratelimit maybe

boreal ravine
maiden fable
#

Try turning on logging

maiden fable
slate swan
#
async def t(ctx):
          ^
SyntaxError: invalid syntax```
#

Does anyone know why? Is there a limit to how many commands you can have?

boreal ravine
slate swan
#
@client.command()
@commands.has_permissions(manage_messages=True)
async def t(ctx):
        await ctx.send(f'{ctx.author.mention} Hey!')
#

thats literally it

boreal ravine
#

wait

slate swan
boreal ravine
#

!e

def b(arg):
  print(arg)
b(1)