#discord-bots

1 messages Β· Page 958 of 1

slate swan
#

^

#

the last line you talking about right

supple thorn
#

ok

slate swan
#

oops i called xe a him again sorry!

supple thorn
#

i don't know how else we can simplify more

slate swan
slate swan
slate swan
slate swan
#

I thought my mistake was on the points = .. no?

#

i mean you shouldnt even store tags in a first place

#

you should store ids as they never change

#

and use a db!

#

am using json

#

json isnt a db!

#

im done with you

supple thorn
slate swan
#

πŸ’€

slate swan
supple thorn
left crater
#

zezemzey

supple thorn
#

πŸ—Ώ

slate swan
left crater
#

he got offended again πŸ’€

supple thorn
#

mans just trying to help you

supple thorn
slate swan
slate swan
#

keep up this behavior and you will be reported to administrators

left crater
#

oh no

slate swan
#

last warning there buckaroo

supple thorn
#

buack

slate swan
#

honestly i think that human is a troll

supple thorn
#

same

slate swan
slate swan
supple thorn
#

excuse me what

#

phub

slate swan
#

how do you import phub

slate swan
supple thorn
#

lmao

slate swan
supple thorn
#

i wonder what that is

slate swan
#

is it import.phub?

slate swan
#

or import phub

#

so stop asking pls!

#

how do import fuzzywuzzy

#

why do you have Wireshark installed? @slate swan

supple thorn
slate swan
#

someone told me to import it

supple thorn
slate swan
supple thorn
#

lmao

#

y9sus stalking you

slate swan
#

anyways isnt that a bit weird asking such a question about my desktop?

slate swan
slate swan
#

I like ur background

supple thorn
slate swan
slate swan
slate swan
supple thorn
#

this is getting creepy

slate swan
jolly basin
#

HOW IMPORT YOUTUBED1

slate swan
slate swan
slate swan
#

<@&831776746206265384>

#

pls not here.

slate swan
supple thorn
#

trollers

slate swan
#

smh

#

where are my mods

supple thorn
#

gone

left crater
#

up ur ass

slate swan
#

πŸ’€

blissful lagoon
#

!ban 867284733879386152 troll

slate swan
unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied ban to @jolly basin permanently.

slate swan
#

this chat is getting worse and worse

slow estuary
#

still lost

supple thorn
#

well all of it started when y9su got here

supple thorn
slow estuary
#

my bot

#

can't figure out whats even broken

slate swan
supple thorn
#

what are you lost on

blissful lagoon
slate swan
#

you tell him mod!

supple thorn
#

lmao

left crater
#

alright sorry mate

slate swan
supple thorn
#

it's like a video i watched

#

person going behind a bigger person and saying go get them

left crater
slate swan
#

i think im just gonna leave

slate swan
supple thorn
slate swan
#

Hello!

left crater
#

Hi!

supple thorn
slate swan
#

Im new to coding

supple thorn
slate swan
#

how do you import 52576726

supple thorn
#

why are you here

slate swan
#

whats import phub how import it

supple thorn
#

help

slate swan
#

someone told me to import it

slate swan
#

ok

#

whats import fuzzywuzzy

#

!pypi fuzzywuzzy

unkempt canyonBOT
slate swan
#

yo

#
@slash.slash(name="roster", Description='Shows members on a team')
async def roster(ctx, *, arg):
             property members
colors = ['red', 'green', 'blue', 'yellow']
output = ""
separator = ", "
for color in colors:
    output += color + separator
print(output)
             colors = ['red', 'green', 'blue', 'yellow']
separator = ", "
print(separator.join(colors))
             integers = [1, 3, 6, 10, 15]
print(", ".join(str(e) for e in integers))```
#

can someone fix this for me

#

no we cannot, but we can help you with it!

#

ok

#

what do i do

#

erros? why do you have property members after your functions declaration?

slate swan
#

well that someone is wrong!

#

and what are you trying to do exactly?

unkempt canyonBOT
#

Joining Iterables

If you want to display a list (or some other iterable), you can write:

colors = ['red', 'green', 'blue', 'yellow']
output = ""
separator = ", "
for color in colors:
    output += color + separator
print(output)
# Prints 'red, green, blue, yellow, '

However, the separator is still added to the last element, and it is relatively slow.

A better solution is to use str.join.

colors = ['red', 'green', 'blue', 'yellow']
separator = ", "
print(separator.join(colors))
# Prints 'red, green, blue, yellow'

An important thing to note is that you can only str.join strings. For a list of ints,
you must convert each element to a string before joining.

integers = [1, 3, 6, 10, 15]
print(", ".join(str(e) for e in integers))
# Prints '1, 3, 6, 10, 15'
slate swan
#

and you should use list comps!

maiden fable
#

Calm down with the !

slate swan
#

never!

slate swan
#

and it will work?

#

may i ask do you know basic python?

#

no

feral lichen
#

prolly not

slate swan
#

whats python? i use java

#

bro

#

python is a programming language

#

i thought it said java

#

what

slate swan
#
require './lib/tic_tac_toe'

describe TicTacToeRound do
  describe '.place' do
    it 'places cross on the board the first time' do
      expect { subject.place(0) }.to change {subject.board}.to(['X', nil, nil, nil, nil, nil, nil, nil, nil])
    end

    context '@whos_turn' do
      it 'chanes @whos_turn to O after a placement' do
        expect { subject.place(0) }.to change { subject.whos_turn }.to('O')
      end
      it 'changes @whos_turn back to X after two placements' do
        expect { subject.place(0) && subject.place(1) }.not_to (change { subject.whos_turn })
      end
      it 'does not update @whos_turn if placement was already made' do
        expect { subject.place(0) && subject.place(0) }.to change { subject.whos_turn }.to('O')
      end
    end
  end
end```
supple thorn
#

what

#

wtf

feral lichen
#

bro isnt that ruby

slate swan
#

yes

#

bro

feral lichen
#

bro

slate swan
#

wtf is ruby

#

you can see do and end keywords

