#discord-bots
1 messages Β· Page 666 of 1
you could probably have it async.sleep(10) or something lol
bad idea

most likely, yeah, but an idea all the same :p
i dont really know how your json file looks like.....
its refering to the json file named data.json and in it is {"rev-num":0}
you're dumping the results back tho?
okee
Well what I basically wanna do is for example if i send 1 in to the channel
i want it to store it
and the next time lets say i send 2
it would have 3 stored in that json
are you dumping the results back???
dont use json as a db π
cant argue
The data stored in the json? Yeah
opening json every message is also not a good idea
Says a person whose whole bot is based on json
its okay......ig
i recommend you use a database
^ if json isnt fine
like sqlite or postgres
how simple are they to use
cause what i need it for doesnt need it to be complicated
very easy
You fine if i hit u up if i got any qs regarding em
how to make my bot detect multiple reaction and react differently based on the reaction the user reacted?
sure
ty ty
i mean you can ask in the databases channel if im not wrong
also make sure to use an async lib
imma add u up, ill try it out
!d discord.ext.commands.Bot.wait_for
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**...
@small igloo
Who can help me?
Im wanting to add a timer for a command, in the sense that when a command is used, a countdown is set for 30 minutes, if x conditions arent met within the 30 minutes, something happens, else something else happens
@tasks.loop(seconds=10)
async def messageInterval(ctx, message):
await ctx.send(message)
@bot.command()
async def taskstart(ctx):
messageInterval(ctx, "Your message").start()
await ctx.send("Task ready!")
``` ?
Thanks @slate swan but I realised that wasnt what I needing anymore for my program, need something like this
basically if a user does a command, and requirement x isnt met within 30 minutes, function x will run on the author of the message for the command
from discord.ext.commands import Bot
from discord.ext.commands.context import Context
from discord.ext import tasks
from asyncio import sleep
bot = Bot("?")
@tasks.loop(minutes=31)
async def checkk(ctx):
await sleep(60*30)
raise Exception("Timed out")
@bot.command()
async def tests(ctx : Context):
def check(message, user):
return message.author == ctx.message.author
try:
checkk.start()
try:
k = bot.wait_for("message", timeout=60*30, check=check)
except TimeoutError:
checkk.stop()
return
if k.content == "Message":
await ctx.send("Message")
except:
checkk.stop()
await ctx.send("Timed out")
bot.run("token")
``` ?
Right but that is waiting for a message, im waiting for x == y
Ok so when a user does
!q
if len(playerqueue) == qsize within 30 minutes, then nothing happens,
if len(playerqueue) != qsize within 30 minutes, then I invoke another command for the user
can i host a discord.py bot on digitalocean for free?
and use a sqlite database with it without the data getting wiped?
Not for free, u need to pay for the service
use mongo π
mongo is eh to be honest, i prefer sqlite3
nice
@boreal ravine you were helping me with my verification command the other day right?
i don't recall
anything else < sql
jsonc > json
uh what command to remove user's reaction?
!d discord.Message.remove_reaction
await remove_reaction(emoji, member)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Remove a reaction by the member from the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").
If the reaction is not your own (i.e. `member` parameter is not you) then the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission is needed.
The `member` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.
ok, thanks
O, imagine having bad net
slow :)
ok π thanks @boreal ravine @maiden fable
eh...?
owo
uwu
bruh momment
@boreal ravine :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | AttributeError: 'str' object has no attribute 'id'
show code
wait, i doesn't even make that str with attribute id
my code?
await message.remove_reaction(reaction.emoji, name)
z = game.check_player_index()
if z == 63:
game.reset()```
how u can do this :v
do wut
colored
!codeblock
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
@small igloo show full error
show where you defined member
that name
weird
wait i thought there was a free tier?
Is there one? Idk
U have to do message.remove_reaction(reaction.emoji, ctx.author)
hm
can't i add .name there?
No
Whoa since when is Discord only 7 and 14 boosts for the next level :D
More than a month
tbf 30 was a bit much
Yea
how do i make a command where the bot removes a role from everyone who has it
Instead of removing from everyone, delete the role and remake it
If there are 10 people in your server, it will take 10 API Calls, but removing and making would take only 2
@compact field, looks like you posted a Discord webhook URL. Therefore, your message has been removed, and your webhook has been deleted. You can re-create it if you wish to. If you believe this was a mistake, please let us know.
hello guys
i want to create a new webhook with Webhook class
and send messages in text channel
what is the data positional argument ?
user_embed = Embed(title='some', description=f'some',
color=0x148500)
user_embed.set_thumbnail(url='some url')
wb = Webhook(
'webhook_url',
)
wb.send(embed=user_embed)
__init__() missing 1 required positional argument: 'data'
what is wrong ?
yeah but i use the role id for multiple other commands so if i delete and remake it then it'll be troublesome
!d discord.Webhook.from_url @compact field
classmethod from_url(url, *, session, bot_token=None)```
Creates a partial [`Webhook`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook "discord.Webhook") from a webhook URL.
!d discord.Role.members RIP then
property members: List[Member]```
Returns all the members with this role.
U gotta loop through them
how do i prevent the bot from hitting the ratelimit tho
U can't, there's no way π€·ββοΈ
do i just do await asyncio.sleep(1) in the for loop or
but then there's some bots which have this removeall command
how do they not get ratelimited
Yea u can do asyncio.sleep(1) but that's not gonna help much
Lemme guess... Verified Bots?
yes
Ah. Well they request discord to increase their ratelimits
So they get ratelimited less
oh
That makes sense, I never have thinked about that
That's literally written in the ratelimit part of the docs haha
I never read that part of docs
Hahaha I read only that part lmao
BTW fun fact
There's a very huge chance my bot got flagged
Flagged = ?
So yea either cz of weird servers my bot is part of or some other reason idk
The bigger problem is that they don't even tell if the bot is flagged, soooo
They gonna have an even closer look, meaning more chances of denial
And yea, it's been 21 days and 11 business days since I haven't heard from them
There's a difference π€£
how do I make an if statement to say weather the command is in CoolDown e.g.
@bot.command()
@commands.cooldown(1, 10,commands.BucketType.user)
async def test(ctx):
await user.send(f'{ctx.author.id}')
and then make an if statement such as
user: !test
5 seconds later user: !test
bot: command in cooldown
yes
!d discord.ext.commands.Command.get_cooldown_retry_after
get_cooldown_retry_after(ctx)```
Retrieves the amount of seconds before this command can be tried again.
New in version 1.4.
!d discord.ext.commands.Bot.get_command
get_command(name)```
Get a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") from the internal list of commands.
This could also be used as a way to get aliases.
The name could be fully qualified (e.g. `'foo bar'`) will get the subcommand `bar` of the group command `foo`. If a subcommand is not found then `None` is returned just as usual.
hmm but its sending the remaining seconds what I want to do is
if the command is in cooldown
bot says y
if not
bot says x
!d discord.ext.commands.Command.is_on_cooldown
is_on_cooldown(ctx)```
Checks whether the command is currently on cooldown.
@yeheboi#8363
Hi
I'm quite new in Dislash and I'm trying an example from https://github.com/EQUENOS/dislash.py#creating-buttons
import discord
from discord.ext import commands
from dislash import InteractionClient, ActionRow, Button, ButtonStyle
bot = commands.Bot(command_prefix="!")
inter_client = InteractionClient(bot)
@bot.command()
async def test(ctx: commands.Context):
# Make a row of buttons
row_of_buttons = ActionRow(
Button(
style=ButtonStyle.green,
label="Green button",
custom_id="green"
),
Button(
style=ButtonStyle.red,
label="Red button",
custom_id="red"
)
)
# Send a message with buttons
msg = await ctx.send(
"This message has buttons!",
components=[row_of_buttons]
)
# Wait for someone to click on them
def check(inter):
return inter.message.id == msg.id
inter = await ctx.wait_for_button_click(check)
# Send what you received
button_text = inter.clicked_button.label
await inter.reply(f"Button: {button_text}")
bot.run("TOKEN")
```So what I want to do is disable the row of button after a timeout. How can I do that? Thanks.
A Python wrapper for discord slash-commands and buttons, designed to extend discord.py. - GitHub - EQUENOS/dislash.py: A Python wrapper for discord slash-commands and buttons, designed to extend di...
And Ping me when you help
Yes, of course
I'm not encountering any errors.
try printing numbers after 2-3 steps, when the numbers stop printing, thats where the error is, then use try and except keywords
Guys how i get the guild that user joined using the on_member_join event?
@upbeat otter No the code itself doesn't have any errors. And it worked properly. But I want to disable the buttons when reach a timeout
Just set a timeout in the wait_for?
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.```
Does this meen im using to many requests?
You exceeded the rate limit
How?
Then how can I do it?
Your bot sent too many requests
Sending too many requests at once results in exceeding ratelimits
too many request at a time
PS C:\Users\phoen> & C:/Users/phoen/AppData/Local/Programs/Python/Python310/python.exe c:/Users/phoen/OneDrive/Desktop/main.py
Traceback (most recent call last):
File "c:\Users\phoen\OneDrive\Desktop\main.py", line 3, in <module>
from PyQt4.QtCore import *
ModuleNotFoundError: No module named 'PyQt4'```
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
How to solve this
Is PyQt4 related to discord bots?
@upbeat otter How do I stop it? I only have like 4 function def that do anything
@astral cobalt read about rate limits here
okie
The error was obtained during the developement of a discord bot
Install PyQt4
Installed
trybash pip install PyQt4
Try, pip install PyQt4, again even if you have installed
Or maybe python 3.10 doesnt support it yet
If you host bot on repl this would happpen
Yeah
I read somewhere it is supported only by python 3.5 and less
how do i get the roles name in MissingAnyRole??
WDYM?
I ran it on 3.9, it should work
WHAT I MEAN IS WHAT I SAID
@cinder marsh I am hosting the bot on rept it. Is there another good place that you would reccomend hosting it thats free
C:\Users\phoen>python -m pip install PyQt4
ERROR: Could not find a version that satisfies the requirement PyQt4 (from versions: none)
ERROR: No matching distribution found for PyQt4
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\phoen\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.```
WOW
Heroku?
You pinged wrong blank lel
heroku?
It worked that time
heroku is good but they provide 23 days per month
23 days per month? So My bot can only be on and active 23/30 days?
you can make 2 accounts
PyQt4 either isnt suppoted by python 3.10 or it doesnt exist lol
Try:
python -m pip install PyQt4
Make 2 accs
but that would be a pain
Is that not the same of what I did
I am not using python 3.10?
@upbeat otter what about my question?
But the path says, python310
Or am I
I saw that rn
Guys is there a way to upload image to imgur because its api is using auth code but its anonymous for humans (without selinium)
I thought I was using python 3.9.8
No idea, im really sorry
Sad
Man how to install it
Any Idea @upbeat otter ?
Play with chromedrivers?
Why not use selenium?
So what's the issue with API?
And you think imgur will allow you to upload as many as you want and DDoS them
π
any other playform other than imgbee?
and imgur
imgbee was good but they don't accept .jpeg files
Well IDK but you can make one of your own yk
._.
It's ez
I can't keep my pc on whole day ._.
What's the issue?
Student
How does that matter
Python for fun
You can just leave your PC on and go do whatever you wish
Parents will nom nom me if I keep my pc on whole day
Wait, i think....just gimme a minute
π
get romanian vds for 1.3β¬ / month
Need a free
20β¬/year
Sir giving us the best idea
lol
I am poor
4gb ram
I will instead self host 8 gb RAM π
.....____________________......
and double ur electric bill
trying
just use a decent webserver from some host
WoW that's amazing
,-,
BTW any solution to my issueπ
wait
alr
@tiny ibex what's the problem
Can't install PyQt4
@tiny ibex of course it doesnt support python 3.10
@maiden fable
IG I will try going down
What bout 3.9.7?
What's the issue
yep
C:\Users\phoen>pip install pyqt4
ERROR: Could not find a version that satisfies the requirement pyqt4 (from versions: none)
ERROR: No matching distribution found for pyqt4
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\phoen\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.```
btw, ask from the best programmer present here aka @maiden fable
alr
Please tell me u r joking
@tiny ibex why r u even installing that π
For web scraping
pip install PyQt5
Use this π€¦
Guys can we upload an image to py embed.set_image()instead of using url?
PyQT4 is outdated, use QT5
!local-file
Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:
# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")
# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
file = discord.File(f)
When using the file-like object, you have to open it in rb mode. Also, in this case, passing filename to it is not necessary.
Please note that filename can't contain underscores. This is a Discord limitation.
discord.Embed instances have a set_image method which can be used to set an attachment as an image:
embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png") # Filename here must be exactly same as attachment filename.
After this, you can send an embed with an attachment to Discord:
await channel.send(file=file, embed=embed)
This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.
Even Qt6 exists
Cool
embed.set_image(url="attachment://image.png")
What if I have bytes?
C:\Users\phoen>pip install PyQt6
Collecting PyQt6
Downloading PyQt6-6.2.2-cp36-abi3-win_amd64.whl (6.2 MB)
|ββββββββββββββββββββββββββββββββ| 6.2 MB 1.3 MB/s
Collecting PyQt6-Qt6>=6.2.2
Downloading PyQt6_Qt6-6.2.2-py3-none-win_amd64.whl (43.9 MB)
|ββββββββββββββββββββββββββββββββ| 43.9 MB 157 kB/s
Collecting PyQt6-sip<14,>=13.2
Downloading PyQt6_sip-13.2.0-cp310-cp310-win_amd64.whl (78 kB)
|ββββββββββββββββββββββββββββββββ| 78 kB 5.5 MB/s
Installing collected packages: PyQt6-sip, PyQt6-Qt6, PyQt6
Successfully installed PyQt6-6.2.2 PyQt6-Qt6-6.2.2 PyQt6-sip-13.2.0
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\phoen\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.```It worked!
U need to save them first
ask from intelligent people, me dumb
._.
U can use io.BytesIO for that
PoV: You are the most intelligent among us
IK but which param for file in embed image
PS C:\Users\phoen> & C:/Users/phoen/AppData/Local/Programs/Python/Python310/python.exe c:/Users/phoen/OneDrive/Desktop/main.py
Traceback (most recent call last):
File "c:\Users\phoen\OneDrive\Desktop\main.py", line 5, in <module>
from PyQt6.QtWebKit import *
ModuleNotFoundError: No module named 'PyQt6.QtWebKit' ```
smh
@maiden fable
@maiden fable
Yay
Btw do you know this channel is for discord bots help?

Hey! Can anyone suggest how to make script for self replying bot?
wdym, replying to self?
That kinda says you dk how to solve it
Tell me I am wrong
Na need a kind of talking bot
use brainshop api
π€¦
!d discord.ext.commands.Bot.wait_for
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**...
Just invite HunAI Yea, brainshop is good if u can code in JS
why not py?
Self advertisement
Reverify your Python version
The last time I saw it, it only supported JS
@tiny ibex
._. π
And that last time, was, uhhh, 3 months ago or something
It's 3.10
Okay...
How to solve the issue?
@maiden fable How do I use image bytes in em.set_image
U'll have to save the image somewhere before
istg sometimes this channel is as dead as me but sometimes active as fuck
Why not bytes only?
Czzz it needs an image url?
sheesh
ctx.channel.send
Indent the last line
No lol
and indent
IDK I use ctx.channel.send
missing tab on last line
Remove the extra clear from the Embed thingy
wait
why aren't you using @bot.command()
your using @bot.command not @bot.command()
oh yeah and indent
good notice adx
ok i made it @bot.command()
please don't use ableist language
how..
oh
u literally press tab
await ctx.send(embed=embed)
^
IndentationError: unexpected indent```
error that comes up
idk why i cbed that
indent that last line
i did
!indention
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
Oh Only last one (no auth) worked
can i see the code ?

