#discord-bots

1 messages Β· Page 488 of 1

cobalt jacinth
#

can i change font size in embed ?

boreal ravine
#

I was trying to make a simple command and theres this error and I dont know what it means. py @bot.command() #the command async def test(ctx): await ctx.send(", ".join(ctx.guild.members)) The error ```py
Command raised an exception: TypeError: sequence item 0: expected str instance, Member found

boreal ravine
dusk pumice
#

hmm

#

Can someone help me..........

#

plz

boreal ravine
#

with what

dusk pumice
#

the code

#

It doesn't work

boreal ravine
#

What code? Show us lol

dusk pumice
#
admin = await msg.get_user(ID).create_dm()
await admin.send("ADMIN")
#

here

boreal ravine
#

whats the error

dusk pumice
#

There's no message in consol

#

Oh I gotan error code

cobalt jacinth
boreal ravine
dusk pumice
#

There is no more error

vast gale
vast gale
dusk pumice
#

tnx

storm zodiac
#

is there a discord.utils method for formatting datetime.timedelta ? like discord.utils.format_dt() ?

jade jolt
vast gale
#

Lol. I'm not super sure about the speed because I haven't looked much in to that but yeah, that's one way to write it πŸ˜›

#

(its probably faster iirc)

jade jolt
#

seems like it would be faster

#

not sure how to test that

drifting arrow
#

shit i walked away for a minute

#

and someone spoke.

jade jolt
drifting arrow
jade jolt
#

Β―\_(ツ)_/Β―

drifting arrow
jade jolt
#

stuff

drifting arrow
#

Hey man. That's not allowed.

#

Stuff isnt allowed. Gonna need to confiscate your bot.

jade jolt
#

do it

#

but yeah, this is all it does tbh

drifting arrow
#

oh it tracks whenever someone uploads a video?

jade jolt
#

i just give it a channel id and it gets the latest

drifting arrow
#

I'll do that.

jade jolt
#

gl

drifting arrow
#

I wonder if someone already has twitch and youtube api connectors for python or if i'll need to make my own

jade jolt
#

google made for youtube

ocean leaf
#

pls help me

slate swan
#

not a string

jade jolt
#

you did list comp tho

slate swan
#

I mean ,
",".join(member.name for member in ctx.guild.members) will result an error

jade jolt
#

will it?

slate swan
#

.join takes a list

jade jolt
#

ctx.guild.members is a list...

slate swan
#

!e
list = [ 1 , 2]
print("".join(str(number) for number in list))

unkempt canyonBOT
#

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

12
slate swan
#

Hmm

jade jolt
#

my point

slate swan
#

Ow nvm me

jade jolt
#

thanks for proving i was right

#

hmm wait

#

!e

list = [ 1 , 2]
print("".join(number for number in list))
unkempt canyonBOT
#

@jade jolt :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: sequence item 0: expected str instance, int found
jade jolt
#

just making sure

boreal ravine
tiny ibex
#

Help me

jade jolt
#

with

tiny ibex
# tiny ibex Help me

Actually I want to know how to make a command which can increase or decrease channel slowmode

#

@jade jolt please help

boreal ravine
#

!d discord.TextChannel

unkempt canyonBOT
#

class discord.TextChannel```
Represents a Discord guild text channel.

x == y Checks if two channels are equal.

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

hash(x) Returns the channel’s hash.

str(x) Returns the channel’s name.
tiny ibex
boreal ravine
#

ok

fading harness
#

hey

#

i want to select a system server

tiny ibex
fading harness
tiny ibex
fading harness
#

and...

#

i want to check that the author of message is a bot or not

#

what do i need to do

ocean leaf
#

how can i send a message in a specific server's specific channel instead of ctx.send()?

#

this doesn't work

fading harness
river walrus
#

Hi, I'm re-creating (and not forking) discord.py (called Disthon) using the code form discord.py, discord.js and Sapphire framework.
I need programming experts to lend me a hand with the project. If anyone's interested in contributing, please reply to this message

oak warren
#

btw its preferred to put levelling_channel in the function and its await ctx.guild.get_channel(id)

ocean leaf
#

i thought it is client.get_channel

#

but i need a specific server

oak warren
#

that works of discord.Client()

oak warren
ocean leaf
#

not commands.bot()

oak warren
#

if the channel was not found it will return error

oak warren
ocean leaf
ocean leaf
boreal ravine
ocean leaf
#

i read it somewhere

ocean leaf
oak warren
boreal ravine
oak warren
#

that is why ctx.guild.get_channel

ocean leaf
spring flax
#

you need it.

river walrus
boreal ravine
#

Okay lol

ocean leaf
#

can i do this

oak warren
river walrus
ocean leaf
#
guild = client.get_guild(guild id)
channel = guild.get_channel(channel id)
await channel.send(message)
#

will this work?

ocean leaf
#

ok

#

it is easier ig

oak warren
ocean leaf
oak warren
#

but i think its for the same guild only

#

i forget

slate swan
#

!d discord.ext.commands.Bot.get_channel

unkempt canyonBOT
oak warren
ocean leaf
#

i dont wanna remove the guild variable bcoz i need it

slate swan
#

Use that

ocean leaf
oak warren
#

yea it should work without the guild

#

*get guild

river walrus
ocean leaf
#

yeah it will be valid

#

i need the guild variable for later so i can't delete it

#

i think it will not cause error

#

i iwill try it

#

thanks

fading granite
#

Hello! Can someone tell me how can I make a bot like the Tatsu bot?

keen talon
#

||discord.py||

slate swan
#

||disnake||

#

||hikari||

slate swan
maiden fable
#

Well I deleted the code before and in the new code, just subclassed View and added buttons to it... Made method which would send the embed and the view (which is self)

grim oar
#

import discord
import os

my_secret = os.environ['TOKEN']

client = discord.Client()

@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))

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

if message.content.startswith('!hello'):
await message.channel.send('hello')

@client.event
async def on_message(message):
if message.author == client.user:
returnif message.content.startswith('!how is life'):
await message.channel.send('good')

@client.event
async def on_ready():
print(f'{client.user.name}has connected to discord')

@client.event
async def on_member_join(member):
await member.create_dm('hello')
await member.dm_channel.send(f'Hi {member.name}welcome to brooks bot test server.')

client.run(os.getenv('TOKEN'))

#

would there be any problems with this script?

#

its just a simple bot that replies and greets new members

spring flax
lament mesa
#

!intents

unkempt canyonBOT
#

Using intents in discord.py

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

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

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

from discord import Intents
from discord.ext import commands

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

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

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

slate swan
#
@bot.event
async def on_message_join(member):
    channel = bot.get_channel(890120317605928990)
    embed=discord.Embed(title=f"Welcome {member.name}", description=f"Thanks for joining {member.guild.name}!") # F-Strings!
    embed.set_thumbnail(url = member.avatar_url)
    await channel.send(embed=embed)```
