#discord-bots

1 messages · Page 828 of 1

nimble plume
#

i change my name to noob pls forgive me

maiden fable
#

what's even happening here

slate swan
maiden fable
#

Rip

#

@nimble plume u need help with add_field?

maiden fable
#

Still?! Smh

slate swan
#

yeah

maiden fable
#

@nimble plume u have to do something like

#
embed = disnake.Embed(...) 
embed.add_field(name=..., value=...) 
await channelslogs.send(embed=embed) 
#

And yea, @slate swan drink some water and calm down

slate swan
maiden fable
#

Cool

desert badger
#

can a discord bot find out if a user is server booster? if yes, how?

maiden fable
unkempt canyonBOT
desert badger
#

oooo

#

whats a property

#

and discord.member.Member

maiden fable
#

Yea the bot

desert badger
#

oh and can a discord bot access and show a users profile banner?

final iron
#

!d discord.Member.banner

unkempt canyonBOT
#

property banner```
Equivalent to [`User.banner`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.banner "discord.User.banner")
desert badger
#

o

maiden fable
#

It's an attribute

blissful bone
#

Hey does anyone know how to do ctx with on_member_join

heavy fox
#

why isnt Member.banner working for me

#
@bot.command()
async def banner(ctx, member: discord.Member):
    await ctx.send(member.banner)
#

or does it have a workaround such as discord.File

slate swan
#

.banner returns is an asset object

#

You gotta use .url

#

member.banner.url

heavy fox
#

oh

blissful bone
# final iron You don't

Welp then my plan failed hard I am attempting to have an on member join check a database to see if the members been there before and if they have notify the owners

heavy fox
#

AttributeError: 'Member' object has no attribute 'banner'

final iron
heavy fox
#

or 1.7.3

#

yes 1.7.3

slate swan
#

update to the master branch or use a fork

heavy fox
slate swan
#

pip install -U git+https://github.com/Rapptz/discord.py

sage otter
#

What’s the point of the -U if it’s gonna pull from master anyway?

slate swan
#

If they already have discord.py installed it won't update, -U flag is used for update if exists

heavy fox
#

now its giving AttributeError: 'NoneType' object has no attribute 'url'

slate swan
#

you need to fetch the member first

#

!d discord.Member.banner

unkempt canyonBOT
#

property banner```
Equivalent to [`User.banner`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.banner "discord.User.banner")
heavy fox
#

ah alright

boreal ravine
#

!d discord.User.banner

unkempt canyonBOT
#

property banner: Optional[discord.asset.Asset]```
Returns the user’s banner asset, if available.

New in version 2.0.

Note

This information is only available via [`Client.fetch_user()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.fetch_user "discord.Client.fetch_user").
boreal ravine
#

read the note

heavy fox
#

thank you

#

AttributeError: 'NoneType' object has no attribute 'url'

@bot.command()
async def banner(ctx, member: discord.User):
    user = await bot.fetch_user(member.id)
    await ctx.send(user.banner.url)

Changed from member: discord.Member to member: discord.User because member is a child of User and User contains id but it still isnt catching up it's id
usage: ,banner @vdev

slim ibex
#

you user variable returns None

heavy fox
boreal ravine
#

does the user have a banner

slate swan
#

Aka, no custom banner

slim ibex
heavy fox
#

oh, i thought its code error because it was throwing errors, shouldve tried it with avatar

#

thank you

slim ibex
#

didn't even know banner existed

#

does that represent the thing in user profile

tulip gazelle
#

hmmm

slim ibex
#

also hello @maiden fable

final iron
slim ibex
#

press on my profile, and the blue area above my pfp

gaunt ice
slim ibex
#

thats the banner correct?

final iron
gaunt ice
#

but when someone again reacts to the quote

#

it resends it again

#

how to fix that

final iron
gaunt ice
gaunt ice
final iron
#

Make an if statement. If the user is inside the list then you ignore it

heavy fox
#

!d discord.Member

gaunt ice
#

but

final iron
gaunt ice
#

list.append(values:type)?

blissful bone
#

Kinda

gaunt ice
#

oh

slim ibex
#

isn't bot.listen() old?

final iron
#

🚪 🏃‍♂️

gaunt ice
final iron
slim ibex
#

oh k lmao

heavy fox
#

Here im trying to get user avatar

@bot.command()
async def avatar(ctx, member: discord.Member):
    user = await bot.fetch_user(member.id)
    await ctx.send(user.avatar.url)

And I'm getting this.
Usage: ,avatar @vdev

blissful bone
#

So it’s list_name.append(values)

slate swan
blissful bone
#

So yes exactly what u said

slate swan
#

user.avatar can be None if there's no Pfp

gaunt ice
slate swan
gaunt ice
slim ibex
#

list.append(values:type) isn't the same as list.append(values)

gaunt ice
#

i want that count

gaunt ice
heavy fox
blissful bone
slate swan
gaunt ice
slate swan
unkempt canyonBOT
#

property default_avatar```
Equivalent to [`User.default_avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.default_avatar "discord.User.default_avatar")
maiden fable
blissful bone
#

I see

slate swan
#

This is for one provided by disx

gaunt ice
#

in this i want that count

heavy fox
#

Oh thank you all, didn't know default_avatar existed

gaunt ice
boreal ravine
gaunt ice
#

i....

slate swan
#

!d disnake.User.display_avatar if you use Disnake something smart like this exists too.

unkempt canyonBOT
#

property display_avatar: disnake.asset.Asset```
Returns the user’s display avatar.

For regular users this is just their default avatar or uploaded avatar.

New in version 2.0.
slim ibex
#

oh no

gaunt ice
slim ibex
#

not another one that doesn't know python and using dpy

maiden fable
unkempt canyonBOT
#

property display_avatar: discord.asset.Asset```
Returns the member’s display avatar.

For regular members this is just their avatar, but if they have a guild specific avatar then that is returned instead.

New in version 2.0.
slim ibex
#

anyways properties are getters and setters

final iron
#

Are you using dpy 2.0

slim ibex
#

python's way is different from other langs like c# where you do