#

i found that code off stack website

supple thorn
slate swan
#

so it has to be python

#

its not lol its rb

final iron
#

do and end aren't a thing in python

slate swan
#

ok ok

#

so can someone help me fix this, THIS IS PYTHON

#
local mouse = LocalPlayer:GetMouse()
local Camera = workspace.CurrentCamera
local Debris = game:GetService("Debris")
local UserInputService = game:GetService("UserInputService")
local target = false
local RunService = game:GetService("RunService")


getfenv().lock = "Hitbox" -- Head or Hitbox or Random

fov = 150;
local fovCircle = true;
local st = tonumber(tick());
warn("Loading script...")

if fovCircle then
    function createcircle()
        local a=Drawing.new('Circle');a.Transparency=1;a.Thickness=1.5;a.Visible=true;a.Color=Color3.fromRGB(156, 0, 0);a.Filled=false;a.Radius=fov;
        return a;
    end;  
    local fovc = createcircle();
    spawn(function()
        RunService:BindToRenderStep("FovCircle",1,function()
            fovc.Position = Vector2.new(mouse.X,mouse.Y)
        end);
    end);
end;

function isFfa()
    local am = #Players:GetChildren();
    local amm = 0;
    for i , v in pairs(Players:GetChildren()) do
        if v.Team == LocalPlayer.Team then
            amm = amm + 1;
        end;
    end;
    return am == amm;
end;
function getnearest()
    local nearestmagnitude = math.huge
    local nearestenemy = nil
    local vector = nil
    local ffa = isFfa();
    for i,v in next, Players:GetChildren() do
        if ffa == false and v.Team ~= LocalPlayer.Team or ffa == true then
            if v.Character and  v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 then
                local vector, onScreen = Camera:WorldToScreenPoint(v.Character["HumanoidRootPart"].Position)
                if onScreen then
                    local ray = Ray.new(
                        Camera.CFrame.p,
                        (v.Character["Head"].Position-Camera.CFrame.p).unit*500
                    )
                    local ignore = {
                        LocalPlayer.Character,```
final iron
slate swan
supple thorn
#

this is a troll

slate swan
supple thorn
#

<@&831776746206265384>

maiden fable
#

Thanks

slate swan
#

not even funny

supple thorn
#

he's literally just spamming chat

slate swan
#

i thought it was python sorry dont ban

slate swan
#

i started coding 30 minutes ago

#

im new sorry

#

a new troll?

visual yarrow
#

!mute 676977528463949856 Trolling and off-topic

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1649211806:f> (59 minutes and 59 seconds).

final iron
slate swan
#

thanks LX

feral lichen
#

fuck sakes that dude was cancerous

supple thorn
#

yeah of course you mistook 3 different languages as python

maiden fable
slate swan
#

mina is lurking😳

final iron
#

πŸ—Ώ

maiden fable
#

Since CokeCane pinged all the mods, soooo

final iron
final iron
#

Forget pep8, pep 9001 is my homie

slate swan
unkempt canyonBOT
final iron
slate swan
visual yarrow
#

Alright, let's get this channel back on track...

slate swan
#

thanksAG_MochaThumbsUp

maiden fable
#

Bro

#

Wait what? That isn't really possible

supple thorn
maiden fable
#

Nvm it is

supple thorn
#

jewish people?

vocal snow
#

Huh

slate swan
#

just delete the whole command at this point

supple thorn
#

we can't really help at this point

#

you just got fucked

feral lichen
#

sounds like he has a... fetish?

supple thorn
#

it's like getting your base found in 2b2t

feral lichen
#

πŸ’€

supple thorn
#

send in dms

#

πŸ—Ώ

daring olive
supple thorn
#

hello Mina

final iron
#

<@&831776746206265384>

#

He probably the alt of the guy that yall just muted.

frozen patio
#
AttributeError: module 'discord' has no attribute 'Permissions'```

What is this & how do I fix this?
daring olive
#

!mute 867932248438104074 incident_investigating

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @limpid ocean until <t:1649212558:f> (59 minutes and 59 seconds).

daring olive
#

!clean 867932248438104074

unkempt canyonBOT
#
Bad argument

Missing cleaning limit.

sick birch
#

Lot of trolls here today

final iron
#

!d discord.Permissions

unkempt canyonBOT
#

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

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

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

It should exist

frozen patio
#

I am using nextcord

final iron
#

Then why are you using discord.Permissions? Shouldn't you be using nextcord.Permissions?

frozen patio
#
import os 
from quart import Quart, render_template, redirect, url_for
from quart_discord import DiscordOAuth2Session, requires_authorization, Unauthorized
from nextcord.ext import ipc 
import nextcord

app = Quart(__name__) #

app.secret_key = b'subscribe'
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "true"

app.conig["DISCORD_CLIENT_ID"] = 961029967410520124
app.config["DISCORD_CLIENT_SECRET"] = "SECRET"
app.config["DISCORD_REDIRECT_URI"] = "http://127.0.0.1:5000/callback"
app.config["DISCORD_BOT_TOKEN"] = "  TOKEN"

nextcord = DiscordOAuth2Session(app)

@app.route("/login/")
async def login():
    return await nextcord.create_session()

@app.event("/callback/")
async def callback():
    try:
        await nextcord.callback()
    except:
        return redirect(url_for("login"))

    return redirect(url_for("dashboard"))

@app.route("/")
async def index():
    return await render_template("index.html")

@app.route("/dashboard/")
async def dashboard():
    user = await nextcord.fetch_user()
    return await render_template("dashboard.html", user=user)

if __name__ == "__main__":
    app.run(debug=True)
frozen patio
#

in this code it does not

final iron
sick birch
frozen patio
sick birch
#

Perhaps not the best idea

frozen patio
# final iron Send the full traceback
Traceback (most recent call last):
  File "c:\Users\Student\Desktop\Dashboard-Bot\dashboard.py", line 3, in <module>
    from quart_discord import DiscordOAuth2Session, requires_authorization, Unauthorized
  File "C:\Users\Student\AppData\Local\Programs\Python\Python310\lib\site-packages\quart_discord\__init__.py", line 4, in <module>
    from .client import DiscordOAuth2Session
  File "C:\Users\Student\AppData\Local\Programs\Python\Python310\lib\site-packages\quart_discord\client.py", line 11, in <module>
    class DiscordOAuth2Session(_http.DiscordOAuth2HttpClient):
  File "C:\Users\Student\AppData\Local\Programs\Python\Python310\lib\site-packages\quart_discord\client.py", line 65, in DiscordOAuth2Session

    permissions: typing.Union[discord.Permissions, int] = 0, **params
AttributeError: module 'discord' has no attribute 'Permissions'
PS C:\Users\Student\Desktop\Dashboard-Bot>
sick birch
#

I mean, I thought the same thing but for my dashboard I decided to seperate it

final iron
frozen patio
#

Yeah I best try that

frozen patio
#

I cannot import ipc from nextcord

final iron
#

Error?

frozen patio
# final iron Error?
PS C:\Users\Student\Desktop\Dashboard-Bot> & C:/Users/Student/AppData/Local/Programs/Python/Python310/python.exe c:/Users/Student/Desktop/Dashboard-Bot/dashboard.py
C:\Users\Student\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\health_check.py:20: DistributionWarning: discord.py is installed which is incompatible with nextcord. Please remove this library by using `pip3 uninstall discord.py`
  warn(message, DistributionWarning, stacklevel=0)
Traceback (most recent call last):
  File "c:\Users\Student\Desktop\Dashboard-Bot\dashboard.py", line 4, in <module>
    from nextcord.ext import Ipc
ImportError: cannot import name 'Ipc' from 'nextcord.ext' (unknown location)
final iron
#

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

#

Oh

#
DistributionWarning: discord.py is installed which is incompatible with nextcord. Please remove this library by using `pip3 uninstall discord.py`
#

You might have an issue since discord_quart uses discord.py but discord.py can't be installed along side with nextcord

frozen patio
#

Hmm

#

Does nextcord-quart exist?

sick birch
#

Do you really need them to be in the same application?

frozen patio
#

Yeah

final iron
sick birch
#

Perhaps. Best to consider it strongly as a design choice before moving forward

frozen patio
#

And still run all my code?

final iron
#

Just test it out

frozen patio
#

Well I will see

final iron
#

See what breaks and we'll see if we can fix it

frozen patio
#

Ok thanks!

sick birch
#

For a bot me and a few others are working on

#

Still a heavy WIP

#

Written using next.js and tailwindcss :)