#

i use this bot my bot not send messages

#

when member join

#

any help?

#

why bot bot run properly but not send message when join

tiny ibex
#
  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: NameError: name 'io' is not defined```
#

Help

thorny condor
#

anyone know how to fix Process finished with exit code -1073741819 (0xC0000005) in pycharm?

tiny ibex
# slate swan code pls
    format = "gif"
    user = user or ctx.author
    if user.is_avatar_animated() != True:
        format = "png"
    avatar = user.avatar_url_as(format = format if format != "gif" else None)
    async with aiohttp.ClientSession() as session:
        async with session.get(str(avatar)) as resp:
            image = await resp.read()
    with io.BytesIO(image) as file:
        await ctx.send(file = discord.File(file, f"Avatar.{format}"))    ```
meager whale
#

Pls help me

little ether
tiny ibex
meager whale
slate swan
# meager whale
@client.command(aliases= ['vote'])
@commands.has_guild_permissions(administrator =True)
async def poll(ctx,*,message):
  embed = discord.Embed(title=":loudspeaker:POLL", description=f"{message}",colour=discord.Colour.red())
  msg = await ctx.send(embed=embed)
  await ctx.message.delete()
  await msg.add_reaction(":thumbsup:")
  await msg.add_reaction(":thumbsdown:")```
#

here it is

meager whale
#

Ok

#

@slate swan

steady ember
#

'NoneType' object has no attribute 'send'

ornate scarab
#

Hi everyone, I need the bot to display the username in a separate chat and to which voice chat it connects or leaves every time this happens, can you tell me where to start? I don\t understand how to track the connection / exit from the voice chat of any user

slate swan
slate swan
slate swan
unkempt canyonBOT
#

Using intents in discord.py

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

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

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

from discord import Intents
from discord.ext import commands

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

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

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

slate swan
#

nd it's for on_member_join

#

Then it's intents

slate swan
slate swan
#

*s

slate swan
#

Send them :3

slate swan
#

alr

#

It should be discord.Intents.all()

#

ok

slate swan
#

Sure

slate swan
#

😫

#

Any error?

#

no

slate swan
#

ahh

river walrus
#

Hi, I'm re-creating (and not forking) discord.py (called Disthon) using the code form discord.py, discord.js and Sapphire framework.
I need programming experts to lend me a hand with the project. If anyone's interested in contributing, please reply to this message

fading granite
# slate swan What does that bot do?

It is basically level up bot with many features like a bank, reward system etc. On every level up it gives coins, and with that members can purchase stuff from shop.

meager whale
#

@slate swan can you help me

#

I found a code from Google but I can't use it

slate swan
boreal ravine
meager whale
meager whale
slate swan
boreal ravine
meager whale
#

Yeah

slate swan
#

lol

meager whale
#

I am a beginner and I don't know things

boreal ravine
#

Copying stuff dont make u smarter it only makes u more lazy

slate swan
#

to find error

boreal ravine
#

@slate swan whats your error again?

slate swan
boreal ravine
slate swan
#

but bot not send message

slate swan
boreal ravine
slate swan
boreal ravine
slate swan
# boreal ravine Also get an error handler :)
@bot.event
async def on_member_join(member):
    channel = bot.get_channel(890120317605928990)
    embed=discord.Embed(title=f"Welcome {member.name}", description=f"Thanks for joining {member.guild.name}!") # F-Strings!
    embed.set_thumbnail(url = member.avatar_url)
    await channel.send(embed=embed)```
#

i not setup handler

boreal ravine
jade jolt
#

guild isnt defined

slate swan
#

ok

slate swan
boreal ravine
jade jolt
#

member.guild is correct in this case

boreal ravine
#

then whats the error I see nothing that can cause the error

jade jolt
#

there isnt one apparently

boreal ravine
slate swan
jade jolt
#

it would say, wouldnt it

boreal ravine
slate swan
#

all

boreal ravine
#

The application's intents

slate swan
#

and also enable from developer portle

boreal ravine
boreal ravine
slate swan
#

yes 100%

boreal ravine
#

Hm

slate swan
#

see

#

alr

boreal ravine
#

Try to make an basic error handler that prints the error into the console

boreal ravine
#
on_command_error(ctx, error):
  print(error)
jade jolt
#
@bot.event
async def on_command_error(ctx, error):
    print(error)
slate swan
#

ik

jade jolt
#

just making sure

slate swan
#

lol

boreal ravine
#

Done? Try to rejoin the server on an alt to see if it works if not there's gonna be an error

slate swan
#

still πŸ‘Ž no error shown

#

😫

boreal ravine
slate swan
#

don

#

done but not a single error

jade jolt
#

hm

#

add a print to your on_member_join is actually being called?

boreal ravine
slate swan
#

wait

boreal ravine
#

Add a print to the event to make sure the event actually works lol

slate swan
#

i am doing

boreal ravine
#

Kk

jade jolt
slate swan
#

i run bot now

boreal ravine
#

Did it work

slate swan
#

no it do not prient

boreal ravine
#

Show your code in a screenshot lol

jade jolt
boreal ravine
slate swan
#

You need to rerun the bot everytime @slate swan did you?

boreal ravine
#

He stopped typing

#

😐

slate swan
slate swan
boreal ravine
jade jolt
#

bruh

boreal ravine
#

did u not hover

#

over the error?

