#discord-bots

1 messages Β· Page 1133 of 1

paper sluice
#

glue library

slate swan
#

no

#

it refers to the same thing hence making it an alias

#

!pip pycord

unkempt canyonBOT
slate swan
#

thats like saying discord.py and discordpy its the same title

#

Hi. I’m very embarrassed to talk about it, but after spending several hours studying what is written in this link, I couldn’t get anything. Can you please help me to sort out this problem?

unkempt canyonBOT
#
Nope.

Package could not be found.

slate swan
#

not a thing, so they are the same thing

unkempt canyonBOT
paper sluice
slate swan
paper sluice
#

dpy ducky_devil

slate swan
#

and not discordpy

paper sluice
slate swan
#

cute

slate swan
#

they will just see you typing and they would ban you instantly

#

unfunny

#

idk

#

no

pseudo dawn
#

Yo I need help with a bot

paper sluice
#

no, lets not give him that position

slate swan
#

python wasn't made by a single person smh

#

guido van is the creator of python lol

#

no

#

probably not

#

i mean he is

#

nvm

#

actually he is

#

well he is i agree

pseudo dawn
#

?

slate swan
#

look at him

#

pharmacist

#

πŸ˜”

#

wish he was my dad

paper sluice
slate swan
#

danny

slate swan
slate swan
#

ryuga i saw that

paper sluice
#

😳

slate swan
#

dont make me do

del Ryuga
paper sluice
paper sluice
slate swan
#

πŸ‘€

paper sluice
#

I couldn't read that in time πŸ˜”

slate swan
#

so sad

#

me saving API calls here like smh πŸ˜”

paper sluice
slate swan
slate swan
paper sluice
#

if you made the code, you should make the tests as well

slate swan
#

but you're clearly uwuer

paper sluice
#

😳

slate swan
#

im pretty sure you can make a partially created obj with that info

buoyant linden
#
        await channel.send(embed=embed)```

help pls
slate swan
buoyant linden
vast gale
#

πŸ’€

slate swan
#

arllll

vast gale
#

smh imagine leaving disnake

slate swan
slate swan
paper sluice
vast gale
#

smh

#

but also

slate swan
vast gale
slate swan
paper sluice
#

hmm, then i don't really know, you can ask in #editors-ides or VSC support

slate swan
#

rip I need help too 😭

#

My sqlite db file always get's cleared on startup

slate swan
#

consider using CREATE TABLE IF NOT EXISTS if you are not already doing that

slate swan
#

that is only what gets executed

#

might sound dumb but did you commit?

slate swan
slate swan
#

same for all snowflakes

slate swan
#

cz integer only works fine for sqlite iirc

paper sluice
paper sluice
slate swan
slate swan
heady sluice
#

not me

paper sluice
#

i was gonna ping you lol

swift pumice
#

german moment

slate swan
# heady sluice not me

stop it smh, just remember when I say meh am not referring to you, but when I say handsome meh I am honestly referring to you

heady sluice
#

when you say what

#

oh and the last part

#

Ik

toxic crypt
#

Hi!
Uhhhhhh how do I define a Variable depending on a Message?

Example: I have a Message in My Server which contains "215". How do I define a Variable in a Script to sync with the Value of this Message?

cloud dawn
#

"sync"?

toxic crypt
full lily
#

do you have an "on_message" event set up?

toxic crypt
cloud dawn
full lily
cloud dawn
#

Meaning what are we syncing and how.

toxic crypt
#

uhhh ye, like if I edit this Message it should sync the value of this Message to the Variable assigned to

toxic crypt
cloud dawn
unkempt canyonBOT
#

discord.on_message_edit(before, after)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message "discord.Message") receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.

If this occurs increase the [`max_messages`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") parameter or use the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") event instead.

The following non-exhaustive cases trigger this event...
cloud dawn
#

!d discord.on_raw_message_edit

unkempt canyonBOT
#

discord.on_raw_message_edit(payload)```
Called when a message is edited. Unlike [`on_message_edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_message_edit "discord.on_message_edit"), this is called regardless of the state of the internal message cache.

If the message is found in the message cache, it can be accessed via [`RawMessageUpdateEvent.cached_message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.RawMessageUpdateEvent.cached_message "discord.RawMessageUpdateEvent.cached_message"). The cached message represents the message before it has been edited. For example, if the content of a message is modified and triggers the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") coroutine, the [`RawMessageUpdateEvent.cached_message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.RawMessageUpdateEvent.cached_message "discord.RawMessageUpdateEvent.cached_message") will return a [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message "discord.Message") object that represents the message before the content was modified.

Due to the inherently raw nature of this event, the data parameter coincides with the raw data given by the [gateway](https://discord.com/developers/docs/topics/gateway#message-update).
toxic crypt
#

like:
TheVariable = TheValueOfTheMessageOnDiscord

#

Example is if the Message on Discord is "12345", then the Variable should be "12345" as well

toxic crypt
swift pumice
#
async def verify(ctx):
        role = ctx.guild.get_role(985205310740389918)
        await ctx.author.add_roles(role)
        await ctx.message.delete()
        await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)``` why isnt this working i just dont understand it
#

problem: it wont do anything

slate swan
#

do you have an on_message event
/ if no: do you have an error handler
/ if no: is this command above bot.run

slate swan
#

πŸ˜‚ which one?

swift pumice
#
async def on_message(message):
    if message.author == bot.user:
            return    
    if message.channel.id == 987651665492586568 and message.content.lower() != "!verify":
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)
    else:
        await bot.process_commands(message)```
#

i dont have an error handler

slate swan
#

remove that else part completely

swift pumice
#

wait why

slate swan
#

and change .event to listen()

swift pumice
#

okay