supple thorn
#

i should learn js

#

i actually did want to learn js before python

sick birch
#

well

#

js kind of sucks

supple thorn
#

but it seemed overwhelming when i learned that i needed to also learn html and css while also learning js

sick birch
#

ts is much better

supple thorn
sick birch
#

And often you won't be writing raw css

#

You'd be using libraries like material ui, tailwind, or bootstrap

supple thorn
#

wanted to learn node.js to see what discord.js feels like

sick birch
#

Tried discord.js, it feels much more intuitive

#

But d.py has more features

supple thorn
#

but stopped when i learned that i needed js experience

#

πŸ—Ώ

sick birch
#

Once you become experienced in one language, similar languages come pretty easily

supple thorn
#

picked the wrong language to first learn

sick birch
#

You seem pretty experienced in Python. I believe that you can pick up js very easily since both python and js are similar

supple thorn
#

you got any resources you recommend?

#

my brother is a web designer so that's a plus since i can just ask him to help me if i don't understand something

boreal ravine
#

learn node

supple thorn
#

all failed when i didn't js

slate swan
#

i wanna learn cpp

sick birch
#

Try replicating one of your existing bots using discord.js. It's an excellent way to learn

supple thorn
#

oh god

sick birch
supple thorn
#

okay

sick birch
#
client.on("message", (message) => {});
#

See?

#

With being more intuitive the tradeoffs is less functionality

slate swan
sick birch
#

Yes. Javascript event emitters are basically the gold standard when it comes to event-based, so no surprise rin's implementation looks similar

supple thorn
slate swan
#

but andy kept the original gateway event name

sick birch
#

You will :)

final iron
supple thorn
#

i know it's maybe listening on a event message

sick birch
#

Eyup

final iron
#

So in discord.js they don't use decorators?

#

They have their own thing?

sick birch
#

No. Python has to use a hacky way to get it to achieve the same effect

supple thorn
#

does decos even exist in js?

pliant gulch
slate swan
sick birch
sick birch
#

More like python has its own thing rather than js

sick birch
#

Not in the sense you might think

daring olive
pliant gulch
#

Not really a hacky way, just a different way

pliant gulch
#

Javascript directly uses a function to subscribe a callback to an event

slate swan
#

semi colons are good for one liners!

sick birch
final iron
#

Just write all your code in 1 line like a chad

pliant gulch
sick birch
#

If you think about it, decorators in Python weren't really meant for calling events. Event emitters, on the other hand, are made exactly for that. The problem with event emitters is that we don't have as much customizability, like checks

pliant gulch
#

Well, decorators are low-level enough compared to other things in this higher level language

sick birch
#

Yep. It does its job very well, albeit still wasn't made for that purpose

supple thorn
#

what exactly is node.js

pliant gulch
#

Why does it need to be specifically designed to subscribe

sick birch
pliant gulch
#

It's low-level, it can pretty much do anything

pliant gulch
#

It's just a sugar anyways

sick birch
#

You think it would be good to also be able to dispatch events yourself?

supple thorn
#

also robin

#

can i dm you if i need js help

sick birch
#

Absolutely

supple thorn
#

just like questions

#

okay

pliant gulch
#

If the library gives control for that, yes 100% without a doubt

sick birch
#

Perhaps it's own thing maybe. EventDispatcher or something

pliant gulch
#

This allows for custom objects without monkey patching

sick birch
#

Off the top of my head I can't really think of a use case

