#discord-bots

1 messages Β· Page 1000 of 1

final iron
#

Bro

slate swan
#

😳

final iron
#

Anyway do you want to go on a bikeride?

#

😳

junior verge
#

@final iron

final iron
#

!d discord.Role.delete

unkempt canyonBOT
#

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

Deletes the role.

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

anyone got an idea for a discord bot im bored

cloud dawn
#

well if someone were to delete that msg this would not send anything..

slate swan
#

it sent the gif after i deleted the message

#

your theorem is not true πŸ‘€

#

mine is tho

#

i just got scammed out of nitro

#

😦

slate swan
#

fuck that reminds me of when my account got hacked and the dude bought 130 dollars worth of nitro πŸ’€

#

turn on 2fa🀨

tawdry perch
#

But it's not from your money, right...?

slate swan
#

hey cyberweaponpithink

tawdry perch
#

Hello

slate swan
#

long time no see

tawdry perch
#

I just randomly lurk here, most of time nothing too interesting to say here

slate swan
#

lol

tawdry perch
slate swan
#

managed to claim a year and a motnh of nitro before the dude and get my 130 back

#

so i got a year and a month of free nitro because the scammer was a bit stupid

tawdry perch
#

Luckily I don't have any credit card stuff connected to my account, not like it would have any money in the first place

tawdry perch
slate swan
olive osprey
#

!d discord.Role.tags

unkempt canyonBOT
olive osprey
slate swan
#

Not sure if I’m allowed to make this joke

#

But, Import this package? Yeah I’ll import this package into your mom

#

A little python joke

#

For your entertainment

slate swan
#

πŸ’€

olive osprey
slate swan
#

Hey hey hey you heard nothing

#

Let’s say your mom is the name of my python script

#

πŸ’€

#

!pypi mom

unkempt canyonBOT
slate swan
#

LMFAOO

unkempt canyonBOT
slate swan
#

!pypi you

unkempt canyonBOT
slate swan
#

nvm

heady sluice
#

"My next dumb thing."

slate swan
slate swan
#

well i checked and it looks like content downloder from website

heady sluice
#

are you talking with yourself

slate swan
slate swan
slate swan
slate swan
slate swan
#

^ +1 πŸ’€

slate swan
#

πŸ’€

dull terrace
#

what is the module onMessage that you're trying to import

olive osprey
#

bruh

dull terrace
#

Do you know what a module is?

olive osprey
#

i doubt it

dull terrace
#

like idk if you even have anything to import called onMessage

slate swan
#

using a library for a hack command is the one of the brainliest things i've seen yet

olive osprey
#

What then why are you importing d.py tho

olive osprey
slate swan
dull terrace
#

look for some python tutorials before you try to build a bot

olive osprey
slate swan
#

yes

slate swan
olive osprey
slate swan
#

not by all tho

flint isle
dull terrace
slate swan
dull terrace
#

i think they just want us to write the code for them

slate swan
# slate swan uhuh

i mean.. i'm using it. i love it. but most of the ppl love other forks.. so.. not all :>

dull terrace
slate swan
#

nakime, u are aware of how many times i told u to learn python :") and u never listened :")

dull terrace
flint isle
slate swan
dull terrace
#

when i first started trying to make a bot, i never ever asked for someone to fix something when i didn't understand the basics of it

slate swan
dull terrace
#

i googled until i figured out what modules were and what the error meant and then tried to fix it myself, then and only then i would ask for help if i was still stuck

slate swan
#

^ +1

dull terrace
#

asking basic stuff when you've clearly done no work yourself feels kind of

slate swan
#

me too.. like googling out & finding the solution by ourselves is actuallly satisfying, as long as we're aware of what the code is doing

slate swan
slate swan
slate swan
#

me not kiddo πŸ’€ u kid

#

oh wait nvm, sorry

#

in on_command_error how would i check for a specific error like Command raised an exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)

slate swan
#

like what if the error comes from some other command in future.. and u dont get to know the reason?

#
ModuleNotFoundError: No module named β€˜onMessageβ€˜`
``` what do you understand by this line?
torn sail
#

YouTube tutorials are very outdated

slate swan
#

There are multiple commands that i have that when this error pops up means something

#

it means that nothing was found

#

in the context of the commands

#

πŸ€” makes sense

slate swan
torn sail
slate swan
west mango
#

Hey folks, has anyone here found a way to create new threads via discord.py without using cogs? It looks like the API doesnt support create-threads. It looks like pycord might support this. If so, can anyone here speak to their experience?

slate swan
# slate swan private

oh then it's fine... if you'd say that you're making a public one then i would have RECOMMENED u to mke slash instead of prefix one.. nvm

torn sail
slate swan
dense coral
#

Anyone know what the problem is?
code:

@bot.command()
async def test(ctx, message="**To create a ticket react with πŸ“¨**"):
  embed=nextcord.Embed(description=message,color=ctx.author.color)
  embed.set_author(name=f"{ctx.guild.name} Tickets", icon_url=ctx.guild.icon_url)
  view2 = ticket1()
  await ctx.send(embed=embed, view=view2)```
slate swan
# slate swan whys that?

because u won't be able to use prefix-commands in future... IF your bot gets verified.. discord is forcing all the VERIFIED BOTs to switch to slash commands

torn sail
# slate swan And how would i do this?
@commands.command()
async def command1(ctx):
    ...

@commands.command()
async def command2(ctx):
    ...

@command1.error
@command2.error
async def error_handler(ctx, error):
    ...
torn sail
torn sail
unkempt canyonBOT
#

await create_thread(*, name, message=None, auto_archive_duration=..., type=None, reason=None, invitable=True, slowmode_delay=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a thread in this text channel.

To create a public thread, you must have [`create_public_threads`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.create_public_threads "discord.Permissions.create_public_threads"). For a private thread, [`create_private_threads`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.create_private_threads "discord.Permissions.create_private_threads") is needed instead.

New in version 2.0.
slate swan
dense coral
slate swan
#

not sure... lol

#

How to make hosting 24/7?

slate swan
slate swan
#

i want the error_handler to check for this error

slate swan
torn sail
slate swan
slate swan
torn sail
slate swan
#

"Command raised an exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

#

would it be this?

torn sail
#

JSONDecodeError

slate swan
torn sail
#

only use one lib

west mango
torn sail
#

yes

slate swan
#

JSONDecodeError can happen in all of my commands

torn sail
#

then make a local error handler for each command if it changes by command

slate swan
#

If theres a way to check for the specific error, tell me it

sick birch
#

Have a global error handler and catch it there, but be careful, because if you're not, it will eat up all other errors

#

Don't follow youtube tutorials

#

And what do you mean by "hack command"?

torn sail
sick birch
#

My apologies. What are you looking for?

slate swan
#

lmao

slate swan
sick birch
#
if isintance(error, JSONDecodeError):
  ...

is this what you mean?

torn sail
#

it would be CommandInvokeError

slate swan
torn sail
#

and JsonDecodeError would be error.original

slate swan
#

hey hey hey, cant be saying that, but pillow would be the best option for adding text to images

sick birch
#

PIL can be used for that

slate swan
#

u can do it with APIs also btw

sick birch
#

Could be slower

#

APIs I mean

slate swan
#

your point being?

sick birch
#

What with the overhead

slate swan
sick birch
#

Right, and I believe PIL is blocking?

#

So it may not be completely out of the question

slate swan
#

If you wanna send that image then send the image πŸ’€

#

unless you mean you want to add text to an image then use PIL/pillow

sick birch
#

That's what we suggested

slate swan
slate swan
#

!pypi pillow

unkempt canyonBOT
slate swan
#

a python library...

sick birch
#

Image manipulation library

slate swan
dense coral
#

Not working, I do not know what the problem is
Code in DM me.

slate swan
sick birch
slate swan
dense coral
#

Ok

#

I'll check

slate swan
#

not sure what you mean

#

yes

sick birch
#

Then PIL is what you're looking for

slate swan
west mango
#

Lmk if this isn’t the best place to ask, but I just wanted to confirm my understanding that replit virtual development environments are containerized per REPL. That’s to say that if I wanted to port from discord.py -> discord.py 2.0, simply creating a new repl would help avoid dependency issues in doing so.

west mango
#

Thanks y’all, I appreciate it.

slate swan
#

no worries

dull terrace
#

Is there a tool for python that i could use for sentiment analysis for gifs 7739monkathink

dull terrace
#

i would have to split the gifs into seperate images and then average the scores

slate swan
#

yeah

dull terrace
#

need to research how accurate itll be

slate swan
#
  1. @bot.command(description="desc) 2. bot = commands.Bot(command_prefix="!", activity = discord.Game(name="b!help, currently " + status))
little ivy
#

Is this "async def test(user:discord.User)

Or not?

slate swan
little ivy
#

Okay Thank you!

slate swan
#

no problem

heady sluice
#

it's a guild command...

slate swan
heady sluice
#

still not test

slate swan
heady sluice
#

wait I gotta change the name on this account too

dull terrace
#

the more i think about adding gif reactions to my bot the more pointless it feels

heady sluice
#

done

slate swan
#

jaguar is back

#

jaguar a paragraph of what you need help with is hard to understand

#

Just say what you need, this isn't an essay

slate swan
dull terrace
#

and you tag someone while sending it

slate swan
#

ah well its pretty to use then

dull terrace
#

the only way it makes sense is to handpick gifs which is gonna take ages and not end up with enough to be worth it

slate swan
#

make an api request with aiohttp and get a gif response

#

Jaguar, send your message

#

please

flat solstice
#

anyone got any good recommendations for a tagscript engine or similar, something that lets my users execute 'code' on my bot, a bit like carl-bots tags system. Ik carl-bot uses https://github.com/JonSnowbd/TagScript but this repo was last updated 1 year ago so I'm not sure how 'current' it is nor does it appear to have any documentation on how to use it as a dev and it's outsouring it's user docs to carl-bot. I also found this repo https://github.com/phenom4n4n/TagScript/tree/dpy2 which seems to support dpy 2.0 but I'm not sure if it's something specific to Red-Discord-Bot as this repo's dev seems to do a lot of projects for Red.

Just wondering if anyone else is using a tagscript engine or similar and if so what their thoughts are on it.

slate swan
slate swan
flat solstice
slate swan
#

heyo

#

so uh

#

what's the bot about

livid hinge
#

hello

#

well theres two i'm working on

#

one is a chat bot and the other is a general kitchen sink sort of bot

slate swan
#

BAHAH kitchen sink bot
what does that mean

livid hinge
#

yes lol

slate swan
#

sounds funky

livid hinge
#

its got a bunch of random commands

#

and some of them i borrowed from a bot i was doing for another server lol

#

one was tic tac toe i borrowed from a github gist

slate swan
#

Is there something im missing? This convo kinda sparked out of nowhere

livid hinge
#

the rest are stuff like wikipedia, google, wolfram alpha, python doc, ping, meme, etc .

#

yeah we were in pygen originally πŸ˜‚

slate swan
#

oh ok

slate swan
chilly kelp
#

yo

slate swan
#

but then he told me there's a "kitchen sink sort of bot" and i just went lol

#

oh so basically you guys shifted to thes channel, and i thought im missing some context

chilly kelp
#

wsg

slate swan
livid hinge
#

yeah exactly

chilly kelp
#

you want to make a chat bot?

#

i can code one for you if you like

#

since i got time to waste

slate swan
chilly kelp
slate swan
#

would be funky but i don't have money or anything i can't pay you

chilly kelp
livid hinge
#

you gotta decide what is gonna be the brains behind your chat bot

slate swan
#

hmm

#

i'm not sure, i haven't made one yet

#

cause its much more than simply programming logic

slate swan
chilly kelp
slate swan
#

i assume it would need AI and stuff

#

i just want a bot that kinda learns from what i say and stuff

chilly kelp
slate swan
#

and it might remember stuff

chilly kelp
#

kinda isnt

slate swan
#

if you want to make a good one, you'd need a machine learning base Unless youre using some api to get responses

#

AND INITIATE CONVERSATIONS

slate swan
livid hinge
chilly kelp
#

but i just make basic reply bots not like off the wall type stuff because i make all from stuff from py

slate swan
slate swan
#

heres a article about how to make an ai chatbot

slate swan
#

if that helps in any way

chilly kelp
chilly kelp
slate swan
#

nlp
NY LITTLE PONY

chilly kelp
#

but that works as well πŸ‘

slate swan
slate swan
#

:O

chilly kelp
#

brb i needa do sum

slate swan
#

DIDN'T UWU BACK

chilly kelp
#

isnt uwu like from anime or something?

slate swan
#

you confused him already :c

livid hinge
chilly kelp
slate swan
#

oopsie the bot broke me

slate swan
#

ANYWAYS i just wanna make a chat bot and that's it

chilly kelp
# slate swan

BRUH IM SITTING HERE THINKIN UR ACTUALLY TALKIN TO SOMEONE 😭

slate swan
#

im finna fight this mf

#

getting on my nerves

chilly kelp
#

thx server dont got pepe emojis :c

slate swan
#

THE MF PLAYED ME

#

THE AI PLAYED ME FFS

#

bro what is this

#

I BROKE IT FOR REAL

#

!ot

unkempt canyonBOT
slate swan
#

I'm

chilly kelp
#

this server needs pepe emojis :)

slate swan
#

no

chilly kelp
#

yes

slate swan
#

emojis are related to python not pepe

chilly kelp
#

pepe carries

chilly kelp
#

well ima go make me a bot to play with

slate swan
#

pepe coding in python is a good idea

chilly kelp
#

il see u guys later πŸ‘‹

slate swan
#

🐒 we need pep not Pepe

chilly kelp
slate swan
#

im bored af

chilly kelp
#

bro i hate every time when i go to portal so i can make a bot i have to reset token everytime and grab my phone which is like 20 feet away from me when i can just reset the token without 2fa

chilly kelp
dull terrace
slate swan
#

just turn on 2fa

chilly kelp
slate swan
#

mhm really?

chilly kelp
#

cuz without 2fa it wont ask for a 2fa code

chilly kelp
slate swan
#

good thing i dont do bot dev anymore

chilly kelp
#

well im making my self a bot anyway so i should be good

slate swan
#

why don't you just store the token somewhere, preferably the bot's dms itself

#

send me that library you found

dull terrace
chilly kelp
#

actually lemme just show u so it will be easier

dull terrace
#

need something that can tell if someone is being punched, hugged etc in the image

chilly kelp
#

i have to click this and once i click reset token it says this

#

then once it says this

slate swan
#

sort them yourself, or get an api to do that for you

#

oh hm, haven't opened that page for weeks

chilly kelp
#

so now i need to get my lazy azz up to get my phone 😭

#

just for stupid code

dull terrace
slate swan
chilly kelp
#

wait is there cussing here? i dont wanna get kicked for cussin πŸ˜…

dull terrace
#

i could just go on mturk and pay people 5c for every gif they send me matching specifications actually

slate swan
#

definately not since its a public server with People of all ages here

slate swan
#

it broke

slate swan
chilly kelp
dull terrace
slate swan
slate swan
dull terrace
#

i saw this ai recently that tries to construct a story

chilly kelp
#

works :)

dull terrace
#

you send it sentences to continue the story and itll continue it after your sentence

slate swan
dull terrace
#

worked okay but didn't handle it when you broke theme

chilly kelp
#

lol

chilly kelp
slate swan
chilly kelp
#

bro i wanna learn c# so bad but ion feel like it 😭

slate swan
#

gimme chat bot uwu

slate swan
chilly kelp
#

i feel like c# is better then py tho even tho py is easiest lang

dull terrace
chilly kelp
slate swan
#

makes sense

chilly kelp
#

i wanted to work with java but i heard thats one of the most *TRASH langs

slate swan
#

c# be like
public static void main string args include stdio class console writeline

slate swan
unkempt canyonBOT
slate swan
#

ok so discord bots

slate swan
#

once i made a bot that (when you join a voice channel) and say !wait it would play hold music on loop

#

nice

dull terrace
#

this isn't helpful ablobsweats

slate swan
#

aslkdfjsakdjfΓ©lds

chilly kelp
slate swan
chilly kelp
#

idk

slate swan
#

its glorified html πŸ’€

#

im still bored af

chilly kelp
#

same

#

im just making a bot for fun

slate swan
#

i finished the bot that i made for fun

#

can you make me one pls

#

and now im sad

#

i'll gib you hug

chilly kelp
#

ok does anyone know how to make the bot actually ping the person?

slate swan
#

fuck this api is nice

#

im gonna use this one day

#

You can use the .mention attribute

chilly kelp
#

bottom one isnt working for me bruh

chilly kelp
slate swan
#

And the f needs to be at the start

chilly kelp
#

k

slate swan
#

.send(f"hello...

chilly kelp
#

thx :D

slate swan
dull terrace
slate swan
#

.

chilly kelp
slate swan
#

!f-strings # Might help :)

unkempt canyonBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

chilly kelp
#

k

livid hinge
#

were we always able to send images here?

slate swan
#

yep

#

yes

livid hinge
#

oh cool

slate swan
#

@dull terrace you still need an API for your gifs?

livid hinge
dull terrace
chilly kelp
slate swan
livid hinge
#

I figured out how to send a message from the repl lemon_raised_eyebrow

slate swan
dull terrace
slate swan
dull terrace
#

actions mainly

livid hinge
#
asyncio.ensure_future(loop.create_task(chan.send("hi!")))```
dull terrace
#