#
async def on_message(message):
    if message.author == bot.user:
            return    
    if message.channel.id == 987651665492586568 and message.content.lower() != "!verify":
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)
    ```like this right?
slate swan
#

.listen()

swift pumice
#

oh

#

so it still isnt working?

#
async def on_message(message):
    if message.author == bot.user:
            return    
    if message.channel.id == 987651665492586568 and message.content.lower() != "!verify":
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)
    


@bot.command()
async def verify(ctx):
        role = ctx.guild.get_role(985205310740389918)
        await ctx.author.add_roles(role)
        await ctx.message.delete()
        await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)``` this is how it looks alike rn
slate swan
#

can you try adding some print()s to check where the code stops working

swift pumice
#

what do you want me to print out?

slate swan
#

anything you want, just for an idea to see what parts of code gets excecuted

swift pumice
#

like print? print(verify)?

#

sry im new to python

slate swan
#

wait do you have an on_command_error event?

swift pumice
#

no i dont

neat field
#

why not just use a button?

slate swan
# swift pumice no i dont

just add a print statement inside that command which prints "command executed" to see if the command runs or not

slate swan
paper sluice
#

persistent view is a view that never timesout right?

slate swan
#

yep

swift pumice
#

yes it prints works

slate swan
#

so just the role doesnt get added?

#

recheck the role ID

cloud dawn
#

Yesn't

sick birch
#

Depends on the VPS

#

AWS is a bit difficult

warm tulip
#

hey guys helpp

#

i wanna join my bot in a voice called office

#

and i use this cmd:

  async def join(ctx):
    channel = ctx. author. voice. channel
    await channel. connect()```
#

and i join a vc and i use that cmd

#

here is eror :

#

next(iterator)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 979, in on_message
await self.process_commands(message)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 976, in process_commands
await self.invoke(ctx)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 855, in invoke
await self.prepare(ctx)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 789, in prepare
await self._parse_arguments(ctx)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 693, in _parse_arguments
raise discord.ClientException(fmt.format(self))
discord.errors.ClientException: Callback for join command is missing "ctx" parameter.

magic ore
#

You're missing the self parameter, which should be the first parameter of the method

warm tulip
#

umm

#

better ?

#
  async def  join(self, ctx):
      channel = ctx.author.voice.channel
      await channel.connect()```
#

@magic ore

warm tulip
#

not wroking

river rain
#

Hello, I'm making a discord bot that reads and writes some data to a text file, is there a way I can make it so once the amount of lines is greater than 15, it deletes the top line before adding another line, so it only stores the most recent 15 values (if that makes sense)

paper sluice
scenic stump
#

hi how can i fix?

minor summit
#

error...

#

how can i fix?

desert heart
#

Your screenshot doesn't include the actual error

#

Also, you can just paste the error. Don't bother with screenshots. They're not preferred anyway.

scenic stump
desert heart
scenic stump
#

can you recommend a good one?

#

I'm remaking the bot from scratch, in time for a change

desert heart
#

Not really. I haven't used interactions much myself. I know discord.py's alpha version supports them.

scenic stump
#

that of rapptz?

desert heart
#

You'll have to get advice from someone more experienced with interactions. I'm the wrong person to ask

#

Yes

scenic stump
#

ah ok

#

thanks

#

try

dull terrace
#

is there still no way to see if a link button is clicked

slate swan
#

nope

slate swan
#

unless u own the link

#

how do u wait for message discord py

slate swan
slate swan
#

!d discord.ext.commands.Bot.wait_for

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.10)"). 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.10)") 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.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
slate swan
#

I think you're looking for this 🀷🏾🀷🏾

#

There is a check

#

It does work πŸ€”

#

Wym by the correct message

#

Maybe u did something wrong or something idk

#

Yer_brickwall

dense walrus
#

any help?

sick birch
#

Try restarting it

dense walrus
sick birch
#

Might be a discord shortage then

wet crystal
#

I have a great Idea for a Discord bot

So basically it will be a phone.
I know that may sound stupid at first but listen.
So it will be that way that if you can go into a waiting room and then call a real number by something like !call +1 123345453.
Then it will move you and call the number over a VOIP API which leads you to be fully anonymous if you also use a spam Discord account.
It would be kind of expensive tho

dusky pine
#

Or just get a phone

#

Whichever works :P

wet crystal
#

Whichever works πŸ˜›

wet crystal
slate swan
#

privacy issues

wet crystal
slate swan
#

I mean, how does the api call numbers?

sick birch
#

random.randint and while True go brr

slate swan
#

well even if that works how's the command invoker gonna talk

dusky pine
#

so then you'd have the same number calling different people at the same time

#

or will you have to input your number

#

or auto-buy a SIM card for each user?

#

idea is just confusing :P

slate swan
#

just buy a call service providing company

#

and exploit the resources

dusky pine
slate swan
robust fulcrum
#

Hi

dusky pine
#

looking for a challenge? πŸ™‚

rare saddle
#

How to make a custom activity in a bot?

robust fulcrum
dusky pine
slate swan
robust fulcrum
slate swan
#

its the same....

rare saddle
robust fulcrum
dusky pine
robust fulcrum
robust fulcrum
dusky pine
#

using buttons

robust fulcrum
#

Let me try it

slate swan
slate swan
rain olive
#

...

slate swan
#

dumb*

#

lmao

dusky pine
#

jus tell us

slate swan
#

something that like keeps a check on specific user and messages

#

more like stalking

#

^

#

exactly

dusky pine
#

That's fucking dumb

rain olive
#

fr

slate swan
#

well, most logging bots do the same

#

discord bots are dumb

#

discord is dumb*

dusky pine
#

The internet is dumb*

rain olive
#

you are dumb*

slate swan
#

css is dumb

robust fulcrum
slate swan
#

stalking != act of theft

robust fulcrum
#

Stalking == grand theft

slate swan
#

me != not a thief

dusky pine
slate swan
robust fulcrum
#

Me a lot dumb

slate swan
dusky pine
robust fulcrum
#

πŸ˜‚

dusky pine
#

😳😏

robust fulcrum
#