Niceee
How do I run my bot locally? Instead of uploading to the server every time
Or should I be pushing to the server everytime I make a change and what to test it
test first, push only stable builds
help
error:
C:\Users\Szymon\Desktop\MauBot\main.py:112: RuntimeWarning: coroutine 'sleep' was never awaited
asyncio.sleep(0.5)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\Szymon\Desktop\MauBot\venv\lib\site-packages\discord\ext\commands\core.py:85: DeprecationWarning: logout is deprecated, use Client.close instead.
ret = await coro(*args, **kwargs)
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000291D4B97F40>
Traceback (most recent call last):
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 745, in call_soon
self._check_closed()
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000291D4B97F40>
Traceback (most recent call last):
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 745, in call_soon
File "C:\Users\Szymon\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
Szymon is my username and MauBot is my bot name
Code:
@client.command(name='restart', alliases=['restart'])
async def Restart(ctx):
if ctx.author.id in teamid:
await ctx.send(f'Bot zostanie zresetowany w przeciΔ
gu 5 sekund', delete_after=0.5)
asyncio.sleep(0.5)
await ctx.send('Restartowanie...', delete_after=1)
try:
await client.logout()
except EnvironmentError as e:
print(e)
client.clear()
await ctx.send('Bot zostaΕ zresetowany pomyΕlnie')
else:
ctx.send(f'UΕΌyΕeΕ komendy ktΓ³ra jest przeznaczona tylko dla niektΓ³rych osΓ³b')
ctx.send(f'JeΕΌeli sytuacja siΔ powtΓ³rzy jeszcze kilka razy moΕΌesz dostaΔ gbana')
await asyncio.sleep(...)
coroutine 'sleep' was never awaited the error says it all
i changed this
Error:
Hey @worthy moat!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
can someone tell me how do I know which file path is going to the user?
number = random.randint(1, 99)
wow = random.randint(100, 140)
f_path = "./vote_rewards/reward "
g_path = "./vote_rewards2/reward "
f = discord.File(f_path+ str(number)+".jpeg", filename="vote_rewards.jpeg", spoiler=False)
g = discord.File(g_path+ str(wow)+".jpeg", filename="vote_rewards2.jpeg", spoiler=False)
embed = discord.Embed(title="Konichiwa Goushinjin-sama", description="**Arigcato Gosaimushta For Voting, Here Is Your Reward**", color=0xcf24ff)
embed.set_image(url="attachment://vote_rewards.jpeg" or "attachment://vote_rewards2.jpeg")
choices = [f,g]
random.choice(choices)
user = await bot.fetch_user(message.content)
await user.send(files=[f, g], embed=embed)```
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i tried
print(files.fp) or
print([f,g.fp])
both arent working
@visual island
use client.close()
k
again it's shown in the error DeprecationWarning: logout is deprecated, use Client.close instead.
Hey @worthy moat!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
is it possible to make it send messages randomly in random servers, like " Hey
"
what user?
discord user?
yep
how
yes
the function
searches for an userid in the channel and send them dm
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
message.author.mention and remove <@> from it
I cant get the reddit api to properly print a picture to the discord
ignore RuntimeError: Event loop is closed, it's a windows bug
nothing fails but it will just not print anything
or get_user() might work
so it works?
just an example:
guilds = bot.guilds #all the guilds bot is in
for ids in guilds.channels: #iterating
guild_ids = ids.id #storing the ids
for guilds in guild_ids: #iterating through guilds
guild = bot.get_guild(guilds) #fetching the guild
#get the channels by iterating and using the .id method on it and use .send method
the bot is sending dm correctly
if your bot gets disconnected then yes
its just idk how to send 1 random image from any 2 folders
guilds = bot.guilds
for ids in guilds.channels:
channel_ids = ids.id
for channels in channel_ids:
guild = bot.fetch_channel(channels)
await ctx send("Hi :Pepe_Gun:")
?
import discord
from discord.ext import commands
from discord.ui import Button,View
class Mybutton(Button):
def __init__(self,ctx,label):
super().__init__(label=label,style=discord.ButtonStyle.green,emoji="π")
self.ctx = ctx
async def callback(self,interaction) -> None:
if interaction.user.id == self.ctx.author.id:
return await interaction.response.send_message(f"hello {self.ctx.author.name}")
return await interaction.response.send_message(f"HEY !{interaction.user} you are not {self.ctx.author.name} why did you click the button ?!?!")
class buttons(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def test_button(self,ctx):
button = Mybutton(ctx,"click me lmao")
view = View()
view.add_item(button)
await ctx.send("button",view=view)
def setup(bot):
bot.add_cog(buttons(bot))``` why does the button not reply ?
wouldnt u be spamming ?
@slate swan I updated it, check now
its a really raw example, you can see the other things like fetching the channels and limiting the loop
@visual island
https://pastebin.com/xnG8S6Gf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
for channel in guild.channels
channel.send("dont spam lmao")```
just dont send anything ?
you need to fetch them first and you will send a message in every channel with this
can someone help me pls
https://pastebin.com/xnG8S6Gf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
like I said earlier
import random
var = random.choice["filepath1", "filepath2]
file = open(var, "r")
so command work yes?
import random
var = random.choice["filepath1", "filepath2]
file = open(var, "r")
tryna make it send stuff like
Fun fact:
The sun is bigger then all planets in the solar system combined!
but once 3-4 hours
yes
oh okay thx
well make a task that runs every 4 hours and u could do that , and make sure to wait around 2 secs for each channel . i suggest increasing that if u want to be safe
||im new to discord.py||
does time.sleep work

not from discord.py
sure that would work
both of them do , they're trying to make it blocking on purpose
h
like dis?
number = random.randint(1, 99)
wow = random.randint(100, 140)
var = random.choice[f"./vote_rewards/reward + str{number}+'.jpeg'", f"./vote_rewards2/reward + str{wow}+.'jpeg'"]
file = open(var, "r")
embed = discord.Embed(title="Konichiwa Goushinjin-sama", description="**Arigcato Gosaimushta For Voting, Here Is Your Reward**", color=0xcf24ff)
embed.set_image(url="attachment://vote_rewards.jpeg" or "attachment://vote_rewards2.jpeg")
user = await bot.fetch_user(message.content)
await user.send(files=var, embed=embed)
print(var.fp)```
@fpr.command(name='registro')
async def registrar(ctx):
member = ctx.author
guilda = ctx.guild
idforcheck = ctx.author.id
randomstr = (''.join(random.choice(string.ascii_uppercase + string.digits)
for _ in range(7)))
randomvar = str(randomstr)
def check(m):
return m.author == ctx.author
def check_random(m):
return m.author == ctx.author and m.content == randomvar
await member.send(f'**verify** | please, type dis code: `{randomvar}` for register.')
codigor = await fpr.wait_for("message", check=check_random)
await asyncio.sleep(3)
await member.send('**registering** | wait a minute.')
await asyncio.sleeo(10)
player = discord.utils.get(guilda.roles, name="π₯γ»Jogadores")
await member.add_roles(player)
``` im trying to do a register command... but the bot do not recognize the penultimate lines.... can any1 help me?
@client.command()
async def get_meme(ctx):
print("In here")
memes_submissions = await reddit.subreddit('memes')
memes_submissions = await memes_submissions.hot()
post_to_pick = random.randint(1, 10)
for i in range(0, post_to_pick):
submission = next(x for x in memes_submissions if not x.stickied)
await ctx.send(submission.url)``` Anyone know why this returns ```RuntimeWarning: Enable tracemalloc to get the object allocation traceback``` Am I missing an await somewhere that im not seeing?
I'll rewrite the code later too mess to understand
the full error should say something about where you missed it
okay
I think reddit.subreddit should be awaited, not sure
for channel in original_guild.channels:
channel_id = channel.id
fetched_channel = await client.fetch_channel(channel_id)
await fetched_channel.send(".....")
why does this return "CategoryChannel" object has no attribute 'send'
CategoryChannel is the categories in a server
oh lol
It's also a channel type in dpy
smh, how do I ignore those ,-,
@maiden fable It says that memes_submissions = await reddit.subreddit('memes').hot() is missing it
but its not
check if it's an instance of CategoryChannel
how
!d isinstance
isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.
Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
I am really back with classes and stuff lmao
istg mobile sucks sometimes
thanx you
Don't ask how to use it now, else.... nvm
,-, I am not "that" dumb
Just saying
that way you're only awaiting the .hot() method
No blaming please
I'm using the CodeCogs API to get a LaTeX image, but the text is black. Anyone know how to turn it into white text?
how do i get input on discord.py? im trying to figure out how to do stuff like
?gennumber 0,100
then it'll do
for i in range(0,100)
ctx send (i)
how can i change my bot status?
@worthy moat i will send you in dm in 2 m
Okay @visual island Got it to run without error but still wont send back a url to discord
ok thx
@client.command()
async def test(ctx):
button = Button(label="Click me!", style=discord.ButtonStyle.green, emoji="π")
view = view()
view.add_item(button)
await ctx.send("Hi!", view=view)
What is rong here?
hey wasn't there a case_sensitive check for discord.py i swear there was i think
oh yeah there was but whenever i set the value to False it breaks :c
@worthy moat check your pm
try this
@client.command()
async def test(ctx):
button = Button(label="Click me!", style=discord.ButtonStyle.green, emoji="π")
async def button_callback(self, button, interaction):
view = Myview()
view.add_item(button)
await ctx.send("Hi!", view=view)
you can use Bot.change_presence() or set the activity kwarg in your bots constructor.
Use command arguments? Make an argument for the first number and the second. Also i donβt know why you're using range. Consider random.randint()
hi, does anyone know how to make bot search random image on google and upload it?
import discord, os
from discord.ext import commands
from decouple import config
from lib import db
from time import perf_counter
import datetime
Token = "I deleted on purpose"
client.run(Token)
print("Launch successful")
Traceback (most recent call last):
File "C:\Users\ADMIN\PycharmProjects\Fluxo\main.py", line 1, in <module>
import discord, os
ModuleNotFoundError: No module named 'discord'
Install the module then?
xd
hi an idiot, i'm dad!
how do I make a command which picks a ranom record from sql database and sends in as an output
@bot.command()
async def test(ctx):
player = ctx.author
conn = sqlite3.connect('list.sql')
c = conn.cursor()
wala = discord.Embed(title='It Seems Goshujin-sama You Have Already Participated In The Giveaway', description='**Good Luck**', color=0xcf24ff)
gg = c.execute(f"SELECT * FROM list WHERE ID = {player.id}")
if c.fetchone() is not None:
await ctx.send('Goshujin-sama You Have Already Participated In The Giveaway')
else:
c.execute(f"INSERT INTO list VALUES({player.id})")
conn.commit()
conn.close()
await ctx.send(embed=wala)```
this is the code to enter the user.id in the sql database

E does anyone know how to make bot search random image on google and upload it?
use lxml get xpath use random.randint
Get href=
and put it in the await ctx.send
Ah thatβs so bad
hate to sound like a bigger idiot but..
what am i supposed to install exactly?
f-for a newbie that's quite understandable-
When I make a reddit meme definition it doesent seem to work, im using asyncpraw. It wont return an actual value and print something to the user. Anyone have any tips?
bad word detected!
plz help
think for few mins to understand
:troll:
Also just select the ID column and random.choice() it
my brain processed that as:
- dunno what's Ixml and xpath
- random to make the bot search randomly
- href is the hyperlink
- separate the link and make it an uh... string?
- also send the link after that
this?
i dont have an issue but i made a report system with 3 lines of code :troll: (exclude the @report.error)
pls help
pip install discord.py ??????
says i already have
Alternatively discord.py[voice]

what
or if that doesn't work either, git clone discord.py (i thought of that π )
os is in the standard package library.
This emoji is from a server that is either private or unavailable. Learn more about using custom emoji.
and extra stuff when you git clone discord.py:
- discord buttons
- discord selects
google lxml
xpath is a type of path on websites
by href i mean google images usually have dis
href="link"
and i didnt talked about strings and stuff
random cuz you said you want random
then how to implement it in my code ;-;
you gotta learn about it
i dont spoonfeed
nah hees not gonna spoonfeed you (spoonfeed = copypastable code)

i only understand from examples and my brain
k, thanks btw for the answer
same
because today i just learned that using bot.get_channel() you can do anything with the channel.var
@small igloo tip: go to the search bar and think of a keyword that best describes what u need and see if anyone else had the same issue and got spoonfed
tbh stack overflow awesome
yeah
i wanna make my report system more complicated because its just this crap:
await ctx.send(f"report sent to the admins, {member} will be checked soon")
reportChannel = bot.get_channel(918056493142671370)
await reportChannel.send(f"{member} was reported for {reason}")
:troll:
and that's how i get so many error message :l
its just that you can see other questions and get answers
but cant ask cuz i tried when i was new and everyone said just read docs and you will get it and its true
Another tip: eliminate the errors one by one until the code you copy pasted is good
well you are getting errors because you dont know what you doing, do you?
discord API docs?
no ||but actually yes||
if you know what the problem is, its half solved
read lxml docs and understand xpaths later you can implement in the discord codes
how to make it more complicated π€
and even another tip: eliminate the code one by one until the one left just print("hello world")
ok, thanks
anyone know why asyncpraw wont let me actually get anything from reddit?
@small igloo I copy paste a lot too, my tip for now is to go do something and come back in like 5 hours and ask again when thereβs a new group of people in chat
oh, one question, why discord component's InteractionType got removed-
the- 5 hours???
if you want examples
press f12 is chrome browser
and use the element inspect and click on anything then it wil open an element page and left click and copy full xpath and you will get xpath
y'all really like spoonfeeding, mine is somewhat similar i just understand from examples
e.g.
this is the full xpath of #discord-bots
/html/body/div[1]/div[2]/div/div[2]/div/div/div/div/div[1]/nav/div[3]/div/div[23]/div/div/a/div[2]/div
3 hours if ur inpatient
π€£
bru grammar
you'd only ask 3 times a day /shrug
or 4 because that would be 12 hours
If u come back too quick thereβs a chance they will spread the news that youβre trying to copy paste and youβll have to repeat the process of waiting
π
camelCase 
maybe u mean 8? that would be 24 hours-
Does no one PEP8
then you gotta change name and pfp and get undercover? π€£
Canβt u just send the report into a webhook
Well, theyβll know anyways cause youβll be asking them the same thing
E u pay for nitro?
π€ what would be the use for that
because the only things special about the webhook is identical to a discord bot iself
damn you are experienced in dis stuffs
@bot.command(aliases = ['mc'])
async def membercount(ctx):
countembed=discord.Embed
(title = 'membercount', description = '{member.guild.member_count}')
await ctx.send(embed=countembed)```
anybody know why this isnt working?
wtf is member defined as
maybe he's ever try that?
nothing, so define it or use ctx
You learn a couple things after getting spoon fed 300+ lines and 4-10 tests
talking to me?
yes, what is member defined as in your code
um
bruh you didnt got spoonfeed you got the entire pot π€£
Nooooo! Heβs taking to his body pillow
oh
body under a pillow
anime body pillow?
isnt f string is needed when you add {}?
member isn't defined and good notice, no f strings
yeah true
@slate swan :x: Your eval job has completed with return code 1.
001 | File "<string>", line 3
002 | if any(word in msg for word in sad_words):
003 | ^
004 | IndentationError: expected an indented block after 'if' statement on line 3
!e
@client.event
async def on_message(msg):
if any(word in msg for word in sad_words):
print("bruh")
@shadow wraith :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'client' is not defined
thanks
pog
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | NameError: name 'client' is not defined
@small igloo 4 hours and 50 minutes to go! 
dude why are you trying to run your bot's code with @unkempt canyon
async def membercount(ctx):
countembed=discord.Embed
(title=f'membercount', description=f'{member.guild.member_count}')
await ctx.send(embed=countembed)```
still not working for some reason
@slate swan :x: Your eval job has completed with return code 1.
001 | File "<string>", line 3
002 | print("tEsT")
003 | ^
004 | IndentationError: expected an indented block after 'if' statement on line 2
Swap the first member with ctx
@slate swan :warning: Your eval job has completed with return code 0.
[No output]
im really confused
It needs to be ctx.guild.member_count
what
Was talking to the guy above, not you. As far as syntax errors, thatβs all you. Basic python support doesnβt go in this channel.
top = subreddit.top(limit=200)
async for submission in top:
all_subs.append(submission)``` Anyone know why this forloop doesent break?
how to create server invite? i tried print(channel.create_invite()) but it just prints <coroutine object GuildChannel.create_invite at 0x7f7f5dba4440>
how do i make a command that sends something to another channel after someone has sent the command?
like if the command was "~hello", the bot would send the author's username and tag to another channel
Um guys am I doing something wrong??py await client.change_presence(activity = discord.Streaming(url="https://www.google.com", name=f"with {initiates+officials} PHGs"))
Thatβs the object. If you want the link. Use the .url attr
ok i will try that
Get the channel and send the message there????
AttributeError: 'coroutine' object has no attribute 'url'
it's working no?
i converted that to a dir and this is what i get
['await', 'class', 'del', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'name', 'ne', 'new', 'qualname', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'close', 'cr_await', 'cr_code', 'cr_frame', 'cr_origin', 'cr_running', 'send', 'throw']
nope
dont see url there
Whatβs the problem ?
Its saying playing, but code is for streaming 
thereβs a streaming
i want to generate invite link if i do print(channel.create_invite()) it says <coroutine object GuildChannel.create_invite at 0x7f7f5dba4440> tried channel.create_invite().url and channel.create_invite().link nothign worked
Try making a custom status
print(await channel.create_invite())```
wdym
still same thing but ['BASE', 'class', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'slots', 'str', 'subclasshook', '_state', 'approximate_member_count', 'approximate_presence_count', 'channel', 'code', 'created_at', 'delete', 'from_gateway', 'from_incomplete', 'guild', 'id', 'inviter', 'max_age', 'max_uses', 'revoked', 'temporary', 'url', 'uses'] if i do dir(object) i see url in that
nvm
storing it in a variable and then doing .url worked
what do you want to do (you haven't awaited in your code)
no first i did
print(await channel.create_invite(max_age = 300).url)
that didnt work
but
because it gives a list
No, its because they're trying to access the url attribute of a coroutine object
before it was awaited
see the code again
this
i said it gives that when i did dir(object)
Thats just them printing our the dir of the object
^
try thispy inv=await channel.create_invite() print(inv['-2'])
what the hell lmao 
print((await channel.create_invite(max_age = 300)).url)
invite objects arent subscriptable
i figured it out
this worked
This works too btw
ya
Instead of making a one time use variable you could just do it all in one line
yep okk thanks!
is this the output of dir(object)??
Yes they said that in that message
Really weird output if it is.
yea kekw
but if it is then you could dopy dir(output)['url']
cursed
can you help me
Yes it is
oh sorry
try this @dim vapor
I have edited it, i forgot it was a list
I canβt tell if you're trying to code golf or just shitpost at this point m.
and i figured it out lol
ok let lets drop the topic 
@cloud dawn @sage otter
There is no url kwarg??
!d discord.ext.commands.Bot.change_presence
await change_presence(*, activity=None, status=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Changes the clientβs presence.
Example
```py
game = discord.Game("with the API")
await client.change_presence(status=discord.Status.idle, activity=game)
``` Changed in version 2.0: Removed the `afk` keyword-only parameter.
there is
Where?
sometime url can be before name 
For the streaming status you need one
there is
I said the same
await client.change_presence(activity = discord.Streaming(url="https://www.google.com", name=f"with {initiates+officials} PHGs"))
Wtf
Or youtube
But I have tried it before and it worked perfectly fine
let me get a ss
wait a minute
Without a twitch url?
what if we simply add this url: https://twitch.tv/#
yup
Idk tbh but add a valid url
What's the issue in adding a valid url?
IDK I just don't want my users to redirect there
No it wonβt lmao.
Then idk
Here is a friend
I never did it so idk
and..........
it works
it worked 
I have entered fake urls before and they worked
WoW I am gonna try it
hi
guys, anybody's got any idea if I can use replit's database locally?
locally as in?
vsc
nope, u cannot download the db. u need to access it from code
.......huh
if you put www.google.com in url, it would also give streaming icon but it will be only visible on android
wdym
....okay
oh, thankie
(:
Accessing a DB through ftp or sftp would be weird aswell lol
what is the best free hosting web 24/7?
Or if you asking bout the best it is self hosting
isn't it p2u?
E how to do it?
but not 24/7 :l
Self Hosting is done 24/7
It depends on you
Β―_(γ)_/Β―
breh, yes as long as i not close the tab/shut down the pc :l
So don't close the tab or shut down the PC
burh the tab automatically reload ;-;
@tiny ibex fixed that error?
No...
ouch
Run the code in your console
What tab are you talking bout
chrome tab-
Why do you need a chrome tab for running a script?
replit-
wait, it still can connect?
@muted lynx ?
Ofc it can
how if i use VScode
It's all good
lemme try
As a matter of fact it's better than using replit
replit is slow
And you got storage issues ofc
Thatβs subjective. Thatβs also dependent on many factors.
Such as
Your electricity goes and script stops running
You get bored of the script
The universe gets over
discord.py tags go brrrrrrr
xD
:l i forgor that i also use replit's database-
Find an alternative
Some people have really shit pcs. Electron apps like vsc can be pretty heavy memory wise and effect people with those shit pcs. And if thatβs the case they probably canβt even hold a respectable IDE like pycharm or something.
sql? i don't understand that at all :l
Replit in that case could be more performant as a DE
Just use console instead of using the console inside those IDEs
Simple
Running out of storage
Learn it now is the time!
Replit is no way good
writing is not easy, but grammarly can help
Thatβs a factor that really applies to big bots.
You doing ads?
lol ofc nope
Rather use heroku instead of repl
Not really
burh the database is way more simpler
Thatβs still pretty shit
Repl is slow
especially p2u-
Thereβs not really any good alternatives for free hosting
Repl running out of storage is cool
High pings is cool
A lot of packaging errors is cool
Repl is not made for hosting
And not hosting discord bots at all
And heroku isnβt meant for hosting discord bots either 
Like hunter said dpy tags go brr
I agree but it's a better alternative to replit
eh.. go to package and search to install package?
Either way itβs a lose lose situation
time to disable chrome auto discard-
And when you get errors with version you will be fcked hard
Self hosting is the best
cant complain about the packaging errors ,-,
Bahhahhha I am poor
bruuu p2u
this time i agree with u
the resources you waste while running your computer 24/7 goes to vps
ok bye
I don't get 8 gigs of ram in a vps
u c a n ' t l e a v e f r o m t h i s h e l l
I got like 16
I have to study bye
what bot u make-
tomorrow exam?
Money
Some shit bots
:v
I don't have money to buy enough
who even studies for exams
Honestly you donβt really need much
True
A small to medium size discord bot doesnβt even need a gig of ram
I wanna host 10 bots
on wednesday
I can do that on my pc
silly
Couldnβt imagine keeping my computer on 24/7
my bot with members intent and 84 servers hardly take 250 MB RAM lmao (and hardly any CPU)
Just giving examples
Sounds like a "you" issue
well you keeping your computer up 24/7 isnβt really good for your computers health either
facts
ok, what website to gain money easily
Especially if you're on a laptop. Youβll burn the battery out.
oh, so that's why when i plugged out my pc it's shutting down-
oh ok, goodluck >:3
Wut??!?!
yea...
My bot only in 3 servers but takes around 0.5k gb
HunAI hardly takes 250 MB RAM
That's cool
lemme see the exact number
Don't you have to study Eevee
Hunter finding good opportunities to advertise
It's not harmful as long as you don't have a potato pc
oh yes, bye....
Thatβs really not true
And then there is me who has an exam on Monday but studies on Sunday π
bake potato and give it to pig ||they won't like it||
If you have a good pc youβll still degrade performance keeping it constantly 24/7
Bro you in ICSE?
Not to a high enough extent
Oof
who wanna test my half-done discord bot
its taking 152.34 MB RAM and 0.16% CPU
That's cool
just 0.16%???? zoom take litteraly 75% of my pc ;-;
with members intent
Lmfao not so bad days
Python itself is a RAM intensive language as long as u don't use machine learning modules like tensorflow
And zoom is heavier than his bot
no one wanna test my bot?
Sure !
hi, sorry if this is a dum question, but does discord.py support message components like buttons yet?
C:\Users\ADMIN\PycharmProject\Fluxo>python main.py
Traceback (most recent call last):
File "C:\Users\ADMIN\PycharmProjects\Fluxo\main.py", line 10, in <module>
client.run(Token)
NameError: name 'client' is not defined
import discord
import discord, os
from discord.ext import commands
from decouple import config
from time import perf_counter
import datetime
Token = "OTE4ODIyMTE2MDg0ODQyNTE3.YbM1xw"
client.run(Token)
Still. Why would you want to degrade your pcs health.
you havent defined client in your code yet
interactionType removed ;-;
i've searched over the documentation but it doesnt lead me to anything, how do i add buttons?
u need to install from github
ah
i thought the pypi one is the same as the one on github
so cmd pip install git+https://github.com/Rapptz/discord.py?
Nope
github has the one with dpy 2.0
The one on pypi is 1.7.somethingiforgot
1.7.3? ig
why is it different tho
because dpy 2.0 is the newest version as of now
so its not official release?
it is
well makes sense
..then why is it not on pypi?
There should be a category attr for text channels and voice channels
Just gotta look at docs
Itβs kinda not in a way. In the actual dpy server, itβs still considered as a beta. Thatβs why thereβs still consecutive testing going on with it.
once it is properly debugged, it will
ok thx
you can use disnake as an alternative for now tho
ahem ahem
HunAI flexer back
Go study
π€¨
oh yeah
now that i installed v2 how do i even implement it π
!d discord.CategoryChannel.channels
ask the world's best AI creator - @maiden fable
property channels: List[GuildChannelType]```
Returns the channels that are under this category.
These are sorted by the official Discord UI, which places voice channels below the text channels.
!d discord.ui.Button
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.
!d discord.ui.View
class discord.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.
!d discord.TextChannel.send has a view kwarg now
await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
ok thx
yes dpy 2.0 exists
If that token is real then regenerate
the official dpy will not release the 2.0 to pypi
that's only one part of it
Are there any coders who want to work on projects
what kind of project
Simple discord bots APIs and website
It is but I deleted like 8 letters
so discord bot with a webserver for it?

or two different project
Different projects
hm
discord bot development is kinda boring for me now so that would be a no from me
And website and apis
How can I create a private voice channel for particular members then know when they all join and then leave it?
no for website kinda stuff but maybe api. however it depends
Ok will you join my server
Quite stuck on this 
i saw a bot sending a message that is only for me on a channel, how do i do the exact same thing?
was it a slash command
u can dm me
its just a command, when i press a button it just gives me the private message thing
Yeah its an interaction type
Yes possible
....
if message.content.startswith('a'):
await message.channel.send(insult)```
so here, the bot is supposed to send a random insult from the list but whatever it sends comes out between [], is there a way to stop this
are there lists inside of list3?
nope
only like 44 sentences of insults, all of which are separately between ' ' and with commas
...how do i do it..??
so like ['a','b','c']