if you type "punch" into giphy youll see all sorts of irrelevant stuff

#

not just people punching/being punched

slate swan
#

person being punched

#

thats a search tag

livid hinge
#

you know how you can do python -i , for interactive

slate swan
#

it filters it for you

dull terrace
livid hinge
#

I was looking for a way to send a message to a channel from the interactive prompt

dull terrace
#

only 1 of the first 4 are actually person being punched

slate swan
#

Try tenor then

dull terrace
#

same issue

livid hinge
#

since it's not in an async method its a little different but that appeared to work

dull terrace
#

considered using reaction gifs from reddit and filtering based on title, but that's all over the place too

livid hinge
#

even tho my event loop was running in a background thread

left crater
slate swan
chilly kelp
slate swan
#

all gifs of someone getting punched

#

eh nvm

daring olive
#

why are we talking about this

slate swan
chilly kelp
slate swan
# daring olive why are we talking about this

Hello officer, we were talking about discord bots and the person wanted to know how he could make a command like owobot and it ended up being a talk about getting gifs with certain actions starewaiting

daring olive
#

ty for the detailed response

#

i was v confused

slate swan
#

k

#

i think you were the mod i called fat a while ago

#

my apologies

#

krypton with the gophers

#

i love gophers and the crab rst has

#

python doesnt have a cute character