πŸ˜΅β€πŸ’«

dusky pine
#

alr this channel will be renamed to flirting-zone

slate swan
#

ash is just jealous

dusky pine
#

doesn't matter 😳

robust fulcrum
#

Whats gay?

rain olive
robust fulcrum
#

Hmmm i should I use my discord bot to ask about this word

slate swan
#

🐒 lmao

slate swan
robust fulcrum
#

Let me go and use the define command

rain olive
#

.

slate swan
#

lets move on from this topic before some mod bonks our head

rain olive
#

bruh

dusky pine
#

.topic

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

Suggest more topics here!

slate swan
#

if you want something more challenging that a bot but related to the discord api make an api wrapper lol

#

make an api instead.

dusky pine
slate swan
#

oki

slate swan
slate swan
robust fulcrum
slate swan
#

oh that

dusky pine
#

ash you're the non-pg-13 one

slate swan
#

lmaoooo

#

bro ash you're dirty minded

rain olive
#

whats the non-pg-13 of bonk

robust fulcrum
slate swan
dusky pine
slate swan
#

ok boomer

slate swan
dusky pine
#

remain pg-13

slate swan
#

boi what the hell boi

robust fulcrum
#

Anyway get to the topic

dusky pine
#

.topic i didn't do anything

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!

robust fulcrum
slate swan
slate swan
dusky pine
slate swan
#

yup

robust fulcrum
#

Guys can discord bot record voice?

dusky pine
slate swan
slate swan
robust fulcrum
slate swan
#

use discord.js, no but some forks got it

dusky pine
#

make command that simulates jiggle physics

slate swan
robust fulcrum
slate swan
#

good for you

#

djs

robust fulcrum
#

I hate java

dusky pine
#

I don't think DJs know how to code

slate swan
#

js isnt java...

#

its javascript ;-!

dusky pine
slate swan
#

and java is our lovely language ❀️

slate swan
dusky pine
robust fulcrum
#

Where is asher

dusky pine
#

asher is gone <3

slate swan
#

@shrewd apex wakie wakie

robust fulcrum
#

Don't ping

slate swan
#

who cares i dont

robust fulcrum
#

Mayhe he school

slate swan
#

its sunday

#

school on Sunday yes.

dusky pine
#

@shrewd apex wakey wakey, is time fo schoo

slate swan
#

dont disturb him, hes sleeping, with me

shrewd apex
#

rip

robust fulcrum
#

I forgot its sunay

dusky pine
slate swan
#

asssserrrr

slate swan
#

ahser*

shrewd apex
#

?

robust fulcrum
#

I dont like sleeping

slate swan
#

asher*

#

asher wanna play coc?

#

i love sleeping but can't

#

anyone wanna play clash of clans?

dusky pine
#

coc

shrewd apex
robust fulcrum
#

Nah

slate swan
robust fulcrum
#

Play free fire with me

shrewd apex
#

i used to play dropped at th13

dusky pine
#

I'd rather not use Clash of Clans' abbreviation

slate swan
#

robin stop stalking us

shrewd apex
slate swan
slate swan
dusky pine
#

Robin has been caught

robust fulcrum
#

@slate swan want to play free fire with me?

slate swan
#

robin, πŸ˜” I made changes to the pr
(if you read this)

slate swan
dusky pine
sick birch
shrewd apex
#

i played all super cell games except boom beach and hay day

slate swan
rain olive
#

what day

slate swan
sick birch
#

lmao

slate swan
sick birch
rain olive
#

copyright.

slate swan
#

bro

shrewd apex
#

ok i am gonna go back and study cya

slate swan
#

bai bai goodluck

#

bye asher, gl.

#

dedication makes you close discord ots, totally not me

robust fulcrum
#

Good luck for study

dusky pine
slate swan
#

πŸ’€

rain olive
#

πŸ’€

slate swan
#

down bad brother

rain olive
restive osprey
#

for example
I have a file name main.py
and another called rust.rs (extension for rust)
and I call a function in rust from that file
will that code execute in rust or python

robust fulcrum
torn sail
slate swan
patent lark
#

hm.

swift pumice
#
async def on_message(message):
    if message.author == bot.user:
            return    
    if message.channel.id == 987651665492586568 and message.content.lower() != "!verify":
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)
    else:
        await bot.process_commands(message)
        
@bot.command()
async def verify(ctx):
        role = ctx.guild.get_role(985205310740389918)
        await ctx.author.add_roles(role)
        await ctx.message.delete(delete_after=3)
        await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)
        ```why isnt this working i just dont understand it(the bot.event works)
#

it doesnt give an error in the console

#

but the problem is it doesnt send the message neither adds the role

slate swan
#

show the full code

#

@swift pumice

swift pumice
#

what do you mean by full code?

#

my entire script?

slate swan
#

nvm

#

are you using Client or Commandsbot

#

like bot = commands.Bot

#

or something else

#

@swift pumice

swift pumice
#

yes im using bot

slate swan
#

you did two intents

swift pumice
#

bot = commands.Bot(command_prefix=(["!","E!"]) , case_insensitive=True)

slate swan
#
@bot.command()
async def verify(ctx):
        role = ctx.guild.get_role(985205310740389918)
        await ctx.author.add_roles(role)
        await ctx.message.delete(delete_after=3)
        await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)```
```py
@bot.command()
async def verify(ctx):
    role = ctx.guild.get_role(985205310740389918)
    await ctx.author.add_roles(role)
    await ctx.message.delete(delete_after=3)
    await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)```
swift pumice
#

oh

#

you are right, but is that a problem?

slate swan
#

i mean it could be since you're trying and it's not working

swift pumice
#

okay

slate swan
#

did it work?

swift pumice
#

no it didnt

slate swan
#

can you show me what are you typing to execute the command

swift pumice
#

!verify

slate swan
#

wait

swift pumice
#

problem, my event triggers

slate swan
#