pliant gulch
slate swan
supple thorn
#

how different is node.js to normal javascript

slate swan
pliant gulch
slate swan
sick birch
supple thorn
#

i see

sick birch
#

Also you can't use fetch()

#

And a bunch of other stuff

#

One of the things I really don't like when a language runs both backend and frontend. If you're using a framework, it can be hard to tell where a specific piece of code is running

pliant gulch
#

Mostly just javascript lmao

sick birch
#

Fair point

slate swan
#

sup

pliant gulch
#

New framework for javascript comes out like every other week

slate swan
#

finally unmuted

sick birch
#

More like every hour

pliant gulch
#

Then an old framework gets deprecated

sick birch
#

We have some gold standards that've been around for a while

supple thorn
sick birch
#

Best to let the dust settle after a new framework comes out and see where it goes

slate swan
pliant gulch
slate swan
#

nah im fwy

final iron
sick birch
slate swan
sick birch
#

Let's not start this again please

supple thorn
slate swan
supple thorn
slate swan
#

a promise im js bro

supple thorn
#

that memory comes rushing back

slate swan
#

🀨

#

how do u become voice verified

sick birch
#

JS promises are cool, they're like coros but you can run them in regular functions too

slate swan
#

wrong chat

pliant gulch
#

In python we don't need promises because we have the async/await syntax kek

sick birch
#

Though honestly feeling like js async makes it feel more sync. Default js feels very async

supple thorn
#

promises are awaits?

slate swan
slate swan
pliant gulch
#

You can.

sick birch
#

Which I personally do love

slate swan
pliant gulch
sick birch
pliant gulch
supple thorn
#

how do promises look like in js

sick birch
#

You have 2 ways of dealing with "coros":

await promise()

or:

promise()
  .then(() => {}) // Success
  .catch((e) => {}) // Failure
  .then(() => {}); // Always

or

coros()
slate swan
#

they stole our await syntax😑

sick birch
#

When it comes to discord bots, this is very interesting:

client.on("message", (message) => {

}):

AND

client.on("message", async (message) => {

});
supple thorn
#

the first one is really similiar

sick birch
#

Quite

slate swan
#

😳

#
@bot.command()
@has_any_role('Franchise Owner')
async def promote(ctx, user: discord.Member):
    guild = ctx.guild
    HC = discord.utils.get(guild.roles, name="Head Coach")
    await user.add_roles(HC)
    await ctx.send("Promoted to Head Coach")
    if HC in user.roles:
      guild = ctx.guild
      GM = discord.utils.get(guild.roles, name="General Manager")
      await user.add_roles(GM)
      await ctx.send("Promoted to General Manager")```
supple thorn
sick birch
supple thorn
sick birch
#

Just wait till you compile modern ES6 async/await to older syntax without it and see the resulting code πŸ˜„

sick birch
supple thorn
#

fuck

sick birch
#
async def on_message(message):
  ...
slate swan
sick birch
#

Those are arrow functions, i.e multi line lambdas

#

Functions without names

supple thorn
final iron
sick birch
#

You get used to it after a while

supple thorn
sick birch
#

Very fun though, especially when you make it to go along with your discord bot

final iron
slate swan
sick birch
#

That's why earlier I was urging the other person to reconsider using quart to put both the dashboard and their bot in the same application

final iron
sick birch
#

Often times you won't need a live websocket connection to your dashboard

slate swan
supple thorn
#

guess that'll be my goal for now

sick birch
#

Quite similar to the other ones isn't it?

slate swan
#

i want it to do !Promote then give HC role

#

then !promote and take away HC role then give GM

supple thorn
slate swan
#

but idk

flat solstice
#

Anyone got the disnake server invite? Thought I was in the server but seems not

pliant gulch
#

Then you later find out javascript classes are just dict's with no boilerplate

supple thorn
#

i can see the similarity

slate swan
daring olive
#

#jinx

supple thorn
#

faster than mina

daring olive
#

lol i show up first on my end

supple thorn
#

πŸ‘€

flat solstice
daring olive
#

!sf 961092294554042378 961092293513871380

unkempt canyonBOT
#
Snowflakes

961092294554042378
Created at 2022-04-06 02:37:39.253000+00:00 (<t:1649212659:R>).

961092293513871380
Created at 2022-04-06 02:37:39.005000+00:00 (<t:1649212659:R>).

slate swan
daring olive
#

yeah you beat me

supple thorn
#

haha

pliant gulch
#

Yea I am

slate swan
#

Oh

final iron
slate swan
#

ay

midnight gorge
#

How do I install this module:

motor.motor_asyncio

#

?

sick birch
#

!pypi motor

unkempt canyonBOT
slate swan
#

Motor kind of sucks, it's unfortunate you have to use it

rancid escarp
#

Can someone help me with how i can mention a channel in an embed on to another channel?

unkempt canyonBOT
sick birch
midnight gorge
#

ty

#

what about pymongo.mongo_replica_set_client?

slate swan
#

Lol Motor is literally an async ready version of pymongo

#

Why are you using the latter

slate swan
boreal ravine
lucid vine
#

any idea how i make this keep updating because rn it doesnt update unless i restart the bot

rancid escarp
azure scroll
#

is there something like ctx.guild.member_count that does not count bots?
basically returns the number of users

lucid vine
#

what

supple thorn
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
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").
daring olive
#

do discord slash commands support aliasing at all?

slate swan
slate swan
slate swan
#

You can rename a command using

#

!d discord.app_commands.describe

unkempt canyonBOT
#

@discord.app_commands.describe(**parameters)```
Describes the given parameters by their name using the key of the keyword argument as the name.

Example:

```py
@app_commands.command()
@app_commands.describe(member='the member to ban')
async def ban(interaction: discord.Interaction, member: discord.Member):
    await interaction.response.send_message(f'Banned {member}')
slate swan
#

But I don't think that's what you're after.

daring olive
#

yeah just playing around with some other big servers with slash commands and was thinking ...... i like aliases

slate swan
#

I can ask in the official server

#

Well yeah there are no plans to support aliases for app commands.

tired hinge
#
@bot.command(name="duck")
@commands.cooldown(1, 5, commands.BucketType.user)
async def duck(ctx):
    e = discord.Embed(title="Looking for a duckie in the wild...")
    m = await ctx.send(embed=e)
    r = requests.get(url = os.getenv("DUCK_URL")).json()
    em = discord.Embed(title="Found one!", color=discord.Colour(0x2de230))
    em.set_footer(text="Powered by random-d.uk")
    em.set_image(url=r['url'])
    await m.edit(embed=em)

for some reason, it ends up sending the embed twice.

#

also, requests is not asynchronous amiright?

boreal ravine
tired hinge
#

so its blocking?

boreal ravine
boreal ravine
tired hinge
tired hinge
vale wing
unkempt canyonBOT
tired hinge
tired hinge
dull sorrel
#

Is there any command to detect if a user has become online?

supple thorn
#

!d discord.on_member_update

unkempt canyonBOT
#

discord.on_member_update(before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") updates their profile.

This is called when one or more of the following things change:

β€’ nickname

β€’ roles

β€’ pending...
zinc phoenix
#

How do I get the id of the member that has left the server for my bot

#

Oh nvm I have changed from leave to remove, it works now

supple thorn
#

of the member

#

!d discord.Member.status

unkempt canyonBOT
#

property status```
The member’s overall status. If the value is unknown, then it will be a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") instead.
slate swan
#

then you can use client.loop.create_task(statuschange())

#

in a event

hybrid mural
#

For some reason my bot cannot join discord voice channels although it has ffmpeg, pynacl and opus as libraries (the server it is hosted on is ubuntu 18.04)

slate swan
hybrid mural
vale wing
hybrid mural
vale wing
#

!d discord.on_presence_update

unkempt canyonBOT
#

discord.on_presence_update(before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") updates their presence.

This is called when one or more of the following things change:

β€’ status

β€’ activity

This requires [`Intents.presences`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.presences "discord.Intents.presences") and [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled...
slate swan
hybrid mural
#

yeah yeah intents activated its working on my pc but not on the server though

lucid vine
vale wing
#

Why yall like providing misinformation

#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
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").
slate swan
#

I used this 1 min

#
@client.event
async def statuschange():
    await client.wait_until_ready()
    while True:
        await client.change_presence(activity = discord.Activity (type = discord.ActivityType.watching, name = f"{len(client.guilds)} servers  {len(set(client.get_all_members()))} Members| .help for commands"))
        await asyncio.sleep(25)
        await client.change_presence(activity = discord.Activity (type = discord.ActivityType.listening, name = "anything"))
        await asyncio.sleep(10)
        await client.change_presence(activity = discord.Activity (type = discord.ActivityType.playing, name = "Minecraft"))
        await asyncio.sleep(10)

@client.event
async def on_ready():
    await statuschange()
    client.loop.create_task(statuschange())
vale wing
#

No

slate swan
#

worked for me last year, idk if things changed

vale wing
slate swan
#

I don't need it

hybrid mural
#

im dumb i forgot on_command_error is for all errors hence how i couldnt see an error handler

#

Weird is i have PyNaCl

manic wing
hybrid mural
#

whats the pip command for it

#

pip install PyNaCl?

manic wing
#

yes, but bearing in mind you could have multiple python versions leading to a clusterfuck

hybrid mural
#

i do have multiple python versions

#

but installing libraries just downloads it somewhere else i always move it back to the bot folder

manic wing
#

you what

#

thats not how python modules work

#

this isn’t js, we don’t put modules in a dir in the project

hybrid mural
#

i have to

#

i cant use the python 3.6 standard given to me since i need 3.8+

hybrid mural
#

so i seperately install python3.10.4 and run it through there

manic wing
#

cant lie you’ve gotten to the point where it all goes sideways

hybrid mural
#

sacrifices must be made

#

and that sacrifice is my mental wellbeing so yes you are right xd

barren oxide
#

hey guys

#

today i will make a disscord bot

vale wing
supple thorn
#

Just now learned

boreal ravine
tired hinge
placid skiff
#

And then there is me who is going crazy to make a discord bot to play poker D_D

tired hinge
#

when does commandInvokeError get raised?

vale wing
#

Have you checked docs about it

placid skiff
#

!d discord.ext.commands.CommandInvokeError

unkempt canyonBOT
#

exception discord.ext.commands.CommandInvokeError(e)```
Exception raised when the command being invoked raised an exception.

This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError")
tired hinge
#

ty ty ty

#

i was a little confused.

little ivy
#

anybody knows why this wont work?

honest shoal
little ivy
#

Thanks lmfao

#

Such a dumb mistake, im blind i think

tired hinge
#

does discord.Member.avatar return a URL?

hybrid mural
#

PyNaCl library needed in order to use voice

tired hinge
#

if not, how do i get it?

hybrid mural
hybrid mural
#

!d discord.Asset

unkempt canyonBOT
#

class discord.Asset```
Represents a CDN asset on Discord.

str(x) Returns the URL of the CDN asset.

len(x) Returns the length of the CDN asset’s URL.

x == y Checks if the asset is equal to another asset.

x != y Checks if the asset is not equal to another asset.

hash(x) Returns the hash of the asset.
hybrid mural
#

!d discord.User.avatar

unkempt canyonBOT
#

property avatar```
Returns an [`Asset`](https://discordpy.readthedocs.io/en/master/api.html#discord.Asset "discord.Asset") for the avatar the user has.

If the user does not have a traditional avatar, `None` is returned. If you want the avatar that a user has displayed, consider [`display_avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.display_avatar "discord.User.display_avatar").
tired hinge
#

ty!

vale wing
#

Better use display_avatar

somber sky
#

how come this returns nothing but also no errors

#

but this does reutrn

slate swan
slate swan
hybrid mural
#

Hello ashley

#

active as ever

slate swan
#

hi totoro

supple thorn
#

Hello ashley

hybrid mural
#

Btw i finally managed to get my bot on a hosted server with a db and all included πŸ™‚

slate swan
hybrid mural
#

300mbit/s upload good enough?

slate swan
hybrid mural
supple thorn
slate swan
hybrid mural
#

what

#

whats an offline class

slate swan
#

smh

supple thorn
#

Lmao

#

πŸ—Ώ

hybrid mural
#

??????

#

who uses the term offline class tf

slate swan
hybrid mural
#

nahhhhh

slate swan
#

well

hybrid mural
#

here in europe we use the term e-learning and normal class

#

not offline πŸ’€

quick gust
somber sky
hybrid mural
somber sky
#

ty

spring flax
slate swan
hybrid mural
#

bruh austrians are special then ig

slate swan
somber sky
#

the command legit does nothing

slate swan
somber sky
#

but the other one which is basically the same thing but opposite works perfectly fine

hybrid mural
spring flax
#

Send it

slate swan
spring flax
#

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

somber sky
spring flax
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.

spring flax
#

Don't send screenshots

#

It's harder to read them

somber sky
spring flax
#

oh my

somber sky
#

i have another codee just like it that works perfectly fine

#

thats why im so confused

#

and theres 0 errors

#

it just does nothing

spring flax
#

do you have an error handler?

somber sky
#

no

slate swan
spring flax
#

what is, for examplem Team_21ID?

supple thorn
#

What the fuck is that

somber sky
#
Team_1ID =(949781381553197096)```
#

oh 21

#
Team_22ID =(424242424242424248)```
#

i cant fucking type

spring flax
somber sky
#

its not a real id.

#

i put an id for certain roles

#

role 1 which is what i was using has a real id;

supple thorn
slate swan
#

32 get_roles

supple thorn
#

Lmao

spring flax
#

36*

slate swan
#

is that even a good thing to do....

#

cruel

supple thorn
#

How would you do that

#

Doesn't any just check if something is true in a iterable

#

How would you know what role was in their roles

slate swan
junior verge
#

How does this happen? lol

spring flax
slate swan
junior verge
spring flax
#

no it responded with the ping

slate swan
slate swan
junior verge
#
from discord.commands import(slash_command)
from discord.ext import commands


class Ping(commands.Cog):

    def __init__(self, client):
        self.client = client
    
    @commands.Cog.listener()
    async def on_ready(self):
        print(f"{self.__class__.__name__} Cog has been loaded\n-----")

    @slash_command(name="ping", description="Returns the latency of the bot",guild_ids=[867086205182017536])
    async def ping(self, ctx):
        message = await ctx.send("Pong!")
        await message.edit(content = f"Pong! **{round(self.client.latency * 1000)}**ms")    

def setup(client):
    client.add_cog(Ping(client))
tired hinge
#
class SubclassedHelp(commands.MinimalHelpCommand):
    async def send_pages(self):
        destination = self.get_destination()
        for page in self.paginator.pages:
            emby = discord.Embed(description=page, colour=0xf2cafa)
            await destination.send(embed=emby)
    
    async def send_error_message(self, error):
        embed = discord.Embed(title="Error, that command does not exist.", value=error)
        channel = self.get_destination()
        await channel.send(embed=embed)
)