#

Those squiggly lines are errors

slate swan
#

oooo

boreal ravine
#

..

#

Bruh.

jade jolt
#

if they were errors, theyd show in console. correct?

boreal ravine
#

yes

jade jolt
#

theyre not in console though

boreal ravine
#

Looks like defined but never used error lol

slate swan
#

hmm ic now i try

jade jolt
boreal ravine
jade jolt
#

yeah

slate swan
#

me 2

boreal ravine
#

@slate swan do you know basic python

slate swan
#

lol

boreal ravine
jade jolt
#

i even put example code

slate swan
#

i am sry

boreal ravine
#

ok

#

@slate swan

#

try getting the guild id then get the channel id

#

like ```py
guild = bot.get_guild(1234567890)
channel guild.get_channel(1234567890)

jade jolt
#

u can call get_channel from discord.Bot

meager whale
#

Guys how can I make a message with more then one word

jade jolt
#

type more words

boreal ravine
meager whale
jade jolt
#

how

meager whale
#

How do I add on_message_event to my bot

boreal ravine
#

!d discord.on_message

unkempt canyonBOT
#

discord.on_message(message)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") is created and sent.

This requires [`Intents.messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.messages "discord.Intents.messages") to be enabled.

Warning

Your bot’s own messages and private messages are sent through this event. This can lead cases of β€˜recursion’ depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that [`Bot`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot "discord.ext.commands.Bot") does not have this problem.
spring flax
#

@meager whale i assume you mean arguments?

jade jolt
spring flax
#

if you want multiple word arguments for a command do

async def example(ctx, *,arg):```
the `, *,` makes the next argument multiple words.
meager whale
boreal ravine
jade jolt
#

lol

meager whale
#

Stop

#

Stop bullying me

jade jolt
#

we're not

meager whale
#

You are

jade jolt
#

not

#

why do you need 2

#

put them both in the same event?

#

yes?

#

theres no limit for how big it can be

sleek ore
#

could you delete a field in an embed? And if so, how to?

slate swan
#
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 21, in on_member_join
    embed=discord.Embed(title = f':tada:Welcome to server {member.name}:tada:',colour=discord.Colour.blue)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/embeds.py", line 115, in __init__
    self.colour = colour
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/embeds.py", line 230, in colour
    raise TypeError('Expected discord.Colour, int, or Embed.Empty but received %s instead.' % value.__class__.__name__)
TypeError: Expected discord.Colour, int, or Embed.Empty but received method instead.```
#

i got it

lofty heron
#

hi does anybody know the event for command no argument error thing?

jade jolt
#

explain

lofty heron
#

missing arguments

sleek ore
jade jolt
sleek ore
#

or if you want it to be red, 0xff0000, use a color picker, copy the hex code, remove the #, add a 0x prefix

lofty heron
#

ok tenks

lament mesa
slate swan
#

ty all i solved problem ty @jade jolt @boreal ravine @sleek ore

slate swan
#

for helping me

#

well i maked new bot for that

slate swan
#

yay

quasi pawn
#

how do you send an embed with a normal text above it

boreal ravine
#

How do I make my bot detect the amount of reactions on a message? Like for example the message got 2 reactions on the same emoji.

boreal ravine
quasi pawn
boreal ravine
#

np

urban goblet
#
@client.command()
async def send(ctx, *args):
    userID = ctx.message.author.id

    today = date.today()

    # dd/mm/YY
    d1 = today.strftime("%m/%d/%Y")
    message = ""
    for i in args:
        message = message + str(i) + " "


    embed=discord.Embed(title="Gunvir Alerts", color=0x33fe9e)
    embed = discord.Embed(title="Gunvir Alerts", color=0x33FE9E)
    embed.add_field(name="", value=message, inline=False)

    embed.add_field(name="Date", value=str(d1), inline=False)```
#

how do I get this to send an embed? since I added the line with "name" and "value" it wont send

hasty iron
#

you could just do message = " ".join(args)

urban goblet
#

what would that replace?

hasty iron
#

and you can’t leave the name empty

#

and it’s clear what would it replace

urban goblet
#

I want this to format like this

#

[ 🎟️] Contract:
[βœ…] Entry Range:
[❌] Stop Loss:
[⚠️] Risk: 3.5/5

#

how would I do that?

#

@hasty iron

river walrus
maiden fable
#

Imagine pinging

#

Imagine having a shit auto correct (totally me)

urban goblet
# river walrus `'\n'.join(args)`

so the command is
/send
[ 🎟️] Contract:
[βœ…] Entry Range:
[❌] Stop Loss:
[⚠️] Risk: 3.5/5
how would I get it to format as sent

maiden fable
urban goblet
#

πŸ‘€

#

Blanket you didnt see nothin

maiden fable
urban goblet
#

this font

hasty iron
#

what font

urban goblet
#

for the
[ 🎟️] Contract:
[βœ…] Entry Range:
[❌] Stop Loss:
[⚠️] Risk: 3.5/5

hasty iron
#

you can’t change the font

urban goblet
#

Ah, thats all g

slate swan
#

hey guys a bot from me has reached 70 servers, wasnt it like that i could then verify the bot with a license? Or why didnt i become a message or will it only come at 100 servers?

hasty iron
#

why didn’t you become a message…?

#

what

maiden fable
#

Yea, I am also confused

slate swan
hasty iron
#

oh i think i know what you mean

slate swan
maiden fable
#

Ah

hasty iron
#

uh i believe you should see something in the dev page

maiden fable
#

That comes at 75

hasty iron
#

idrk

urban goblet
slate swan
#

oh

maiden fable
#

Also, remember to make your bot leave bot farms and small servers

#

Else discord won't verify it

slate swan
#

yea

hasty iron
#

message content intents pepelaugh

maiden fable
#

πŸ₯²

slate swan
#

i hope no one spammed it in discord servers they made 70 times that would be sad

maiden fable
#

Ikr

#

My bot also is in 66 servers but most of them are small, soooo

slate swan
#

the biggest one almost has 1K i think

maiden fable
#

Eh, the biggest one for my bot (in which it is used) is like 150 or something lmao

slate swan
#

what do they exactly mean by "whitelisting"?

boreal ravine
river walrus
boreal ravine
maiden fable
#

To use privileged intents

slate swan
maiden fable
blissful notch
#

Why cant i import from discord.ext.menus ?

trail breach
#
bot = commands.Bot(command_prefix='!')
client = discord.Client()```together??
trail breach
#

