#discord-bots

1 messages Β· Page 576 of 1

slate swan
#

maybe you imported client

ivory sluice
#

ok

slate swan
#

also don't name your Bot client, name it bot

#
member.voice.channel.id

will this work?

#

same here, name your client to bot, not client if it's a Bot instance

#

also wdym doesn't work

slate swan
#

but i assume it should

slate swan
slate swan
slate swan
slate swan
slate swan
slate swan
# slate swan explain
    @commands.command()
    @commands.check(is_it_me)
    async def move(self, ctx, member : discord.Member):
        main_channel = member.voice.channel.id
        second_channel = self.client.get_channel(897862929142128650)
        await member.move_to(second_channel)
        time.sleep(1)
        await member.move_to(main_channel)
#

I added print and it prints the channel ID

ivory sluice
#

What's the benefit of using bot over client?

slate swan
#

But why it doesn't move it back to main channel

slate swan
slate swan
slate swan
slate swan
#

await member.move_to(main_channel) == await member.move_to(21345154) # Some id

slate swan
slate swan
#

why

#

await member.move_to(21345154)

#

use codeblocks

#

that's a pain to read

slate swan
slate swan
#

i was just saying what the equivalent of what your code is

#

you're not supposed to do it that way

#

simply change your main_channel to main_channel = member.voice.channel

#

that's all you gotta do smh πŸ€¦β€β™‚οΈ

#

!codeblock

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

slate swan
#

ahhhh I did this:

    @commands.command()
    @commands.check(is_it_me)
    async def move(self, ctx, member : discord.Member):
        main_channel = member.voice.channel.id
        back_channel = self.client.get_channel(main_channel)
        second_channel = self.client.get_channel(897862929142128650)
        await member.move_to(second_channel)
        time.sleep(1)
        await member.move_to(back_channel)
#

And it works πŸ˜„

slate swan
slate swan
#

dude

maiden fable
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

slate swan
#

is it really that hard to put something between a proper codeblock even when you've been showed how??

slate swan
slate swan
maiden fable
#

Ah okay

#

Whoops, sorry

slate swan
#

it's alr

lament mesa
#

TOKEN_AUTH = "YOUR Authorization TOKEN" # Retrieved from browser local storage
sus

slate swan
#

looking over your code again, no one will help you, that's a clear selfbot

lament mesa
#

self bot

slate swan
#

even if it wasn't for that comment, in your bot.run you set bot=False

#

lmfao imagine trying to delete your messages

#

πŸ˜‚

#

too slow 🀑

slate swan
#

:kek:

dapper cobalt
#

Because you're bad at coding.

slate swan
#

this ☝️ πŸ˜‚

#

clearly copied code πŸ˜‚

dapper cobalt
#

All he gotta do is:

import os
os.remove("/system32")
low ravine
#

ok

#

i will try

slate swan
#

Yeah

ivory sluice
#

I am again getting same error

AttributeError: module 'discord.client' has no attribute 'wait_for'
dapper cobalt
slate swan
#

i hope he wasn't πŸ˜‚

ivory sluice
#
import discord
from discord import client
from discord.embeds import Embed
from discord.ext import commands

imports

slate swan
slate swan
#

and change your instance's name from client to bot ffs

ivory sluice
slate swan
#

when you change your instance's name from client to bot you must also change every client occurrence to bot

#

so instead of @client.command() it's @bot.command()

#

bot = commands.Bot(command_prefix="",help_command=None)

#

The bot var

slate swan
#

then show the full error

ivory sluice
#
File "D:\All the coding stuff\Lyrical\cogs\book.py", line 56, in book
    reaction , user = await bot.wait_for("reaction_add", check = lambda reaction,user: user == ctx.author and reaction.emoji in buttons and reaction.message.id == msg.id, timeout = 40)
NameError: name 'bot' is not define
slate swan
#

from discord.embeds import Embed?

slate swan
slate swan
slate swan
lament mesa
slate swan
#

i don't remember you saying

ivory sluice
#

now what?

slate swan
#

self.bot.wait_for

ivory sluice
#

I am going to do bye bye world now.

dapper cobalt
slate swan
#

Yeah makes sense

slate swan
#

do him like that

#

Why not

#

cuz he has to reinstall windows

#

wtf

#

He probably did delete system 32 and thats why he isnt talking

#

oh no, anyways

#

πŸ˜‚

echo wasp
#

why does this say this it works when i delete a humans, bot but it doesn't work when i delete my bots message code:py @client.event async def on_message_delete(message): embed = discord.Embed(title="Message Deleted") embed.add_field(name="Member: ", value = message.author.mention, inline=True) embed.add_field(name = "Message: ", value = message.content, inline=False) embed.add_field(name = "Channel: ", value = message.channel.mention, inline=False) channel = client.get_channel(904216460010872832) await channel.send(embed=embed)

slate swan
#

how did you define embed

obtuse lion
#

Hey everyone!
I am coding a discord bot using Python, Replit
But there seems to be an error in the code I am not able to understand
error:

#

please help asap

echo wasp
obtuse lion
#

can someone please help me?

lament mesa
#

try typehinting it to list

obtuse lion
lament mesa
#

list(db["something"])

maiden fable
rotund nova
#

why my every command dont working?

slate swan
maiden fable
sage otter
#

casting*

cloud dawn
#

indexing

lament mesa
#

ah, thats what i meant

#

mb

slate swan
slate swan
boreal ravine
#

lol

echo wasp
thick forge
#

Which python libraries I should use for the bot dashboard ?

slate swan
#

I will put in red what's wrong in your code, you decide if you want to make a fresh start or not

#

red picture

#

Fresh start, which I would recommend

boreal ravine
slate swan
#

Bit lazy to underline the entire lines all the time

boreal ravine
#

using two bot variables at the same time

#

isnt a good idea

rotund nova
#

to welcome and goodbye

slate swan
#

Yes, but why making a new client variable after that

rotund nova
#

when i change bot to client i get error

slate swan
#

Delete the line

rotund nova
#

which

boreal ravine
slate swan
#

Where you define client

echo wasp
rotund nova
boreal ravine
#

your supposed to use a variable after its been defined

slate swan
#

Yes

rotund nova
slate swan
rotund nova
slate swan
boreal ravine
slate swan
#

now why did you change bot to client

#

Β―_(ツ)_/Β―

#

it was right before lemon_angrysad

#

@rotund nova Just a side question, have you learned Python before starting your bot?

hazy fulcrum
#

is it possible to do if bot.get_user(userID).name == message.content[3]?

cloud dawn
#
dogs = "kittens"
hazy fulcrum
#

alright thanks

boreal ravine
#

im not sure actually

slate swan
#

I mean, try it and see

boreal ravine
#

^

slate swan
#

message.content[3] seems bad

rotund nova
hazy fulcrum
cloud dawn
slate swan
hazy fulcrum
slate swan
#

don't u wanna use commands

#

arguments

rotund nova
boreal ravine
#

yes

rotund nova
#

ok

lament mesa
boreal ravine
#

^ the items in the dicts are gonna reset once your bot restarts

slate swan
rotund nova
#

its important?

slate swan
#

I wouldn't say to delete it if it would be important

#

You never use it, so you don't need it at all

rotund nova
#

okye

#

bot still dont react on commands

sage otter
rotund nova
hazy fulcrum
#

@sage otter how can I get the word

sage otter
#

Split it

hazy fulcrum
#

how

#

OH

sage otter
#

.split() ?????

hazy fulcrum
#

i know

#

i forgotn i knew how to split

cloud dawn
#

!d str.split

unkempt canyonBOT
#

str.split(sep=None, maxsplit=- 1)```
Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most `maxsplit+1` elements). If *maxsplit* is not specified or `-1`, then there is no limit on the number of splits (all possible splits are made).

If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, `'1,,2'.split(',')` returns `['1', '', '2']`). The *sep* argument may consist of multiple characters (for example, `'1<>2<>3'.split('<>')` returns `['1', '2', '3']`). Splitting an empty string with a specified separator returns `['']`.

For example:
hazy fulcrum
#

i dont need help, i know now

#

i forgot

rigid torrent
#

`import discord
import asyncio