public string Name { get; set; }
final iron
#

No

quick gust
#

No, download from github

maiden fable
#

pip install git+https://github.com/Rapptz/discord.py

quick gust
#

On pypi it's 1.7.3

slim ibex
#

.does pypi stand for python package installer

maiden fable
slate swan
#

btw does anyone know how to make a bot send msges on server privately (like when it says only u can view this msg)

slim ibex
#

ok

final iron
maiden fable
#

!d discord.Interaction.response

unkempt canyonBOT
#

Returns an object responsible for handling responding to the interaction.

A response can only be done once. If secondary messages need to be sent, consider using followup instead.

slate swan
maiden fable
#

(:

final iron
#

There's an ephermal kwarg

#

It can only be done in an interaction though

slate swan
#

thx

dense swallow
#

does anyone know how to merge the commits of the original repo with a fork?

boreal ravine
maiden fable
#

Uhhh?

slate swan
dense swallow
slate swan
#

ah , use fetch upstream

#

you will see it on your repo's page

final iron
#

Jarvide is still alive?

dense swallow
#

yeah?

slate swan
#

also anyone know how to make a discord bot 24/7?

#

Check pins

slim ibex
final iron
slate swan
#

or at least last for the day

slim ibex
#

VPS*

slate swan
#

without paying

boreal ravine
final iron
slate swan
#

electricity bill

gaunt ice
quick gust
slate swan
#

lol

dense swallow
slate swan
final iron
boreal ravine
quick gust
#

finally kayle didn't suggest replit

boreal ravine
slate swan
#

"buy" lol

boreal ravine
#

option 3/4

slate swan
#

they arent 24/7

#

or last the day

boreal ravine
#

how do you know that

slate swan
#

They do?

boreal ravine
slate swan
#

why wud they let u host it 24/7 for free

#

theywont do that

#

Using a host.

slim ibex
#

replit is so bad 💀

boreal ravine
slate swan
#

which hpsts do u reccomend?

#

hosts*

slim ibex
#

Vultr

boreal ravine
slate swan
#

Sneakyhub, Epikhost and railway app works for me

boreal ravine
#

people just misuse it's purpose

slate swan
#

vultr is paid

quick gust
slim ibex
#

You won’t really get a good and reliable host for free

slate swan
#

Aws/google cloud.

#

sad

#

i was thinking to make a bot that spams watch add button on bdfd

boreal ravine
#

BDFD?

slate swan
#

and covert to BDscript

#

worst app.

#

convert*

boreal ravine
#

Whats BDFD

slate swan
#

Bot developer for discord

#

Bot designer for discord

#

*designer

boreal ravine
#

oh

slate swan
#

samething

boreal ravine
#

Isn't that an app on mobile

slate swan
#

ye

#

Uses javascript iirc

#

ok u think u need to watch 12 ads for 1 day hosting

boreal ravine
#

I've used it before when I was a skid, BDscript is bad

slate swan
#

ik

slate swan
boreal ravine
#

oof

slate swan
#

jk

#

i will not

#

if you can get GitHub students pack, replit hacker plan is an option too

#

i alr get 2x 20 second unskippable ads on youtube

#

im not gonna watch more

heavy fox
#

how can i pass a ctx parameter in the command? such as setting default response?

such as

async def avatar(ctx, member: discord.Member = ctx.message.author.id):
rotund frigate
#

can someone help me link two python files for discord?

heavy fox
rotund frigate
#

my file name is test so would i do

#

import .test

heavy fox
#

yes

slate swan
#

ye

rotund frigate
#

with a period

heavy fox
#

yes

rotund frigate
#

?????

slate swan
#

u cant have a .test file

#

thts not a extension

heavy fox
#

my bad

slate swan
heavy folio
slate swan
boreal ravine
slate swan
rotund frigate
boreal ravine
#
member: discord.Member=None
ctx: commands.Context

member = member or ctx.author
slate swan
slate swan
#

u need the full file name

rotund frigate
slate swan
heavy fox
#

whole replit marketing based on live share lmfao

slate swan
#

ikr

#

accidentally put my dc oken on there once

#

token*

#

for bot

heavy fox
boreal ravine
#

x= in the command

slate swan
#

dont u create var x?

heavy fox
#

ohhh, that didnt come to the idea, thanks

rotund frigate
heavy fox
slate swan
#

ahh

slate swan
#

try searching it up

slim ibex
flat solstice
#

So my bot kept telling me that I was exceeding the 1024 char cap on a embed field value which I don't think I was but okay I guess. To remedy this I decided to split the responses up into separate pages and paginate them but It's still giving me the same errorpy HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embed.fields.1.value: Must be 1024 or fewer in length. In embed.fields.2.value: Must be 1024 or fewer in length.so I'm thinking something is going wrong somewhere in my logicpy @commands.command(description = "Get this bots PoC's.", usage = "poc", hidden = False) async def poc(self, ctx): pages=[] first = discord.Embed(title = f"Point of Contact(s) for {self.bot.user.name}", colour = self.bot.primary_colour) pages.append(first) for guild in self.bot.guilds: embed = discord.Embed(title = f"Point of Contact(s) for {guild.name}", colour = self.bot.primary_colour) admins=[] mods=[] pocs=[] for member in guild.members: if member is guild.owner: embed.add_field(name = "Owner", value = guild.owner) elif member.guild_permissions.administrator: admins.append("{member.name}") elif member.guild_permissions.manage_messages or member.guild_permissions.manage_guild: mods.append("{member.name}") else: if member.id == self.bot.config.admins: #member_mention = "<@{member.id}>" pocs.append(str(member)) embed.add_field(name = "Admins", value = ', '.join(admins)) embed.add_field(name = "Mods", value = ', '.join(mods)) embed.add_field(name = "Other PoC(s)", value = ', '.join(pocs)) paginator = Paginator(length=1, entries=pages, use_defaults=True, embed=True, timeout=120) await paginator.start(ctx)

slim ibex
#

The error is quite easy to understand

#

It’s something to do with the values of your fields

#

maybe print out the admins and mods variables?

flat solstice
# slim ibex The error is quite easy to understand

it would be, if the list of admins and mods were long, but the guild with the most mods has 5 mods (so doubtful that that's hitting 1024) and the most admins on any of the servers is 2 (so three's no way that should be hitting 1024.

okay I'll try printing them but i'm thinking there's a logic issue

spring flax
#

can I make this a deco?

async def check_if_can_ping(ctx, member : disnake.Member):
    async with bot.db.execute("SELECT obj_id from mod_ping WHERE type = ?", ('Role',)) as cursor:
        list_of_roles = await cursor.fetchall()
        the_roles = [role[0] for role in list_of_roles]
        list_of_author_roles = [role.id for role in member.roles]
        common_role = (set(list_of_author_roles) & set(the_roles))
        if common_role:
            return False
        else:
            return True
flat solstice
spring flax
#

command decorator

slim ibex
#

not sure if all that will be able to be used in a decorator

#

And decorators take in a function as a parameter and modify it

#

Maybe it could work if you did like

def random_name(func):
    def wrapper():
        func(*args, **kwargs)

    return wrapper
#

I’m not the best with creating decorators and doing special stuff In them. Prolly should learn more about decorators though

slim ibex
#

hunter is prolly better than me at this 🗿

spring flax
maiden fable
#
def cancel_long_invoke(timeout: int = 10, in_a_cog: bool = True):
    """This is what tells Python that it is a decorator which has to be called.
    Remove this and u don't need to call the deco and the name becomes `deco`"""
    def deco(func: Callable[..., Any]):
        """This is what Python does as func = deco(func)"""
        @wraps(func)
        async def wrapper(*args, **kwargs):
            """This is what is returned when the deco is used. Sort of, this is the command or u can say, the function"""
            if isinstance(args[0], Context) and not in_a_cog:
                ctx: Context[Bot] = args[0]
            elif in_a_cog:
                ctx: Context[Bot] = args[1]
            task = ctx.bot.loop.create_task(  # type: ignore
                wait_for(
                    fut=func(*args, **kwargs),
                    timeout=timeout
                )
            )
            try:
                return await task
            except TimeoutError:
                task.cancel()
                return await ctx.send(f"Hey there! Sorry, but the command timed out after {timeout} seconds, {ctx.author}")  # type: ignore
        return wrapper
    return deco

I added some help docstrings in the long invoke thing, I guess this can help

slim ibex
#

yep definitely something out of what I can do 💀

#

time to learn

maiden fable
#

I also never understood decos tbh. Gotta learn more about them haha

flat solstice
#

I'm trying to make my bot skip over bots if it finds them in the members list, this is how I dentify a bot right? if so should I be passing, returning or continueing in order to make to skip over bots whilst will executing the rest of the code```py
for member in guild.members:
if member.bot == True:
return

if member is guild.owner:```

silk goblet
#

how can i make a 'copy' button which copies some text into the clipboard of the button presser?

maiden fable
unkempt canyonBOT
#

@discord.ext.commands.check(predicate)```
A decorator that adds a check to the [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses. These checks could be accessed via [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks").

These checks should be predicates that take in a single parameter taking a [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context"). If the check returns a `False`-like value then during invocation a [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure") exception is raised and sent to the [`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") event.

If an exception should be thrown in the predicate then it should be a subclass of [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError"). Any exception not subclassed from it will be propagated while those subclassed will be sent to [`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").
dense swallow
slim ibex
#

that means that there are issues with the branch you are trying to merge with the master branch

#

Or have you merged it already?

#

there could be competing lines Changes which can cause merge conflicts. Only those can be solved on GitHub

unkempt canyonBOT
maiden fable
#

U do know that this isn't the correct channel, right

slim ibex
maiden fable
#

Oh wait, nvm

dense swallow
#

nvm i deleted the repo

#

and forked again :/

maiden fable
#

Rip

quaint epoch
#

how do i add a task for my bot? like checking a the time constantly

quaint epoch
slate swan
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
quaint epoch
#

nice

slim ibex
#

You can make cron tasks with apscheduler

maiden fable
bitter depot
#
Ignoring exception in view <SnoozeButtonView timeout=60 children=1> for item <SnoozeButton style=<ButtonStyle.secondary: 2> url=None disabled=False label='Snooze Reminder' emoji=None row=None>:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/discord/ui/view.py", line 361, in _scheduled_task
    await interaction.response.defer()
  File "/usr/local/lib/python3.9/site-packages/discord/interactions.py", line 423, in defer
    await adapter.create_interaction_response(
  File "/usr/local/lib/python3.9/site-packages/discord/webhook/async_.py", line 189, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction```Does anyone know what this error means? How can I know which line of code is raising it?
vocal snow
bitter depot
#

Ah wait

#

No

#

I wait for the "..." ellipses to go

#

Then select from the Select (dropdown)

onyx epoch
#

guys

#

if i wanna start learning python

#

where do i start

#

what is the minimum requirement?

vocal snow
minor bobcat
#

hey i want to create a programm that lets u check other ppl's usernames what should i use

bitter depot
vocal snow
#

i see

minor bobcat
bitter depot
#

And my @ui.select one

minor bobcat
#

??

vocal snow
bitter depot
#
    async def callback(self, interaction: discord.Interaction) -> None:
        """Ensure the reminder author matches the user who clicked button and then display select view."""
        if interaction.user.id != self.parent_view.reminder_author_id:
            await interaction.response.send_message(":x: This is not your reminder to react to!", ephemeral=True)
            return

        snooze_select_view = SnoozeSelectView(
            bot=self.parent_view.bot,
            reminder_id=self.parent_view.reminder_id,
            reminder_author_id=self.parent_view.reminder_author_id
        )
        m = await interaction.message.edit(view=snooze_select_view)```here's how I'm changing the view if that matters
minor bobcat
#

why no1 helps D:

slate swan
bitter depot
vocal snow
slate swan
bitter depot
slate swan
#

!d discord.Interaction.message

vocal snow
bitter depot
slate swan
#

Oh button

slate swan
#

Then it couldnt find the client which pressed the button

unkempt canyonBOT
#

class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").

This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").

x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

hash(x) Returns the member’s hash.

str(x) Returns the member’s name with the discriminator.
slate swan
#

Or User

bitter depot
slate swan
#

As you please

maiden fable
#

@bitter depot the most common way to fix that error would be to first to interaction.defer and then using followup to send/edit or anything else

vocal snow
#

you wouldn't be able to edit the original message with followup

maiden fable
bitter depot
#

It seems to be working after Zeffo's suggested change

maiden fable
#

Ah cool

bitter depot
#

Which is really annoying because I literally put a try/except around it

maiden fable
#

Haha

bitter depot
#

Thanks Zeffo, it's working perfectly 👍

slate swan
#
Ignoring exception in command channel:
Traceback (most recent call last):
  File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 168, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\PC\Desktop\testing\modules\config.py", line 63, in _channel
    await self.channel(ctx=ctx, channel=channel, player=player)
  File "c:\Users\PC\Desktop\testing\modules\config.py", line 55, in channel
    raise commands.MissingRequiredArgument(param=channel)
  File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\errors.py", line 171, in __init__
    super().__init__(f'{param.name} is a required argument that is missing.')
AttributeError: 'NoneType' object has no attribute 'name'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 1055, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 933, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\PC\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
    raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'name'
maiden fable
#

Code

maiden fable
#

Bro?

bitter depot
maiden fable
#

Facts

timber crag
#

never to be seen again

boreal ravine
#

.. ok

slate swan
timber crag
slate swan
#
    async def channel(self, ctx = None, interaction = None, channel = None, player = None):
        ch = ctx or interaction
        func = ch.reply if ctx else ch.response.send_message
        if not player:
            raise commands.MissingRequiredArgument(param=player)
        if ch.guild.id == 566648561840685057:
            if not channel:
                raise commands.MissingRequiredArgument(param=channel)
            guild = self._bot.get_guild(566648561840685057)
            category = nextcord.utils.get(guild.categories, name="TRACKING")
            await self.category.create_text_channel(name=f"{player} {ch.user.name}")
            
        
    @commands.command(name="channel")
    async def _channel(self, ctx, player: str = None, channel: nextcord.TextChannel = None):
        await self.channel(ctx=ctx, channel=channel, player=player)
#

yes did sorry

timber crag
#

also is this in a cog?

slate swan
timber crag
#

ok

#

i was gonna ask because i saw hte self

#

yeah just remove the = None on the ctx arg and ur good

slate swan
#

i cant remove it

#

cause i can get ctx or interaction

timber crag
#

well thaats whats causing your error

slate swan
#

someone said its cause param is None

#

and its true cause im passing param player if its None so its obv its gonna be None

#

someone know what type should it be

tacit token
#

hello guys, MEE6 how not use name in embed?

#

i mean nothing bold and etc

slate swan
#

just dont pass title argument i think

#

users = await ctx.message.reactions[0].users().flatten()
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range

timber crag
tacit token
#
embed=discord.Embed(title="test", description="test")
embed.add_field(name="test", value="test", inline=True)
embed.add_field(name="tes", value="tset", inline=False)
await ctx.send(embed=embed)
#

the name is bold

#

if i dont add any name is error

quick gust
#

yes because add_field requires name and value

tacit token
#

yeah

#

ik

tacit token
#

but the mee6 dont use name

timber crag
tacit token
#

ik but the problem is not the title

timber crag
#
embed = discord.Embed(
  description = "This is a description only!",
  color = 0xffffff
)
tacit token
#

yes

timber crag
#

or you can make a new line using \n

tacit token
#

the name is bold

#

the value is classic

fresh orchid
slate swan
#

how do I send an embed content request to a Discord webhook?

#

without dpy

desert badger
#
embed.set_image(url = user.banner.url)

disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'url' what do i do

boreal ravine
desert badger
shadow wraith
#

is there another way of adding buttons to a message other than subclassing discord.ui.View

maiden fable
#

Yea

boreal ravine
maiden fable
#
view = ui.View(timeout)
btn = ui.Button(...)
view.add_item(btn)
await ctx.send("Okay", view=view)
shadow wraith
#

!d discord.ui.View.add_item

unkempt canyonBOT
desert badger
shadow wraith
#

what do i pas

#

in itemor the first param ofc

desert badger
maiden fable
#

the Button or the Dropdown u want to add

shadow wraith
#

oh yeah and my spelling may be wrong because i got a new mechanical keyboard lol

shadow wraith
torn sail
boreal ravine
desert badger
#

ah

#

_user = await client.fetch_user(user.id)

shadow wraith
#

!d discord.ui.Button

unkempt canyonBOT
#

class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.

New in version 2.0.
shadow wraith
#

oh alr

cold sonnet
#

wth is that name

modest plover
#

Can I make colours appear on discord?

#

I have an idea for a discord bot but it needs to utilise colours

boreal ravine
modest plover
#

Jow

#

How*

boreal ravine
modest plover
#

So like letters in a word are different colours

#

I want to make a command that makes a word go a certain colour

quick gust
#

u can use the ansi colour codes

modest plover
#

How do I use them?

quick gust
modest plover
#

And do they work on mobile

quick gust
#

Uh not sure

shadow wraith
#
\u001b[0;40m\u001b[1;32mThat's some cool formatted text right?
\u001b[1;40;32mThat's some cool formatted text right?
#

code block failure 😭

slate swan
#

\u001b[0;31wat

boreal ravine
#

I think they are on ios though

wicked atlas
#

ios does not have colors 😞

shut axle
#

!category @someone
How do I get the member's category?
For example there is a category called HANGOUT
and in the category there is a voice called Voice Ch #1
and someone is in there, so I did the command and I want to get his category name which is HANGOUT...

potent spear
shut axle
#

?

potent spear
#

so you basically just want the bot to reply the category which a mentioned member (who's in a voicechannel) is in?

shut axle
#

If someone is in a voice channel and I am pinging him so it i'll show the name of the voice channel the the member found in. (i did it)
now i want to get also the category name...

potent spear
shut axle
#
@client.command()
async def invc(ctx, catevc: discord.VoiceChannel, *,  member: discord.Member=None): 
    if member is None:
        return await ctx.reply("**:x: You have to mention a member!**")
    if member.voice is None:
        return await ctx.reply("**:x: The user has not connected to VoiceChannel!**")
    category = catevc.category
    vc = member.voice.channel.name
    await ctx.send(f"User is in: `({category}) - {vc}`.")
#

It is not working..

#

@potent spear How can I fix it?

potent spear
shut axle
#

It is not matter. I removed it.

#

The same problem

potent spear
shut axle
#

discord.ext.commands.errors.ChannelNotFound: Channel "@shut axle" not found.

potent spear
#

why would you even mention a channel?

#

think about it

shut axle
#

Why mention?

#

where?

potent spear
shut axle
#

catevc: discord.VoiceChannel?

potent spear
#

yeah, what's that doing there?

shut axle
#

If I remove it, what can I do instead?

potent spear
#

nothing

#

all you need is the member parameter

#

also ctx ofc, for every command

shut axle
#

I want to get the category name.

#

The member has no attribute for that ..

buoyant quail
#

but it seems you want ping user, not channel

shut axle
#

I want to ping the member like that: !invc @member
to get his category name...

#

I already did it for voice name.

potent spear
#

ctx, member: discord.Member

buoyant quail
#

category = member.voice.channel.category
if i remember it right

potent spear
#

yup, those 2 lines are all you need

shut axle
#

category = member.voice.channel.category**.name**

?

quick gust
#

Yeah sure

maiden fable
drowsy thunder
#

Hi,new to python bots

potent spear
#

pay close attention tho, some guilds might not have a category for some vcs

buoyant quail
drowsy thunder
#

Any idea how to make one?

buoyant quail
drowsy thunder
#

I am having a bit knowledge in python

potent spear
drowsy thunder
#

I know python

#

Ok

marble pilot
#

how do i access the bot user inside of a cog

quick gust
#

self.bot

marble pilot
#

self.bot.user?

quick gust
#

sure

marble pilot
#

srry bruh i have to use discord.py for over 2 years

royal jasper
#

how can i do a private message into a channel (like the print)

quick gust
#

empheral=True

slate swan
#

how do I make my bot pirnts its server ID when a user uses a specific command
e.g.

!test
bot: server {ID}

quick gust
#

only works with interactions

marble pilot
royal jasper
shadow wraith
#

spell it right bro

marble pilot
quick gust
slate swan
#

why that is not a int

potent spear
#

it's a string

#

you have to typehint it

slate swan
#

in docs it's a int

potent spear
#

yeah, but you're not passing one

#

show your unban command

#

it should look like

slate swan
#

i have to pass i string and make it a int?

potent spear
#

ctx, userid: int

#

see? you didn't typehint

potent spear
slate swan
potent spear
#

will you now start reading what I typed? orrrrr

#

async, def unban(self, inter, userID: int)

hoary cargo
#

people sure have some weird ways to overcomplicate things

potent spear
#

they do, but I like how he's trying

timber crag
# slate swan

if you use "" instead of '' you wont need to use \'

manic wing
#

^ best to stay true to the "/' you're using

#

you've got inconsistent usage of double and single

slate swan
#

and ' doesn't look good with a sentence either

#

most of the langauges use it only for a character ( single character)

manic wing
#

most code formatters change to " anyway

storm pebble
#
async def add(ctx, *, question):


  embed = discord.Embed(title = "test", description = f"{question}")
  await ctx.send(embed = embed)

how to send it in specific channel using channel id

royal jasper
#

how can I check if a user has more than a few days using discord? (using created_at)

slate swan
#

And julia

manic wing
#

do they enforce it?

#

c just gives shitty error messages when you use the wrong one

slate swan
#

Yep , atleast I'm sure about Julia and rs

manic wing
royal jasper
potent spear
hoary cargo
manic wing
potent spear
#

it has to

nimble plume
timber crag
#

await channel.send(embed=embed)

nimble plume
nimble plume
#

Its my fault i didnt read what i send

#

I apologize for that

storm fable
#

Hey guys, I'm trying to code an unban-command, but it doesn't work. I always get the same error. Maybe you know what I have to do.

slate swan
#

Image doesn't load, but I'm sure it comes from Lucas?

#

Hm

#

!d discord.Guild.unban utilise this

unkempt canyonBOT
#

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

Unbans a user from the guild.

The user must meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.

You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to do this.
slate swan
#

See the loop inside it lmao

manic wing
slate swan
potent spear
quick gust
tacit token
#

hello guys, how to get emoji?

manic wing
#

people copy and pasting code

gaunt ice
manic wing
unkempt canyonBOT
timber crag
#

aa

tacit token
tacit token
storm fable
storm fable
tacit token
#

i have this small command but it send None on another server

@client.command()
async def emoji(ctx):
    await ctx.send(":logoa:")
gaunt ice
gaunt ice
#

u need nitro bro

#

or either the bot must be in both the servers

#

then we can do it

tacit token
#

with the bot

#

bro

gaunt ice
tacit token
#

the bot has an emoji server where there are emojis. I want to send it to another server from there.

#

with select menus etc

gaunt ice
#

hmm so basically is the bot in both the servers

#

lets name the emoji server as server1 and the final server as server2

#

so is the bot in server1 and server 2?

slate swan
#

for example for yert
It's !yert

gaunt ice
#

lol

tacit token
slate swan
#

where you did this

tacit token
#
@client.command()
async def sendemoji(ctx):
    emoji = client.get_emoji(":logo:")
    await ctx.send(f'{emoji}')
#

the id in here but dc remove

slate swan
#

thats definately not what i asked to do

#

you either do py emoji = client.get_emoji(emoji id here) or get the escaped name and py emoji = 'escaped name'

potent spear
#

just send them like this
name:id
if they're custom and not animated ofc

slate swan
#

<:name:id> and add a before first : if its an animated one.

slate swan
#

What's the issue here why is it not printing?

potent spear
# slate swan

you never added the check in the wait_for
but that's not the issue tho

potent spear
slate swan
#

well, i dont think wait_for is the issue

#

cuz its related to line 11

potent spear
slate swan
slate swan
#

bot.run() in the code?

potent spear
#

are you sure you're running the correct code/file too?

slate swan
#

i put client.run()

#

yeah pretty sure

potent spear
#

show us

#

!paste

slate swan
#

check it, dont be pretty sure.

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.

potent spear
#

don't leak the token

gaunt ice
#

yes

slate swan
#
import discord
from discord.ext import commands
import random
import asyncio 

intents = discord.Intents.default()
intents.members = True

client = commands.Bot(command_prefix = "-", intents = intents)

@client.event
async def on_ready():
    print("Bot is ready")
    print("-------------------------------------")


@client.command(aliases=['decideevent', 'eventoss'])
async def decidevent(ctx):
  def check(m: discord.Message) -> bool:
    if m.user == client.user:
      return False  
  list=['event1', 'event2', 'event3', 'event4', 'event5', 'event6']
  await ctx.send("First event:")
  list[0]=await client.wait_for("message", timeout = 20)
  list[0]=list[0].content
  await ctx.send("Second event:")
  list[1]=await client.wait_for("message", timeout = 20)
  list[1]=list[1].content
  await ctx.send("Third event:")
  list[2]=await client.wait_for("message", timeout = 20)
  list[2]=list[2].content
  await ctx.send("Fourth event:")
  list[3]=await client.wait_for("message", timeout = 20)
  list[3]=list[3].content
  await ctx.send("Fifth event:")
  list[4]=await client.wait_for("message", timeout = 20)
  list[4]=list[4].content
  await ctx.send("Sixth event:")
  list[5]=await client.wait_for("message", timeout = 20)
  list[5]=list[5].content
  reply=await ctx.send(":loading: Reestablishing the Caliphate")
  await asyncio.sleep(1)
  await reply.edit(content= ":loading: Taking the boats on a walk")
  await asyncio.sleep(1)
  await reply.edit(content= ":loading: Preparing with homies for Ghazwa E Hind")
  await asyncio.sleep(1) 
  await reply.edit(content="The events have been decided by the council")
  await ctx.send(random.choice(list))

  client.run('token')```
gaunt ice
#

did u assign token

potent spear
slate swan
#

i did

potent spear
#

take it out

slate swan
#

wait

gaunt ice
#

oh yes

potent spear
#

also, fix your check, that'll be your next upcoming problem

slate swan
#

THANKS

#

bruuuuuuuuuh

gaunt ice
#

lol

tacit token
slate swan
#

wdym by menus?

tacit token
slate swan
#

show code

#

hey all i am trying to make a simple discord bot with some basic commands could somebody help me learn some stuff like the basics how to make a bot ? if yes please dm me or respond to this message

tacit token
#

"Select Menu"

slate swan
tacit token
#

the full is:

slate swan
#

if you're wondering what the id of the emoji is, those numbers in the escaped name is the id

#

move the emoji variable inside the function.

slate swan
#

it isnt cached if its outside

tacit token
#

true true

slate swan
mild drift
#

!e

unkempt canyonBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

mild drift
#

e

tacit token
slate swan
tacit token
slate swan
slate swan
slate swan
tacit token
slate swan
slate swan
#

!resources

unkempt canyonBOT
#
Resources

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

slate swan
#

these are some helpful resources which will guide you!

#

if you face any issue, you may use the channels (depending upon kind of problem) of this server to help you.

slate swan
slate swan
slate swan
slate swan
slate swan
#

and you can try your code at the same time.

#

yeah how do i try my code mate

slate swan
slate swan
slate swan
slate swan
slate swan
slate swan
#

modals need a custom id? or is that like a persistent modal?

#

btw can u help me personally in dms and stuff

slate swan
#

ah ic havent worked with them yet and i dont think i will lolll

slate swan
quick gust
#

Since it's new, you might be better off asking in the support server of the fork you're using since most of us have no experience with it

slate swan
quick gust
#

someone from here asked me to help them with a self bot in dms lmao

slate swan
quick gust
#

i don't help with tos breaking stuff

slate swan
quick gust
#

one sec

#

i don't have the link @slate swan do you

hoary cargo
slate swan
#

@quick gust

#

like man just

quick gust
slate swan
#

tell me how to do the basics

slate swan
quick gust
slate swan
quick gust
sage otter
#

100$ for okimii tutoring

#

What a scam

#

When I met him he didn’t even know how to do list comprehension

quick gust
#

yes! his tutions are priceless!

hoary cargo
slate swan
#


for x in range(1, int(amount) + 1):
   user = ''.join(random.choice(string.digits + string.ascii_lowercase) for _ in range(4))
r = requests.get(f'https://tiktok.com/@' + user)
if r.status_code == 200:
            print(Fore.WHITE+"🚫"+Fore.RED + "Taken"+ Fore.RED+ f' {user}')
else:
            print(Fore.WHITE + "✅" + Fore.YELLOW + "Available" + Fore.YELLOW + f' {user}')
            f = send()
slate swan
slate swan
slate swan
slate swan
slate swan
slate swan
slate swan
quick gust
hoary cargo
slate swan
slate swan
quick gust
slate swan
#

slow

quick gust
#

nvm I'm slow

slate swan
#

slow

quick gust
#

again

#

bro stop

slate swan
#

youre slow

#

@slate swan tutor for for 60$ btc I’m broke rn

slate swan
slate swan
#

LOL

slate swan
#

okk

slate swan
slate swan
slate swan
neat pagoda
#

Umm, This might sound stupid, but how to do cycle statuses, I forgot how to do it, I know it's

,status = cycle(["status1","status2"]

But how do you get it to change like that, and how do you specify the seconds, can anyone dm me a solution?

slate swan
#


for x in range(1, int(amount) + 1):
   user = ''.join(random.choice(string.digits + string.ascii_lowercase) for _ in range(4))
r = requests.get(f'https://tiktok.com/@' + user)
if r.status_code == 200:
            print(Fore.WHITE+"🚫"+Fore.RED + "Taken"+ Fore.RED+ f' {user}')
else:
            print(Fore.WHITE + "✅" + Fore.YELLOW + "Available" + Fore.YELLOW + f' {user}')
            f = send()

The amount is only 1 when it’s suppose to be 9

#

And it’s not sending request with send()

neat pagoda
#

maybe try session.get?

slate swan
slate swan
slate swan
neat pagoda
#

well, u have requests.get

#

ok assuming it's like session, try requests.close()

slate swan
slate swan
slate swan
#

delete this now

neat pagoda
#

thxx

slate swan
#

its horrible in every way

rotund nova
#

someone have idea what add to code to set how much winners in giveaway?

slate swan
#

never seen something that bad

#

Are you fucking serious

#

You found the hardest way to do it 😭

#

You will prolly get rate limited for using same program for different Botd?

#

It's just 6-7 line of code you know

slate swan
slate swan
slate swan
#

Ye

#

Elaborate logging? Saving them somewhere?

#
  1. the discord api has dynamic ratelimits
  2. tasks are a thing
  3. starting a loop on ready isnt the best thing to do
  4. why not on ready? on ready gets triggered many times as it gets triggered on cache population and if a bot gets disconnected from the gateway it will for sure trigger it again
  5. youll always have to wait for the bot to get ready first or the gateway will disconnect you
  6. hes talking about in the kwargs in the Bot class
sage otter
#

I’m proud of you Okimii you’ve progressed so far PB_cry

slate swan
#

the run method on the bot instance creates an infinite loop, so you shouldnt run multiple bots

slate swan
#
import random
import time
import crayons
from discord_webhook import *
import random, string, requests, time
from colorama import Fore
import concurrent.futures
import os 

print("{}".format(crayons.green('Made by: alexlol#001')))

def send():
    webhook = DiscordWebhook(url=webhookurl, content="https://tiktok.com/@" + user) 
    response = webhook.execute()


webhookurl = 'web' 

amount = 9


for x in range(1, int(amount) + 1):
   user = ''.join(random.choice(string.digits + string.ascii_lowercase) for _ in range(4))
r = requests.get(f'https://tiktok.com/@' + user)
if r.status_code == 200:
            print(Fore.WHITE+"🚫"+Fore.RED + "Taken"+ Fore.RED+ f' {user}')
else:
            print(Fore.WHITE + "✅" + Fore.YELLOW + "Available" + Fore.YELLOW + f' {user}')
            f = send()
   
  
  

time.sleep(1.65) #DONT CHANGE THIS!!

print('done')
time.sleep(5)

Anyone help?

slate swan
#

Use a json or a seperate file?

neat pagoda
#

that doesn't work, and I mean, like, having the code I have ,status = cycle(["",""])

slate swan
slate swan
#

Lord Okimii will help

#

👁️👁️

slate swan
#

For job ^

slate swan
unkempt canyonBOT
slate swan
neat pagoda
#

does anyone have a better solution for cycling statuses?

#

Ij ust need to know the time bit

#

like how often to cycle

#

That's what i forgot

slate swan
slate swan
full karma
#

hey! i'm pretty new to coding, only know a little python. I'm interested in discord bots, and i'm wondering where to start. any ideas?

slate swan
#

!d itertools.cycle and use next

unkempt canyonBOT
#

itertools.cycle(iterable)```
Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats indefinitely. Roughly equivalent to:

```py
def cycle(iterable):
    # cycle('ABCD') --> A B C D A B C D A B C D ...
    saved = []
    for element in iterable:
        yield element
        saved.append(element)
    while saved:
        for element in saved:
              yield element
```...
neat pagoda
slate swan
unkempt canyonBOT
#
Resources

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

full karma
slate swan
slate swan
#

Pretty much messed up but trying to make something cool

slate swan
#

working on a Pokemon bot ( yes the one I was making pokeapi wrapper for)

#

ah so canary?

slate swan
slate swan
slate swan
#

lemon_sweat yea I'm doing quite the opposite of what one should do

neat pagoda
slate swan
#

Tho i test it using bare asyncio

#

same

neat pagoda
#

!d itertools.cycle status

unkempt canyonBOT
#

itertools.cycle(iterable)```
Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats indefinitely. Roughly equivalent to:

```py
def cycle(iterable):
    # cycle('ABCD') --> A B C D A B C D A B C D ...
    saved = []
    for element in iterable:
        yield element
        saved.append(element)
    while saved:
        for element in saved:
              yield element
```...
neat pagoda
#

same thing ig

#

!d itertools.cycle and status

unkempt canyonBOT
#

itertools.cycle(iterable)```
Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats indefinitely. Roughly equivalent to:

```py
def cycle(iterable):
    # cycle('ABCD') --> A B C D A B C D A B C D ...
    saved = []
    for element in iterable:
        yield element
        saved.append(element)
    while saved:
        for element in saved:
              yield element
```...
neat pagoda
#

ok yeah

slate swan
#

#bot-commands

neat pagoda
haughty quartz
#
@bot.command()
@commands.has_role(894035256129232937)
@commands.has_role(780648554271211542)```can i have 2 roles?
slate swan
# slate swan yes you are

Reason for that is I don't want to make api reqs inside the command itself, so solution for that would be creating functions, and now since there would be many functions ( around 50+) so I'll make it in a wrapper itself

slate swan
haughty quartz
neat pagoda
#
@bot.command()
@commands.has_role(894035256129232937,80648554271211542)
#

otherwise try or instead of comma

slate swan
#

@commands.has_any_role(1,2)

slate swan
haughty quartz
#

okay i'll try these things out! thanks yall

neat pagoda
#

:)

slate swan
slate swan
#

so I wouldn't have to use dictionary keys for everything and objects instead

slate swan
#

Around 5% of what I'll actually need

#

And I tried making json for all the data from pokeapi.co (only Pokemons) it exceeds 70 mbs

slate swan
#

so its more like methods to access the db?

slate swan
#

I mean, that's just for reading purpose

slate swan
#

and it's for the bot, the api wrapper has cache

#

Yep

#

so much things to do for just a bot

sage otter
#

I’m not gonna lie

#

I wanted to do Pokemon bot. But there’s already so many of those.

slate swan
#

yeah

#

All with same names lmao

#

yup

sage otter
#

Thinking about doing yu-gi-oh, Beyblade or some shit

slate swan
slate swan
slate swan
sage otter
#

Leaning towards Beyblade since the concept seems very interesting. Allowing people to collect different bey parts that they can integrate into their bey and allowing them to battle with others.

sage otter
#

Same way you’d battle with a pokemon bot

slate swan
#

could use video manipulation

sage otter
#

Oh fuck no.

slate swan
#

Api reqs go brrrrr

#

and show the actual beyblades of the users never seen that one done before

sage otter
#

That’s would be extremely difficult to integrate.

neat pagoda
#

nvm, how would you make it say Live on YouTube, not Live on Twitch?

slate swan
neat pagoda
#

discord.Activities.Streaming(name=...

sage otter
#

The concept of beyblade bot is already unique

#

That’s why I said im not doing pokemon

slate swan
neat pagoda
#

activity=discord.Streaming(name=StreamName, url=Streams))

slate swan
#

I made 3 views for a slash command ( to be edited in a single command) and don't wanna read the code again

sacred reef
#

hi need a bit of help
'function' object has no attribute 'start'
im tryna dynamically create a task but it keeps making it a function, and i dont want that since it wont start the task

the_task = tasks.loop(seconds=30.0,loop=plant_growth)

this is my function im tryna do

async def plant_growth(self,ctx,trayid,number):

and the part where its meant to run this spaghetti code

the_task.start(self, ctx, trayid, number)

help

neat pagoda
#

maybe watching?

slate swan
#

such a unique idea thats being limited no?

#

shouldnt you go all out?

sage otter
#

I’m not trying to break my back over something so trivial.

#

Maybe img manip

#

That’s as far as I’ll go

slate swan
sacred reef
slate swan
#

your unique idea will get taken away and made in to something better if you dont make the general features of the game

sage otter
#

Okimii I already had plans in mind. What you're suggesting poses extreme difficulty towards the development.

sage otter
#

Functionality comes first. UX comes later.

slate swan
slate swan
sage otter
#

You get the same experience with pokemon bots yet people still dig those

sacred reef
#

ive really never used tasks like this before

slate swan
slate swan
sage otter
#

Because in the end someone will find a way to one up the bot

sacred reef
#

i want to make a background task dynamically

sage otter
#

Being the original is good enough for me

slate swan
sage otter
#

No because that’s not a thing you can doc

sacred reef
#

so i can have 1-2 background tasks for some shit and im too much of a lazy person to make it check and update all the plants itself

sage otter
#

Software is always being one upped

#

There’s never gonna be something at the top

#

And just stays there

slate swan
slate swan
sage otter
#

I have no idea what you just said okimii.

sage otter
#

With what I said tho.

#

You can continue to try to strive to the top

#

Continuous development

#

I’m not just gonna release the bot and stop there.

slate swan
sage otter
#

Sarthak back me up here please.

slate swan
#

just as the example I showed above

sacred reef
#

wait really?

slate swan
sacred reef
#

when i tried doing that it would only run it once

slate swan
#

but making a bot thats so limiting that it limits the show itself makes it look like the developer of it never thought about it well or were limited by themselves

slate swan
#

take discord.py as an example 🏃 danny made discord.py as the sole maintainer
And then py-ahem library , a bunch of Devs with a low success rate

#
@bot.event
async def on_message(message):
    if message == "Hey":
        print(f"Hey")
    else:
        pass
```Is this correct?
#

yes it's correct, syntax wise

#

Why do you need partial messagable?

royal jasper
#

this code is not working, what is wrong?

@client.command(name='email')
async def enviar_email(ctx, membro, *, mensagem):

    member = ctx.author
    data_entrada = member.joined_at.strftime("%b %d, %Y")

    if data_entrada < datetime.timedelta(days=7):
        await ctx.reply('**OPS** | Você precisa ter esta conta ({1}) dentro do servidor a mais de `1 semana` para executar este comando. :confused:'.format(ctx.author.name), mention_author=False)
    else: pass

    await ctx.send(f'{mensagem}\n\n~ enviado por {ctx.author.mention} para {membro}')
slate swan
sacred reef
#

@slate swan
RuntimeError: Task is already launched and is not completed.
i tried running the task twice for 2 diff plants

#

it did run the task

#

but only once before displaying this error

#

3 times actually

slate swan
#

Show code

#

How did you reinstall it?

sacred reef
#
@tasks.loop(seconds=10.0)
async def plant_growth(self,ctx,trayid,number):
  ...
  plant_growth.start(self,ctx,trayid,number)
async def hydrotray(self, ctx,number,trayid):
    if plt.endswith("Plant"):
      try:
       plant_growth.start(self, ctx, trayid, number)
      except Exception as e:
        await ctx.send(f"ERROR: {e}")
    else:
      return
#

the hydrotray is a function that is meant to shorten the command

sacred reef
#

both the function and loop are very long so i only highligted the important parts

spring flax
#

Timestamp markdown is not supported on mobile?

sacred reef
slate swan
slate swan
spring flax
royal jasper
sacred reef
#

like i said hydrotray is a function inside a bot command like

@bot.command()
async def yadada(ctx, number, trayid):
 await hydrotray(ctx, 1, tray1))
spring flax
#

Actually then which one works for mobile also?

royal jasper
slate swan
#

!e py from datetime import datetime print("<t:",datetime.now().timestamp(),":f>")

scarlet aurora
#

how can i make it so that a bot event get's turned into a function whenever it's called in the code? def choice(): @bot.event async def example():

unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

<t: 1644954043.963345 :f>
slate swan
#

<t:1644954043:f>

slate swan
manic wing
#

<t:1644954043.963345:f>

slate swan
#

Change it to an int

#

Remove . And numbers after that

manic wing
#

<t:1644954043:f>