no output?

#

dude

swift pumice
#

yes, but my problem is rn, if i write !verify my bot.event triggers and not my command

slate swan
#

if you're trying to make a verify command that just triggers the basic things, you can use a normal on_message event for that no need to make two different functions for a command

swift pumice
#

oh

slate swan
#

how long does it take to loop through 5k members

swift pumice
#

how would it look alike then?

slate swan
#

you can remove bot.coomand

swift pumice
slate swan
patent lark
slate swan
#

πŸ‘€

#

but depends on your program's load

swift pumice
#

?

slate swan
swift pumice
#

what

slate swan
#

what

slate swan
#

what even is the issue

#

smh

swift pumice
#

yes ig

slate swan
paper sluice
slate swan
#

nice

slate swan
#

nah, I just mean the logic behind doing that stuff

slate swan
#

@swift pumice when you type the command, does it get deleted?

swift pumice
#

yes

paper sluice
swift pumice
slate swan
slate swan
#

let's make it 2 ms for me plz πŸ˜”

swift pumice
slate swan
swift pumice
#

ok

slate swan
#

guild = get_guild then role = guild.get_role

swift pumice
#
async def on_message(ctx,message):
    if message.author == bot.user:
            return    
    if message.channel.id == 987651665492586568 and message.content.lower() != "!verify":
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)
    else:
        role = ctx.guild.get_role(985205310740389918)
        await ctx.author.add_roles(role)
        await ctx.message.delete(delete_after=3)
        await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)
        await bot.process_commands(message)
#

@slate swan

#

like this?

slate swan
#
if message.channel.id == 987651665492586568 and message.content.lower() == "!verify":
  role = ctx.guild.get_role(985205310740389918)
        await ctx.author.add_roles(role)
        await ctx.message.delete(delete_after=3)
        await ctx.send(f'{ctx.author.mention}you are now verified', delete_after=3)
        await bot.process_commands(message)        

    else:
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)
swift pumice
#

thanks

slate swan
#

make sure to add intent to that role

swift pumice
#

ok

slate swan
#

lemme know if it works

#

oh no

#

@swift pumice

swift pumice
#

okay

slate swan
#

i never noticed that exclaimation symbol lol

#

now try i've updated the code

swift pumice
#

okay

#

doesnt work

shell wing
#
from dinteractions_Paginator import Paginator
ModuleNotFoundError: No module named 'dinteractions_Paginator'
``` can someone tell me why is this happening ??? when im using replit it isnt a problem
slate swan
#

remove the ctx from your bot.event(ctx,message)

swift pumice
#

okay

slate swan
#

wtf is wrong with me

swift pumice
#

replace it with?

slate swan
#
if message.channel.id == 987651665492586568 and message.content.lower() == "!verify":
  role = ctx.guild.get_role(985205310740389918)
        await message.author.add_roles(role)
        await message.delete(delete_after=3)
        await message.channel.send(f'{ctx.author.mention}you are now verified', delete_after=3)
        await bot.process_commands(message)        

    else:
        await message.delete()
        await message.channel.send(f'{message.author.mention}please only write !verify and not something other', delete_after=3)```
#

it should work now

swift pumice
#

thx

paper sluice
#

it will take 2 in hikari πŸ˜„

#

!pip dinteractions_Paginator

unkempt canyonBOT
paper sluice
shell wing
#

it was and is working like this in replit...

#

though

#

ill change it ty

slate swan
paper sluice
#

5k members -> 0.0003195000008417992s
πŸ‘€

#

.3 ms

robust fulcrum
#

Hi

hollow carbon
#

Hello every, so I have a question, the question is how can I make a button and when the user clicks it, bot will response some question for you in the private message, at last, the private message will content direct to my discord server and bot will make a Embed Editor, How can I make this ?? (.py)

#

thx

slate swan
#

and which library?

#

you can't open links for people

#

I mean, run programs on the client side

hollow carbon
#

πŸ€”

slate swan
#

how to dm the mentioned user

warm tulip
#

guys help

#

im coding in replit

#

and this is main.py

import asyncio
import os
import random
from discord.ext import commands

bot = commands.Bot(command_prefix=["p!","P!", "puppy", "Puppy"])

bot.remove_command("help")


@bot.event
async def on_ready():
  await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="Spotify"))



  