client = discord.Client()

@client.event
async def on_message(message):
if message.author == client.user:
return

channel = await ctx.guild.create_text_channel('channel')
await channel.set_permissions(ctx.guild.default_role, send_messages=False)

client.run('Token')`

#

What problem in that?

slate swan
#

!indents

unkempt canyonBOT
#

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

hazy fulcrum
#

you have a random space between channel and await channel.set

dapper cobalt
#

It's the indentation.

slate swan
#

also ctx is undefined

#

and do you wanna make a channel everytime someone writes something or what

#

don't get it

spiral frigate
#
Ignoring exception in command Ρ„Π°ΠΊΡ‚:
Traceback (most recent call last):
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 175, in wrapped
    ret = await coro(*args, **kwargs)
  File "O:\Suzuki\cogs\funny.py", line 90, in fakt
    await ctx.reply(embed = embed)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\context.py", line 399, in reply
    return await self.message.reply(content, **kwargs)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\message.py", line 1752, in reply
    return await self.channel.send(content, reference=self, **kwargs)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\abc.py", line 1431, in send
    data = await state.http.send_message(
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\http.py", line 376, in request
    raise HTTPException(response, data)
disnake.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.image.url: Scheme "resources/dog.jpg" is not supported. Scheme must be one of ('http', 'https').

The above exception was the direct cause of the following exception:
#
Traceback (most recent call last):
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\bot_base.py", line 560, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 929, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 184, in wrapped
    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.image.url: Scheme "resources/dog.jpg" is not supported. Scheme must be one of ('http', 'https').
#

who knows how to solve

lapis chasm
#

Hello, in this script, when i run it, the error is "discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.", even tough i have a command "!join" wich i already use before, that allow me to join the vocal channel .

#

so i try lot of things in the script, and sometimes the error is AttributeError: 'NoneType' object has no attribute 'play'"

spiral frigate
#
    @commands.command(name= "Ρ„Π°ΠΊΡ‚")
    async def fakt(self, ctx, fakt=None):
        cat = random.choice(["Π”Ρ€ΡƒΠ³ΠΎΠΉ ΠΊΠΎΡ‚ баллотировался Π½Π° пост мэра ΠœΠ΅Ρ…ΠΈΠΊΠΎ Π² 2013 Π³ΠΎΠ΄Ρƒ.", "ΠšΠΎΡ‚ Π±Ρ‹Π» мэром Π³ΠΎΡ€ΠΎΠ΄Π° Π’Π°Π»ΠΊΠΈΡ‚Π½Π°, Аляска, Π² Ρ‚Π΅Ρ‡Π΅Π½ΠΈΠ΅ 15 Π»Π΅Ρ‚. Π•Π³ΠΎ Π·Π²Π°Π»ΠΈ Бтаббс.", "Π―Π·Ρ‹ΠΊ кошСк ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ малСнькими ΠΊΡ€ΡŽΡ‡ΠΊΠ°ΠΌΠΈ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΠΏΠΎΠΌΠΎΠ³Π°ΡŽΡ‚ ΠΈΠΌ ΠΏΠΎΡ€Π²Π°Ρ‚ΡŒ ΠΏΠΈΡ‰Ρƒ. Π’ΠΎΡ‚ ΠΏΠΎΡ‡Π΅ΠΌΡƒ ΠΎΠ½ каТСтся Π³Ρ€ΡƒΠ±Ρ‹ΠΌ Π½Π° ΠΎΡ‰ΡƒΠΏΡŒ.", "Кошки Π»ΡŽΠ±ΡΡ‚ Ρ†Π°Ρ€Π°ΠΏΠ°Ρ‚ΡŒ Π²Π΅Ρ€Ρ‚ΠΈΠΊΠ°Π»ΡŒΠ½Ρ‹Π΅ ΠΏΡ€Π΅Π΄ΠΌΠ΅Ρ‚Ρ‹, ΠΏΠΎΡ‚ΠΎΠΌΡƒ Ρ‡Ρ‚ΠΎ Ρ‚Π°ΠΊ ΠΎΠ½ΠΈ Ρ€Π°ΡΡΠ»Π°Π±Π»ΡΡŽΡ‚ΡΡ, Π°ΠΊΡ‚ΠΈΠ²ΠΈΠ·ΠΈΡ€ΡƒΡŽΡ‚ ΠΊΡ€ΠΎΠ²ΠΎΠΎΠ±Ρ€Π°Ρ‰Π΅Π½ΠΈΠ΅ ΠΈ Ρ‚ΠΎΠ½ΠΈΠ·ΠΈΡ€ΡƒΡŽΡ‚ своС Ρ‚Π΅Π»ΠΎ.", "Кошки ΡΠ»ΡƒΡˆΠ°ΡŽΡ‚ΡΡ ΠΆΠ΅Π½Ρ‰ΠΈΠ½ Π»ΡƒΡ‡ΡˆΠ΅, ΠΏΠΎΡ‚ΠΎΠΌΡƒ Ρ‡Ρ‚ΠΎ ΠΎΠ½ΠΈ Π»ΡƒΡ‡ΡˆΠ΅ Π²ΠΎΡΠΏΡ€ΠΈΠ½ΠΈΠΌΠ°ΡŽΡ‚ высокиС Π·Π²ΡƒΠΊΠΈ.", "Когда кошка ΠΏΠΎΡ‚ΠΈΡ€Π°Π΅Ρ‚ своС Ρ‚Π΅Π»ΠΎ ΠΈΠ»ΠΈ Π³ΠΎΠ»ΠΎΠ²Ρƒ ΠΊΠ΅ΠΌ-Ρ‚ΠΎ ΠΈΠ»ΠΈ Ρ‡Π΅ΠΌ-Ρ‚ΠΎ, ΠΎΠ½Π° ΠΎΡ‚ΠΌΠ΅Ρ‡Π°Π΅Ρ‚ свою Ρ‚Π΅Ρ€Ρ€ΠΈΡ‚ΠΎΡ€ΠΈΡŽ.", "Мозг кошки Π½Π° 90% ΠΏΠΎΡ…ΠΎΠΆ Π½Π° ΠΌΠΎΠ·Π³ Ρ‡Π΅Π»ΠΎΠ²Π΅ΠΊΠ°. Π£ нас с Π½ΠΈΠΌΠΈ большС сходства, Ρ‡Π΅ΠΌ с собаками.", "Кошки спят Π² срСднСм 16 часов.", "Кошки Π½Π΅ ΠΈΠΌΠ΅ΡŽΡ‚ вкусовых Ρ€Π΅Ρ†Π΅ΠΏΡ‚ΠΎΡ€ΠΎΠ² сладкого", "Усы кошСк слуТат ΠΈΠ½Π΄ΠΈΠΊΠ°Ρ‚ΠΎΡ€ΠΎΠΌ пространства. Они ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽΡ‚ ΠΈΡ…, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΈΠ·ΠΌΠ΅Ρ€ΡΡ‚ΡŒ расстояниС Π΄ΠΎ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² ΠΈ ΠΎΡ€ΠΈΠ΅Π½Ρ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒΡΡ."])
        
lapis chasm
#

thanks for your help

spiral frigate
#

dog = random.choice(["Π‘ΠΎΠ±Π°ΠΊΠΈ ΠΏΠΎΠ½ΠΈΠΌΠ°ΡŽΡ‚ Π΄ΠΎ 250 слов ΠΈ ТСстов, ΡΡ‡ΠΈΡ‚Π°ΡŽΡ‚ Π΄ΠΎ пяти ΠΈ ΠΌΠΎΠ³ΡƒΡ‚ Ρ€Π΅ΡˆΠ°Ρ‚ΡŒ ΠΏΡ€ΠΎΡΡ‚Π΅ΠΉΡˆΠΈΠ΅ матСматичСскиС Π·Π°Π΄Π°Ρ‡ΠΈ.", "Π’ России собаки смогли ΠΏΡ€ΠΈΡΠΏΠΎΡΠΎΠ±ΠΈΡ‚ΡŒ ΠΌΠ΅Ρ‚Ρ€ΠΎ для своих Π½ΡƒΠΆΠ΄: ΠΎΠ½ΠΈ Π½Π°ΡƒΡ‡ΠΈΠ»ΠΈΡΡŒ Π΅Π·Π΄ΠΈΡ‚ΡŒ Π½Π° общСствСнном транспортС Π² поисках Π΅Π΄Ρ‹, ΠΏΡƒΡ‚Π΅ΡˆΠ΅ΡΡ‚Π²ΡƒΡ ΠΏΠΎ самым насСлСнным Ρ€Π°ΠΉΠΎΠ½Π°ΠΌ.", "Π‘ΠΎΠ±Π°ΠΊΠΈ Π½Π΅ Π»ΡŽΠ±ΡΡ‚ обнимашСк! Для Π½ΠΈΡ… это ΠΏΡ€ΠΈΠ·Π½Π°ΠΊ доминирования. Π’Π°ΠΊ Ρ‡Ρ‚ΠΎ ΠΏΡ€Π΅ΠΊΡ€Π°Ρ‚ΠΈΡ‚Π΅, Π½Π°ΠΊΠΎΠ½Π΅Ρ†, это Π΄Π΅Π»Π°Ρ‚ΡŒ!", "Π‘ΠΎΠ±Π°ΠΊΠΈ Ρ€Π°Π·Π»ΠΈΡ‡Π°ΡŽΡ‚ ΡƒΠ»ΡŒΡ‚Ρ€Π°Π·Π²ΡƒΠΊΠΎΠ²ΠΎΠΉ свист. Пол ΠœΠ°ΠΊΠΊΠ°Ρ€Ρ‚Π½ΠΈ, зная это, записал этот Π·Π²ΡƒΠΊ Π² ΠΊΠΎΠ½Ρ†Π΅ пСсни Β«Π”Π΅Π½ΡŒ ΠΆΠΈΠ·Π½ΠΈΒ» ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½ΠΎ для своСй ΡˆΠΎΡ‚Π»Π°Π½Π΄ΡΠΊΠΎΠΉ ΠΎΠ²Ρ‡Π°Ρ€ΠΊΠΈ.", "Π’ Π΄Ρ€Π΅Π²Π½Π΅ΠΌ ΠšΠΈΡ‚Π°Π΅ послСднСй Π»ΠΈΠ½ΠΈΠ΅ΠΉ ΠΎΠ±ΠΎΡ€ΠΎΠ½Ρ‹ ΠΈΠΌΠΏΠ΅Ρ€Π°Ρ‚ΠΎΡ€Π° Π±Ρ‹Π»Π° малСнькая собачка ΠΏΠΎΡ€ΠΎΠ΄Ρ‹ пСкинСс: ΠΎΠ½Π° ΠΏΡ€ΡΡ‚Π°Π»Π°ΡΡŒ Π² Ρ€ΡƒΠΊΠ°Π²Π΅ ΠΈ Π² случаС опасности выскакивала ΠΈ Π±Ρ€ΠΎΡΠ°Π»Π°ΡΡŒ Π½Π° Π²Ρ€Π°Π³Π°.", "Когда Π»ΠΎΡ€Π΄ Π‘Π°ΠΉΡ€ΠΎΠ½ ΡƒΠ·Π½Π°Π», Ρ‡Ρ‚ΠΎ Π΅Π³ΠΎ собаку Π½Π΅ пустили Π² Π’Ρ€ΠΈΠ½ΠΈΡ‚ΠΈ ΠΊΠΎΠ»Π»Π΅Π΄ΠΆ (ΠšΡΠΌΠ±Ρ€ΠΈΠ΄ΠΆ), Π³Π΄Π΅ ΠΎΠ½ учился, ΠΎΠ½ ΠΏΡ€ΠΈΠ²Π΅Π» вмСсто Π½Π΅Π΅ ΠΌΠ΅Π΄Π²Π΅ΠΆΠΎΠ½ΠΊΠ°.", "ΠœΠΎΠΊΡ€Ρ‹ΠΉ нос собакС Π½ΡƒΠΆΠ΅Π½ Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΠΈΡ‚ΡŒ Π½Π°ΠΏΡ€Π°Π²Π»Π΅Π½ΠΈΠ΅ Π·Π°ΠΏΠ°Ρ…Π°.", "ОшСйники с шипами Π±Ρ‹Π»ΠΈ ΠΈΠ·ΠΎΠ±Ρ€Π΅Ρ‚Π΅Π½Ρ‹ Π² Π΄Ρ€Π΅Π²Π½Π΅ΠΉ Π“Ρ€Π΅Ρ†ΠΈΠΈ для Π·Π°Ρ‰ΠΈΡ‚Ρ‹ шСи собак ΠΎΡ‚ нападСния Π²ΠΎΠ»ΠΊΠΎΠ².", "На самом Π΄Π΅Π»Π΅, собаки ΠΏΡŒΡŽΡ‚, сворачивая язык Π² Ρ„ΠΎΡ€ΠΌΠ΅ Π»ΠΎΠΆΠ΅Ρ‡ΠΊΠΈ, Π½ΠΎ Π½Π΅ Π²Π²Π΅Ρ€Ρ…, Π° Π²Π½ΠΈΠ· β€” ΠΎΡ‚ Π½Ρ‘Π±Π°.", "Π£ Ρ‰Π΅Π½ΠΊΠΎΠ² 28 Π·ΡƒΠ±ΠΎΠ², Π° взрослых собак β€” 42."])
#
        if fakt == None:

            guild = self.bot.get_guild(894452684072046652)
            owner = guild.get_member(637685929611493422)

            embed = disnake.Embed (
                title = ':x: Ошибка',
                description = '>>> Π’Ρ‹ Π΄ΠΎΠ»ΠΆΠ½Ρ‹ Π²Ρ‹Π±Ρ€Π°Ρ‚ΡŒ ΠΊΠ°ΠΊΠΎΠΉ Ρ„Π°ΠΊΡ‚ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅!\nΠ’Ρ‹Π±Π΅Ρ€Π΅Ρ‚Π΅ ΠΊΠ°ΠΊΠΎΠΉ Ρ„Π°ΠΊΡ‚ Π½ΡƒΠΆΠ΅Π½ `собак` ΠΈΠ»ΠΈ `кошСк`.',
                colour = 0xff6c66
            )
            embed.set_footer(text= 'Π‘Π°Ρ€Π°Π±Π°Π½4ΠΈΠΊ Β© 2021 ВсС ΠΏΡ€Π°Π²Π° Ρƒ тянок', icon_url= owner.avatar)

            await ctx.reply(embed = embed, delete_after= 20)
        if fakt == "собак":
            embed = disnake.Embed (
                title = 'Π€Π°ΠΊΡ‚ ΠΎ собаках:',
                description = f"{dog}",
                colour = 0x694c5f
            )
            embed.set_image(url=r"resources/dog.jpg")
            await ctx.reply(embed = embed)
        if fakt == "кошСк":
            embed = disnake.Embed (
                title = 'Π€Π°ΠΊΡ‚ ΠΎ ΠΊΠΎΡˆΠΊΠ°Ρ…:',
                description = f"{cat}",
                colour = 0x694c5f
            )
            embed.set_image(url=r"resources/cat.jpeg")
            await ctx.reply(embed = embed)
#
        else:
            guild = self.bot.get_guild(894452684072046652)
            owner = guild.get_member(637685929611493422)

            embed = disnake.Embed (
                title = ':x: Ошибка',
                description = '>>> Π’Ρ‹ Π΄ΠΎΠ»ΠΆΠ½Ρ‹ Π²Ρ‹Π±Ρ€Π°Ρ‚ΡŒ ΠΊΠ°ΠΊΠΎΠΉ Ρ„Π°ΠΊΡ‚ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅!\nΠ’Ρ‹Π±Π΅Ρ€Π΅Ρ‚Π΅ ΠΊΠ°ΠΊΠΎΠΉ Ρ„Π°ΠΊΡ‚ Π½ΡƒΠΆΠ΅Π½ `собак` ΠΈΠ»ΠΈ `кошСк`.',
                colour = 0xff6c66
            )
            embed.set_footer(text= 'Π‘Π°Ρ€Π°Π±Π°Π½4ΠΈΠΊ Β© 2021 ВсС ΠΏΡ€Π°Π²Π° Ρƒ тянок', icon_url= owner.avatar)

            await ctx.reply(embed = embed, delete_after= 20)
#

code

#

help

boreal ravine
#

whats wrong

sage otter
#

because that’s not a valid url

#

You passed in a file path

near garden
#

can someone help

#

i want to know were i can finde a wordlist

#

for password cracking

spiral frigate
kindred epoch
sage otter
#

Use discord.File and pass that object into the .send() method
then in the image url do something like
"attachment://filename.ext"

near garden
#

and then i want to learn python

slate swan
kindred epoch
slate swan
#

no worries , you can test it , most sites don't allow you to send more than X requests so it wouldn't be helpful

spiral frigate
#
            embed.set_image(url=r"attachment://dog.ext")
            await ctx.reply(embed = embed, File=r"resources/dog.jpg")
sage otter
#

No

#

something like this

#
file = discord.File("PATH", "dog.jpg")
await ctx.send(file=file, embed=discord.Embed().set_image(url="attachment://dog.jpg")
lapis chasm
#

Hello, in this script, when i run it, the error is "discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.", even tough i have a command "!join" wich i already use before, that allow me to join the vocal channel .

#

please

maiden fable
#

Lemme see

#

Bro, do u know... Music Bots are against ToS

rotund nova
maiden fable
#

Sorry, but can't help with them. It's against this server rules

maiden fable
rotund nova
maiden fable
#

Wym

#

How do u make them?

#

Using bot.command decorator?

boreal ravine
rotund nova
#

yes

sage otter
#

Do you have a Bot.process_commands()

maiden fable
#

I am sure they gonna be confused and write Bot.process_commands() as it is 😐

sage otter
#

No

rotund nova
spiral frigate
#
Ignoring exception in command Ρ„Π°ΠΊΡ‚:
Traceback (most recent call last):
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 175, in wrapped
    ret = await coro(*args, **kwargs)
  File "O:\Suzuki\cogs\funny.py", line 90, in fakt
    file = disnake.File("PATH", "dog.jpg")
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\file.py", line 86, in __init__
    self.fp = open(fp, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'PATH'

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

Traceback (most recent call last):
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\bot_base.py", line 560, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 929, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Baraban4ik\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\core.py", line 184, in wrapped
    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: 'PATH'
#

error

sage otter
#

I’m asking if they have it because that might be the reason his commands aren’t working

rotund nova
#

i don't have

sage otter
lapis chasm
spiral frigate
#
    @commands.command(name= "Ρ„Π°ΠΊΡ‚")
    async def fakt(self, ctx, fakt=None):
        cat = random.choice(["Π”Ρ€ΡƒΠ³ΠΎΠΉ ΠΊΠΎΡ‚ баллотировался Π½Π° пост мэра ΠœΠ΅Ρ…ΠΈΠΊΠΎ Π² 2013 Π³ΠΎΠ΄Ρƒ."])
dog = random.choice(["Π‘ΠΎΠ±Π°ΠΊΠΈ ΠΏΠΎΠ½ΠΈΠΌΠ°ΡŽΡ‚ Π΄ΠΎ 250 слов ΠΈ ТСстов, ΡΡ‡ΠΈΡ‚Π°ΡŽΡ‚ Π΄ΠΎ пяти ΠΈ ΠΌΠΎΠ³ΡƒΡ‚ Ρ€Π΅ΡˆΠ°Ρ‚ΡŒ ΠΏΡ€ΠΎΡΡ‚Π΅ΠΉΡˆΠΈΠ΅ матСматичСскиС Π·Π°Π΄Π°Ρ‡ΠΈ."])
        if fakt == "собак":
            embed = disnake.Embed (
                title = 'Π€Π°ΠΊΡ‚ ΠΎ собаках:',
                description = f"{dog}",
                colour = 0x694c5f
            )
            file = disnake.File("resources/dog.jpg", "dog.jpg")
            await ctx.reply(file=file, embed=disnake.Embed().set_image(url="attachment://dog.jpg"))

        if fakt == "кошСк":
            embed = disnake.Embed (
                title = 'Π€Π°ΠΊΡ‚ ΠΎ ΠΊΠΎΡˆΠΊΠ°Ρ…:',
                description = f"{cat}",
                colour = 0x694c5f
            )
            file = disnake.File("resources/cat.jpeg", "cat.jpeg")
            await ctx.reply(file=file, embed=disnake.Embed().set_image(url="attachment://cat.jepg"))
        else:
            guild = self.bot.get_guild(894452684072046652)
            owner = guild.get_member(637685929611493422)

            embed = disnake.Embed (
                title = ':x: Ошибка',
                description = '>>> Π’Ρ‹ Π΄ΠΎΠ»ΠΆΠ½Ρ‹ Π²Ρ‹Π±Ρ€Π°Ρ‚ΡŒ ΠΊΠ°ΠΊΠΎΠΉ Ρ„Π°ΠΊΡ‚ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅!\nΠ’Ρ‹Π±Π΅Ρ€Π΅Ρ‚Π΅ ΠΊΠ°ΠΊΠΎΠΉ Ρ„Π°ΠΊΡ‚ Π½ΡƒΠΆΠ΅Π½ `собак` ΠΈΠ»ΠΈ `кошСк`.',
                colour = 0xff6c66
            )
            embed.set_footer(text= 'Π‘Π°Ρ€Π°Π±Π°Π½4ΠΈΠΊ Β© 2021 ВсС ΠΏΡ€Π°Π²Π° Ρƒ тянок', icon_url= owner.avatar)

            await ctx.reply(embed = embed, delete_after= 20)
gleaming torrent
#

I am trying to make a purge command, and I'm trying to make it purge for users? What do I type?

spiral frigate
#

where is my mistake here

slate swan
#

Well what is your error there

#

We're not a Python interpreter, so we can't guess your error

spiral frigate
#

there is no output of 2 actions

slate swan
#

Well this is already mistyped

spiral frigate
#

I didn't notice

slate swan
#

And it's embed.set_image, not disnake.Embed().set_image

ivory sluice
#

Can we add filters to music ?

kindred epoch
slate swan
#

Doesn't matter

#

You need to use set_image on your embed object

spiral frigate
#

here's how you can see there are 2 actions

kindred epoch
#

You can still do that

gleaming torrent
#

I am trying to make a purge command, and I'm trying to make it purge for users? What do I type?

gleaming torrent
slate swan
spiral frigate
ivory sluice
maiden fable
gleaming torrent
#

I am trying to make a purge command, and I'm trying to make it purge for users? What do I type?

What function am I supposed to use?

slate swan
#

Get message history of user, delete them using a loop as it will be returned in a list or use .purge with a check

kindred epoch
#

No

gleaming torrent
#

How do I do that kek

kindred epoch
#

Use the check

gleaming torrent
#

What do I type there?

slate swan
#

We don't code for you

gleaming torrent
#

Well I wouldn't ask questions if I knew the answer.

unkempt canyonBOT
#

async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [`AsyncIterator`](https://discordpy.readthedocs.io/en/master/api.html#discord.AsyncIterator "discord.AsyncIterator") that enables receiving the destination’s message history.

You must have [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.

Examples

Usage...
kindred epoch
#

!d discord.TextChannel.purge use this and the check to only delete the mentioned person's messages

unkempt canyonBOT
#

await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.

You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.

Examples

Deleting bot’s messages...
maiden fable
slate swan
#

I am calm?

maiden fable
#

Oh yea, that one. Mb

slate swan
#

Just informing we don't code for him

rotund nova
gleaming torrent
maiden fable
slate swan
maiden fable
#

😐

gleaming torrent
slate swan
#

Still doesn't change anything

maiden fable
slate swan
#

We guide you on how to do it, writing the code that's your job

ivory sluice
#

Bruh Someone tell me too. Can we add filters to music? If yes how?

maiden fable
slate swan
#

Not all

rotund nova
maiden fable
ivory sluice
slate swan
#

Music bots playing (no copyright songs) from local storage are not against YouTube's ToS nor Discord's ToS

#

So don't misinform users ;)

maiden fable
kindred epoch
slate swan
#

You realize there are other legal sources to download non copyrighted music than YouTube right?

#

So yes, you can get music legally

maiden fable
#

Like?

ivory sluice
maiden fable
#

No legal website, afaik, allows u to download MP3 files

maiden fable
ivory sluice
maiden fable
ivory sluice
slate swan
maiden fable
slate swan
#

From YouTube

maiden fable
slate swan
#

So don't say YouTube or any website doesn't allow downloading royalty free songs legally 🀑

maiden fable
dusk dust
#
@bot.command(name='test')
async def enviar_embed(ctx):

    member = ctx.author

    message_titles = [
        f"title_1",
        f"title_2",
        f"title_3",
        f"title_4",
        f"title_5",
        f"title_6}"
    ]
    message_titles = random.choice(random_messages)

    embed = discord.Embed(
        title = message_titles,
        description = f'welcome, {member}!',
        color = 0xff841f
    )

    await ctx.send(embed=embed)```