#

πŸ˜”

#

we need one a cute little snake😑

#

The lemon is pretty cute

#

Kinda hot 2

#

bro?

#

Nvm

#

I may or may not have rule34 of the lemon saved

livid hinge
#

thank you for that image ,i will now be stuck with

olive osprey
slate swan
rare saddle
#

Please tell me what's wrong?

cloud dawn
#

= is for setting variable and == is for comparing the value or equality of two objects.

rare saddle
cloud dawn
rare saddle
cloud dawn
#

What is the text in the = ?

rare saddle
cloud dawn
rare saddle
flint isle
#
@bot.command(name='allmsg')
async def msg(ctx):
	print('Running Search')
	msgs = [message async for message in ctx.channel.history(limit=10)]
	# messages is now a list of Message...
	for ctx.message in msgs:
	   print(ctx.message)
	   if ctx.message.reactions:
	   	for reaction in ctx.message.reactions:
	   		if reaction.emoji ==  'βœ…':
	   			print('checkmark detected')
	   			await ctx.send('checkmark detected')

How can I get the message that had the reactions id?

cloud dawn
rare saddle
cloud dawn
#

So guild.verification_level.value should return the level int

#
class VerificationLevel(Enum, comparable=True):
    none = 0
    low = 1
    medium = 2
    high = 3
    highest = 4

    def __str__(self):
        return self.name
cloud dawn
#

You can also compare the objects.

plucky quiver
#

hello I need help developing a bot for my discord server can anyone help

cloud dawn
plucky quiver
#

i need a bot

cloud dawn
plucky quiver
#

ok

#

help me their

flint isle
plucky quiver
#

can we talk in voice

cloud dawn
plucky quiver
#

ok bacicly can you show me code

#

thats it

flint isle
#

I'm trying to get the message that has the checkmark reaction id