ohk

valid niche
#

so client will be useless here

trail breach
#

ok

#

How can i do something like if i say hi thenthe bot responds to the first hi and not other that follow??

hasty iron
#

what

trail breach
#

mybe others also respond but then the bot will end up replying to them all

#

how can i do this im not good at async so idk

hasty iron
#

can you explain what you want more

trail breach
#

ok 1 sec

hasty iron
#

cuz i didn’t understand anything from what you said

trail breach
#

I ve made a command which replies to anyone saying hello(person1) but if any one(person2) ends up responding to that person1 but bot will also reply to person2 which i dont want

#

i dont know much of asynchronous so i dk how todoit

hasty iron
#

ur using wait_for?

trail breach
#

wait?

hasty iron
#

are you using it

trail breach
#

no

hasty iron
#

i still don’t get what you mean

trail breach
#

theres something on stack lemme see

trail breach
hasty iron
#

can i see your code

trail breach
#
@bot.listen("on_message")
async def task_hi(message):
    username_mention = message.author.mention
    
    username = str(message.author).split('#')[0]
    user_message = str(message.content).lower()
    chanel = str(message.channel.name)
    # print(f'{username} : {user_message} ({chanel})')

    for i in range(0,len(HELLO),1):
    
        if username == str(bot.user).split("#")[0]:
            return "avoiding bot"
        
        if  HELLO[i] in user_message  :
            print(username_mention)
            general_channel = bot.get_channel(GENERAL)
            print('executed')
            await general_channel.send(f'Hello {username_mention}')
            return ```
hasty iron
#

ok so

trail breach
#

HELLO= ["hello", "hi", "sup", "hello there","hey", "helo"]

hasty iron
#

when i person sends a message

#

and then another person at the same time does that

trail breach
#

not that

hasty iron
#

it might respond to the second first?

trail breach
#

wait

hasty iron
#

dude i have no clue what’s your issue or what you want

trail breach
#

if i write bot: thats what the bot shud do

#
User: Hello
Bot: Hello @User#0000
User2: Hello@Usr#0000
now here bot !!shouldn't!! respond
trail breach
hasty iron
#

ok so its an issue with how you parse the message

#

or what

trail breach
#

read again srry i made a mistake

hasty iron
#

oh

trail breach
#

srry

hasty iron
#

oh so you want to check

#

if the bot has been mentioned inside a message?

#

if so, that’s easy

#

!d discord.ClientUser.mentioned_in

unkempt canyonBOT
trail breach
#

not thaaat

#

cries screams screeches

hasty iron
#

if the user pinged himself?

trail breach
#

the bot shuldnt replu to user 2

#

who is replying to usr 1

#

as user 1 is to be considered new

river walrus
#

Hi, I'm re-creating (and not forking) discord.py (called Disthon) using the code form discord.py, discord.js and Sapphire framework.
I need programming experts to lend me a hand with the project. If anyone's interested in contributing, please reply to this message

slate swan
#

Hey a nother question i just got a dm from discord that my bot reached 75 servers or more, so then i clicked on their link and they said the bot grew to fast and they now set the limit of my bot to 250 server and told me to wait a few weeks and try again but how long does it take to calm down and what should i do and what should i dont do?

hasty iron
#

it’s because you’re checking jf one of the hello messages are inside the message

#

that’s why it triggers

trail breach
#

yes

hasty iron
#

you can just check if the whole message matches the hello message

trail breach
#

finally

#

reframed : how can a pause a function for a short time like half a minute

#

where it stops listening

#

after getting executed

hasty iron
#

!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.10/whatsnew/3.10.html#whatsnew310-removed) for more information.

Example of coroutine displaying the current date every second for 5 seconds:
trail breach
#

ok ty

#
@bot.listen("on_message")
async def task_hi(message):
    username_mention = message.author.mention
    
    username = str(message.author).split('#')[0]
    user_message = str(message.content).lower()
    channel = str(message.channel.name)
    # print(f'{username} : {user_message} ({chanel})')

    for i in range(0,len(HELLO),1):
    
        if username == str(bot.user).split("#")[0]:
            return "avoiding bot"
        
        if  HELLO[i] in user_message  :
            print(username_mention)
            reply_channel = bot.get_channel(channel)
            print('executed')
            await message.reply_channel.send(f'Hello {username_mention}')
            return```
#
    await reply_channel.send(f'Hello {username_mention}')
AttributeError: 'NoneType' object has no attribute 'send'
#

if i use a variable in place of channel it works

silk notch
#

hello

#

i needed some ideas for python

valid niche
#

Hey there, thanks for the tips i guess? I made pretty much all of the current code (Client, handler and websocket) in the last few days. I changed a few things here and there, would you say it's somewhat better now? For the handle_events i'll be doing more processing in the websocket.py later on, but right now it's just more of a proof of concept to check it works. I'll be doing the event handling later

trail breach
#

more pl r online there

silk notch
#

but nobody is helping me

#

😭

#

help me

valid niche
# silk notch but nobody is helping me

you are in the wrong channel here. So I have my doubts you'll get help here too.

Also this discord is pretty much fully driven by the community. Don't expect someone to help EVERYTIME, but almost everyone will get helped at some point

hasty iron
valid niche
hasty iron
#

you dont have to use a thread

#

and when you dont that time.sleep and asyncio.run are uh

valid niche
#

What do you suggest?

hasty iron
#

a simple task lol

valid niche
#

I was under the assumption using a thread would make it less prone to blocking

hasty iron
#

it wouldn’t block if you use asyncio.sleep

meager whale
#

Hey guys

hasty iron
#

and you could just await the heartbeat method

valid niche
meager whale
#

Can anyone tell me the code of Making a Calculator Command for my bot

hasty iron
#

well i also don’t think creating a new event loop per heartbeat is good