i found this code in one of my old bots, but i don't seem to remember how this works. does anybody mind explaining?

spring flax
#

do the slash command again, see if it errors again

junior verge
#

Trying to use pycord

junior verge
slate swan
#

u dont have any response msg ig

supple thorn
junior verge
slate swan
#

i have use views

slate swan
slate swan
supple thorn
#

I was staring at it for a solid 3 minutes

slate swan
junior verge
#

So what then?

supple thorn
#

Thinking of ways how any could improve the code

slate swan
junior verge
#

Trying it on another command now getting this error

junior verge
#

oh

junior verge
junior verge
hybrid mural
#

how to delete all messages from chat?

#

or better to say i just need to get all the messages in a chat

#

is that even possible

slate swan
hybrid mural
#

just let the peasants delete it for themselves

supple thorn
#

Shit damn i might still think about this problem while i sleep again

slate swan
supple thorn
slate swan
#

dont deny thats its fun nor do i accept it

supple thorn
#

Like have every id in a list

#

And use a for loop to loop through them

slate swan
supple thorn
#

Would that work and be better though

slate swan
supple thorn
#

But would this idea work

slate swan
supple thorn
#

I don't want to sleep without solving this

#

Hi Blvck

placid skiff
#

!e

lst1 = ["a", "b", "c", "d"]
lst2 = ["a", "a", "a"]

print(any(char == "a" for char in lst1))
print(all(char == "a" for char in lst2))
unkempt canyonBOT
#

@placid skiff :white_check_mark: Your eval job has completed with return code 0.

001 | True
002 | True
slate swan
#

nvm bai bai

#

have a good sleep

supple thorn
#

I can sleep today

somber sky
#

how do i make a command where you set a logs channel. and everytime u run a command the command message sends to the log

somber sky
#

idk how to explain it but yea

supple thorn
#

God i can't look at it and not want to help

somber sky
#

lol sure

placid coyote
#

!e

unkempt canyonBOT
#
Missing required argument

code

placid coyote
#

!e print("lol")

unkempt canyonBOT
#

@placid coyote :white_check_mark: Your eval job has completed with return code 0.

lol
supple thorn
hybrid mural
#

how would i make it so the bot server mutes itself?

#

in voice channel

tired hinge
#
r = requests.get(url = "so and so").json()
em.set_image(url=r.url)
await m.edit(embed=em)

this sends the embed before the url has been retrieved. any way i can send the message only after the url is retrieved?

unkempt canyonBOT
#