cloud dawn
plucky quiver
#

what

cloud dawn
plucky quiver
flint isle
# plucky quiver what

We don't spoonfeed here. If you want some starting code look for tutorials and start from there. That's where most of us started

plucky quiver
#

but i scrolled

slate swan
plucky quiver
#

to so much vids i need a teacher

slate swan
#

we help as guiding you not giving you everything

cloud dawn
flint isle
cloud dawn
plucky quiver
#

k

cloud dawn
plucky quiver
#

got it

#

so can you teeach

cloud dawn
#
@bot.command(name='allmsg')
async def msg(ctx):
    print('Running Search')
    msgs = [message async for message in ctx.channel.history(limit=10)]
    # messages is now a list of Message...
    for ctx.message in msgs: # <----
       print(ctx.message)
       if ctx.message.reactions:
           for reaction in ctx.message.reactions:
               if reaction.emoji ==  'βœ…':
                   print('checkmark detected')
                   await ctx.send('checkmark detected')
flint isle
cloud dawn
#

ctx.message would be the command message.

cloud dawn
cloud dawn
flint isle
#

I just had it there temporarily lol

slate swan
flint isle
#

I'm just trying to find out how to get the message's ID. :)

cloud dawn
slate swan
#

and just print the list if you want all the ids

cloud dawn
#

Trying so hard to not oneline it rn

slate swan
cloud dawn
#

I was talking to myself πŸ˜‚

slate swan
#

ik

#

im just saying sorry if i confused the person more for you

cloud dawn
#

@flint isle```py
@bot.command(name='allmsg')
async def msg(ctx):
print('Running Search')
msgs = [message async for message in ctx.channel.history(limit=10)]

# messages is now a list of Message...
for msg in msgs:
    print(msg.content)
    if ctx.message.reactions:
        for reaction in msg.reactions:
            if reaction.emoji ==  'βœ…':
                print('checkmark detected')
                await ctx.send('checkmark detected')
flint isle
cloud dawn
#

But you got reaction right.

#

You are comparing it in the if

#

!d discord.Reaction

unkempt canyonBOT
#

class discord.Reaction```
Represents a reaction to a message.

Depending on the way this object was created, some of the attributes can have a value of `None`.

x == y Checks if two reactions are equal. This works by checking if the emoji is the same. So two messages with the same reaction will be considered β€œequal”.

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

hash(x) Returns the reaction’s hash.

str(x) Returns the string form of the reaction’s emoji.
cloud dawn
#

Look a the attributes

flint isle
cloud dawn
#

You just got a double for loop

#

!e ```py
for x in range(3):
for y in range(2):
print(x)

unkempt canyonBOT
#

@cloud dawn :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 0
003 | 1
004 | 1
005 | 2
006 | 2
cloud dawn
#

I can still access x inside the second for loop.

flint isle
#

Ok... idk where your going with that.

cloud dawn
slate swan
#

File "/home/container/main.py", line 63, in <module>
bot = commands.Bot(command_prefix = ">")

TypeError: init() missing 1 required keyword-only argument: 'intents'

unkempt canyonBOT
#

class discord.Intents(**kwargs)```
Wraps up a Discord gateway intent flag.