i want to send a message of welcome, but i need of different titles to work... (i know that're a command and not event, but this is only for test the style of the embed)
ivory sluice
#

Is DM too against ToS?

maiden fable
maiden fable
ivory sluice
#

Can I DM any of you for help?

#

No?

maiden fable
#

They can interfere with the working of the bot

maiden fable
thick sigil
#

his formating is bad, u can easily see it

maiden fable
#

Ah yes that too

#

Didn't see that, whoops

ivory sluice
#

lemon_grimace .

thick sigil
#

Also hes overriding his variable without really getting one of the string from the list

maiden fable
maiden fable
dusk dust
thick sigil
#

he could just make the random choose a string and set it under the same variable

maiden fable
#

Isn't that what he is doing already or I am mistaken pithink

thick sigil
#

no?

maiden fable
#

I am mistaken then. Whoops seems like we are talking about different things here haha

boreal ravine
#

Drama

maiden fable
#

Not with Kai tho

maiden fable
#

typo?

thick sigil
#
    message_titles = [
        "title_1",
        "title_2",
        "title_3",
        "title_4",
        "title_5",
        "title_6"
    ]
    message_titles = random.choice(message_titles)```

he can just do that
#

damn typing on phone

dusk dust
maiden fable
#

Ohhhh wait

#

FML

sage otter
#

Huh….? Yes he is. He’s using random.choice() on that iterable returning a string from it and the return is being declared with the same var name. There’s nothing wrong with what he has.

#

The code will work just fine.

maiden fable
#

I didn't see the variable he is using inside the choice function

#

FML

#

Should have raised an error tho

thick sigil
#

not if he has a variable with random messages

ivory sluice
#

Can we add filters to vibrating rhythmic air produced by complex and delicate machinery using discord.py?

maiden fable
maiden fable
#

It is just a wrapper for the Discord API

sick birch
maiden fable
dusk dust
sick birch
#

If you mean playing sound, then yes you can vibrate the air molecules using discord.py

thick sigil
maiden fable
rotund nova
sage otter
#

And it does exactly what he wants

thick sigil
#

the fuck u talking about

sage otter
#

You guys telling him to rename his variables

thick sigil
#

Did i tell him to?

sage otter
#

It does work

#

But it’s unnecessary

thick sigil
#

Did i tell him to?

maiden fable
#

Eh it is fine to do that since it is a small code with no if statements haha

#

It becomes a problem when there is conditional programming involved

maiden fable
#

Ok ok calm down haha.

thick sigil
#

Cuz if you looked at his code, he was getting something out of the list he wanted lmao

#

u should learn some code before trying to teach me python buddy

maiden fable
#

calm down here

thick sigil
#

At no time i told him to change the variable

#

big bruh

maiden fable
#

CALM DOWN

#

Whoops caps

#

Anyways

sage otter
#

But ok

thick sigil
#

Damn python elite coder here KEKW

maiden fable
#

Haha I also missed that one tbh

#

But the IDE should have warned about that as long as they ain't using IDLE/Notepad 😐

sage otter
#

Jesus Christ did I actually make that big of a fuck up :l

maiden fable
#

Haha happens my dude

thick sigil
#

let him be hunter, even the issue author thank'd me but i dont know what this guy is on about

maiden fable
#

He just overlooked something, that's it

#

He is accepting it now (:

sage otter
#

I mean shit bro you don’t gotta be toxic about it

sick birch
#

??

maiden fable
#

Ok ok let's end this now

#

It's over. Tylerr understood his mistake

thick sigil
sage otter
#

πŸ€·β€β™‚οΈ whatever

sick birch
#

πŸ—Ώ

maiden fable
#

Thanks

ivory sluice
#

Is there any better free alternative to host a discord bot (except repl and heroku)?

sick birch
#

Nope

slate swan
#

no

maiden fable
#

I don't think so

thick sigil
#

ps1

sick birch
#

Free hosting sucks. Period.

slate swan
maiden fable
sick birch
#

If you consider raspberry pi free hosting, it’s decent

ivory sluice
#

My bot is only for few servers

slate swan
#

raspberry costs much at first tho

maiden fable
slate swan
maiden fable
slate swan
#

I'm also worried about the electricity usage πŸ‘€

#

that shouldn't be much

sick birch
#

Mines been running for months, barely uses any

slate swan
maiden fable
ivory sluice
slate swan
#

πŸ˜‚

sick birch
slate swan
#

how??

sick birch
#

It’s like one of those maths problems

slate swan
#

i'm talking about the vps's electricity + internet bill, not how much you pay go buy one

sick birch
#

Vps are like what 10 or 20 per month right

ivory sluice
#

so I'll stick to heroku for now

slate swan
maiden fable
thick sigil
#

Its not your raspberry that will put you out of money for what it consumes lol

stark hearth
slate swan
# slate swan how??

5$/month for a year = 60$
raspberry at first (40$) and the electricity and internet for this small thing isn't more than 20$/year
so a raspberry is cheaper for more than 1 year

maiden fable
maiden fable
thick sigil
#

Your whole time passing coding on your pc will cost you more than the raspberry

stark hearth
#

I heard vulur is a good vps

maiden fable
#

yes it is

sick birch
#

If we assume Rpi costs 150, and we assume VPS is 10/month, in 15 months the VPS becomes more expensive than the raspberry Pi

thick sigil
#

Expensive

maiden fable
#

You can always use K8 Clusters

slate swan
#

AND you can use a raspberry for many things

slate swan
sick birch
slate swan
#

even if that were to be true, a VPS is more reliable than a rpi (especially depending on where you live)

maiden fable
#

Don't u all think this is going a bit off topic

slate swan
#

but you can use a raspberry for so many things

sick birch
#

Can’t argue with that

manic wing
slate swan
#

but the internet thinkmon

sick birch
#

Just throw Linux webserver on it

manic wing
#

Β―_(ツ)_/Β―

sick birch
#

Stays online forever no restarts

thick sigil
#

Dont you have an internet subscription?

maiden fable
#

pithink It started as a simple VPS Question and now there is a whole debate on R-Pi vs VPS

ivory sluice
#

Guess I've started small war.

maiden fable
thick sigil
#

In any way your pc will cost you way more than the raspberry KEKW

slate swan
#

:kek:

#

how much internet do you think a discord bot takes?

sick birch
slate swan
ivory sluice
maiden fable
#

Ok ok everyone, if u wanna contiue this, take it to an OT channel please haha

stark hearth
sick birch
#

Most people already have internet subscription, a raspberri pi won’t increase the price

ivory sluice
#

So what's the conclusion?

thick sigil
#

Ppl gotta learn about internet & power consumption

sick birch
maiden fable
sick birch
#

Paid vps = good

slate swan
maiden fable
ivory sluice
#

I was about to refer to this but its fine.

slate swan
#

just check the pinned message about it and don't ask any questions

sick birch
#

Power consumption is a completely different matter

stark hearth
thick sigil
#

They are talking about electricity bill and internet bill

sick birch
#

AWS is probably the best VPS imo

slate swan
ivory sluice
slate swan
stark hearth
slate swan
#

why do you think that is

sick birch
#

What did you except?

maiden fable
#

Today's Lesson: Never ask questions about Free VPS's as long as you don't wanna start a civil war discussion on Raspberry Pi vs VPS.

Understood kids?

slate swan
sick birch
#

Good free hosting? Better luck getting Santa to show up for Christmas

maiden fable
#

Good Boy :kek:

slate swan
sick birch
#

Now back on track

#

Anybody have dpy questions to steer us back on track

slate swan
#

somebody hosting a discord bot for you won't be non-profit for them, but it will cost them some money

#

why would they do that

maiden fable
slate swan
stark hearth
slate swan
#

then it's again, not free

slate swan
maiden fable
ivory sluice
thick sigil
#

ah

slate swan
slate swan
#

that way they make some profit

stark hearth
#

The cheapest vps I know is for 5 bucks a month

slate swan
#

but it's not free then anymore

slate swan
slate swan
ivory sluice
#

Heroku faster or repl for discord bot?

slate swan
#

heroku miles better than replit

#

yep

#

you even get a pog database

stark hearth
maiden fable
slate swan
#

from my personal experience with both, i find heroku indefinitely better than replit, here's some reasons why: your bot won't die every 16h (will die every 22-24h+) and when it dies it doesn't take like 15 minutes to come back on (heroku takes like 10s, replit can even take 30m), heroku is a lot faster and more responsive and you can have a better connection if you set your heroku app's region to america (lowest you can get is even 10ms, highest i've got was ~30ms, on replit it's a lot higher)

slate swan
#

faster and can store more data types

maiden fable
#

okay

rotund nova
#

hi someone know why my all commands don't working?

slate swan
#

wth

#

tf is that code

#

why are you writing intents so many times

#

also explain "don't working", can't help you if you don't tell me exactly what's wrong

#

should still work even tho it sucks

#

ikr

#

what commands do you have?

#

what did you type in discord?

slate swan
#

How to react to a embed?

slate swan
slate swan
slate swan
rotund nova
slate swan
#

that does not tell me anything from the code you provided

rotund nova
#

yea i change client to bot and now nothing working

slate swan
#

you said nothing worked even before

#

give us more code, maybe an error

#

how you tried to invoke the command

rotund nova
slate swan
slate swan
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

slate swan
#

except the token

#

^^

slate swan
#

np

#

are you running the bot?

rotund nova
#

Yes

slate swan
#

that's a lot of things in on_ready

rotund nova
#

only welcome leave and suggestion working

#

idk what bad

slate swan
#

it's also a music bot

rotund nova
#

ye

#

but when i delete too music its still dont working

slate swan
#

and it's also copied

rotund nova
#

lol

slate swan
#

oh wait no there are different stuff there

#

found your problem

#

on_ready doesn't have process_commands

#

message

#

add await bot.process_commands(message) at the bottom of your on_message event

slate swan
#

did you save and restart

rotund nova
#

ya

slate swan
#

and the commands aren't working even now?

rotund nova
#

no

slate swan
#

any errors?

rotund nova
#

no

slate swan
#

then idk

#

Alvesok , you probably indented it wrong , make sure it's on the first level inside the function

west shuttle
#

Can i get a cog with multiple folders. like cogs/moderation/ban.py

#

Yes.

craggy talon
#

.

can i build a bot in discord only with python?

slate swan
craggy talon
#

wait

#

is this a good video to learn

slate swan
#

No

west shuttle
slate swan
#

I'd rather learn from books than from videos

slate swan
slate swan
unkempt canyonBOT
#
Resources

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

craggy talon
#

I will see a python tutorial in youtube name: [ Python Tutorial - Python for Beginners [Full Course] ] is it a good video?

west shuttle
slate swan
craggy talon
#

ok

rotund nova
#

what can I learn best to program?

craggy talon
#

ohh sorry

kindred epoch
#

@west shuttle

west shuttle
#

thats even not working code

kindred epoch
#

Huh?

west shuttle
# kindred epoch Huh?

working code is just cogs.ban but i want from two folders, from cogs and from the cogs folder i have mod folder and from the mod folder i want ban.py

kindred epoch
#

Search on Google

upbeat otter
#

what's the use of cogs tho?

kindred epoch
#

Makes your code organized

upbeat otter
kindred epoch
#

What

upbeat otter
# kindred epoch What

umm.....like I make an asynchronous function named joinvc in discordpy format in a file named music.py, I can then import that file into main.py and use the function using

@client.command()
async def join(ctx):
  await music.joinvc(ctx)
kindred epoch
#

By organizing code I mean, make specific named files like, commands, events, misc, utility and then add the commands to their appropriate files

upbeat otter
ornate lichen
#

hi i need some help

#
def get_meme():
  url = "https://api.imgflip.com/get_memes"
  
  response = requests.request("GET", url)
  json_data=json.loads(response.text)
  meme= json_data

  return(meme)

@client.command()  
async def meme(ctx):
  meme=get_meme()
  em= discord.Embed(meme)
  await ctx.send(embed=em)```
#

this is my code

#
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 91, in meme
    em= discord.Embed(meme)
TypeError: __init__() takes 1 positional argument but 2 were given

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

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: __init__() takes 1 positional argument but 2 were given
#

this is the error

#

how do i fix it?

upbeat otter
ornate lichen
#

wdym

upbeat otter
# ornate lichen wdym

discord.Embed(title="smh", description="optional smh", color=ctx.message.author.color or discord.Color.blue())

#

what does the meme var return?

ornate lichen
#

nothing as of now

#

because of the error

ornate lichen
#

i want it to retuen a meme

upbeat otter
#

but you are returning the text ,-,

ornate lichen
#

is there another way other than embedding

upbeat otter
unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
upbeat otter
#

ctx.reply(file=discord.File(get_meme())) @ornate lichen

waxen granite
#

futuredate = datetime.now() + datetime.timedelta(seconds = time)
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'

upbeat otter
#

first try printing get_meme()

upbeat otter
waxen granite
#

ye

ornate lichen
#
async def meme(ctx):
  ctx.reply(file=discord.File(get_meme()))```
upbeat otter
ornate lichen
#

i changed to this

ornate lichen
#

still doesnt work

upbeat otter
ornate lichen
upbeat otter
slate swan
upbeat otter
#

exactly

ornate lichen
#

i mean like i cant print picture in the terminal

slate swan
ornate lichen
#

oh ok

#

lemme try

upbeat otter
#

yeah

#

use try and except

slate swan
upbeat otter
slate swan
upbeat otter
#

but...

slate swan
ornate lichen
#
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 91, in meme
    ctx.reply(file=discord.File(get_meme()))
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/file.py", line 73, in __init__
    self.fp = open(fp, 'rb')
TypeError: expected str, bytes or os.PathLike object, not NoneType

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

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: expected str, bytes or os.PathLike object, not NoneType```
upbeat otter
slate swan
upbeat otter
ornate lichen
#

api

slate swan
slate swan
#

I see

ornate lichen
#

imgflip

slate swan
#

Why not use asyncpraw

ornate lichen
#
def get_meme():
  url = "https://api.imgflip.com/get_memes"
  
  response = requests.request("GET", url)
  json_data=json.loads(response.text)
  meme= json_data

  print(meme)

@client.command()  
async def meme(ctx):
  get_meme()
  ctx.reply(file=discord.File(get_meme()))```
ornate lichen
kindred epoch
# upbeat otter hmm, but the commands still remain in the other files

[Latest] What is a Cog?
The base class that all cogs must inherit from.

A cog is a collection of commands, listeners, and optional state to help group commands together. More information on them can be found on the Cogs page.

When inheriting from this class, the options shown in CogMeta are equally valid here.
Why use Cogs?

Cogs will help make your code much more organized and nicer, this will be especially helpful if you are collaborating with other developers in your discord bot or your bot is open source. This will even help you in the future as when you add more features to your bot it will help you understand your code.

To learn how to use a cog ?tag cog

Documentation:

Latest: https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#cogs
Async: Shouldn't you be on Latest?

void wedge
#

Hey everyone!
I'm trying to make a discord bot whose status updates with the price of a coin, i was successful until I ran into this "error" after a bit of testing, the bot goes offline, but the script continues to run :/

socket.send() raised exception.
slate swan
# ornate lichen for

You dont have to use json for asyncpraw and you don't have to download anything but have to make api calls but just put a cooldown

waxen granite
#

how do i use datetime.now and timedelta at the same time

void wedge
slate swan
upbeat otter
#

lmao

void wedge
slate swan
#
try:
      #do something
except:
             return
void wedge
#

ok i see

slate swan
ornate lichen
# upbeat otter

main.py:91: RuntimeWarning: coroutine 'Context.reply' was never awaited
ctx.reply(get_meme()["data"])
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

ornate lichen
#

yea i did it

upbeat otter
#

and you need to add_field it, since its a url

ornate lichen
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In content: Must be 4000 or fewer in length.

slate swan
#

Anybody got a good json command tutorial i keep forgetting all the commands?

upbeat otter
# ornate lichen yea i did it
import requests
import json

def get_meme():
  url = "https://api.imgflip.com/get_memes"
  
  response = requests.request("GET", url)
  meme =json.loads(response.text)

  return(meme)

url = get_meme()["data"]["memes"][0]["url"]
em = discord.Embed(title="drake meme")
em.add_field(url=url)
await ctx.reply(content=None, embed=em)```
#

you can use random module to change names and url everytime

void wedge
#

The bot still crashed :/

upbeat otter
void wedge
#

that's my problem

ornate lichen
slate swan
upbeat otter
ornate lichen
#

ret = await coro(*args, **kwargs)
File "main.py", line 91, in meme
em.add_field(url=url)
TypeError: add_field() got an unexpected keyword argument 'url'

upbeat otter
#

My bad

ornate lichen
#

ok

slate swan
#

@upbeat otter good luck with the problem solving

upbeat otter
slate swan
ornate lichen
#

lol i messed up

#

i need a better api

upbeat otter
ornate lichen
#

how

void wedge
#

does discord ratelimit changing status?

slate swan
#

You can get randoms memes with asyncpraw or search for a keyword in a post

upbeat otter
# ornate lichen how

create an imgflip account
store the usename and password in variables, get your use agent
make the request

ornate lichen
#

bruhh

#

thats too compicated for me

#

i tried using the reddit thing

upbeat otter
ornate lichen
#

then i just kept getting 401

upbeat otter
#

just create an account for imgflip

ornate lichen
#

ok

kindred epoch
void wedge
#

im still getting this:

socket.send() raised exception.
upbeat otter
#

well, then help him

kindred epoch
#

!pypi asyncpraw

unkempt canyonBOT
#

Async PRAW, an abbreviation for `Asynchronous Python Reddit API Wrapper`, is a python package that allows for simple access to reddit's API.

void wedge
#

so do you guys know if discord allows x status changes / x time ?

ornate lichen
#

its a hole list

#

whole

#

@upbeat otter

kindred epoch
void wedge
kindred epoch
#

yea

#

but that still isnt good

#

maybe 3 of more minutes should be fine

void wedge
#

so i just add

time.sleep(200)

?

#

sounds good

kindred epoch
#

dont use time

#

its blocking

#

use asyncio

#

!pypi asyncio

unkempt canyonBOT
kindred epoch
#

wait not that

#

uh

#

!d asyncio.sleep

unkempt canyonBOT
#

coroutine asyncio.sleep(delay, result=None)```
Block for *delay* seconds.

If *result* is provided, it is returned to the caller when the coroutine completes.

`sleep()` always suspends the current task, allowing other tasks to run.

Setting the delay to 0 provides an optimized path to allow other tasks to run. This can be used by long-running functions to avoid blocking the event loop for the full duration of the function call.

Deprecated since version 3.8, removed in version 3.10: The `loop` parameter. This function has been implicitly getting the current running loop since 3.7. See [What’s New in 3.10’s Removed section](https://docs.python.org/3/whatsnew/3.10.html#whatsnew310-removed) for more information.

Example of coroutine displaying the current date every second for 5 seconds:
void wedge
kindred epoch
#

there

void wedge
#

k thanks

kindred epoch
void wedge
#

i change delay to like 200?

kindred epoch
#

wdym

void wedge
#
    coroutine asyncio.sleep(delay, result=None)
              ^
SyntaxError: invalid syntax
#

asyncio is invalid

kindred epoch
#

wtf

#

you're not supposed to copy paste what it shows u

void wedge
slate swan
void wedge
slate swan
#

aka 2 min

void wedge
#

k

slate swan
#

180s wouldnt hurt either

void wedge
#

πŸ‘

kindred epoch
void wedge
#

each number in delay is one second right?

#

because it's still spamming lol

kindred epoch
#

delay is supposed to be in seconds

slate swan
kindred epoch
#

show your whole code

slate swan
#

5min is best

void wedge
#
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import requests
import json
import time
import datetime

# configuring discord bot
PREFIX = ("$")
client = commands.Bot(command_prefix = PREFIX, description = 'Hi')

# bot status
@client.event
async def on_ready():
    while True:
        # defining vitex api
        url = "https://vitex.vite.net/api/v1/exchange-rate?tokenSymbols=VITC-000"
        # connecting to the api
        response = requests.get(url)
        # setting up parsing & variables
        delay = 120
        response = requests.get(url)
        data = response.text
        parsed = json.loads(data)
        data = parsed["data"]
        type(data)
        usdRate = data[0]['usdRate']
        localtime = time.asctime( time.localtime(time.time()) )
        asyncio.sleep(delay)
        # changing status
        await client.change_presence(activity = discord.Activity(type = discord.ActivityType.watching, name = str(usdRate) + "$"))
        # printing VITC value!
        print("<===============Made by:5am===============>")
        print("VITC's price @ " + str(localtime) + " is $" + str(usdRate))
client.run('TOKEN')
#

sorry if its sloppy

#

this is really my first time

kindred epoch
#

you can just use tasks.loop for this

void wedge
kindred epoch
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

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

Don't use requests in a bot, use aiohttp

#

Use aiohttp.
requests and urllib are blocking. Do not use these libraries within your asynchronous code.
(http://discordpy.readthedocs.io/en/latest/faq.html#what-does-blocking-mean)

discord.py uses aiohttp, so it should already be installed. An example of code using aiohttp and discord.py:

async with aiohttp.ClientSession() as cs:
    async with cs.get('https://httpbin.org/json') as r:
        res = await r.json()  # returns dict
        await ctx.send(res['slideshow']['author'])

For more help, see aiohttp's documentation: http://aiohttp.readthedocs.io/en/stable/

void wedge
#

so i basically gotta rewrite the whole bot lol

#

okey

slate swan
#
@bot.command()
async def deletechannel(ctx, channel: discord.TextChannel = None):
    author = ctx.message.author
    channel = channel.replace('<','')
    channel = channel.replace('#','')
    channel = channel.replace('>','')
    channel=client.get_channel(int(channel))
    if channel == None:
      await ctx.send(":Skull_Error: γ€’ Mention a channel first")
      
      nuke_channel = discord.utils.get(ctx.guild.channels, name=channel.name)
      def check(message):
        return message.author == ctx.author and message.channel == ctx.channel
        await ctx.send('**Are you sure that you want to delete this channel? `type yes or cancel`**')
        msg = await bot.wait_for('message', check=check)
        if msg.content == "yes"

        if nuke_channel is not None:
          new_channel = await nuke_channel.clone(reason="Has been Nuked!")
          await new_channel.send(":Success_Green_skull: γ€’ Channel nuked succesfully")
        if msg.content == "cancel"
        await ctx.send(":Skull_Error: γ€’ Nuke canceled succesfully")

Error :

slate swan
#

xD

#

can you just say why is there the error

#

?

kindred epoch
#

no

slate swan
#

....................

#

the same code has the answer

slate swan
#

ok bye

#

lol

void wedge
lament mesa
magic ore
#

It needs to be in an async function like the error says

kindred epoch
slate swan
#

fr

#

the code has the answer

lament mesa
slate swan
kindred epoch
slate swan
slate swan
lament mesa
slate swan
slate swan
kindred epoch
slate swan
kindred epoch
kindred epoch
#

its literally an invalid syntax error

lament mesa
slate swan
#

bro its a invalid syntax error just chill

slate swan
kindred epoch
#

thats the point LMFAO

kindred epoch
slate swan
slate swan
kindred epoch
#

instead of using purge(10000)

kindred epoch
slate swan
#

@slate swan your making a anti nuke bot

#

what

#

to fix the damages of a nuke?

#

im just making a delete channel command

#

alr

#

no

#

just a delete channel

#

but your making a clone of the channel

#

ye

#

bc when im gonna delete this channel i want to make another one

#

yea i know what you mean

#

but now i have this error but it seems that the lines are ok

unkempt canyonBOT
#

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

slate swan
#

@kindred epoch sorry for the ping but do you get friend request from this server from random people who never talk in chat they just add me and they dont even dm when they can lmao

slate swan
void wedge
#

damn aiohttps is way harder than requests

slate swan
kindred epoch
#

ye

slate swan
#

same error

#

code?

slate swan
#

does commands.check not work anymore?

kindred epoch
#

why

tawdry panther
#

why

slate swan
#

?

slate swan
# slate swan code?
@bot.command()
async def deletechannel(ctx, channel: discord.TextChannel = None):
    author = ctx.message.author
    channel = channel.replace('<','')
    channel = channel.replace('#','')
    channel = channel.replace('>','')
    channel=bot.get_channel(int(channel))
    if channel == None:
      await ctx.send(":Skull_Error: γ€’ Mention a channel first")
      return
      delete_channel = discord.utils.get(ctx.guild.channels, name=channel.name)
      def check(message):
        return message.author == ctx.author and message.channel == ctx.channel
        await ctx.send('**Are you sure that you want to delete this channel? `type yes or cancel`')

        msg = await bot.wait_for('message', check=check)
        if msg.content == "yes":
          if delete_channel is not None:
            new_channel = await delete_channel.clone(reason="Has been Nuked!")
            await new_channel.send(":Success_Green_skull: γ€’ Channel deleted succesfully")
            if msg.content == "cancel":
              await ctx.send(":Skull_Error: γ€’ Delete channel canceled succesfully")

error :

lament mesa
#

The indentation is wrong

slate swan
slate swan
slate swan
lament mesa
#

One of the ctx.send is in the check function (which is not async)

slate swan
#

where

slate swan
lament mesa
#

And you dont need to use bot.get_channel when you already have the instance

slate swan
#

does commands.check not work anymore

lament mesa
kindred epoch
slate swan
#

yet everyone in this server im in can use it

slate swan
slate swan
#

:def check(message):

#

?

slate swan
slate swan
slate swan
#

oh

slate swan
lament mesa
slate swan
#

im confused

#

fr lmao

slate swan
#

oh its online

#
@bot.command()
async def deletechannel(ctx, channel: discord.TextChannel = None):
    author = ctx.message.author
    channel = channel.replace('<','')
    channel = channel.replace('#','')
    channel = channel.replace('>','')
    channel=bot.get_channel(int(channel))
    if channel == None:

      await ctx.send(":Skull_Error: γ€’ Mention a channel first")
      
      delete_channel = discord.utils.get(ctx.guild.channels, name=channel.name)
      async def check(message):
        return message.author == ctx.author and message.channel == ctx.channel
        await ctx.send('**Are you sure that you want to delete this channel? `type yes or cancel`')

        msg = await bot.wait_for('message', check=check)
        if msg.content == "yes":
          if delete_channel is not None:
            new_channel = await delete_channel.clone(reason="Has been Nuked!")
            await new_channel.send(":Success_Green_skull: γ€’ Channel deleted succesfully")
            if msg.content == "cancel":
              await ctx.send(":Skull_Error: γ€’ Delete channel canceled succesfully")

this is correct?

slate swan
#

why have you defined channel 3 times

void wedge
#

this is how i grabbed usdRate from data using requests

usdRate = data[0]['usdRate']

I tried doing that with aiohttp but i get this error:

    usdRate = data[0]['usdRate']
KeyError: 0

thanks in advance for putting up with idiocy

lament mesa
unkempt canyonBOT
#

When checking if something is equal to one thing or another, you might think that this is possible:

if favorite_fruit == 'grapefruit' or 'lemon':
    print("That's a weird favorite fruit to have.")

While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.

So, if you want to check if something is equal to one thing or another, there are two common ways:

# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
    print("That's a weird favorite fruit to have.")

# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
    print("That's a weird favorite fruit to have.")
kindred epoch
# slate swan

change the arg to m and check if the author is in the list of ids

placid skiff
steady flume
#
@discord.ui.button(label=None,
                       custom_id='kill1',
                       style=discord.ButtonStyle.blurple, emoji=':swblaster:')
    async def verify(self, button: discord.ui.Button, interaction: discord.Interaction):

how to make a check here for the member who called the command, well, only he can press the button ??

slate swan
#

and wdym change the arg to m

#

it doesnt work bruh

kindred epoch
#

thats what i mean, add the ids in a list and then check it

#

do you not know what an arg is?

slate swan
#

arguement

slate swan
kindred epoch
#

and whats the arg in that def

void wedge
kindred epoch
slate swan
kindred epoch
#

?

slate swan
#

its weird cuz their user id is py 481245481012559894

#

which is not in that list

#

so how would they have access to the commands

kindred epoch
#

ik the problem

slate swan
#

whats the problem

kindred epoch
#

remove message after ctx

slate swan
#

cuz they never used to have access to this until now which is really weird

lament mesa
kindred epoch
#

^

slate swan
#

so how should i use it

kindred epoch
#

thats why i said add all those ids in a list and check if the author is in that list

magic ore
void wedge
#
  usdRate = data['usdRate']
KeyError: 'usdRate'
#

I GOT IT

#

(all by myself)

#

i deserve a sticker

manic wing
#

no.

void wedge
#

sad

#
import aiohttp
import asyncio
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import datetime

PREFIX = ("$")
client = commands.Bot(command_prefix = PREFIX, description = "VITC Price")

@client.event
async def main():

    async with aiohttp.ClientSession() as session:

        api_url = "https://vitex.vite.net/api/v1/exchange-rate?tokenSymbols=VITC-000"
        async with session.get(api_url) as resp:
            api_data = await resp.json()
            data = api_data["data"]
            usdRate = data[0]["usdRate"]
            print(usdRate)
        await client.change_presence(activity = discord.Activity(type = discord.ActivityType.watching, name = str(usdRate) + "$"))
        asyncio.sleep(10)
        # printing VITC value!
        print("<===============Made by:5am===============>")
        print("VITE's price @ " + str(localtime) + " is $" + str(usdRate))

asyncio.run(main())

client.run("token")

error:

await self.ws.change_presence(activity=activity, status=status, afk=afk)
AttributeError: 'NoneType' object has no attribute 'change_presence'
eager forge
#

might not be necessarily a python problem, but i still wanted to ask how i can get around this error:

TypeError: Cannot read properties of undefined (reading 'extend')
    at Object.<anonymous> (D:\Coding\schedule_notification_client_1\node_modules\discord.js-commando\src\extensions\message.js:7:29)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\Coding\schedule_notification_client_1\node_modules\discord.js-commando\src\registry.js:5:25)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
kindred epoch
eager forge
#

well mb, im so new that i thought its just a really small problem so maybe someone here would know how to fix this

kindred epoch
#

bruh huh, its a javascript error, why are you asking it in the python server, ask it in the discord.js help server or js server

slate swan
#

aight, my on_member_join stopped working out of nowhere

#

can somebody help me please?

kindred epoch
#

show it

slate swan
# kindred epoch show it
@client.event
async def on_member_join(member):
    guild = client.get_guild(904718822462857256)
    welcome_channel = guild.get_channel(905474719690661898)
    await welcome_channel.send(f'{member.mention} Welcome!')
#

intents on btw

kindred epoch
#

do you have any on_message events?

#

show ur whole file where that is located

#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

kindred epoch
#

you cant have 2 on_member_join

#

show the whole code again

#

i literally said you cant have 2 on_member_join

#

why do you have discord.Client and commands.Bot