property me```
Similar to [`Client.user`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.user "discord.Client.user") except an instance of [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member"). This is essentially used to get the member version of yourself.
maiden fable
#

!d discord.Member.edit

unkempt canyonBOT
#

await edit(*, nick=..., mute=..., deafen=..., suppress=..., roles=..., voice_channel=..., timed_out_until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the member’s data.

Depending on the parameter passed, this requires different permissions listed below...
maiden fable
#

mute=True

spring flax
#

It's blocking

spring flax
#

Consider this

tired hinge
spring flax
#

!d aiohttp

unkempt canyonBOT
#

Common data structures used by aiohttp internally...

tired hinge
#

but will switching to aiohttp solve the problem?

spring flax
#

Ah

tired hinge
#

the problem is, it sends the embed before it has the url

#

so the embed is empty and after a few seconds it updates

spring flax
#

Code?

#

Full thing

tired hinge
#

alr heres the full code

#
async def cat(self, ctx, *, caption:str = None):
       
        e = discord.Embed(title="Looking for a cat...")
        m = await ctx.send(embed=e)
        em = discord.Embed(title="Found one!", color=discord.Colour(0x2de230))
        if caption:
            r = requests.get(url=f"{os.getenv('CAT_CAPTION_URL')}/{caption}", params={"json":"true"}).json()
        else:
            r = requests.get(url = os.getenv("CAT_URL"), params={"json":"true"}).json()
        em.set_image(url=os.getenv("CAT_DOMAIN")+r['url'])
        em.set_footer(text="Powered by cataas.com")
        await m.edit(embed=em)
spring flax
#

You aren't using r anywhere

junior verge
#
from discord.commands import(slash_command)
from discord.ext import commands


class Ping(commands.Cog):

    def __init__(self, client):
        self.client = client
    
    @commands.Cog.listener()
    async def on_ready(self):
        print(f"{self.__class__.__name__} Cog has been loaded\n-----")

    @slash_command(name="ping", description="Returns the latency of the bot",guild_ids=[867086205182017536])
    async def ping(self, ctx):
        message = await ctx.respond("Pong!")
        await message.edit(content = f"Pong! **{round(self.client.latency * 1000)}**ms")    

def setup(client):
    client.add_cog(Ping(client))
tired hinge
spring flax
#

The variable r

junior verge
#

Let me try

junior verge
tired hinge
# spring flax The variable r

...i don't understand what you mean. r is what requests.get returns, which is the json response which includes the url. i am accessing it using r['url']

paper sluice
#

then try message.response.edit_message

spring flax
#

The e or em?

tired hinge
#

it is empty for a few seconds THEN adds the image. this suggests that the embed is being sent before the response is received?

slate swan
#

thats because the API sends an image response only after the image url is sent

paper sluice
junior verge
#

I just use 1 command

paper sluice
#

ah, i didnt notice u were not using dpy 2.0

#

mb

slate swan
# tired hinge elaborate?

the image is set inside the embed using its url, but it takes some time for discord to load the image...

unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'discord'
tired hinge
slate swan
junior verge
tired hinge
slate swan
#

!d discord.on_message_edit takes 2 args

unkempt canyonBOT
#

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

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

The following non-exhaustive cases trigger this event...
junior verge
slate swan
#

before.content

junior verge
slate swan
#

is how it should be done

#

yesir

#

before&after there are discord.Message objects

final iron
#

before is your instance of the discord.Message class

#

!d discord.on_message_edit

unkempt canyonBOT
#

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

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

The following non-exhaustive cases trigger this event...
final iron
#

It takes before and after

#

Mhm

#

?

slate swan
final iron
#

Send your code

#

And the error

slate swan
#

bro its clear

#

the event only takes 2 arguments

#

which before and after are message objects and hes adding a third message object

final iron
#

Yeah I know...

slate swan
final iron
#

Already told you, remove message

#

@slate swan he's yours πŸƒ

slate swan
#

i gotta go to school

final iron
#

Same

final iron
#

Damn your school starts late

slate swan
#

then you yes

cold sonnet
#

async def on_message_edit(before, after)

slate swan
#
Traceback (most recent call last):
  File "C:\Users\rebellion\AppData\Roaming\Python\Python38\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(args, **kwargs)
  File "C:\Users\rebellion\Documents\Development\Discord\Selfbots\chapter\cogs\admin.py", line 19, in ban
    if member.top_role >= ctx.guild.me.top_role:
AttributeError: 'NoneType' object has no attribute 'top_role'

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

Traceback (most recent call last):
  File "C:\Users\rebellion\AppData\Roaming\Python\Python38\site-packages\discord\ext\commands\bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\rebellion\AppData\Roaming\Python\Python38\site-packages\discord\ext\commands\core.py", line 850, in invoke
    await injected(ctx.args, **ctx.kwargs)
  File "C:\Users\rebellion\AppData\Roaming\Python\Python38\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: AttributeError: 'NoneType' object has no attribute 'top_role'
#

code: ```py
@commands.command(aliases=['deport, b, yeet'])
async def ban(self, ctx, member: discord.Member = None, *, reason: str = "no reason provided"):
await ctx.message.delete()
if member is None:
await ctx.send("missing arguments", delete_after=2.5)
if member.top_role >= ctx.guild.me.top_role:
await ctx.send("i can't ban someone above my top role", delete_after=2.5)
await member.ban(reason=f"{str(ctx.author)}({ctx.author.id}) | {reason}")
await ctx.send(f"{member} has been banned πŸ‘", delete_after=5)

#

it dont make any sense

magic ore
#

You don't return/ensure that member isn't None after you send the nesssage

#

You can also not set a default for the argument and use an error handler instead

vale wing
#

Use an error handler for missing arguments message

slate swan
#

nah cus i have a different message for most things if there is an error

#

i also have a global message handler tho, but i barely use it

vale wing
#

Local error handler

#

!d discord.ext.commands.Command.error

unkempt canyonBOT
#