Similar to [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions"), the properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools.

To construct an object you can pass keyword arguments denoting the flags to enable or disable.

This is used to disable certain gateway features that are unnecessary to run your bot. To make use of this, it is passed to the `intents` keyword argument of [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").

New in version 1.5...
flint isle
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.

cloud dawn
# flint isle Ok. How can I grab the messages id?
@bot.command(name='allmsg')
async def msg(ctx):
    print('Running Search')
    msgs = [message async for message in ctx.channel.history(limit=10)]

    # messages is now a list of Message...
    for msg in msgs:
        print(msg.content)
        if msg.reactions:
            for reaction in msg.reactions:
                if reaction.emoji ==  'βœ…':
                    print('checkmark detected')
                    await ctx.send(f'checkmark detected! it is in {msg.id}')

                    # We break since we already found the check, heading to next message
                    break
slate swan
#

message would be undefined

cloud dawn
#

Yeah xd

slate swan
#

and that whole command makes me wanna cry

cloud dawn
#

Well it's not that bad.

flint isle
#

This is the output

#

I don't see a id output

cloud dawn
#

Restarted the bot?

flint isle
#

Yep twice

cloud dawn
flint isle
#

Even ensured I saved lol

flint isle
cloud dawn
#
@bot.command(name='allmsg')
async def msg(ctx):
    print('Running Search')
    msgs = [message async for message in ctx.channel.history(limit=10)]

    # messages is now a list of Message...
    for msg in msgs:
        print(msg.content)
        if msg.reactions:
            for reaction in msg.reactions:
                if reaction.emoji ==  'βœ…':
                    print('checkmark detected')
                    await ctx.send(f'checkmark detected! it is in {msg.id}')

                    # We break since we already found the check, heading to next message
                    break
pliant gulch
#

Was there a point for that list comp?

#
async for message in ctx.channel.history(limit=10):
    ...
``` instead of creating a list comp, then iterating it again
cloud dawn
slate swan
#

panda is trying his best to give the other guy future strokes

flint isle
#

Ok it gave the correct output now

cloud dawn
flint isle
#

This works for me lol :)

cloud dawn
#

I recommend keeping it like this so you understand what's happening.

flint isle
#

Yeah who knows if my ADHD brain will remember what is going on later if I make it shorter

pliant gulch
#
async for message in history(...):
    if reaction := utils.get(message.reactions, emoji="βœ…"):
        await ctx.send(...)
``` 😳
flint isle
#

Yep I'd forget what was going on lol

cloud dawn
slate swan
#

bro?

cloud dawn
#

..?

slate swan
slate swan
#

we help/guide people here not give them a whole discord bot sorry

#

ah so a tutorial?

#

Hi okimii

#

hi hi

#

U can go watch youtube video we cant explain here

#

Open the website

slate swan
#

Ye

#

Like step by step ;-;

slate swan
slate swan
upbeat vigil
#

hey, i keep getting this error

slate swan
#

you should watch the tutorial and whats the erro?

sick birch
#

Don't watch youtube videos for discord bots

slate swan
#

@slate swan choose disnake ok not nextcord

slate swan
#

reload your token!

upbeat vigil
#

reload yo token

slate swan
#

Bro

upbeat vigil
#

oh

slate swan
#

good

upbeat vigil
#

its an aiohttp eror

#

i think

slate swan
#

Goto the website natixe

#

it seems fine to me its just stopping because youre pressing your keyboard hence the error raising

#

Im sure he dont know python basics

#

and shut all of those powershells

#

and the other python interpreter

#

it can run another instance of your bot

#

Oh ye lol

#

What

#

well thats not really his point but thats really cool!

#

Html and python are toatally different things

slate swan
#

what about the starting and ending tags in html?

#

nah python doesnt have tags

#
<python>
print("hello world")
</python>
#

bro

#

xD

slate swan
#

LOL

#

thats what i wanted to do HAH

slate swan
#

πŸ’€πŸ˜­πŸ˜­

#
<py>hello world</py>
#

😳

#

nope

#

..

cloud dawn
#

{% for guild in guilds %}

slate swan
#

I think html should support python (in the script tag)

slate swan
slate swan
slate swan
cloud dawn
#
      <div class="container guilds" style="margin-top: 30px;">
        {% for guild in guilds %}
            <div class="row" style="height: 96px;">
                <div class="col-sm-1">
                    {% if guild.icon_url is not none %}
                    <img class="vertical-center av_image" style="margin-left: 5px; width: 64px; height: 64px;" src="{{guild.icon_url}}" alt="Card image cap">
                    {% else %}
                    <img class="vertical-center av_image" style="margin-left: 5px; width: 64px; height: 64px;" src="https://cdn.discordapp.com/attachments/833503537479942155/844650622342922310/Zeny_Bot_Gray.png" alt="Card image cap">
                    {% endif %}
                </div>

                <div class="col-sm-9">
                    <h5><span class="text_primary vertical-center">{{guild.name}}</span></h5>
                </div>

                <div class="col-sm">
                    {% if guild.in_server is true %}
                        <a href="/dashboard/{{guild.id}}" class="btn btn-warning vertical-center float-right" role="button">Open Dashboard</a>
                    {% else %}
                        <a href="{{join_url}}" class="btn btn-dark vertical-center float-right" role="button">Invite to server</a>
                    {% endif %}
                </div>
            </div>
        {% endfor %}
        </div>
    </div>
slate swan
#

bro

#

!ot

unkempt canyonBOT
slate swan
#

i hate classes in html

slate swan
#

easy as breathing

unkempt canyonBOT
#

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

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

slate swan
#

so easy yet nasty

slate swan
#

o my

#

he posted the token

slate swan
#

even if its old the filter would catch it

#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

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

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

slate swan
#

ok

#

Yes

#

```py
print("Hello World!")

use this
slate swan
cloud dawn
#

Hello? Could you stop with the n word.

slate swan
#

theres nothing wrong

#

ok what u want?

#
    async def test(self, ctx, test: str, test2: str, test3: str, test4: str, test5: str, test6: int):
        if ctx.channel.id != 967941919785250826: 
            return await ctx.send("Wrong Channel")
        #now how do I make it so where the Wrong channel goes before the missing argument error, so people have to use the command in the correct channel, THEN if they use it incorrectly in the wrong channel, they get the error?

slate swan
#

Can someone make a bot for me pls

slate swan
slate swan
slate swan
#

so this command

        if ctx.channel.id != 967941919785250826: 
            return await ctx.send("Wrong Channel")

basically means that if they use a command in the wrong channel (not 967941919785250826), the bot returns "Wrong Channel"

but if they use the command in the RIGHT channel (967941919785250826), but don't put the right arguments like they do !test and don't specify the args like test1, etc. the bot responds with "Incorrect Usage"

cloud dawn
slate swan
slate swan
#

yo help
my giv cmd doesnt trigger for some reason

@commands.command(name="g")
    async def giveaway(self, ctx :commands.Context):
        print("TRIGGER")
#

Anyone want to make a bot for me

slate swan
#

Can you provide an example please?

cloud dawn
slate swan
#

so like

slate swan
#

async def test(self, ctx, test: bruh):

olive osprey
slate swan
#

i just add a listener and it doent work

slate swan
unkempt canyonBOT
#

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

lol
slate swan
slate swan
slate swan
slate swan
slate swan
slate swan
#

no

slate swan
slate swan
slate swan
#

so I cant check for a certain value

slate swan
#

just check if there the default value

#

..

#

How do I get Application Programming Interface

#

..

slate swan
#

ok ill try that then

slate swan
#

?

slate swan
unkempt canyonBOT
#

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

001 | Argument wasnt specified
002 | Argument was specified
unkempt canyonBOT
#
all

all(iterable)```
Return `True` if all elements of the *iterable* are true (or if the iterable is empty). Equivalent to:

```py
def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True
slate swan
#

right

slate swan
slate swan
#

The only good coding I’m good at is Minecraft command blocks not really good at roblox studio and kinda good at scratch

slate swan
#

its syntax is pretty nice

slate swan
# cloud dawn Discord

So if I want to make a bot that can verify people roblox Minecraft rocket league fortnite and among us account I would have to get what that is a api

supple thorn
#

also using command blocks is coding?

slate swan
slate swan
supple thorn
#

i always thought it's just doing commands automatically

supple thorn
cloud dawn
slate swan
slate swan
supple thorn
#

it does?

slate swan
#

yes

supple thorn
#

it has int and str keywords?

supple thorn
#

i know it has numbers and letters

slate swan
supple thorn
#

find it

slate swan
#

Like is a api a app

#

And if so what apps do I need

slate swan
#

@slate swan need help here stop helping @slate swan here does not even have a good pfp

supple thorn
slate swan
#

Oh ok

slate swan
slate swan
slate swan
#

But I hate when people help others but not me

#

i feel like this channel has gone way too hostile for me

supple thorn
slate swan
#

Just can you help me

#

So if I want to make a bot that can verify people roblox Minecraft rocket league fortnite and among us account I would have to get what that is a api

slate swan
supple thorn
slate swan
#

Nobodys going to find or have an api to do all that for you bro

#

Its not simple to verify all those accounts lmao

#

Ok try 2 witch is simple

mortal dove
#

Anyone know why I get this? I don't think I'm omitting any required fields.
Code -> https://paste.ofcode.org/r79d5tEF5axq8zQ3FmaZ93

discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'modal' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.components: This field is required
``` Any help is appreciated! Using discord.py.
supple thorn
#

all of this help is volunteered

slate swan
#

How fast will it be if I make a bot that when you do a command /info it will bring up a private chat where you can type your info then if someone types /info then the username they can see that usernames info if the user allows them to

slate swan
#

its an api limitation!

slate swan
#

god im gay

#

!ot

unkempt canyonBOT
slate swan
#

pls keep on topic guys!

supple thorn
cloud dawn
#

<@&831776746206265384>

slate swan
mortal dove
visual yarrow
#

Hello πŸ™‚

slate swan
supple thorn
daring olive
#

hi

visual yarrow
#

Let's keep this channel on-topic please

slate swan
supple thorn
#

or phrase it's just ot

slate swan
daring olive
slate swan
supple thorn
mortal dove
#

...

slate swan
slate swan
#

Like I feel like week days are like I have fucking school tomorrow

supple thorn
daring olive
supple thorn
#

we either don't know how to help you or don't want to

daring olive
#

let's move on please..

slate swan
#

Thank you mina as always!

#

🀍

daring olive
#

blobsalute .

slate swan
#

Ok whatever anyways How fast will it be if I make a bot that when you do a command /info it will bring up a private chat where you can type your info then if someone types /info then the username they can see that usernames info if the user allows them to

cloud dawn
#

Please guys provide problems with error tracebacks and/or code blocks. What you want the code to do and what you have tried so far. Detailed questions are more likely to get answered faster.

slate swan
#

Like a girls period

cloud dawn
slate swan
#

pls stay on topic!

#

and he ment the period as the end of a sentence!

slate swan
slate swan
mortal dove
#

@slate swan If you want to know how long it would take, that 99% depends on how good at programming you are

cloud dawn
slate swan
#

I’m a fast typed kinda

#

I know that I have bad luck like someone did do a bot for me but it’s not always online someone will make it for me but there offline and I need to pay them and I know python is good so if you want to code I will code

upbeat vigil
#

when i add autoresponder to my code, the rest of my commands stop working

mortal dove
#

By private channel you mean DMs or an actual private text channel?

upbeat vigil
#

is there a way i could fix this?

mortal dove
slate swan
#

hi

cloud dawn
#

No it's pretty annoying whilst okimii is trying to keep up with the chat you just kept being off topic. We're not going to code a bot for you. I would gladly get you started with the basics and where to get started but what you are currently doing is not nice.

slate swan
#

uh, well I still don't really understand so I guess Ill ask again

    async def spoof(self, ctx, name: str, email, str):
        if ctx.channel.id != 967941919785250826: #to check if the user used the command in the right channel
            return await ctx.reply(embed=discord.Embed(color=375314, title="Riddler - Wrong Channel", description="Please use this command in [#967941919785250826](/guild/267624335836053506/channel/967941919785250826/)."))
        
 #now if the user has used the command in the right channel BUT forgot to put an argument, ctx.send("Missing Argument")
 #how to do dat?         
mortal dove
cloud dawn
mortal dove
daring olive
slate swan
slate swan
#

uh can someone repost the db site link here

cloud dawn
plucky cedar
#

Error - discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

@client.command()
async def ban(ctx, member : discord.Member, *, reason=None):
    await member.ban(reason=reason)

Note: The bot has Admin so it does have the valid permissions

slate swan
daring olive
slate swan
slate swan
slate swan
mortal dove
daring olive
cloud dawn
slate swan
#

Witch is How do I make a bot that when you do a command /info it will bring up a private chat where you can type your info then if someone types /info then the username they can see that usernames info if the user allows them to

#

@slate swan do u know python

slate swan
daring olive
#

there aren't really "private chats" on servers. you mean a DM?

slate swan
daring olive
#

that slash command exists btw, /msg

slate swan
cloud dawn
slate swan
#

Where

cloud dawn
pliant gulch
#

I'm assuming your asking about modals right?

mortal dove
# slate swan How would I create my own error?

class MyCustomError(Exception): pass The important part is that it is an exception, so it can be raised. Then you can raise it in spoof when you need to, then do if isinstance(error, MyCustomError): #something in spoof.error

cloud dawn
mortal dove
#

Hope that makes sense? I can explain it more in-depth in DMs if you want @slate swan

slate swan
slate swan
slate swan
#

yems

cloud dawn
slate swan
slate swan
cloud dawn
unkempt canyonBOT
#

@discord.ext.commands.check(predicate)```
A decorator that adds a check to the [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its
subclasses. These checks could be accessed via [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks").

These checks should be predicates that take in a single parameter taking
a [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context"). If the check returns a `False`-like value then
during invocation a [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure") exception is raised and sent to
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") event...
slate swan
cloud dawn
# unkempt canyon

@slate swan If you click on the link there is an example provided.

slate swan
#

That my bot

#
Ignoring exception in on_connect
Traceback (most recent call last):
  File "/home/runner/ZG/venv/lib/python3.8/site-packages/discord/client.py", line 382, in _run_event
    await coro(*args, **kwargs)
  File "/home/runner/ZG/venv/lib/python3.8/site-packages/discord/bot.py", line 1025, in on_connect
    await self.sync_commands()
  File "/home/runner/ZT/venv/lib/python3.8/site-packages/discord/bot.py", line 558, in sync_commands
    registered_guild_commands[guild_id] = await self.register_commands(
  File "/home/runner/ZG/venv/lib/python3.8/site-packages/discord/bot.py", line 471, in register_commands
    registered = await register("bulk", data)
  File "/home/runner/ZG/venv/lib/python3.8/site-packages/discord/http.py", line 351, in request
    raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
#

?

cloud dawn
# slate swan https://discord.com/developers/applications/957751649575792750/oauth2/general

I recommend watching this tutorial https://www.youtube.com/watch?v=T5moR5gBlbM

In this video, we will create a Discord Bot with discord.py v1.7.3 in 2021. This is an updated version of the video where I showed how to do the same thing last year.

If you have any suggestions for future videos/doubts, leave it in the comments below. I might not be able to answer everyone but you can join my discord server for help: https://d...

β–Ά Play video
slate swan
cloud dawn
slate swan
cloud dawn
slate swan
#

guild

cloud dawn
#

Did you let the bot rejoin?

slate swan
#

yes

cloud dawn
#

Does it have permissions?

slate swan
#

yes

#

only 2 commands would load

cloud dawn
#

What did not?

slate swan
#

i figured out the issue.

#

Thanks!!, i forgot the way python reads lines.

cloud dawn
#

What was the issue?

slate swan
#

i was in a rush, so i wasnt really deleteing anything. just re-defining

#

guess that proves the qoute "dont rush code" true

slate swan
cloud dawn
cloud dawn
boreal ravine
#

py -3 -m pip install discord.py perhaps

slate swan
#

That

silver agate
#

anyone knows why my slash isnt working?
made it as the forum said and still isnt working

#
import discord
from discord.ext import commands
from discord_slash import SlashCommand, SlashContext

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
slash = SlashCommand(bot)

@slash.slash(name="test")
async def test(ctx: SlashContext):
    embed = discord.Embed(title="embed test")
    await ctx.send(content="test", embeds=[embed])
slate swan
#

why not use main?

silver agate
slate swan
silver agate
#

o.o

slate swan
#

it has slash commands

silver agate
#

I just downloaded python after month, do I get it on the side?

slate swan
#

no

silver agate
#

where do I get it

slate swan
#

dpy is a third party lib not a stdlib

silver agate
#

wha?

#

bro its 4am in the morning thats to much atm

slate swan
slate swan
silver agate
slate swan
#

no

#

i dont help in dms

silver agate
silver agate
#

already re- invite my bot still not working

boreal ravine
#

does it have the application.commands scope

silver agate
#

idk

#

just saw that I could start with slash atm and wanted to try, looked on py website and tried xd

boreal ravine
silver agate
boreal ravine
#

go to the page where you got the invite, click the application.commands scope

boreal ravine
#

yes

silver agate
#

cant find it

#

but I know what u mean

slate swan
#

in oauth2

silver agate
#

aight

#

got it ill try

#

nowwww

#

holy shit im gonna buy u mcdonalds...