#discord-bots

1 messages · Page 705 of 1

sage otter
#

cast the Member | User object to a string

slim whale
#

what xd

quick gust
#

wrong server

dapper fern
#

my bad lol

sage otter
#

await ctx.send(str(ctx.author))

slim whale
#

oh

#

thanks :D

sage otter
#

Honestly I’m pretty sure anything passed into content is casted anyway. AMshrug you can probably just
await ctx.send(ctx.author)
and call it a day.

snow flare
#

How can I make a cooldown for buttons?

slate swan
#

@quick gust your main file is using disnake right?

quick gust
#

yeah

slate swan
# quick gust yeah

well your cog is using dpy and your main file is using disnake that may be the error

quick gust
#

ah

#

right

slate swan
#

tell me if it works or not

quick gust
#

alr

quick gust
slate swan
quick gust
#

I think I sent an ss of the wrong imports earlier lmfao

quick gust
slate swan
#

thats correctyert

quick gust
#

yes

slate swan
# quick gust yes

imagine thinking that return is broken in dpy smh sometimes i wonder how stupid i can be lol

steel void
#

guys, how can i make a message send every 10m in discord.py

slate swan
steel void
#
py 
@tasks.loop(minutes=1)
async def my_background_task():
    format = '%Y-%m-%d %I:%M %p'
    now_utc = datetime.now(timezone('US/Eastern'))
    channel = client.get_channel(919746368027918357)
    await channel.send(now_utc.strftime(format))
@my_background_task.before_loop
async def my_background_task_before_loop():
    await client.wait_until_ready()
my_background_task.start()
#

i forget how to make it embed with the python syntax or w.e

faint echo
# steel void guys, how can i make a message send every 10m in discord.py

https://discordpy.readthedocs.io/en/stable/ext/tasks/index.html?highlight=tasks loop#discord.ext.tasks.loop
By using tasks.loop and specify the time which is 10 minutes.
Then have your command below it

#Make sure that your loop started
#on on_ready you should do:
#message_to_be_sent.start()

@tasks.loop(minutes=10)
async def message_to_be_sent():
  print("I am cool")
  # To send it in a text channel you will need to know the ID of the channel.
  # then simply await and send it to channel.
steel void
#

how should i go about defining the channel id

#
@tasks.loop(minutes=1)
async def my_background_task():
    format = '%Y-%m-%d %I:%M %p'
    now_utc = datetime.now(timezone('US/Eastern'))
    channel = client.get_channel(919746368027918357)
    await channel.send(now_utc.strftime(format))
#

cause i have this, shouldnt this already work no?

faint echo
steel void
#

can you link me in the right direction to figure that out, sorry for asking nobo questions im new to discord.py

shadow wraith
steel void
#

will do give me a minute

steel void
shadow wraith
#

wait how did you define timezone

steel void
#

now_utc = datetime.now(timezone('US/Eastern'))

slate swan
shadow wraith
#

i tried to run that in my code but it didn't work

#

timezone isn't defined it seems.

steel void
#

you got to import it

#

from datetime import datetime
from pytz import timezone

proven osprey
#

when i click on the button it shows me this

#

Will be grateful for help

manic wing
#

@slate swan i helped before everyone else

quick gust
#

shared the wrong imports

manic wing
#

.

slate swan
manic wing
#

smh

quick gust
#

yes I know

#

thank you Caeden and okimii

slate swan
#

yw

manic wing
#

sulks

manic wing
unkempt canyonBOT
#

discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").

The following, but not limited to, examples illustrate when this event is called...
manic wing
#

what discord.py version are you and what library is that?

#

send full traceback please

proven osprey
#

everything is correct untill i click the button, than it writes me about error

#

Traceback (most recent call last):
File "C:\Users\user1\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
TypeError: on_voice_state_update() missing 1 required positional argument: 'ctx'

manic wing
manic wing
proven osprey
#

did it

#

but now it can't define ctx

quick gust
#

response.channel.send should work I think?

#

in place of ctx.send

manic wing
#

^

#

you cant just magic up a ctx

visual echo
#

Anyone know how to add required permission for a command

steel void
#
@client_main.event
@tasks.loop(minutes=1)
async def my_background_task():
    format = '%Y-%m-%d %I:%M %p'
    now_utc = datetime.now(timezone('US/Eastern'))
    channel = client.get_channel(919746368027918357)
    message = await channel.send(now_utc.strftime(format))
my_background_task.start()

i get this error now raise TypeError('event registered must be a coroutine function')
TypeError: event registered must be a coroutine function

quick gust
#

every arg is required by default I believe

proven osprey
#

i think i did something wrong at response

#

now i click on the button and its nothing happening