bot.load_extension("commands")
bot.run(os.getenv("token"))```
unkempt canyonBOT
#

Hey @warm tulip! I noticed you posted a seemingly valid Discord API token in your message and have removed your message. This means that your token has been compromised. Please change your token immediately at: https://discordapp.com/developers/applications/me

Feel free to re-post it with the token removed. If you believe this was a mistake, please let us know!

slate swan
#

whats the problem

warm tulip
#

idk

#

eror :
Traceback (most recent call last):
File "main.py", line 20, in <module>
bot.run(os.getenv("token"))
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/client.py", line 723, in run
return future.result()
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/client.py", line 665, in start
await self.login(*args, bot=bot)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/home/runner/yoohooool/venv/lib/python3.8/site-packages/discord/http.py", line 216, in request
raise HTTPException(r, data)
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.

Discord Developer Portal

Integrate your service with Discord β€” whether it's a bot or a game or whatever your wildest imagination can come up with.

#

the bot dosent start

slate swan
slate swan
slate swan
#

ew

#

and make a file called restarter.py

from time import sleep
from os import system
sleep(7)
system("python main.py")

put this in restarter py

slate swan
unkempt canyonBOT
#
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=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/latest/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.10)") of [`File`](https://discordpy.readthedocs.io/en/latest/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/latest/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.10)") of [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
slate swan
#

*User

#

!d discord.User.send

unkempt canyonBOT
#
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=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/latest/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.10)") of [`File`](https://discordpy.readthedocs.io/en/latest/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/latest/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.10)") of [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
warm tulip
slate swan
#

same thing though sooo

#

not really

#

whatever smh

#

thats like saying a blueberry is equal to a strawberry

scenic stump
#

hi how can i fix?

hollow carbon
#

btw do you know what I’m talking about?

#

sorry my english is bad

hollow carbon
#

what your get ??

slate swan
slate swan
#

Β―_(ツ)_/Β―

scenic stump
slate swan
#

hikari is complex though

unkempt canyonBOT
slate swan
#

!pip hikari

unkempt canyonBOT
slate swan
#

I still prefer hikari

slate swan
#

it keeps saying

BLOCKED BY RATE LIMITS
RESTARTING NOW

scenic stump
slate swan
#

1.7.3 doesnt have app commands lol

hollow carbon
#

ok so content: I would like to directly deliver all DM messages to the discord server

slate swan
slate swan
slate swan
#

I mean I do know that 1.7 doesn't have slash commands

#

then why recommend it?

#

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

#

you ment 2.0?

slate swan
#

still, hikari ftw

slate swan
slate swan
unkempt canyonBOT
hollow carbon
#

embed editor

slate swan
#

!d discord.Member.send

unkempt canyonBOT
#
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=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/latest/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.10)") of [`File`](https://discordpy.readthedocs.io/en/latest/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/latest/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.10)") of [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
hollow carbon
slate swan
#

there are many things

paper sluice
hollow carbon
#

@slate swan content direct : I would like to directly deliver all DM messages to the discord server

slate swan
# slate swan hhowwwwwwwwwwww

just dm the author of the context of the command, that the message was sent and then have an argument that expects a Member object and then just use Member.send

hollow carbon
#

@slate swan Do you get it???

slate swan
#

oh god

slate swan
hollow carbon
slate swan
#

its a page that shows a preview of an embed

paper sluice
slate swan
#

you can't make someone use an embed editor for custom embeds, it either generates a code for some langauge, or the embed payload ( this can be useful )
you can use Embed.from_dict(payload) for them to create a custom embed

spring flax
slate swan
#

carl bot does something similar

#

sarthak 😭

#

ash :3

slate swan
slate swan
slate swan
#

I just wanna log certain stuff

#

if that is possible

slate swan
#

oh I see

#

thanks cutie

#

since thats set to work in the environment

#

yw

hollow carbon
#

So now I want to make a function, when I click the button in the discord server(like the picture) and the bot will dm me , when the dm end, the bot will directly deliver all DM messages to the discord server

slate swan
#

"when the dm end" ? elaborate

#

how do you define the end of the dm.

#

bad modal size ig?

#

you're adding too many items to the Modal

hollow carbon
slate swan
#

how are you proceeding with asking the questions

hollow carbon
slate swan
#

When i answer all the question
where does the question appear from????

hollow carbon
#

bot ask me a question and I answer it

#

unit All the question end

#

em sorry about my english

#

πŸ₯²

slate swan
#

its okay i understand what you mean but when does the bot asks those questions?

#

when you send something or use some command?

honest shoal
#

How do I localize command responses in disnake?

slate swan
#

can you elaborate wym by localize?

honest shoal
#

Translation

#

Docs do not have much information about localization, options and autocompletes are explained but not responses

slate swan
#

you can store a list of responses and send the response on basis of its invocation

#

because you get the data of locale, but you can't make discord translate stuff for you.

honest shoal
slate swan
#

how do you translate in disnake normally?

honest shoal
#

We just use that key

slate swan
#

its for options and commands not responses.

#

no Library will translate text for you

honest shoal
#

That's what I'm asking, responses aren't explained there

honest shoal
slate swan
#

because its not possible? the option translation is handles by discord

#

*handled

honest shoal
#

I've seen bots supporting that, they use client's language for user based things and server's community language for server based things

slate swan
#

have you ever tried asking how they do that in their support servers?

honest shoal
#

Their framework supports that, I myself have translated some bots

#

and they were not python bots btw

slate swan
#

you can't do that for responses, responses needs to be handled by your bot. Translate the text by getting their locale and translate your response according to that

#

!d discord.Interaction.locale

unkempt canyonBOT
honest shoal
#

And how will my bot know about user's language?

slate swan
#

that depends on the locale ig?

honest shoal
#

Well disnake does that automatically, but I need some more if/else when I get user's langauge

shell wing
#
PS D:\New folder\pythonProject1> pip install -U git+https://github.com/Rapptz/discord.py
Collecting git+https://github.com/Rapptz/discord.py
  Cloning https://github.com/Rapptz/discord.py to c:\users\pratyush\appdata\local\temp\pip-req-build-hka3cn8a
  Running command git clone -q https://github.com/Rapptz/discord.py 'C:\Users\Pratyush\AppData\Local\Temp\pip-req-build-hka3cn8a'
  ERROR: Error [WinError 2] The system cannot find the file specified while executing command git clone -q https://github.com/Rapptz/discord.py 'C:\Users\Pratyush\AppData\Local\Temp\pip-req-build
-hka3cn8a'
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
WARNING: You are using pip version 21.1.2; however, version 22.1.2 is available.
You should consider upgrading via the 'D:\New folder\pythonProject1\venv\Scripts\python.exe -m pip install --upgrade pip' command.

``` im getting this error
#

i recently downloaded the git CMD...(although idk how to use though)

slate swan
honest shoal
#

because it's dead inactive

paper sluice
#

if you installed it and you get an error, then the git executable is not in your windows path

#

you need to add it manually

kind wind
#

is there a way i can get the user's message into a reply?

worthy marsh
#

heyo

#

im facing a positional argument error in my music bot code

#
class Video:
    
    def __init__(self, requested_by, url_or_search):
        
        with ytdl.YoutubeDL(YTDL_OPTS) as ydl:
            video = self._get_info(url_or_search)
            video_format = video["formats"][0]
            self.stream_url = video_format["url"]
            self.video_url = video["webpage_url"]
            self.title = video["title"]
            self.uploader = video["uploader"] if "uploader" in video else ""
            self.thumbnail = video[
                "thumbnail"] if "thumbnail" in video else None
            self.requested_by = requested_by