valid niche
trail breach
hasty iron
#

you could’ve used something like asyncio.run_coroutine_threadsafe

trail breach
#

its not able to get channel id u mean

meager whale
valid niche
hasty iron
#

and also the function name

trail breach
#
    reply_channel = bot.get_channel(channel)
            print('executed')
            await message.reply_channel.send(f'Hello {username_mention}')```
#

its been defined

valid niche
#

I don't see message.reply_channel defined anywhere, i see reply_channel defined, but message.reply_channel is not defined

trail breach
#

oh

valid niche
valid niche
fading harness
#

hey

hasty iron
#

well yeah ok i get it now

fading harness
#

i want to get the username of the author of the message

hasty iron
#

seeing those two together triggered my brain for some reason

valid niche
#

i mean i'm sure there's a better way than using asyncio.run inside a thread, but can't think of it atm

valid niche
trail breach
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\ArcArp\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\ArcArp\Desktop\PYTHON\Python Discord Bot\main.py", line 44, in task_hi       
    await reply_channel.send(f'Hello {username_mention}')
AttributeError: 'NoneType' object has no attribute 'send'
discord-tsting
#
@bot.listen("on_message")
async def task_hi(message):
    username_mention = message.author.mention
    
    username = str(message.author).split('#')[0]
    user_message = str(message.content).lower()
    channel = str(message.channel.name)
    # print(f'{username} : {user_message} ({chanel})')

    for i in range(0,len(HELLO),1):
    
        if username == str(bot.user).split("#")[0]:
            return "avoiding bot"
        
        if  HELLO[i] in user_message  :
            print(username_mention)
            reply_channel = bot.get_channel(channel)
            print('executed')
            await reply_channel.send(f'Hello {username_mention}')
            return ```
valid niche
#

just get message.channelth en

#

instead of this super weird back and forth

trail breach
#

ok

#

so i can just do channel.send

valid niche
hasty iron
#

yeah i saw that

valid niche
#