manic wing
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").
manic wing
visual echo
#

What is the permission for admitstoe

steel void
#

then i get client is not defined

visual echo
#

Administrator

velvet tinsel
#

administrator? In where

manic wing
unkempt canyonBOT
#

class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.

The properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools. This allows you to edit permissions.

Changed in version 1.3: You can now use keyword arguments to initialize [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") similar to [`update()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.update "discord.Permissions.update").
slate swan
visual echo
#

Ty

manic wing
# steel void then i get client is not defined

remove the entire line... it should just be ```py
@tasks.loop(minutes=1)
async def my_background_task():
format = '%Y-%m-%d %I:%M %p'
now_utc = datetime.now(timezone('US/Eastern'))
channel = client.get_channel(919746368027918357)
message = await channel.send(now_utc.strftime(format))
my_background_task.start()

#

and client should be client_main

steel void
#

i tried that before

manic wing
#

if your instance is client_main

manic wing
steel void
#

client_main

#

that screenshot basically just says NameError: name 'client' is not defined

jagged root
#
  File "main.py", line 56, in <module>
    bot.run(os.getenv("TOKEN"))
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
    return future.result()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
    await self.start(*args, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start
    await self.login(*args, bot=bot)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login
    await self.http.static_login(token.strip(), bot=bot)
AttributeError: 'NoneType' object has no attribute 'strip'
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
  * Running on http:/// (Press CTRL+C to quit)
 - - [24/Dec/2021 19:09:28] "GET / HTTP/1.1" 200 -
#

whats that

manic wing
steel void
#

oh will try now! I'll let you know

manic wing
jagged root
#

hm

manic wing
#

you need to copy the bot token and pass it into bot.run(...)

steel void
#

This error appears now AttributeError: 'NoneType' object has no attribute 'send'

jagged root
# manic wing you didnt pass the correct token
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://172.18./ (Press CTRL+C to quit)
172.18.0.1 - - [24/Dec/2021 19:13:40] "GET / HTTP/1.1" 200 -
Traceback (most recent call last):
  File "main.py", line 56, in <module>
    bot.run(os.getenv("TOKEN"))
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
    return future.result()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
    await self.start(*args, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 666, in start
    await self.connect(reconnect=reconnect)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 601, in connect
    raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
 172.18 - - [24/Dec/2021 19:13:40] "GET / HTTP/1.1" 200 -```
now this
unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

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

bot = commands.Bot(command_prefix="!", intents=intents)

For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.

manic wing
#

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

jagged root
#

?

jagged root
#

oh

manic wing
jagged root
#

ty

devout iris
#

How to make mobile activity?

steel void
#

it is though, i just verified / copied / pasted it again and even tried a different channel

manic wing
steel void
steel void
silver iris
#

How do I embed an image through the bot

#

As a large image

#

Not just as a thumbnail

cedar stream
#

!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.
cedar stream
#

i think its image argument

manic wing
silver iris
steel void
#

oh i figured it out, it sent once already, i need to verify it will loop i added await client_main.wait_until_ready()

cedar stream
steel void
#

omg I fixed it, thanks everyone for the help

unkempt canyonBOT
silent portal
#

How can I get rid of this?

cedar stream
#

what did you do to get ratelimited

silent portal
#

how long

silent portal
cedar stream
cedar stream
silent portal
#

my code only has 1 command

torn sail
silent portal
#

why

cedar stream
torn sail
silent portal
cedar stream
#

dont they have multiple servers?

torn sail
torn sail
cedar stream
silent portal
#

Why didn't I ever had problems before? Just after installing 2.0 for sum reason

silent portal
#

hmm kk

manic wing
# silent portal

thats not you - replit has a lot of bots being hosted so it often gets ip ratelimited

silent portal
#

Where do you guys host ur bots?

echo lagoon
#

oh, wanted to ask is there someway to auto deploy to a pi? like thru github after pushing changes. . .

silent portal
cedar stream
silent portal
#

when I run it with visual studio it works

sage otter
torn sail
manic wing
echo lagoon
#

you dont host your bot on your computer? i just leave my computer on 24/7

torn sail
cedar stream
silent portal
#

i see

echo lagoon
cedar stream
silent portal
cedar stream
#

put that in google

silent portal
#

k tyy

torn sail
echo lagoon
# echo lagoon welp,

i did restart this morning after taking that screenshot, needed to do a windows update, also ram usage got out of hand, firefox alone was using 11gigs . - .

cedar stream
#

u have to use n1 micro vm instance i believe

#

not sure, definitely look into it b4 doing

manic wing
cedar stream
#

@echo lagoon do you want to push on ur computer and have it update on pi automatically

cedar stream
#

brb

#

lemme check something

echo lagoon
#

thanks!

velvet tinsel
#

Hello enslo

cedar stream
manic wing
cedar stream
#

u can use webhook

#

have a rest server

echo lagoon
#

guess that works, i already have one for a command

cedar stream
#

when it gets update from github it pulls and restarts the bot

cedar stream
echo lagoon
#

o h, thought you meant on the computer, got an image upscale command which requires a beefy gpu, already set up a restful api, where it handles the task ...

cedar stream
cedar stream
#

pi has to listen for requests from github

slate swan
#

hell yea

cedar stream
#

hi adx

echo lagoon
#

a h, could i not do it the other way around, where the pi queries github?

slate swan
#

gotta do sum verification shit now

echo lagoon
cedar stream
echo lagoon
cedar stream
#

i just told u my point of view

echo lagoon
#

ye, ill see what works for me. . . dont think ima move my bot to a pi just yet either. . . couple things to sort out

manic wing
#

apologies for my language

cedar stream
manic wing
#

yeah...

echo lagoon
#

0.o

cedar stream
#

LMFAO

slate swan
slate swan
cedar stream
slate swan
#

uh

cedar stream
slate swan
#

find out and see

#

autonsfw ? whats even that

manic wing
echo lagoon
#

. - .

cedar stream
slate swan
#

to some channel ?

#

lmao shrug

cedar stream
#

yes

echo lagoon
#

how do you select a channel?

slate swan
# cedar stream Basically it spamms porn

in dpy server it says this

async def get_pre(bot, message):
  return "prefix"  # or a list, ["pre1","pre2"]

bot = commands.Bot(command_prefix=get_pre ...```

the callable will be called on each command process, and can return something different each time
cedar stream
cedar stream
echo lagoon
#

ah,

cedar stream
#

but ig the bot is commands.Bot if anything

slate swan
#

just moved all channels to 1 file tho

cedar stream
echo lagoon
#

^

slate swan
#

^

manic wing
#

^

slate swan
#

^

manic wing
#

^

slate swan
#

^

manic wing
#

^

cedar stream
#

^

manic wing
#

^

slate swan
slate swan
#

and didn't bother to learn db usage now either

manic wing
#

private projects
porn bot

slate swan
#

its easy istg, way easier than json hmmCat

manic wing
#

just ... why

#

fucking weird man

slate swan
manic wing
#

right now - what would your parents say if they saw it?

slate swan
#

I dont make porn for my self dude

cedar stream
#

kinda concerning

manic wing
#

the amount of horny little fucks on this app...

cedar stream
cedar stream
slate swan
#

hm I might just send the file where all server names are stored here

echo lagoon
cedar stream
#

mby this is the right path to take in bot deving

manic wing
#

hate to be this guy but... probably time to steer back on topic

brave vessel
#

.topic

lament depotBOT
#
**What feature would you be the most interested in making?**

Suggest more topics here!

manic wing
cedar stream
#

hmm

manic wing
slate swan
#

lets say

manic wing
#

the way you type in a help channel and it makes it occupied and then it closes after x minutes etc

#

thats pretty cool

cedar stream
slate swan
manic wing
#

what moderation features are you after? they're all pretty easy

slate swan
#

idk

cedar stream
#

automod is kinda fun

slate swan
#

haha

manic wing
#

nah too hard to get it right

echo lagoon
#

welp, other bots do it fairly well already

cedar stream
slate swan
#

maybe less moderation feature but probably some server backup / template bot

slate swan
#

might try to make one someday

#

when I've fixed my shitty code and servers

cedar stream
#

mby a bot that lets u create a server with commands

#

like add staff chats etc

manic wing
echo lagoon
slate swan
patent lark
#

what did i just walk into-

cedar stream
cedar stream
slate swan
cedar stream
#

features

manic wing
#

if the automod detects if word x is in word y it would raise error at 'circumcission'
if the automod detects word x == word y it wouldnt raise error at 'fucking' its so hard to get it right

slate swan
cedar stream
slate swan
#

.topic

lament depotBOT
#
**What commands/features are you proud of making?**

Suggest more topics here!

cedar stream
slate swan
manic wing
patent lark
slate swan
patent lark
#

ima just walk away lol

slate swan
manic wing
#

my tokens open source if you can find it

cedar stream
# lament depot

those welcome message with image manipulation rly payed off

manic wing
#

mathematically embedded into my code

cedar stream
slate swan
#

.topic

#

these topics suck

manic wing
slate swan
cedar stream
slate swan
cedar stream
#

jk, dont

#

.topic

lament depotBOT
#
**Do you think there's a way in which Discord could handle bots better?**

Suggest more topics here!

cedar stream
#

add back verified dev badge

slate swan
manic wing
#

is that not a thing?

slate swan
cedar stream
slate swan
#

how were u able to get it

slate swan
#

sadly

#

were

cedar stream
slate swan
#

ah

slate swan
#

😔

untold token
#

What even happened here-

slate swan
slate swan
#

english lessions right here in discord bots

cedar stream
#

tho i also read it where 1st time

slate swan
#

my bad i forgot english isnt my native languagejam_cavedude

manic wing
#

can someone just ask a help question

torn sail
slate swan
#

dude what, I was looking thru all the discords my bot is in, this is one of the names

"that one sad homo's server"

shrewd inlet
#
bot = commands.Bot(command_prefix=";",activity=discord(type=discord.ActivityType.watching,name="you half-drunk happy"),help_command=None,intents=discord.Intents().all())
untold token
#

!ot

unkempt canyonBOT
slate swan
#

wrong prefix

cedar stream
shrewd inlet
#
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    bot = commands.Bot(command_prefix=";",activity=discord(type=discord.ActivityType.watching,name="you half-drunk happy"),help_command=None,intents=discord.Intents().all())
TypeError: 'module' object is not callable
echo lagoon
#

welp, gonna make a music bot, anyone got a good guide?

shrewd inlet
#

anyone know what i did wrong?

cedar stream
manic wing
#

discord.Activity(type=....,

#

also that I think

#

two things there

untold token
#

^ yeah that too

echo lagoon
untold token
#

Also please follow pep-8

manic wing
# untold token Also please follow pep-8
__builtins__['print'](str((__0__:=lambda: None)==((_0:=1),)).replace('False', '') if True is True else True is True, end='');_:__import__('typing').Callable[[str],str] = lambda m=None: True if m is False else False; print.__call__(bool(''.join(list(map(lambda __m__: __m__.lower(), str((__:=(_,))[0](True if (___:=lambda e=None: _())() else (_)==(_)==[_])))))))
``` like this?
slate swan
cedar stream
untold token
echo lagoon
cedar stream
manic wing
slate swan
#

!ytdl

unkempt canyonBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
slate swan
cedar stream
slate swan
#

haha fuck this im not gonna even verify

untold token
slate swan
cedar stream
slate swan
cedar stream
#

dudes dreams got crushed

shrewd inlet
#

does anyone know how i can make my bot status the mobile icon?

untold token
shrewd inlet
slate swan
cedar stream
slate swan
#

we are talking about discord bots

cedar stream
#

^

shrewd inlet
untold token
cedar stream
untold token
#

Only statuses bots can have are online dnd and invisible

#

!d discord.Status

unkempt canyonBOT
#

class discord.Status```
Specifies a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") ‘s status.
slate swan
#

is it morally wrong to collect data, names of nsfw servers?

untold token
#

!d discord.Activity

unkempt canyonBOT
#

class discord.Activity(**kwargs)```
Represents an activity in Discord.

This could be an activity such as streaming, playing, listening or watching.

For memory optimisation purposes, some activities are offered in slimmed down versions:

• [`Game`](https://discordpy.readthedocs.io/en/master/api.html#discord.Game "discord.Game")

• [`Streaming`](https://discordpy.readthedocs.io/en/master/api.html#discord.Streaming "discord.Streaming")
untold token
cedar stream
slate swan
#

ahahahah what someone named thier server "Homework Folder" and invited my nsfw bot into it

slate swan
#

can someone explain how a bot has no status but still works? would like to know

manic wing
#

i have no status and i still work

cedar stream
manic wing
#

a bot doesnt need a status

patent lark
#

since when do you need a status to work

manic wing
#

!d discord.Status.offline || or do you mean this?

unkempt canyonBOT
cedar stream
#

status (Optional[Status]) – Indicates what status to change to. If None, then Status.online is used.

silent portal
#

How can I ignore any other commands which were sent that are not in my code? If I only have !lol as a command. And ppl type !hello. It gives me an error that it doesn't exist. How can I completely ignore that?

cedar stream
#

if its none, it will show as online

untold token
#

I think there was a bug that allowed bots to have the mobile icon status

cedar stream
#

lemme send u link

untold token
#

I saw that in few bots, but I never really looked into it

patent lark
silent portal
cedar stream
untold token
#

Oh there

#

Wait huh

patent lark
#

confusing

untold token
#

Thats weird

#

Exactly, that should have worked

patent lark
#

is there no documentation for it

cedar stream
untold token
#

There is

patent lark
#

then why didnt the command work lmao

untold token
#

It's a bug then

cedar stream
silent portal
patent lark
silent portal
#

k ty

patent lark
#

the event will be called on any raised exception

#

so when an exception is raised, you can handle, whether you choose to ignore it, or even send an error message is up to you.

cedar stream
#

under global error handling @silent portal

silent portal
#

k ty

slate swan
eager frost
manic wing
#

jesus bloody christ you're ambitous

cedar stream
eager frost
#

oh its just a GUI to let the user drag and drop multiple images

wary zenith
cedar stream
eager frost
#

not really more like a small program

manic wing
cedar stream
wary zenith
cedar stream
#

@eager frost

eager frost
#

people in here are gonna be more informed on discord development

#

even if the channel name doesnt exactly match

slate swan
eager frost
#

like for example I already asked this in other channels and its dead

cedar stream
slate swan
# patent lark no

sorry,i dont remember what he said hes always explaining stuff in big paragraphs jam_cavedude

cedar stream
eager frost
#

I feel like maybe its an API?

sick birch
#

Attachment links?

#

Like the link media gets when you upload it to discord?

eager frost
#

yeah

cedar stream
#

that can only be generated by discord

sick birch
#

Just upload it into a test server and copy the link

#

this way discord kind of acts like a google drive for you

cedar stream
#

or make ur own server where u store media and give em some link

#

but ud need a domain

#

and idk how it would work if u sent the link in discord

eager frost
cedar stream
cedar stream
#

you would have to save it to ur own server and give it ur link

#

and server not as discord server

#

more of a rest server where u can upload and get media from

patent lark
#

@untold token so i guess we were using the incorrect symbol, thats why the documentation refused to pull up

sick birch
#

you can also upload it to a discord server

#

with just you and copy the link

patent lark
#

rather than discord.on_command_error. it should have been discord.ext.commands.Bot.on_command_error

velvet tinsel
#

Oh

cedar stream
#

Oh

slate swan
#

Oh

patent lark
#

Oh

slate swan
#

With the new timeout feature in discord is there any way to manipulate it with a bot?

#

Ping me with response

dapper cobalt
slate swan
#

?

thin kelp
#

Do the inline fields of embeds not work on discord Mobile

lapis lintel
#

Which is a fork of dpy

manic wing
#

nothing works on mobile

velvet tinsel
#

:this_tbh:

manic wing
#

rip nitro

thin kelp
#

I'll look at it later

#

Could be just me being stupid

shrewd inlet
velvet tinsel
shrewd inlet
#

oh yeah and changing the color of roles by hex codes cus u can’t do that on mobile (yet)

velvet tinsel
#

I never do anything on mobile apart from trash talking splitgate players and scrolling through reddit lol

sour lodge
#

are most popular bots made with discord.py or discord.js

manic wing
manic wing
velvet tinsel
#

I doubt they'll be written in dpy lol

cedar stream
velvet tinsel
#

Dank memer is written in .js I've looked through source code

manic wing
slate swan
#

It's by far not the only good wrapper

manic wing
#

meh nodejs is irrelevant who gives a shit about it

#

!ot-names || before you correct me 😳

unkempt canyonBOT
cedar stream
velvet tinsel
velvet tinsel
slate swan
unkempt canyonBOT
#

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

Times out the member from the guild; until then, the member will not be able to interact with the guild.

Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.

You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.

New in version 2.3.
shrewd inlet
velvet tinsel
slate swan
slate swan
shrewd inlet
#

i’ve heard of disnake and other things like that

slate swan
#

You can choose what to install I believe.

shrewd inlet
cedar stream
#

shrewd inlet
#

also is it bad to use replit ? 😭

slate swan
#

It's a normal python library, choose which one to install

shrewd inlet
slate swan
#

And yes it's indeed bad to use replit

shrewd inlet
shrewd inlet
slate swan
#

read that

velvet tinsel
cedar stream
shrewd inlet
#

oh

slate swan
shrewd inlet
velvet tinsel
slate swan
shrewd inlet
#

alright

#

can i transfer my code though ??

velvet tinsel
#

PyCharm

shrewd inlet
#

i don’t wanna type everything all over again

velvet tinsel
shrewd inlet
velvet tinsel
#

it does it more efficiently

slate swan
velvet tinsel
shrewd inlet
velvet tinsel
#

it's not

shrewd inlet
#

o

slate swan
velvet tinsel
slate swan
#

it is

cedar stream
velvet tinsel
#

you need to have the folders and everything

shrewd inlet
#

o

velvet tinsel
slate swan
velvet tinsel
velvet tinsel
cedar stream
slate swan
slate swan
velvet tinsel
slate swan
shrewd inlet
#

i don’t have any folders

#

like at all ..

slate swan
#

vsc is more light compared to pycharm

cedar stream
velvet tinsel
#

I dont think so...

#

afaik

cedar stream
#

🤷🏼‍♂️

#

Kinda sucks

velvet tinsel
#

yeah

#

draggin' droppin' the whole lot

slate swan
#

hes starting how much folders would he have jeez

velvet tinsel
#

oh

slate swan
#

just use my method lol

velvet tinsel
#

I didn't know that, sorry 😦

velvet tinsel
slate swan
#

@shrewd inlet you store your token in a .env file right🕴️

cedar stream
slate swan
shrewd inlet
cedar stream
#

If you push it to git

slate swan
velvet tinsel
cedar stream
#

Hub

slate swan
slate swan
velvet tinsel
cedar stream
slate swan
cedar stream
#

You dont hardcode the token

velvet tinsel
#

it's ||never gonna give you up, never gonna let you down, never gonna run around and desert you||

slate swan
velvet tinsel
#

I shouldnt have leaked it

cedar stream
slate swan
#

ill store it in a py file later

velvet tinsel
#

merry crismis

cedar stream
#

Merry Christmas

slate swan
cedar stream
#

.topic

lament depotBOT
#
**What feature would you like to see added to the library? What feature in the library do you think is redundant?**

Suggest more topics here!

velvet tinsel
cedar stream
#

Wdym

slate swan
velvet tinsel
#

yeah

slate swan
velvet tinsel
#

I dont want to do async def unban

velvet tinsel
cedar stream
#

What do u wanna do…

slate swan
#

thats not related to dpy?

cedar stream
velvet tinsel
#

it is

#

I don't want to do

@bot.command()
async def unban(ctx, member:discord.Member):
  ...

I just want

@bot.command()
async def unban(ctx, member:discord.Member):
  await unban(member)
slate swan
# velvet tinsel it is

dpy only knows its a command because of the decorator on top of it the rest is just a async function 😭

slate swan
#

i think he wants like

@bot.command(ban member reason)
await ban(reason)

or something idk

#

just doesnt make sense

silent portal
#

You have to specify a reason

#

Either in ur message or you can specify a one in ur code

cedar stream
velvet tinsel
velvet tinsel
silent portal
velvet tinsel
#

I would like an unban command like the await ban() command

#

it would be nice

#

and custom status like what @slate swan said

cedar stream
cedar stream
unkempt canyonBOT
#

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

Unbans this member. Equivalent to [`Guild.unban()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.unban "discord.Guild.unban").
cedar stream
silent portal
#

owo

cedar stream
slate swan
#

that would be cool

cedar stream
slate swan
cedar stream
#

Current implementation is fine

#

I think dpy has a pretty nice api

cedar stream
#

He wanna know

velvet tinsel
cedar stream
slate swan
#

@velvet tinsel something like this?

async lambda ban: ctx  member: discord.Member reason await member.ban(reason=reason)
velvet tinsel
#

♥️

slate swan
silent portal
#

Wait- There's nothing for display_banner ?

cedar stream
sour lodge
slate swan
slate swan
#

wouldn't that be cool tho?

cedar stream
slate swan
cedar stream
#

It’ s not registered as command

slate swan
cedar stream
#

Current implementation is nice

slate swan
#

yes

sour lodge
#

stealing from custom help command code is nice

cedar stream
sour lodge
slate swan
sour lodge
#

yes

#

I do not understand

#

that at all

slate swan
#

lol

#

never done it but subclassing isnt hard tbh

sour lodge
#

yea i really dont understand anything that happens in the custom help command

#

so I just copy and pasted instead

cedar stream
cedar stream
#

Subclassing is basic oop

#

Rly handy

sour lodge
#

i should really learn oop

cedar stream
sour lodge
#

idk just the sound of classes gets me demotivated and my brain dies

slate swan
#

i only understand oop becaude of dpy lol

eager frost
slate swan
sour lodge
#

time to travel to freecodecamp oop video

cedar stream
#

@sour lodge

sour lodge
#

too many words

cedar stream
#

Video has too many words + media + 2h time + ads skippable after 6 sec

slate swan
#

oop isnt really hard its just like legos

sour lodge
#

Object Oriented Programming is an important concept in software development. In this complete tutorial, you will learn all about OOP and how to implement it using Python.

💻 Code: https://github.com/jimdevops19/PythonOOP

🔗 Tutorial referenced for a deeper explanation about repr: https://www.youtube.com/watch?v=FIaPZXaePhw

✏️ Course develo...

▶ Play video
slate swan
#

in a way

shrewd inlet
#

In your opinion, what is the best way to format a help embed?

shrewd inlet
eager frost
#

Yes.

cedar stream
cedar stream
eager frost
#

for tutorials the shorter the better cause no one is motivated enough to complete a MOOC

cedar stream
#

Or written guides

eager frost
#

right but for something like OOP watching a tutorial + doing your own demos is great

#

since its like a larger concept

slate swan
#

am i the only one that makes a new command named help?

shrewd inlet
#

is this good or is it too long?

cedar stream
shrewd inlet
cedar stream
slate swan
shrewd inlet
shrewd inlet
slate swan
cedar stream
shrewd inlet
#

i’m gonna search up a tutorial for it

#

this should work

#

or i could make a site for the commands

#

a site that shows all the commands

#

some bots do that and i think it’s cool

silent portal
#

Those are pretty cool

shrewd inlet
#

yep

slate swan
#

i should learn menus

silent portal
#

They can be confusing tho

#

I worked with them once

slate swan
#

why?

silent portal
#

But if you got it, it's easy

silent portal
#

I have to get used to them

#

I don't like using new things

#

that's why I never really learned them

slate swan
#

ive done slash commands buttons

#

i think i got it

silent portal
#

I never tried slash commands. I just think they're kinda useless imo

silent portal
#

I used buttons aswell for a ticketbot

#

turned out good

#

actually

slate swan
#

nice

silent portal
#

But I like how Discord is adding more and more features for bot devs. There are more possibilities everytime and you don't get "bored"

slate swan
#

i do lol

#

when timeout came i just made a command and i got bored lol

silent portal
#

Why don't u develop Custom bots for different servers?

slate swan
#

idk

silent portal
#

Not many servers have them. And I think it's kinda cool

slate swan
#

idk i just dont lol

silent portal
#

that's ok :) But you should try it

slate swan
#

meh

silent portal
#

With developing for a different person you expand ur skills

slate swan
#

i mean yeah i could but i dont do jobs or payed jobs i just make bots because i like doing them

slate swan
silent portal
#

Well you don't have to get payed, I do it for fun aswell

silent portal
#

ppl have different reasons for developing. You can have multiple at once aswell

silent portal
#

yep

slate swan
silent portal
#

all good :) Have a nice day

slate swan
silent portal
#

❤️

cedar stream
unkempt canyonBOT
#
Not in my house!

No documentation found for the requested symbol.

cedar stream
#

!d disnake.ui.View

unkempt canyonBOT
#

class disnake.ui.View(*, timeout=180.0)```
Represents a UI view.

This object must be inherited to create a UI within Discord.

New in version 2.0.
cedar stream
#

!d disnake.ui.Select

unkempt canyonBOT
#

class disnake.ui.Select(*, custom_id=..., placeholder=None, min_values=1, max_values=1, options=..., disabled=False, row=None)```
Represents a UI select menu.

This is usually represented as a drop down menu.

In order to get the selected items that the user has chosen, use [`Select.values`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.Select.values "disnake.ui.Select.values").

New in version 2.0.
slate swan
#

thats why i said its easy

cedar stream
slate swan
cedar stream
#

I love views

slate swan
honest vessel
#

class disnake.ui.Select

#

is dis sme nike or rebbus?

#

Oldie but goldie! Hahahahhahahaha hahahah Dominican style hahhhahahhhh !!!!! 😂😂😂😂😂😂😂 Been watching this video at least 5 times a day now for 3 days straight. I can’t stop laughing! Lmao. Too damn funny. With SUBTITLES.

Radio DJ Spanish speaking finds song Rhythm of the Night / "This is some reebok or some nike"

Unusual song request from one of...

▶ Play video
#

hopefuly u all have alaugh

slate swan
#

@lapis lintel send their docs link please

hard trail
#

what has happened to this channel?

echo lagoon
#

i dont get it, why is testing this in non nsfw channel returning 0. . .

#
            item = anime_links.anime_global[text]
            if (ctx.channel.is_nsfw and (len(item[0]) > 0)):
                index = 0
            else: 
                index = 2

            url = utility.get_random(item[index])
            return await ctx.send(f"`{item}`\n\n`{url}`\n\n{index}")
echo lagoon
cedar stream
echo lagoon
echo lagoon
cedar stream
#

So basically list with 2 elements

echo lagoon
#

4,

first is nsfw link, with an nsfw phrase, then an sfw link and sfw phrase

cedar stream
#

And item[1] will always be 2nd element in a list

echo lagoon
#

mhm

cedar stream
#

If there is only 1 element, it will be an error

echo lagoon
#

it will always have all items in the list

cedar stream
#

Ok

echo lagoon
#

welp, that generates the list,

cedar stream
#

Btw in python u dont need to put if statement conditions in ()

echo lagoon
slate swan
#

I want the bot to send something in dms to a user, how do I get the bot to read the response?

cedar stream
echo lagoon
#

tested with just this, same issue. . . channel im testing in is definitely not nsfw

            if (ctx.channel.is_nsfw):
                index = 0
            else: 
                index = 2
cedar stream
#

And print out channel.is_nsfw

unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
echo lagoon
#

ima hella lost. . .

velvet tinsel
#

?

#

what's the problem

echo lagoon
cedar stream
echo lagoon
#

o h

#

my bad, ima try

velvet tinsel
slate swan
velvet tinsel
#

I love that manga + anime

cedar stream
echo lagoon
echo lagoon
velvet tinsel
echo lagoon
#

wait a min, is is_nsfw a method? maybe parenthasis?

cedar stream
cedar stream
velvet tinsel
#

ive never used nsfw lol

cedar stream
#

!d discord.TextChannel.is_nsfw

unkempt canyonBOT
#

is_nsfw()```
[`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.9)"): Checks if the channel is NSFW.
velvet tinsel
#

my search history would be sus if I started googling it

velvet tinsel
slate swan
cedar stream
#

Print it to see what it returns

cedar stream
velvet tinsel
echo lagoon
#

ah got it, it was a method, required parenthasis at end of is_nsfw()

slate swan
#

But I only want it to work in dms

echo lagoon
#

thank you!

echo lagoon
velvet tinsel
slate swan
#

Ok

velvet tinsel
#

make a check as well

#

you dont want the bot to respond to itself

cedar stream
slate swan
#
response = await self.bot.wait_for(code)

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'int' object has no attribute 'lower'

tawdry perch
velvet tinsel
#

why did...why did you put code

slate swan
slate swan
#
code = random.randintt(1111,9999)
velvet tinsel
#

it shouldn't be a variable...

#

no..

slate swan
#

oh

velvet tinsel
#

why...why did you put a random in a wait for

slate swan
#

🤷

#

I just want the bot to wait for a randomly generated 4 digit code in dms

tawdry perch
# slate swan wdym

I assume you tried to do .lower but it's a string method which won't work for numbers

silent portal
#

bruh

tawdry perch
#

Also it did not make sense to try lowering a number because they don't have upper case/lower case

velvet tinsel
#

you dont "wait for" a randomly generated number

#

you put it in a var

cloud dawn
#

A for effort though

manic wing
#

!d discord.DMChannel ||pithink await self.bot.wait_for('message', check=lambda m: isinstance(m.channel, discord.DMChannel)) - this waits for a message to be sent.

check=lambda m: isinstance(m.channel, discord.DMChannel)
this just makes sure that m.channel (which is an instance of discord.TextChannel) is in a dm.

unkempt canyonBOT
#

class discord.DMChannel```
Represents a Discord direct message channel.

x == y Checks if two channels are equal.

x != y Checks if two channels are not equal.

hash(x) Returns the channel’s hash.

str(x) Returns a string representation of the channel
slate swan
visual island
#

Merry Christmas!!

sick birch
slate swan
slate swan
slate swan
slate swan
visual island
manic wing
manic wing
#

!e print(range(10))

unkempt canyonBOT
#

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

range(0, 10)
manic wing
#

!e py nums = range(10) if 1 in nums: print(':O')

unkempt canyonBOT
#

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

:O
slate swan
slate swan
#

and so i did this and mixed it up

#

!e

print(list(range(11)))
unkempt canyonBOT
#

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

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
slate swan
visual island
# slate swan yes

you're comparing message.content (str) to a (list[int]) which wont work

visual island
slate swan
visual island
#

if its a parameter which is typehinted to int then yes

#

else no

unkempt canyonBOT
#

Objects/rangeobject.c line 638

return PyUnicode_FromFormat("range(%R, %R)", r->start, r->stop);```
slate swan
#

if you dont time hint it it makes it a str right

visual island
#

yeah

#

"time hint"

slate swan
#

🕴️

#

type hint*

slate swan
#

if you havent even seen my params🕴️

visual island
slate swan
#

dont know what your talking about lol🚶

visual island
#

"I just want the bot to wait for ..." then you gave a code with message and range stuff

slate swan
visual island
#

ask it.

slate swan
#

why dont you

visual island
#

you wanted it..

#

not me

#

:hehe:

slate swan
#

do you want me to ask him?

visual island
#

do you want me (okimii) to ask him?

#

now okimii

#

ask him

slate swan
visual island
#

pithink yes ask him for me

slate swan
#

why dont you doesnt that seem impolite pithink

visual island
#

pithink yeah it is

slate swan
#

pikachu?

visual island
#

im innocence so no thanks

slate swan
#

since when were you here?

#

makes sense

slate swan
#

jeez i make a mistake and you guys die for a reason smh

#

we all make stupid mistakes especially me

visual island
#

hi

slate swan
#

hi

visual island
#

you like zt so much?

slate swan