#

discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.video' raised an error: TypeError: Video.__init__() missing 1 required positional argument: 'url_or_search'

#

Basically if i switch requested_by with url_or_search, it happens with requested by instead

paper sluice
#

make a list of all the words you want to detect, and in ur on_message listener see if the message has any of the words from the list and then you can delete the message

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
#

i wanted to do this :c

worthy marsh
#

Oh i am really sorry

#

Although this seems to be a python error aswell

#

Could you maybe look into it with a general perspective?

slate swan
worthy marsh
#

could you elaborate on that?

paper sluice
#

!e

class Foo:
    def __init__(self, a, b):
      ...

Foo(1)
unkempt canyonBOT
#

@paper sluice :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 5, in <module>
003 | TypeError: Foo.__init__() missing 1 required positional argument: 'b'
paper sluice
#

thats whats happening in your case, you are only passing in one argument

worthy marsh
#

wait so how do i pass both of them

#

i mean both are being used in the code

paper sluice
worthy marsh
#
class Video:
    
    def __init__(self, requested_by, url_or_search):
        
        with ytdl.YoutubeDL(YTDL_OPTS) as ydl:
            video = self._get_info(url_or_search)
            video_format = video["formats"][0]
            self.stream_url = video_format["url"]
            self.video_url = video["webpage_url"]
            self.title = video["title"]
            self.uploader = video["uploader"] if "uploader" in video else ""
            self.thumbnail = video[
                "thumbnail"] if "thumbnail" in video else None
            self.requested_by = requested_by

    def _get_info(self, video_url):
        with ytdl.YoutubeDL(YTDL_OPTS) as ydl:
            info = ydl.extract_info(video_url, download=False)
            video = None
            if "_type" in info and info["_type"] == "playlist":
                return self._get_info(
                    info["entries"][0]["url"]) 
            else:
                video = info
            return video

    def get_embed(self):
        
        embed = discord.Embed(
            title=self.title, description=self.uploader, url=self.video_url)
        embed.set_footer(
            text=f"Requested by {self.requested_by.name}",
            icon_url=self.requested_by.avatar_url)
        if self.thumbnail:
            embed.set_thumbnail(url=self.thumbnail)
        return embed

def setup(bot):
    bot.add_cog(Video(bot))
#

the whole thing looks like this

paper sluice
#

your doing Video(bot), but it requires another argument

#

which is url_of_search

worthy marsh
#

ah ok ill check

paper sluice
#

.rp OOP

#

:( forgot about this

worthy marsh
#

just an empty string?

paper sluice
# worthy marsh ah ok ill check

#bot-commands message
there are some links for OOP, i recommend checking them out. It would be easier for debug ur own code

kind wind
# kind wind is there a way i can get the user's message into a reply?

basically im making a submit bot command and I want the user to add 2 things on the message and the first will be the bot id and the second the prefix. I want to do something like this:

await ctx.reply("You have submitted <@" + [the first message] + "> with a prefix " + [the second message] + " . You will be contacted  for further info.")

How can I do something like that

slate swan
shrewd apex
#

!d discord.ext.commands.Bot.wait_for

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.10)"). 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.10)") 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.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
slate swan
#

!d discord.on_interaction

unkempt canyonBOT
#