@error```
A decorator that registers a coroutine as a local error handler.

A local error handler is an [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") event limited to a single command. However, the [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") is still invoked afterwards as the catch-all.

Changed in version 2.0: `coro` parameter is now positional-only.
slate swan
#

ok fixed it tho, thanks

vale wing
#

But as for this command you need to add return statement in case the member is None

#

Your current one sends the "error message" and continues the command execution

hoary cargo
#

CatAwk why people don't use return at all

slate swan
#

hey, how can I get the roles from other server?

cold sonnet
#

get roles from member.guild.roles

#

not member.roles

#

also, logically, the guy won't have any roles when joining a server

#

maybe you did some special stuff there

slate swan
muted quarry
#
@client.command()
async def roll(ctx):
        """Roll some die"""
        await ctx.send(embed=discord.Embed(title="**You rolled a {}! 🎲**".format(random.randint(1, 6)), color=0x104E8B))```

I want it to ping the person who requested the command in the embed
But it keeps giving me an error
#

Example @wumpus you rolled a 5

hoary cargo
#

CatAwk so we need to guess the error for you or what

slate swan
#

does anyone know a website I can put my bot faq in

muted quarry
#

@hoary cargo

narrow grail
#

How to check if someone used a command to edit a certain message from an other command?

hoary cargo
#

Traceback

slate swan
#

uhh so im trying to get my discord bot on heroku but it doesnt work

#

https://hypixel.net/||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​|| https://i.e-z.host/β€‹β€‹β€β€‹β€Œβ β€Œβ€Œβ€‹β β€β€β€β β€‹β€Œβ€β€‹β β β€β€‹β€β€Œβ β€β€β β€‹β β€‹

hypixel.net image host!
#

any reasons why?

placid skiff
muted quarry
# hoary cargo Traceback

await ctx.send(embed=discord.Embed(title=f"{ctx.message_author}You rolled a {}! 🎲".format(random.randint(1, 6)), color=0x104E8B))
^
SyntaxError: f-string: empty expression not allowed

muted quarry
placid skiff
unkempt canyonBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

placid skiff
slate swan
muted quarry
#

I used

#

format (random)

slate swan
#

f strings are a thing

muted quarry
#

@slate swan

hoary cargo
placid skiff
muted quarry
placid skiff
#

please learn python before moving on d.py or any other oop based package

slate swan
#
~ $ python main.py
Traceback (most recent call last):
  File "/app/main.py", line 10, in <module>
    bot = commands.Bot(command_prefix='+')
TypeError: BotBase.__init__() missing 1 required keyword-only argument: 'intents'```
#

is this just a heroku issue or is it me?

#

nvm you did but you cant use format and f strings in the same string lol

hoary cargo
#
a = random.randint(1, 6)
print(f'your number is {a}')
placid skiff
slate swan
placid skiff
slate swan
hoary cargo
slate swan
#

^

#

u can fetch the member's ID and then do <@ID>

slate swan
#

just a mention

muted quarry
hoary cargo
#

so you may want to mention it after or before you send the embed

slate swan
#

<@fetchedid>

hoary cargo
slate swan
muted quarry
narrow grail
#

how to make command where you can write some content after it for example -test [member]?

slate swan
#

since the member isnt in the guild

placid skiff
slate swan
#

yeah in titles you cant format anything

hoary cargo
slate swan
#

!d discord.Member

unkempt canyonBOT
#

class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").

This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").

x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

hash(x) Returns the member’s hash.

str(x) Returns the member’s name with the discriminator.
narrow grail
slate swan
# narrow grail hm so what to do?

member: discord.Member here member is an argument that is expected to be a Member obj which dpy converts the string in to a member obj

placid skiff
#

will try to convert*

slate swan
#

yes

placid skiff
#

and it will be done through bot cache

slate swan
#

yes

hoary cargo
#

CatShake getch

placid skiff
slate swan
hoary cargo
#

ciudat me when i see .format in someone's code

placid skiff
tough lance
#

Lol

#

Just gives away that the code is copy pasted

slate swan
#

😳

hoary cargo
#

πŸ—Ώ damn

placid skiff
#

and after all of that they tells you that they are using replit or heroku

hoary cargo
#

The " i'm new to this guys" starter pack

slate swan
#

"so i can host my bot 24/7"

junior verge
#

any way to stop this xd

hoary cargo
#

did you defer it ?

junior verge
#

What's defer? Sorry

hoary cargo
#

ciudat so you didn't

junior verge
#

I'm not English

slate swan
#

im stuck on disnakes docs

hoary cargo
#

πŸ—Ώ

slate swan
#

bro

junior verge
#

I am not using disnake

tough lance
#

What're you using then

junior verge
#

Pycord

slate swan
hoary cargo
#

!d disnake.InteractionResponse.defer

unkempt canyonBOT
#

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

Defers the interaction response.

This is typically used when the interaction is acknowledged and a secondary action will be done later.
tough lance
slate swan
junior verge
#

Disnake..

slate swan
#

pycordAG_WorrySadge

junior verge
#

I am not using that

junior verge
slate swan
#

what

junior verge
#

So how do I stop that rn it's still going

hoary cargo
#

maybe show some code πŸ—Ώ

junior verge
#

Sure.

#

!Paste

#

Getting this error

#

Someone tried explaining me on how to add reactions in pycord but I don't get it at all

tough lance
#

Try reading the pycord docs for how to get the message

hushed galleon
#

according to their docs ApplicationContext wraps the Interaction

junior verge
junior verge
hushed galleon
#

.original_message() is a method of Interaction, and the ApplicationContext has a .interaction attribute

junior verge
#

Yeah?

#
await msg.interaction.add_reaction("πŸ‡¦")
        await msg.interaction.add_reaction("πŸ‡§")
``` like this then?
tough lance
#

ctx.interaction.original_message

#

It's that simple

#

I just read this from the docs also

junior verge
tough lance
#

original_message is a coroutine

#

m = await ctx.interaction.original_message()

#

And then m.add_reaction

junior verge
#

But I already got msg = await ctx.original_message()

#
await ctx.respond(embed=e)
        msg = await ctx.original_message()
        await msg.add_reaction("πŸ‡¦")
        await msg.add_reaction("πŸ‡§")
hushed galleon
#

yeah thats the line that gave you the previous error

junior verge
#

oh

#

That's what @tough lance said

tough lance
#

Yes