also also send HB calls send_json which is also async and used for almost every request (it's a built in of aiohttp)

trail breach
#

await bot.get_channel(channel_id).send(f'Hello {username_mention}')

#

something like this

valid niche
#

you are overthinking and making your code overcomplex

trail breach
#

here channel is the id ri8

valid niche
#

is_avatar_animated is a method not an attribute

icy seal
#

that wouldn’t error, it would just return a function

valid niche
#

massive difference and the issue in your code

#

oh i see

#

user is a disnake.Member

#

and i have no idea how or what

#

idk disnake

meager whale
#

How do I fix this error

valid niche
meager whale
icy seal
#

is_avatar_animated is a method of discord.Member, not whatever you’re using

valid niche
#

i'm very certain that this issue is purely because you're on phone and your phone uses some alternative character or adds some invisible character that python cannot read

slate swan
icy seal
#

also Divy this is my personal preference but please use 4 spaces for tabs lol

slate swan
#

in if statements

#

why do you name a bot instance client

#

use pass_context

valid niche
#

all those things too

meager whale
#

Duh I am a beginner

#

Stop Everyone

#

Pls

upbeat otter
#
member = ctx.message.author
    await member.avatar_url.save("newmember.png")  
    img = Image.open("newmember.png")
    height,width = img.size
    lum_img = Image.new('L', [height,width] , 0)
    image = Image.open("images/template.png")
    draw = ImageDraw.Draw(lum_img)
    draw.pieslice([(0,0), (height,width)], 0, 360, 
              fill = 255, outline = "white")  
    img_arr =np.array(img)
    lum_img_arr =np.array(lum_img)
    final_img_arr = np.dstack((img_arr,lum_img_arr))
    finalimage = (Image.fromarray(final_img_arr))
    finalimage.save("circle.png")
    ne = Image.open("circle.png")
    data = BytesIO(await ne.read())
    pfp = Image.open(data)
    pfp2 = pfp.resize((40, 40))
    image.paste(pfp2, (150, 13))
    image.save("newimg.png")
    await ctx.send(file=discord.File("newimg.png"))
    os.remove("newimg.png")

This gives me an error: Command raised an exception error: AttributeError: read

slate swan
#

check the tutorial in the pinned messages

#

not on youtube

valid niche
slate swan
valid niche
#

made by @vocal plover (amazing person for helping the community so much)

slate swan
#

and I think the problem is not with the return line

#

but that client. after

#

idk

flint bobcat
#

hm any god discord bot dev

#

who can make me a bot free please dm em

slate swan
#

nop

#

!rule 9

unkempt canyonBOT
#

9. Do not offer or ask for paid work of any kind.

slate swan
#

😹

boreal ravine
#

he said How do I set Images from my directory? (embeds)

pliant gulch
valid niche
slate swan
#

yo why is my bot ofline

valid niche
#

i'll check it out, and convert it all to snakecase

valid niche
pliant gulch
#

It's in the websockets, the keep alive method

slate swan
#

but hpw can i fix it lol

valid niche
slate swan
#

how can i fix it

pliant gulch
slate swan
#

lol

pliant gulch
#

Makes it sort of hard to read at first

hasty iron
slate swan
#

how???

hasty iron
#

who knows

slate swan
#

i added to my server buts its ofline

#

in the memebers lisr

valid niche
slate swan
valid niche
#

isn't sure enough. I want you to be 100% about your case

hasty iron
#

whats ur code

#

!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.pydis.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
#

without token

#

u dobe what to know

#

trust me

#

what

#

don't help him

hasty iron
#

!rule 5

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

valid niche
#

thanks for the tips

slate swan
#

he didn't say anything about the situation

#

and he just said that it's against ToS

#

πŸ€¦β€β™‚οΈ

#

why does the code say import discord could not be reoluved

#

πŸ€¦β€β™‚οΈ

hasty iron
slate swan
#

it is

#

i did pip inatall

hasty iron
#

anyways we cant help you

valid niche
hasty iron
#

you said your bot is a nuking one

slate swan
hasty iron
#

dont act dumb

slate swan
#

he's a troll

#

when tho

#

but when did i say it

valid niche
slate swan
#

a tiny bit

#
async def check_prefix():
                fetch_arg = "prefix"
                db_func = discord.utils.get(bot.get_all_channels(), name=fetch_arg)
                channel_id = db_func.id
                db_user = bot.get_channel(channel_id)


                msg_info = discord.utils.get(await db_user.history(limit=100).flatten())
                msg = msg_info.content
                msg_id = msg_info.id
                msg_fetch = await db_user.fetch_message(msg_id)
                return msg

asdf = await check_prefix()

Getting an error here - "invalid syntax". Can't figure out what to fix. Can anyone help?

boreal ravine
#

How do I send files to discord if I'm on replit?

hasty iron
#

or you could use loop.create_task or loop.run_until_complete

#

create_task schedules the function to run in the background

visual island
hasty iron
#

run_until_complete waits for it to finish

slate swan
#

Alright, thanks!

boreal ravine
# visual island `file=discord.File("color.png")`?
Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.image.url: Scheme "<discord.file.file object at 0x7f56e42c4a40>" is not supported. Scheme must be one of ('http', 'https').
``` ```py
        f = discord.File("color.png")
        embed=discord.Embed().set_image(url=f)
        await ctx.send(embed=embed)
``` lol
visual island
#

!local-file

unkempt canyonBOT
#

Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:

# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")

# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
    file = discord.File(f)

When using the file-like object, you have to open it in rb mode. Also, in this case, passing filename to it is not necessary.
Please note that filename can't contain underscores. This is a Discord limitation.

discord.Embed instances have a set_image method which can be used to set an attachment as an image:

embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png")  # Filename here must be exactly same as attachment filename.

After this, you can send an embed with an attachment to Discord:

await channel.send(file=file, embed=embed)

This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.

visual island
#

oh you can

#

attachment://color.png

boreal ravine
visual island
boreal ravine
#

yes and no

visual island
boreal ravine
#

lol

visual island
#

one last way..

#

send the image to a channel, then copy the image url, then pass it

slate swan
#

it's written there above tho

slate swan
visual island
slate swan
#

the problem is only with getting the path on replit

#

I think

#

hello guys i have a small question

i want to validate the type of channel that user sent a message

how can i do this ?
because message.channel has not attribute like type

visual island
#

yeah maybe

slate swan
#

oh wait I'm dumb

#

he forgot the kwarg

#

in the send function

slate swan
#
        f = discord.File("color.png")
        embed=discord.Embed().set_image(url=f)
        await ctx.send(embed=embed)
        f = discord.File("color.png", filename="image.png")
        embed=discord.Embed().set_image(url="attachment://image.png")
        await ctx.send(file=f, embed=embed)
#

kinda spoonfeeding

hasty iron
#

by using isinstance

slate swan
#

message.channel , returns discord.abc.Messageable

slate swan
#

but abc.Messegable has no attribute to find type

boreal ravine
#

Command raised an exception: FileNotFoundError: [Errno 2] No such file or directory: 'attachment://color.png'

slate swan
boreal ravine
#

The code I used after asking for help: ```py
f = discord.File("attachment://color.png", filename="color.png")
embed=discord.Embed().set_image(url="attachment://color.png")
await ctx.send(file=f, embed=embed)

hasty iron
#

using isinstance

slate swan
#

thanks it worked

visual island
boreal ravine
visual island
#

discord.File(filepath, filename)

boreal ravine
sweet merlin
#

how do i make my bot to slide to my target dm?
example: .send @left apex this is message
and then the bot will send dm to @vestal hatch

magic pond
#

How do i mention a role ?

little ether
unkempt canyonBOT
unkempt canyonBOT
#

await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
visual island
sweet merlin
sweet merlin
slate swan
sweet merlin
#

okay!

slate swan
#
async def command(ctx , user : discord.User):
  await user.send(...)```
boreal ravine
#

hm it works @visual island thanks

boreal ravine
#

πŸ¦†

slate swan
#

AttributeError: module 'discord.ext.commands.bot' has no attribute 'event' help pls

hasty iron
#

the error is pretty clear

waxen granite
#
    @tasks.loop(seconds = 30)
    async def counter(self):
        for key in self.serverstats.keys():
            guild = self.bot.get_guild(int(key))
        try:
            server_stats = self.serverstats[str(guild.id)]["statschannels"]
        except KeyError:
            server_stats = {}
        category = discord.utils.get(guild.categories, name="STATS")
        botcount = 0
        membercount = 0
        members = guild.members
        textchannelscount = len(guild.text_channels)
        voicechannelscount = len(guild.voice_channels)
        for member in members:
            if member.bot == True:
                botcount += 1
            else:
                membercount += 1
        users_text = f"Users: {membercount}"
        bots_text = f"Bots: {botcount}"
        channels_text = f"Text Channels: {textchannelscount}"
        channels_voice = f"Voice Channels: {voicechannelscount}"
        tier = f"Premium Tier: Level {guild.premium_tier}"
        uc = guild.get_channel(server_stats['member_count'])
        bc = guild.get_channel(server_stats['bot_count'])
        tc = guild.get_channel(server_stats['text_count'])
        vc = guild.get_channel(server_stats['voice_count'])
        pt = guild.get_channel(server_stats['tier'])
        if uc.name != users_text:
            print("1")
            await asyncio.sleep(1)
            await uc.edit(name=users_text, category=category)```
error:`    if uc.name != users_text:
AttributeError: 'NoneType' object has no attribute 'name'`
but i have the id here
cyan sundial
#

how can a bot detect whether it is able to send mesages in a channel, or when a channel unlocks?

hasty iron
waxen granite
# hasty iron where are you starting the loop

@commands.Cog.listener() async def on_ready(self): sChannel = self.bot.get_channel(self.botInfo['startupChannel']) await sChannel.send('serverstats cog has been loaded successfully.') self.counter.start()

hasty iron
#

dont do it inside the on_ready

#

and do you have a counter.before_loop

slate swan
#

🐳

waxen granite
cyan sundial
#

i never tried anything like it

hasty iron
#

oh since you are doing it inside the on_ready cache should be filled ok

#

are you sure the channel is in the guild you want

slate swan
#

AttributeError: module 'discord.ext.commands.bot' has no attribute 'event'

#

how to fix ?

@bot.event
async def on_ready():
   await client.change_presence(activity = discord.Streaming(name = "♆", url = "https://twitch.tv/gucci"))
#

commands.Bot

#

Don't change_presence (or make API calls) in on_ready within your Bot or Client.
Discord has a high chance to completely disconnect you during the READY or GUILD_CREATE events (1006 close code) and there is nothing you can do to prevent it.

Instead set the activity and status kwargs in the constructor of these Classes.

bot = commands.Bot(command_prefix="!", activity=..., status=...)

As noted in the docs, on_ready is also triggered multiple times, not just once.

Basically: don't πŸ‘ do πŸ‘ shit πŸ‘ in πŸ‘ on_ready.

waxen granite
boreal ravine
slate swan
#

bot = commands.Bot(command_prefix="!", activity=..., status=...)

boreal ravine
boreal ravine
#

hm

blissful notch
#

How do i import discord.ext.menus ?

reef shell
#

did you install it?

#
from discord.ext import menus
#

if not installed then install it first

blissful notch
#

I tried that it said unknown location…

reef shell
blissful notch
#

How do i install itpithink

reef shell
#

python -m pip install -U git+https://github.com/Rapptz/discord-ext-menus

#

in terminal

unkempt canyonBOT
#
Not in my house!

No documentation found for the requested symbol.

slate swan
#
  File "nuke.py", line 15, in <module>
    @Bot.event
TypeError: event() missing 1 required positional argument: 'coro'```
 
AAAAAAAAAAAA help plsss
jade jolt
slate swan
#

yes ?

unkempt canyonBOT
#
Not in my house!

No documentation found for the requested symbol.

reef shell
#

and show code

slate swan
#

what is fix ??

#

nuke channel

reef shell
#

!rule 5

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

jade jolt
#

🀨🀨 yeah

reef shell
#

no help about these

slate swan
cyan sundial
#

how do i use this? discord.on_guild_channel_update on the docs it just says before and after

jade jolt
#

bro what

#

before and after are the channels

reef shell
#

parameters

blissful notch
jade jolt
#

just channel objects basically (are what it gives you)

jade jolt
final iron
#

Why would a nuke command be against this servers tos?

boreal ravine
boreal ravine
final iron
#

Aight ig

cyan sundial
#

And probably api abuse

reef mica
#

how can i move a specified member to a specified voice channel

dusty ibex
#

How do I make bot clear for users?

-clear user amount?

#

Dont know what to type on the user thing

#

To make it clear

final iron
#

Are you trying to purge a specific users messages?

dusty ibex
#

Yeah

#

-purge user amount

final iron
#

So what do you need?

#

Wdym make it more clear

dusty ibex
#

Well I just want to know what to type to make it purge

#

For the user

boreal ravine
#

How do I set the color of an embed to a variable (hexcode)? Like e.g (color = f"0x{hexcode}") will this work?

echo flame
#

How can a you colab or other database?

#

use

hasty iron
#

and yes that would work

dusty ibex
#

How do I make my β€œpurge” command clear for specific users?

β€œpurge” user amount

#

What do I type?

boreal ravine
# hasty iron needs to be an int

i got this error tho Command raised an exception: TypeError: Expected discord.Colour, int, or Embed.Empty but received str instead.

hasty iron
#

needs to be an int

boreal ravine
#

yes but how? the hexcode is FFFFFF and I wanna add 0x to it

#

How O-o

hasty iron
#

you just.. add it?

#

!e

print(0xFFFFFF)
unkempt canyonBOT
#

@hasty iron :white_check_mark: Your eval job has completed with return code 0.

16777215
hasty iron
#

look its valid

boreal ravine
hasty iron
#

what

gleaming torrent
#

how do you make a purge command purge for specific users?

boreal ravine
gleaming torrent
#

!purge help

boreal ravine
boreal ravine
gleaming torrent
#

you know how?

unkempt canyonBOT
#

class discord.TextChannel```
Represents a Discord guild text channel.

x == y Checks if two channels are equal.

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

hash(x) Returns the channel’s hash.

str(x) Returns the channel’s name.
hasty iron
boreal ravine
#

oops wrong thing

unkempt canyonBOT
#

@hasty iron :white_check_mark: Your eval job has completed with return code 0.

1048575
hasty iron
#

oops missed an F

#

but you get it

#

you do it like that

boreal ravine
reef mica
#

how do I move a specified member to a specified channel

hasty iron
#

!d discord.Member.move_to

unkempt canyonBOT
#

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

Moves a member to a new voice channel (they must be connected first).

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

This raises the same exceptions as [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member.edit "discord.Member.edit").

Changed in version 1.1: Can now pass `None` to kick a member from voice.
reef mica
#

doesnt work

boreal ravine
reef mica
slate swan
#

bruh

hasty iron
#

my eyes

reef mica
hasty iron
#

member is None

slate swan
#

intents?

boreal ravine
slate swan
#

it shouldn't be a string

hasty iron
#

pass in base as a kwarg

slate swan
#

wait

reef mica
#

why is it saying none

slate swan
#

I'm dumb again

reef mica
#

i dont get it

hasty iron
#

also there is a ColourConverter

#

if you need that

boreal ravine
#

!d discord.ext.commands.ColourConverter

unkempt canyonBOT
#

class discord.ext.commands.ColourConverter(*args, **kwargs)```
Converts to a [`Colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour "discord.Colour").