discord.on_interaction(interaction)```
Called when an interaction happened.

This currently happens due to slash command invocations or components being used.

Warning

This is a low level function that is not generally meant to be used. If you are working with components, consider using the callbacks associated with the [`View`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.ui.View "discord.ui.View") instead as it provides a nicer user experience.

New in version 2.0.
slate swan
#

!d discord.ui.Button.callback <- or

unkempt canyonBOT
#

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

The callback associated with this UI item.

This can be overridden by subclasses.
slate swan
#

not possible.

paper sluice
#

the user only selected one value

#

so values will return a list of len 1

slate swan
paper sluice
#

add another for loop and loop over the directories

#

or use pathlib.Path.glob much easier to work with

robust fulcrum
#

@paper sluice any good challenge for me?

paper sluice
#

using buttons

robust fulcrum
dire wind
#

hi guys

robust fulcrum
#

Hi

paper sluice
dire wind
#

I want to make a Telegram bot, do you know a good source?

slate swan
slate swan
paper sluice
#

you can just do

for directory in os.listdir('cogs'):
    for file in directory:
        ...
#

u dont need 3 loops

#

with pathlib it would just be

extensions = list(pathlib.Path('cogs').glob('**/*.py'))
slate swan
#

if not name.startswith('.'):
AttributeError: 'WindowsPath' object has no attribute 'startswith'

paper sluice
#

show code

slate swan
# paper sluice show code
extensions = list(pathlib.Path('cogs').glob('**/*.py'))
for directory in os.listdir('cogs'):
    for file in directory:
        extensions.append(f'{directory}.{file[:-3]}')
paper sluice
#

why do you have both

slate swan
#
for extension in extensions:
    bot.load_extension(extension)
    print(f'{extension} loaded!')
#

the error is in this part

paper sluice
#

oh do str(extension) and it contains \\ so you would have to replace it with .

paper sluice
robust fulcrum
paper sluice
#

how do you know?

#

have you tried it yet?

robust fulcrum
shrewd apex
#

why not just use os.listdir?

paper sluice
#

You shouldn't be making bots if you don't know about classes...

shrewd apex
#

it's not a must to know classes for making buttons tho

paper sluice
shrewd apex
#

pretty sure oslib has a walkthrough function as well

paper sluice
#

its a recommendation, they can choose the one they are comfortable with

robust fulcrum
pseudo crystal
#

Pycord or nextcord?

robust fulcrum
paper sluice
#

every project i give, you complain that its too hard without even trying, so you should probably ask someone else

robust fulcrum
slate swan
robust fulcrum
#

Guys how we can play audio from file in dpy voice?

kind wind
#

can you select a content from a message like this?

discord.Message.content(1)
visual island
#

select a content?

visual island
unkempt canyonBOT
#

play(source, *, after=None)```
Plays an [`AudioSource`](https://discordpy.readthedocs.io/en/latest/api.html#discord.AudioSource "discord.AudioSource").

The finalizer, `after` is called after the source has been exhausted or an error occurred.

If an error happens while the audio player is running, the exception is caught and the audio player is then stopped. If no after callback is passed, any caught exception will be logged using the library logger.

Changed in version 2.0: Instead of writing to `sys.stderr`, the library’s logger is used.
slate swan
#

Am I allowed to do discord web hook related queries here?

#

and it returns an int

#

ohhh

#

ctx.author.roles

#

gets all roles

#

for role in ctx.author.roles:

#

There is a command decorator that checks if the user has a role

#

!d discord.Member.roles

unkempt canyonBOT
#

property roles```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [β€˜@everyone](mailto:'%40everyone)’ role.

These roles are sorted by their position in the role hierarchy.
slate swan
#

ctx.author returns Member

analog robin
#

Does anyone know a hosting service that can host bots using sqlite as their dbs

#

I know since sqlite stores data on the local drive hosting servers cannot use it?

slate swan
#

depends on what hosting server you are using. if its one like heroku, thats not allowed

robust fulcrum
#

Guys is there any tts library for python?

slate swan
#

yes

paper sluice
#

!pip gtts

unkempt canyonBOT
#

gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API

robust fulcrum
#

Is it possible to use in dpy?

slate swan
#

depends on how you wanna implement it tbh

robust fulcrum
#

I want to make a comamnd that my bot converts text into speech and play in vc

robust fulcrum
#

Ok

slate swan
#

many bots already do that

#

it's not hard or anything soooo Β―_(ツ)_/Β―

robust fulcrum
#

Like i saw many bots have Google search comamnd and bots send link to the Google query . Is there any way that our bot displays the result in the description of the embed instead of link?

paper sluice
#

get a google search api key, then use that api

slate swan
#

^

#

you can even use a library but mehh

#

isn't as good as the api

#

only returns links and urls

robust fulcrum
slate swan
#

you do know that wikipedia and google are different

robust fulcrum
#

Ik

#

@slate swan i am facing one problem in my discord bot can you help me pls?

slate swan
#

?

robust fulcrum
# slate swan ?

Mostly when i use any comamnd it not works when i see the terminal it says rate limeted . But my bot don't even have much stuff
Is there any way to fix?

robust fulcrum
#

?

slate swan
#

because, replit uses shared servers

#

so

robust fulcrum
#

Should I host my bot on heroku?

slate swan
#

do kill 1 in ther shell

robust fulcrum
slate swan
slate swan
robust fulcrum
robust fulcrum
slate swan
slate swan
robust fulcrum
#

What should I do now?

#

Any good way to solve this problem?

slate swan
slate swan
robust fulcrum
#

Pc/laptops will not provide me hosting

paper sluice
#

in heroku, you can't really edit your code. So you can edit code in pc then host it on heroku

slate swan
#

you can get vps for free for lifetime with alts πŸ˜”

robust fulcrum
#

I should do the vps thing

paper sluice
#

rp >> vps

robust fulcrum
#

Repl?

slate swan
#

ew

paper sluice
#

raspberry pi

slate swan
#

I mean repl is already a short form

#

why would anybody create any abbreviation for repl πŸ’€

robust fulcrum
paper sluice
slate swan
#

..?

robust fulcrum
#

πŸ˜΅β€πŸ’«

paper sluice
#

python interactive mode is also called a repl

#

!repl

unkempt canyonBOT
#

Read-Eval-Print Loop

A REPL is an interactive language shell environment. It first reads one or more expressions entered by the user, evaluates it, yields the result, and prints it out to the user. It will then loop back to the read step.

To use python's REPL, execute the interpreter with no arguments. This will drop you into the interactive interpreter shell, print out some relevant information, and then prompt you with the primary prompt >>>. At this point it is waiting for your input.

Firstly you can start typing in some valid python expressions, pressing <return> to either bring you to the eval step, or prompting you with the secondary prompt ... (or no prompt at all depending on your environment), meaning your expression isn't yet terminated and it's waiting for more input. This is useful for code that requires multiple lines like loops, functions, and classes. If you reach the secondary prompt in a clause that can have an arbitrary amount of expressions, you can terminate it by pressing <return> on a blank line. In other words, for the last expression you write in the clause, <return> must be pressed twice in a row.

Alternatively, you can make use of the builtin help() function. help(thing) to get help on some thing object, or help() to start an interactive help session. This mode is extremely powerful, read the instructions when first entering the session to learn how to use it.

Lastly you can run your code with the -i flag to execute your code normally, but be dropped into the REPL once execution is finished, giving you access to all your global variables/functions in the REPL.

To exit either a help session, or normal REPL prompt, you must send an EOF signal to the prompt. In *nix systems, this is done with ctrl + D, and in windows systems it is ctrl + Z. You can also exit the normal REPL prompt with the dedicated functions exit() or quit().

robust fulcrum
#

Should I get a vps for 3 years free?

slate swan
robust fulcrum
#

Btw can we host bots on digital ocean?

slate swan
#

gib money

paper sluice
robust fulcrum
slate swan
#

or better if you have github student

slate swan
#

your jokes are way out of the line 😭

robust fulcrum
paper sluice
slate swan
robust fulcrum
paper sluice
#

you can get a lot of free stuff just by having a credit card

slate swan
#

i won't be making discord bots if i had a real job.

paper sluice
robust fulcrum
slate swan
paper sluice
slate swan
#

try to integrate your both with redis cache

slate swan
#

!pip hikari-sake 😏

unkempt canyonBOT
slate swan
paper sluice
slate swan
paper sluice
#

I made like a whole algo to convert different datatypes into some sort of hash then convert them to bytes, then realized its so pointless and just use alru_cache

#

I still have the configs for redis, its just that none of my commands need it

slate swan
#

fair

slate swan
robust fulcrum
#

@slate swan do you know java script?

slate swan
#

pfftt

#

what's with js now

slate swan
#

this is a python server smh

paper sluice
#

same

slate swan
#

who needs javascript 😏

#

me

#

I breathe javascript πŸ˜”

#

nvm

paper sluice
robust fulcrum
#

I dint like js

slate swan
#

errors are easy to solve meh

robust fulcrum
#

Idk why me asking for challenge and dont do them

slate swan
robust fulcrum
slate swan
#

I never said that

robust fulcrum
#

Which means you saying me not to study

fierce light
slate swan
#

smh, am not gonna give english lessons here nvm

cloud dawn
#

If you can earn money without going to school what does it matter.

robust fulcrum
#

We cant earn

paper sluice
#

you can

fierce light
#

Tips to earn money:

  1. Rob
#

Best advice

cloud dawn
#

That's not earning that's stealing.

fierce light
#

Just kidding pls dont ban me

paper sluice
#

its just that school qualifications and college degrees are more likely to get you a job

fierce light
#

Its a joke

robust fulcrum
fierce light
#

Its a j o k e

paper sluice
robust fulcrum
cloud dawn
fierce light
#

Oh i thought this was general lmao my badπŸ’€

slate swan
robust fulcrum
slate swan
#

no

slate swan
#

heisting generally needs more planning and more than two people to make it successful, anyways am not here to mislead kids

robust fulcrum
robust fulcrum
slate swan
slate swan
robust fulcrum
#

Do you sleep?

slate swan
#

javascript takes all the sleep away

slate swan
slate swan
#

like no shit

slate swan
#

no u

paper sluice
#

no, im more impressed by the fact that you know how many hours there are in a week

cloud dawn
#

It's a programmer thing

#

86400 seconds is a day

paper sluice
#

im not a programmer then πŸ˜”

slate swan
#

24x7

#

how hard's it Β―_(ツ)_/Β―

paper sluice
cloud dawn
#

25*7-7

#

My head.

#

or 24*10/5+24*2

slate swan
#

?

#

24*10/5+24*2 is 4 days isn't it

shrewd apex
#

or 20*7+4*7

slate swan
#

13^2 - 1

shell wing
#
File "main.py", line 55, in <module>
bot.os.environ.get('TOKEN')
AttributeError: 'Bot' object has no attribute 'os'
#

i have imported

#
from discord.ext import commands
import os
import discord
shell wing
#

alr

clever socket
shell wing
#

i messed up bad

#

i didnt added () and run

shell wing
shell wing
slate swan
shell wing
#

the bot wont read them

unkempt canyonBOT
#

os.walk(top, topdown=True, onerror=None, followlinks=False)```
Generate the file names in a directory tree by walking the tree either top-down or bottom-up. For each directory in the tree rooted at directory *top* (including *top* itself), it yields a 3-tuple `(dirpath, dirnames, filenames)`.
shell wing
#

cause they are inside 2 folders and u only made the code to read 1 folder

#

idk if im clear or not

#

for making the bot read and load the ping.py cog u need to do this :- cogs/comon
stuff inside economy :- cogs/economy
and so on

slate swan
indigo dagger
#

guys now i am trying to learn wait for but i cant understand
so suppose if i just want a simple response which says hello user : !xyz bot : hello user : hello [ take this response ] bot : have a good day
how will it be?

plush bluff
#

how can i send a welcome message with a non embed msg along with embed message like in the image

shrewd apex
unkempt canyonBOT
#
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=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.

This works similarly to [`send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for non-interaction contexts.

For interaction based contexts this does one of the following...
shrewd apex
#

content=

plush bluff
indigo dagger
main path
#

client.command()
async def xyz:
  await ctx.send("hello")
  
  def check(message):
    return message.author == ctx.author
  time_r = 300

  
  try:
    message = await bot.wait_for('message', check = check, timeout = time_r) 
  except asyncio.TimeoutError:
    await ctx.send(f"{time_r} seconds passed and you didn't respond")
    return

  message = message.content

  if message.lower() == "hello"
    ctx.send("have a good day")
indigo dagger
#

ok

main path
#

try it

#

and tell me if it worked or not

indigo dagger
main path
#

yes

#

what ever is in the message variable is what the user responded with

main path
#

what is wrong in it?

indigo dagger
#

and check = check
check[does this mean that what we want to check?] = check[and does this check mean the name of the function]?

slate swan
slate swan
#

yeah it is, but the example is really fucked up

#

to heights ngl

main path
#

oops the loop shouldn't be there

#

well I copied it from my code and forgot to remove it

indigo dagger
#

ok ziad i tried once tell me what i have to change coz my code didnt work

main path
#

what is the error

indigo dagger
#
    def inner_check(message):
        return message.author == author and message.content == "Hello"

    return inner_check

@client.command()
async def trial(ctx):
    await client.wait_for('message', check=check(ctx.author, inner_check(ctx)), timeout = 30)
    await ctx.send('Hello')```
main path
#

remove the looop

indigo dagger
#

i tried this tell me what didnt work

main path
#

try this

main path
indigo dagger
#

the code didnt work when i tried

slate swan
#
@bot.command()
async def foo(ctx: commands.Context) -> None:
  await ctx.send("Hi")
  
  def check(message: discord.Message) -> bool:
    return message.author == ctx.author and ("hello", "hi") in message.content.lower()
  
  try:
    message = await bot.wait_for("message", check=check, timeout=300)
  except asyncio.TimeoutError:
    return await ctx.send("rip no hello :pensive:")
  
  await ctx.send("have a good day!")

better

indigo dagger
slate swan
#

dude tf