Changed in version 1.5: Add an alias named ColorConverter

The following formats are accepted...
boreal ravine
#

hm

maiden fable
#

BTW @slate swan, I edited all the code and the paginator works again!

slate swan
#

nice man

reef mica
#

the move_to doesnt work

#

what the hell

#
discord.Guild.get_member(314727938492727296).move_to(839853272991006720)
#

why no work

slate swan
#
    await bot.change_presence(activity = discord.Streaming(name = "♆", url = "https://twitch.tv/gucci"))
  File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 1062, in change_presence
    await self.ws.change_presence(activity=activity, status=status, afk=afk)
AttributeError: 'NoneType' object has no attribute 'change_presence'

pls help ?

reef shell
#

showing only the error ?

#

show code also

hasty iron
slate swan
#

oh ok

hasty iron
#

use bot.wait_until_ready at the top of your function

#

!d discord.Client.wait_until_ready

unkempt canyonBOT
#

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

Waits until the client’s internal cache is all ready.
slate swan
#
    await wait_until_ready()
    ^
SyntaxError: 'await' outside function```
#

@hasty iron

hasty iron
#

and its a method of Bot/Client

reef mica
#
user1 = discord.Guild.get_member(314727938492727296)

TypeError: get_member() missing 1 required positional argument: 'user_id'

#

how does this make any sense

#

it has user id

slate swan
#

can u get me the correct code pls ?

#

@tasks.loop(seconds=4) async def mytask(): await bot.change_presence(activity = discord.Streaming(name = "♆", url = "https://twitch.tv/gucci")) await wait_until_ready() mytask.start()

hasty iron
#

i dont spoonfeed

#

and i said the top of your function

#

and again, its a method of Bot/Client

hasty iron
hasty iron
#

change it to 60-40 to be safe

reef mica
#

how do i get the instance of guild

reef shell
#

ooops

hasty iron
#

you can get it through, Bot.get_guild, Message.guild, Context.guild, etc

reef mica
#

im just gonna use client.fetch_user

#

much easier

reef shell
#

that's an api call

hasty iron
#

why fetch user when you need a guild

#

makes no sense

reef shell
#

sounds funny

#

lmao

reef mica
#

WHY THE HELL IS IT SO COMPLICATED

hasty iron
#

it's not

reef mica
#

it is

hasty iron
#

you're making it complicated for yourself

reef mica
#

i have been trying for 3 hours now

#

every time i get some error

hasty iron
#

that points to lack of knowledge

#

3 hours for something that can be done in a minute

#

is a bit too much

reef mica
#

you should stop making fun of me

hasty iron
#

i am not

reef mica
#

im a complete beginner

#

and thats why im asking help

#

and ur just making fun

hasty iron
#

then you should learn more python

reef mica
#

its not about the python

hasty iron
#

it is

reef mica
#

i know python

jade jolt
#

do you

reef mica
#

the discord lib is stupid

hasty iron
#

you clearly dont know the difference between an instance and a class

jade jolt
hasty iron
#

dont blame it for your own incompetence

#

you should learn more python and that's it

#

!resources

unkempt canyonBOT
#
Resources

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

hasty iron
#

that can help

slate swan
#

@hasty iron fucck u

#

u don't help

hasty iron
#

what did i do

#

i did help

slate swan
#

take shower

hasty iron
#

i did yesterday

slate swan
#

u r unemployed

hasty iron
#

yes ofc i am 14

stark bobcat
#

dang

#

ur too smart for a 14 y/o

hasty iron
#

not really

stark bobcat
jade jolt
slate swan
#
    ^
IndentationError: unexpected indent``` someone can help me ? (@hasty iron is gay)
hasty iron
#

fix your indents

stark bobcat
reef shell
#

he is making a nuke bot

#

with zero knowledge in dpy

jade jolt
#

lmao

hasty iron
#

actually zero in python in general

stark bobcat
#

indeed

icy seal
#

@slate swan why would anyone want to help you when you just insulted the last person who tried...

hasty iron
#

its fine

jade jolt
#

yeah.

hasty iron
#

i dont mind it

jade jolt
#

still not a nice thing to say

icy seal
#

Also what actually is a nuke bot

reef shell
jade jolt
#

something that breaks the TOS

icy seal
#

oh just a blanket term for any TOS rulebreak?

hasty iron
#

whats a blanket term

jade jolt
#

bro-

hasty iron
#

true, discord should become a shower

slate swan
reef shell
#

this guy is so obsessed with other's shower

jade jolt
#

yeaa

#

kinda sus

icy seal
#

blanket term is like something that refers to anything "underneath the blanket", so like wildlife is a blanket term for uh insects, mammals and stuff

hasty iron
#

oh

slate swan
#

well

icy seal
#

oh your name is blanket, i completely forgot lol

slate swan
#

not anymore, there's a blanket

hasty iron
#

lmao

jade jolt
#

hahaha that looks premade

slate swan
#

chill

reef shell
slate swan
#

wat

jade jolt
#

hes under 13 fs

slate swan
#

why me

jade jolt
#

not u

slate swan
#

oh

#

he replied to me

#

that's why I thought....

jade jolt
#

probably didnt mean to?

stiff nexus
#

in Member.add_roles

  • atomic (bool) – Whether to atomically add roles. This will ensure that multiple operations will always be applied regardless of the current state of the cache.

is this helpful?

boreal ravine
#

Is there a parameter to get a certains command's information (aliases, help, desc)? Like if I do !help <command> it'll show all the command info

#

Should the param be command: ctx.command? or something else

hasty iron
#

commands.HelpCommand subclass?

boreal ravine
hasty iron
#

then you can have the param as a string and use Bot.get_command

boreal ravine
#

hmmm ok

hasty iron
#

that returns Command | None

boreal ravine
#

wow it worked wtf thanks

trail breach
#

@bot.listen("on_message") i hv a func

#

any way to make it stop listening for some time

hasty iron
#

no

slate swan
#

hmm

trail breach
#

i cud make a loop or somethin

reef mica
#
@client.command()
async def ban(ctx, member : discord.Member, *, reason="No reason provided"):
    await member.kick(reason=reason)
#

doesnt ban

slate swan
#

it kicks

hasty iron
#

yes read what it does

reef mica
#

i mean

slate swan
#

lol

reef mica
#

kick

sick birch
#

Change the name to _ban or something

hasty iron
#

!e ```py
ban

unkempt canyonBOT
#

@hasty iron :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'ban' is not defined
sick birch
maiden fable
#

Bruh

hasty iron
#

what?

maiden fable
#

It's a ban method

sick birch
#

Of the member object

maiden fable
#

Member.ban

hasty iron
#

that doesn't shadow anything

sick birch
#

discord.Member.ban