#discord-bots

1 messages · Page 779 of 1

slate swan
#

Whatever you want

keen talon
slate swan
#

doesnt matter

cyan ermine
#

So not specific?

slate swan
#

a python file*

#

no

cyan ermine
tender estuary
#

doraemon can be a good name- sorry

#

Thanks

slate swan
slate swan
slate swan
cyan ermine
#

okay!

slate swan
vale wing
#

I name it ext typically sillySmile

slate swan
slate swan
slate swan
#

seen plugings

slate swan
slate swan
#

for anyone ( everyone ) who is not in hikari

#

hikari channels

#

Oh lol

maiden fable
tender estuary
#

carberra is in the server...

maiden fable
slate swan
#

yea , he's a staff there

#

Write everything in one file, ya'll inferior

#

nah youre tripping

tender estuary
slate swan
#

People dont even have any humor left inside them

maiden fable
maiden fable
slate swan
#

dont cof on me pls

slate swan
slate swan
slate swan
maiden fable
slate swan
#

so basically no setuwup function

#

make a subfolder in a subfolder

maiden fable
slate swan
#

Lol

vale wing
#

If we eval os.system('reboot') would the python bot shutdown or it has a protection against that

slate swan
slate swan
unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 143 (SIGTERM).

001 | uwu
002 | uwu
003 | uwu
004 | uwu
005 | uwu
006 | uwu
007 | uwu
008 | uwu
009 | uwu
010 | uwu
011 | uwu
... (truncated - too many lines)

Full output: too long to upload

slate swan
#

expect for making categories

slate swan
tender estuary
#

Is there any "guide" for hikari like the one you just provided to me for lightbulb?

slate swan
slate swan
maiden fable
slate swan
#

Groups?

slate swan
slate swan
maiden fable
#

Anyways gtg, gotta grab breakfast

tender estuary
#

!e

import random
while True:
print(random.randint(1,1000000))
unkempt canyonBOT
#

@tender estuary :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(random.randint(1,1000000))
003 |     ^
004 | IndentationError: expected an indented block after 'while' statement on line 2
maiden fable
#

and help my mind overcome this uwuness

tender estuary
#

ofc indent.

vale wing
slate swan
tender estuary
#

!e

import random
while True:
    print(random.randint(1,1000000))
unkempt canyonBOT
#

@tender estuary :x: Your eval job has completed with return code 143 (SIGTERM).

001 | 745801
002 | 421545
003 | 219828
004 | 980093
005 | 195534
006 | 616568
007 | 209081
008 | 549983
009 | 317698
010 | 693305
011 | 431404
... (truncated - too many lines)

Full output: too long to upload

slate swan
#

password generator

slate swan
vale wing
#

@tender estuary it's better to use #bot-commands

#

You may uh get warned or smth

tender estuary
#

its just one run... I am not building a game or snth

slate swan
#

Can we talk ot in bot cmds?

#

no

#

i dont think so

#

Lol

tender estuary
slate swan
#

theres ot channels for a reason

vale wing
#

We can talk about developing discord bots on python as the channel topic says

tender estuary
#
print("Talk off topic here")

hehe

slate swan
#

Wao

#

ill just stay here

#

rather not

#

waiting for a new error

slate swan
vale wing
#

Imagine a bot for hosting bots

tender estuary
slate swan
tender estuary
vale wing
#

🤯

#

It's possible to create such if we use some docker ig

slate swan
slate swan
#

Who would do that

#

i should go to sleep after that

slate swan
#

Lmao

#

my sanity

slate swan
#

Huh?

#

github copilot

quaint scaffold
#

Oh nevermind

tender estuary
#

I have a friend using the free ver or smth... totally sucks

slate swan
#

No hosting sucks more, something is better than nothing

tender estuary
#

I mean maybe because he just runs around editing strings not knowing discord.js but

slate swan
slate swan
tender estuary
slate swan
#

its kindof bad

quaint scaffold
#

Autocode is literally a Discord bot that helps you host other bots within itself

tender estuary
#

Only for hosting though.. I am poor

slate swan
#

its always "i use replit so my bot is online 24/7"

quaint scaffold
#

Essentially the product of MEE6 premium and retardation having sex

slate swan
#

lmfao

tender estuary
slate swan
#

mina like: 👁️ 👁️

slate swan
#

I spend 2 hours trying to fix my bot's build on heroku and delete the app after 1 day

slate swan
#

cof cof

quaint scaffold
#

heroku ferrisMad

slate swan
#

just use your device to host

slate swan
tender estuary
#

paid hosts are the best, but replit because me wnats bot 24/7

vale wing
#

I remember when I actually didn't know about git and updated everything with SFTP

slate swan
#

gonna give us covid

quaint scaffold
slate swan
quaint scaffold
#

lmao

slate swan
#

ggs plans are good

vale wing
#

Yeah 3$/mo pretty decent

slate swan
#

¯\_(ツ)_/¯

quaint scaffold
#

Hetzner has the best price/reliability according to most, but I use Contabo (better value for more powerful vps')

slate swan
#

i have an idea , stop hosting your bots and okimii will do everything your bot does

#

Loooooool

maiden fable
slate swan
#

gg

maiden fable
#

???

maiden fable
slate swan
slate swan
maiden fable
#

No stop it

slate swan
#

its actually possible , with a url

#

sarthak saves the day

maiden fable
#

BTW oki, do u know that which is used for non living things and who is used for living things 👀

slate swan
#

cursed embed title
description

#

doesnt work on mobile

#

Lmao

maiden fable
maiden fable
#

Anyways it's getting OT yet again

maiden fable
slate swan
maiden fable
#

Same. My laptop is in my bag

slate swan
#

We're botting okimii, easy
Okimii the discord bot

maiden fable
#

No

quaint scaffold
#

die

slate swan
#

oban @obtuse obsidian guys do this

maiden fable
#

Time to block y'all out of my GitHub profile

slate swan
#

Lmao

#

@slate swan what softwares oh_okay

maiden fable
#

Bot

slate swan
#

jeez

slate swan
slate swan
slate swan
maiden fable
#

!ot

unkempt canyonBOT
slate swan
#

your mommas game

#

👁️ 👁️

#

its about discord bots

maiden fable
#

@slate swan you know... I ain't a 5 y/o

slate swan
#

I'm out, bye, hunter too uwu today

#

hunter is such a ||sussy baka||

quick gust
slate swan
quick gust
slate swan
slate swan
#

imagine flagging the doge god

quick gust
#

It was like Jan or September 2019 though

maiden fable
#

Me who joined disc in 2020: 😐

quick gust
#

lmao

slate swan
#

i joined in june 2019 iirc

maiden fable
#

BTW @quick gust did u try that trick yet? On yr mom

#

👀

slate swan
#

lmao

quick gust
#

. No

maiden fable
#

Sad

quick gust
#

well done

quick gust
slate swan
#

i thought i was in the bot commands chat

#

👁️ 👁️

#

used the command cause i never knew you could iterate with a key and a value for a dict

#

thought it was key only

maiden fable
#

I just love how this chat is about everything except discord bots

quick gust
#

.topic

lament depotBOT
#
**What commands/features are you proud of making?**

Suggest more topics here!

quick gust
#

we need more topics!

quick gust
slate swan
slate swan
maiden fable
quick gust
slate swan
#

hunter makes discord AIs cause hes a fancy man

slate swan
slate swan
keen talon
slate swan
#

Lmao

#

maybe hes an ai

#

or maybe i am

#

ais arent dumb

#

but AIs dont make a typo , i do

#

exactly

slate swan
#

!ot

#

cof cof

slate swan
slate swan
slate swan
slate swan
slate swan
#

you need black to format it for you👁️ 👁️

#

mehh ```py
def makes_sense(message : Message)-> bool : if message.author == okimii : return False

slate swan
#

he gets grumpy if he doesnt eat his daily gummies

#

❤️

#

!ot ,<= funny but

unkempt canyonBOT
slate swan
#

i need a mother for this poor child😭

quick gust
#

make one

obsidian rivet
#

wha

#

print ("morthe")

slate swan
#

i need to subclass the parent class

maiden fable
#

oki, do u know 3 OT channels exist for talks like this...?

slate swan
#

whos hunter talking to

maiden fable
#

Ah

#

!d discord.utils.format_dt

unkempt canyonBOT
#

discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.9)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...
maiden fable
#

@slate swan

slate swan
nimble plume
#

I want to check user invites

#

docs didnt help

tender estuary
#

If anyone knows hikari, Will this work?

oblique adder
#

role = interaction.guild.get_role(935824707897401374)
why does it return None /

slate swan
#

but the message thingy

#

you cannot send it that way , probably get a channel first , and send the message

tender estuary
#

Yea I got that figured

slate swan
#

and you need to await it too

oblique adder
slate swan
oblique adder
slate swan
#

<coroutine object GuildChannel.create_invite at 0x0000027BFD9DDC48> why do i get that as an output when im trying to get a server invite?

            activeservers = self.client.guilds
            for guild in activeservers:
                for channel in guild.channels:
                    invite = channel.create_invite(unique=True, max_uses=1)
#

and when i am trying to await it, i have this error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10003): Unknown Channel

#

await channel.create_invite

slate swan
#

help i want to set it to

#

null

boreal ravine
#

set it to None

slate swan
boreal ravine
#

who sent that

slate swan
slate swan
boreal ravine
river flare
#

hellow. I have these to buttons and i want to make something like a stopwatch. Mu code is this and i get this error```python
@nextcord.ui.button(label=" ", style=nextcord.ButtonStyle.green)
async def on(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
user = interaction.user
self.start_time = time.time()
emb2=nextcord.Embed(title=":green_circle: On Duty", description=f"{user.mention} Μόλις μπήκες σε υπηρεσία. Πάτα το κόκκινο κουμπί για να βγεις.", color=color, timestamp=datetime.now())
emb2.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb2, ephemeral=True)

        @nextcord.ui.button(label=" ", style=nextcord.ButtonStyle.red)
        async def off(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
                user = interaction.user
                self.end_time = time.time()
                self.time_lapsed = self.end_time - self.start_time
                async def time_convert(sec):
                    mins = sec // 60
                    sec = sec % 60
                    hours = mins // 60
                    mins = mins % 60
                    emb2=nextcord.Embed(title=":red_circle: Off Duty", description=f"{user.mention} βγήκες από υπηρεσία. Ο χρόνος που ήσουν online είναι: "+ "{0}:{1}:{2}".format(int(hours),int(mins),sec), color=color, timestamp=datetime.now())
                    emb2.set_author(name=user.name, icon_url=user.avatar.url)
                    await interaction.response.send_message(embed=emb2, ephemeral=True)
                time_convert(self.time_lapsed)

convert' was never awaited
time_convert(self.time_lapsed)

slate swan
#

what do you understand with "was not awaited" ?

waxen granite
#

I am trying to store few command and then get those cmd names and if the command name is in the list for that guild , it will be disabled. How can i do this. Can someone give me an idea about it?

slate swan
#

custom checks

#

!custom-checks

unkempt canyonBOT
#

Custom Command Checks in discord.py

Often you may find the need to use checks that don't exist by default in discord.py. Fortunately, discord.py provides discord.ext.commands.check which allows you to create you own checks like this:

from discord.ext.commands import check, Context

def in_any_channel(*channels):
  async def predicate(ctx: Context):
    return ctx.channel.id in channels
  return check(predicate)

This check is to check whether the invoked command is in a given set of channels. The inner function, named predicate here, is used to perform the actual check on the command, and check logic should go in this function. It must be an async function, and always provides a single commands.Context argument which you can use to create check logic. This check function should return a boolean value indicating whether the check passed (return True) or failed (return False).

The check can now be used like any other commands check as a decorator of a command, such as this:

@bot.command(name="ping")
@in_any_channel(728343273562701984)
async def ping(ctx: Context):
  ...

This would lock the ping command to only be used in the channel 728343273562701984. If this check function fails it will raise a CheckFailure exception, which can be handled in your error handler.

slate swan
#

you get a context object so you can do if ctx.command.name in disabled_command_list

pine crown
#
@client.slash_command(description="Clears the number of messages you entered.")
async def clear(ctx, amount=None):
  if amount is None:
    embed=disnake.Embed(color=0xb30000, title="Amount not entered", description="Please input the amount of messages you want to clear.")
    await ctx.send(embed=embed)
  else:
    await ctx.channel.purge(limit=amount)

why doesnt work?

slate swan
#

🙂

zinc surge
#

hi , i want to make a bot with python so any good tutorials for that?

oak warren
slate swan
pine crown
slate swan
#

and argument naming

#

slash command doesnt take context

#

but interaction

oak warren
#

it doesnt matter

#

its a variable

slate swan
#

it does

slate swan
oak warren
#

no

slate swan
#

which isnt correct

heavy folio
slate swan
#

in a sense of naming as i said

oak warren
#

it doesnt matter
its just a name

zinc surge
slate swan
oak warren
#

i have seen it

slate swan
#

and tell me when you see ctx in there examples

slate swan
oak warren
#

i didnt say i saw ctx in examples

#

but it doesnt matter what variable you use

slate swan
#

argument

oak warren
#

ok argument

slate swan
#

its in a methods parameters

oak warren
#

it doesnt matter its just a name

slate swan
#

that's like naming an apple a banana

oak warren
#

it automatically takes the first arg as what is required

slate swan
#

its a positional argument

#

ofc its first

pine crown
flat ruin
#

yo anyone know how to make the snakeeyes from dank memer?

#

or the dice roll animation/emoji

slate swan
#

expecting a string and the argument has a default value of None

#

making it an optional argument

pine crown
#

oh and how to send custom emojis with our bot like example:
dot_white

slate swan
#

you can send it like this
![yert](https://cdn.discordapp.com/emojis/832277526809149461.webp?size=128 "yert") or get it

tiny ibex
#

Can someone tell whyyyyyy

misty ridge
#

anyone have any example of code using slash command that have "Options"

tawdry perch
misty ridge
#

python

tiny ibex
#

It's in footer

tawdry perch
#

same goes there iirc

tiny ibex
tiny ibex
#

Or are you using the direct API?

tawdry perch
#

I assume you tried to mention a user in footer, which might not be possible

misty ridge
#

im using disnake

misty ridge
#

a wrapper

tawdry perch
tiny ibex
tawdry perch
#

then can you tell what you are trying to do

tiny ibex
tawdry perch
#

it has some stuff but I cant remember what that is supposed to do, so can you explain what are you trying to do

boreal ravine
tiny ibex
boreal ravine
#

you cant have special things such as mentions, discord epoch timestamps in discord embed footers, titles and more

tiny ibex
tawdry perch
#

not sure if relevant but just found that

tiny ibex
tawdry perch
#

then as kayle said, I think you can't set a timestamp into a footer using embed.set_footer

#

there is timestamp param for timestamp

tiny ibex
#

I wanna make raw API interactions

tawdry perch
#

so I just had to make a guess

potent spear
#

there are already existing API wrappers, you don't have to reinvent the wheel

tawdry perch
tawdry perch
#

even if you made a raw interaction, I don't think you can pass that to footer

tiny ibex
tawdry perch
#

never heard of it

tiny ibex
tawdry perch
#

why does it need to be specially for footer..?

slate swan
#

The bot cannot see the channel but you tried to create an invite innit

#

got it, thx

boreal ravine
#

not related to discord bots

calm whale
#

ok

royal oar
#

Is there a way to make my leaderboard command to change the look so it goes from this:

2. Future_Fugitive
$845539

to:

$845,539
slim ibex
#

what is the code

royal oar
# slim ibex what is the code

The leaderboard command is this:

@commands.command(aliases = ["lb"])
    async def leaderboard(self,ctx,x = 5):
        """
        mother lb
        **Leaderboard i guess**
        """
        users = await get_bank_data()
        leader_board = {}
        total = []
        for user in users:
            name = int(user)
            total_amount = users[user]["wallet"] + users[user]["bank"]
            leader_board[total_amount] = name
            total.append(total_amount)

        total = sorted(total,reverse=True)    

        em = nextcord.Embed(title = f"Top {x} Richest People" , description = "This is decided on the basis of raw money in the bank and wallet",color = nextcord.Color(0xfa43ee))
        index = 1
        for amt in total:
            id_ = leader_board[amt]
            member = self.client.get_user(id_)
            name = member.name
            em.add_field(name = f"{index}. {name}" , value = f"${amt:.0f}",  inline = False)
            if index == x:
                break
            else:
                index += 1

        await ctx.reply(embed = em)
slim ibex
#
  1. inconsistent indentation
  2. what does x mean and why is it's default 5
final iron
#

Yeah there's something

slim ibex
#

and for the color, you just need to put the hex

royal oar
slim ibex
#

not nextcord.Color

royal oar
slim ibex
#

"the command works" isn't an excuse for having bad indentation

#

but back to your question

royal oar
final iron
#

!e
print(f"{10000000:,}")

unkempt canyonBOT
#

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

10,000,000
final iron
#

@royal oar

royal oar
#

Thats how thank you

slate swan
#

Am I ancient

final iron
sage otter
# slate swan Am I ancient

I mean it’s not particularly useful. I guess it’s good for people who need an eye aid and can’t read numbers.

velvet tinsel
boreal ravine
slim ibex
#

mhmm

velvet tinsel
lament depotBOT
#
**What unique features does your bot contain, if any?**

Suggest more topics here!

velvet tinsel
#

idk I haven't worked on a bot for a long time 😳

misty ridge
#
@bot.slash_command(
  name='sanime',
  description='search the anime by the name given',
  guild_ids=[
    933231923533324290
  ],
  options=[
    {
      name="title"
    }
  ]

)

is this the right way to make an Option on slash commands

#

?

boreal ravine
#

what library is that

slate swan
#

Seems like Disnake , if it is
Then it's wrong

slate swan
boreal ravine
#
    {
      name="title"
    }

what datatype is this?

slate swan
slate swan
boreal ravine
#

it isn't json nor js

#

doesn't look sarcastic at all mate

slim ibex
#

(╯°□°)╯︵ ┻━┻

#

ain’t that serious

unkempt canyonBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

maiden fable
#

?

glossy goblet
#

Sorry

slate swan
#

@slender pumice

#

nab unblock me

maiden fable
#

.....?

devout iris
#

How can i log my bot's DM messages?

#

i mean if someone send DM to my bot, bot will send messages to specific channel

maiden fable
#

@devout iris use the on_message event to check if the channel is an instance of DMChannel

maiden fable
#

!d discord.DMChannel

unkempt canyonBOT
#

class discord.DMChannel```
Represents a Discord direct message channel.

x == y Checks if two channels are equal.

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

hash(x) Returns the channel’s hash.

str(x) Returns a string representation of the channel
maiden fable
#

!d isinstance

unkempt canyonBOT
#

isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.

Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
devout iris
#

Ah thx

finite cobalt
#

discord.errors.NotFound: 404 Not Found (error code: 10009): Unknown OverwriteCan someone help me, I have this error and i dont know why

cloud dawn
#

!d discord.ext.commands.Context

unkempt canyonBOT
#
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.

This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.

This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
fresh orchid
#

Hi I have json File like this

{"615461944154210305":154482,"435336640832074837":2613

And I sort it with this code

with open("userLevels.json", "r") as f:
            data = json.load(f)

            ok = sorted(data.items(), key= lambda x: x[1], reverse=True)[:5]
            print(ok)

This gives me a list like that

[('615741944154210305', 154482), ('731186479461060641', 54499)]

Now I want to get the user id from the ok list. So that it prints the user id and then the message count of the person

How to do it. I can only print it like ('615741944154210305', 154482)

cloud dawn
#

!e ```py

user_id, msg_count = ('615741944154210305', 154482)

print(msg_count)

unkempt canyonBOT
#

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

154482
fresh orchid
#

ok thx

slate swan
#

How do I edit channel name?

cloud dawn
#

!d disnake.CategoryChannel.edit

unkempt canyonBOT
#

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

Edits the channel.

You must have the [`manage_channels`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.manage_channels "disnake.Permissions.manage_channels") permission to use this.

Changed in version 1.3: The `overwrites` keyword-only parameter was added.

Changed in version 2.0: Edits are no longer in-place, the newly edited channel is returned instead.
velvet tinsel
maiden fable
#

Hmmm

dreamy sluice
#

Anyone have command ideas?

#

I am kinda bored rn, and I don't wanna work some commands I got planned

slate swan
dreamy sluice
#

wait, I got an idea

#

imma go, cya

honest vessel
#

make a command that executes rm -rf /

tacit token
#

HI!

Kick not work, but the error work. When i del the error, the kick work. This code work with another maincommand. Whats the problem?

@commands.has_permissions(kick_members=True)
@bot.command()
async def kick(ctx, user: discord.Member, *, reason="No reason provided"):
        await user.kick(reason=reason)
        kick = discord.Embed(color=0xcd0000,title=f":boom: Kicked {user.name}!", description=f"Reason: {reason}\nBy: {ctx.author.mention}", timestamp=datetime.datetime.utcnow())
        await ctx.channel.send(embed=kick)
        await user.send(embed=kick)

@kick.error
async def on_command_error(ctx, error):
    if isinstance(error, commands.MissingRequiredArgument):
        embed = discord.Embed(title=f"", color=0xDC1C13, description=f"")
        embed.add_field(name="Invalid command usage, try using it as:", value=">kick `(member)` `(optional reason)`", inline=True)
        embed.add_field(name="Member:", value="*User mention (@user)*", inline=False)
        embed.add_field(name="Reason", value="Text", inline=False)
        await ctx.send(embed=embed)
    if isinstance(error, commands.MissingPermissions):
        embed=discord.Embed(title="Missed Permission", description="You dont have all the requirements.",color=0xDC1C13,)
        embed.add_field(name="Required Permissions:", value="Kick Members", inline=False)
        await ctx.send(embed=embed)```
slate swan
honest vessel
#

@tacit tokeni dont think u can dm user after he is kicked

#

need to dm before the kick is executed

slate swan
#

also, dont name your error function as on_command_error

#

just to be safe

honest vessel
#

@kick.error
async def on_kick_error(ctx, error): or so

#

also name ur parameter member, not user

slate swan
#

user and member both common

honest vessel
#

dosnt matter but maybe more clearify code

#

what object he using

slate swan
#

lmao

honest vessel
#

its like bot = Client()

slate swan
honest vessel
#

hey why not obfuscate the whole code

#

¯_(ツ)_/¯

slate swan
# honest vessel its like bot = Client()
from disnake import Client as Bot
from token_generator import cheap_token_generator_for_discord_which_doesnt_work_and_is_just_a_normal_string
bot = Bot()
bot.run(cheap_token_generator_for_discord_which_doesnt_work_and_is_just_a_normal_string())

easy peasy

honest vessel
#

from disnake import Client as askjdhkjgjkhajshdkjkhg

#

easy peasy

#

qwieyiqywirt = askjdhkjgjkhajshdkjkhg()

maiden fable
honest vessel
#

kek

dreamy sluice
#

What's that

dreamy sluice
slate swan
#

How do I edit a newly created channels name?

honest vessel
#

magic @dreamy sluice

slate swan
# honest vessel hey why not obfuscate the whole code
import disnake as nextcord
import nextcord as discord
import discord as disnake
from discord import Bot as disnake_Bot

my_bot = disnake_Bot(command_prefix="uwu", intents=nextcord.Intents.all())

my_bot.event
async def on_message(user_message_that_is_sent):
   await user_message_that_is_sent.author.kick()

easy

dreamy sluice
honest vessel
#

someone learned as*

honest vessel
honest vessel
#

(it deletes all on ur linux HDD)

slate swan
echo wasp
#

hello i am getting this error (picture) here is the code py @commands.command(name='Number') async def Number(self, ctx): Number = random.choice(50, 150) await ctx.channel.send(Number)

frosty lance
#

How do i wait for a reaction like the bin symbol of the !e python bot

echo wasp
dreamy sluice
#

How do I get the user object from nextcord buttons?

frosty lance
#

!e print(10)

unkempt canyonBOT
#

@frosty lance :white_check_mark: Your eval job has completed with return code 0.

10
frosty lance
dreamy sluice
#

I am not completely sure of it either

slate swan
#

uses wait for to wait for a reaction

#

!d discord.ext.commands.Bot.wait_for

unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

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

user or member you can pass anything

dreamy sluice
slate swan
#

no?

#

in the init dunder

dreamy sluice
#

oh

slate swan
#

or magic method

honest vessel
#

@echo waspchoice takes a list what u want if not is like random.randint(50,150)

slate swan
#

basic oop

honest vessel
#

that will take a random int from 50 to 150

dreamy sluice
honest vessel
#

wait_for(event, *, check=None, timeout=None)

slate swan
#

the timeour kwarg gets passed in the super init

honest vessel
#

wait_for('message', check=check, timeout=50)

slate swan
dreamy sluice
honest vessel
#

oh

slate swan
#

lmao

honest vessel
slate swan
#

youre good

frosty lance
honest vessel
#

its a function

#

that does the checking, return true or false

cloud dawn
honest vessel
#

yeah or check if a moderator reacts with reactions or what ever u want to check

#

or check if author is the author responding

#

pretty much anything u can return true/false u can check

frosty lance
honest vessel
#

like a Quizgame maybe

honest vessel
frosty lance
honest vessel
#

it does

#

u make an inner function

manic wing
# frosty lance How do I know who reacted? I once tried `message.reactions` but it always return...

A check that checks if the wait_for should trigger. For example, if the event is message, it will take a message argument: ```py
def check(message):
#you return True if you want it to triger and false if you dont want it to trigger

if message.author.bot:
return False
#etc...
#it is often also used with lambda (a one line function), and sometimes looks like:
wait_for('message', check=lambda message: message.author == ctx.author) #you can also add and m.channel == ctx.channel as an extra check
...
wait_for('message', check=check) #how to use it with our check function
to see who reacted you can do `message.author` in the event. Example for `reaction_add` eventpy
def check(reaction, user):
#reaction is the discord.Reaction instance that the user added
#user is the user that reacted
if user == ctx.author:
return True
#etc...

frosty lance
slate swan
#

just a normal non async function

#

lambda is good to

#

same thing

honest vessel
#

@frosty lancethey posted it

slate swan
#

function == lambda

velvet tinsel
honest vessel
#

dont need to lamba it n be more complex can do it simple

slate swan
#

no

velvet tinsel
slate swan
#

yeah

#

relationship i wish i had😔

velvet tinsel
slate swan
honest vessel
#

@frosty lancedo u checkout documents anything? they have a basic simple example of wait_for

slate swan
unkempt canyonBOT
honest vessel
velvet tinsel
slate swan
velvet tinsel
honest vessel
#

i bet u used lamba as first thing

slate swan
#

its a anonymous function

slate swan
honest vessel
#

lamba and oneliners (look cooler)

slate swan
slate swan
#

welp

honest vessel
#

@frosty lancehttps://discordpy.readthedocs.io/en/stable/api.html#discord.Client.wait_for

velvet tinsel
#

oneliners are when you move to #esoteric-python , but if you do like print([i for i in range(len(your_list))]) then that's ok

slate swan
velvet tinsel
frosty lance
velvet tinsel
#

but some oneliners are pretty esoteric

slate swan
#

just better

honest vessel
#

@frosty lanceexample of reaction added:

@client.event
async def on_message(message):
    if message.content.startswith('$thumb'):
        channel = message.channel
        await channel.send('Send me that :thumbsup: reaction, mate')

        def check(reaction, user):
            return user == message.author and str(reaction.emoji) == ':thumbsup:'

        try:
            reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
        except asyncio.TimeoutError:
            await channel.send(':thumbsdown:')
        else:
            await channel.send(':thumbsup:')
slate swan
velvet tinsel
#

for example getattr(__import__("os"), "write")(1, "Hello world!\n")

honest vessel
#

@frosty lancecheck the example i gave u can see check as an inner function

slate swan
#

how much are you gonna ping the poor man

velvet tinsel
slate swan
#

havent seen someone take a nickname so seriously

honest vessel
#

@slate swan@slate swan@slate swan@slate swan@slate swan@slate swan@slate swan@slate swan@slate swan@slate swanu jelly, dont be I tagged too

slate swan
#

i get tagged on a daily lol

#

how am i jelly

honest vessel
#

cause of ur pfp

slate swan
#

how

#

i love juice wrld how am i jelly

#

dont judge a book by its cover

velvet tinsel
#

juice world?

#

didn't he die?

slate swan
#

yeah

velvet tinsel
#

he took drugs

slate swan
#

addiction

velvet tinsel
#

he only lived for 21 years

slate swan
#

yeah

#

!ot pithink

unkempt canyonBOT
slate swan
#

How do I rename channels?

maiden fable
#

!d discord.TextChannel.edit

unkempt canyonBOT
#

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

Edits the channel.

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

Changed in version 1.3: The `overwrites` keyword-only parameter was added.

Changed in version 1.4: The `type` keyword-only parameter was added.

Changed in version 2.0: Edits are no longer in-place, the newly edited channel is returned instead.
slate swan
#

well doesnt the error say it all?

#

imagine reading the error

tacit token
#

im the owner

slate swan
#

ok and?

tacit token
#

and? ?

#

where is the ban perm

slate swan
#

your bot is a separate users which needs its own permissions

tacit token
#

own admin

slate swan
#

wut

tacit token
#

the bot have the all perm

slate swan
#

seems like it doesnt

#

errors dont lie

tacit token
slate swan
#

check ddocs

forest beacon
#

Can i start a @task.loop by assigning it to a variable? For example foo = bar.start()

#

Just learned that discord.py won’t be supported after April. What are you guys using.

slate swan
#

dpy is supported

#

its just not maintaned

#

yes

#

ik i just said yes cuz your jokes are bad

forest beacon
slate swan
#

read the whole text

#

what is it then

#

no it wont

#

unverified bots can get the intents without asking for it

#

i snapped like thanos

forest beacon
slate swan
forest beacon
#

Ima be honest. I don’t know what ss is. I recently got back into bot development after dabbling with flask for a few months.

slate swan
#

screenshot

forest beacon
#

Not seeing anything about verified/unverified

forest beacon
#

Alright. So I shouldn’t post my new bot on a bot list in case people actually want it lmao.

slate swan
#

or use slash commands lol

forest beacon
#

How different are slash commands compared to discord.py?

slate swan
#

not hard at all

#

use a fork thtat supports it like disnake

#

!pypi disnake

unkempt canyonBOT
slate swan
devout iris
#

I have an embed and I want the description of the embed to be edited according to the information from the user, how can I do this?

quick gust
#

you can just the description a required argument, then Embed.description=user_description

magic ore
#

That method doesn't exist

#

.description = ...

quick gust
#

Yeah sorry that, embed.description

#

Let me edit

normal bolt
#
async def info(ctx, event = None):
    if event is None: return await ctx.send(f'{ctx.author.mention}, you need to enter a role id.')
    guild = bot.get_guild(GUILD_ID)
    role = guild.get_role(int(event))
    print(role)
    memberList = role.members
    for item in memberList:
        await ctx.send(item)```` 
My code prints only the bot name, could someone help me please?
devout iris
#

did u?

normal bolt
devout iris
#

hmm.... this shouldn't give an error

#

can u show error?

normal bolt
devout iris
#

can u show ur bot veriable?

normal bolt
#
import discord
from discord.ext import commands

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

client = commands.Bot(command_prefix=',', intents=intents)

@client.event
async def on_ready():
    print("client ON")
    await client.wait_until_ready()

@client.command()
async def info(ctx, event = None):
    if event is None: return await ctx.send(f'{ctx.author.mention}, you need to enter a role id.')
    guild = client.get_guild(GUILD_ID)
    role = guild.get_role(int(event))
    print(role)
    memberList = role.members
    for item in memberList:
        await ctx.send(item)

client.run('TOKEN')```
#

my code

devout iris
#

why don't you do intents all?

#

also what did u change?

normal bolt
#

never used intentions before

devout iris
#

ah i c

#

can u try, intents = discord.Intents.all()

normal bolt
#

same error

devout iris
#

smh

#

Are you using clients on purpose?

#

cus bot is better

normal bolt
slim wagon
#

ModuleNotFoundError: No module named 'discord'

#

im pretty sure i have installed it

#

requirement already satisfied :/

devout iris
slim wagon
#

is it cause of python 3.9?

#

thats what i have

maiden fable
#

No

#

U most probably installed to the wrong Python version

devout iris
#

if you are using vsc you can change it from the bottom left corner of the application

slim wagon
#

im pretty sure this wasnt like this

maiden fable
#

Not this

#

Bottom left

#

On the main screen

devout iris
#

r u using vsc?

slim wagon
#

yes

#

u mean this?

devout iris
slate swan
devout iris
#

or microsoft store

slim wagon
#

no a friend told me it was the same

#

mic store

devout iris
#

hmmm

slim wagon
#

yeah

#

should i uninstall this?

devout iris
#

no need

slim wagon
#

which version to install

maiden fable
#

Nvm u already saw it

devout iris
#

u may install 3.9.9 ig

maiden fable
#

Anyways don't install from Win store

slate swan
#

Imagine installing from microsoft store ¯_(ツ)_/¯

maiden fable
slate swan
maiden fable
devout iris
devout iris
#

rofl

maiden fable
slate swan
devout iris
slate swan
devout iris
#

smh

slate swan
#

i just googled python

slim wagon
#

it was recommended tho

#

installed it

maiden fable
#

I got a book off Amazon to start learning Python soooo (never really used it tbh)

devout iris
#

nice

#

restart vsc

craggy cloak
#

how to vieuw badges? member.badge?

maiden fable
slate swan
#

lol

devout iris
#

then u should change interpreter

slate swan
#

no need to reinstall

devout iris
#

(firstly update pip)

slate swan
#

i think it gets saved

devout iris
slate swan
#

all packages from pip

devout iris
#

from pip but different paths

#

but idk

slate swan
#

it still can read them

devout iris
spring flax
slate swan
#

ive tried it myself

slim wagon
devout iris
slim wagon
devout iris
#

yeah try

slate swan
devout iris
slate swan
#

i have and many times

devout iris
maiden fable
devout iris
slate swan
#

imagine importing discord.ext.commands

devout iris
#

did u understand me rn?@slate swan

spring flax
slim wagon
#

still ModuleNotFoundError: No module named 'discord'

spring flax
#

pip install discord in the terminal

slate swan
devout iris
slim wagon
#

did that

#

python 3.9.7

#

this is strange

devout iris
slim wagon
#

just upgraded it

slate swan
#

just factory reset your computer and install python again

devout iris
#

nice

slim wagon
devout iris
#

did u install discord?

slim wagon
#

yes

devout iris
#

"pip install discord"

slate swan
#

what ide

devout iris
slim wagon
#

i did both tho

slate swan
#

its not outdated

quick gust
#

just use disnake

slate swan
#

as discord

maiden fable
devout iris
#

use pycord

maiden fable
#

pip install discord.py

maiden fable
slate swan
slim wagon
slate swan
#

what ide

devout iris
devout iris
slate swan
#

restart your ide

#

and if youre using the vsc terminal just use cmd

maiden fable
devout iris
#

i already said restart....

#

also vsc is not an ide

spring flax
slate swan
slate swan
#

its a ide/text editor

devout iris
#

are they same?

slate swan
#

a text editor with ide features

slate swan
maiden fable
slate swan
#

its a big debate

maiden fable
unkempt canyonBOT
slate swan
devout iris
#

u r confusing my fcking brain

maiden fable
#

discord is a non updated mirror (I think) of discord.py

devout iris
#

lol

slate swan
#

yes youre correct

junior verge
#
@warn.error
    async def warn_error(error, ctx):   
        if isinstance(error, MissingPermissions):
            await ctx.send("You don't have permission to do that!")
``` How do I fix this
#

I currently got a brain error

slate swan
#

How to get channel ID from channel name?

junior verge
slate swan
#

not what he wanted

slate swan
#

use utills

junior verge
slate swan
#

and its your indents

slate swan
junior verge
slate swan
slim ibex
#

commands.MissingPermissions

slate swan
#

do you expect them to come from somewhere?

#

Hey guys i know this is really basic but how do i get my bot to run when i run the code on replit? i use the secrets tab to store my bot key so that my key is private but i cant seem to run my bot.

slate swan
junior verge
#

what

slate swan
#

¯_(ツ)_/¯

slate swan
# junior verge what
@command.error
async def example_error1(ctx, error: commands.CommandError) -> None:
    if isinstance(error, commands.MissingPermissions):
        await ctx.send("msg")
slate swan
slate swan
slate swan
#

what ever you name the constructor

maiden fable
slate swan
plush peak
#

Hey everyone 🙂 If I got some code questions for a Discord bot, can I just ask here?

maiden fable
slate swan
#

dont ask to ask

slate swan
maiden fable
plush peak
maiden fable
slate swan
slate swan
maiden fable
slate swan
#

just ask lol

plush peak
#

Oh boy that went by smooth as hell ... Well I love a nice welcome xD

slate swan
#

this is the weirdest channel in the server lol

#

what do you expect

maiden fable
#

Facts

#

You will find every weird person from the server here

slate swan
#

^

slate swan
compact ruin
#

Hello Humans cat_wave

slate swan
#

weird my about me is a py code block in mobile but not in my pc

#

discord moment

#

welp

#

how is that ot?

#

!ot

unkempt canyonBOT
slate swan
maiden fable
slate swan
#

im not human

compact ruin
#

I have a question cat_wave
How do i get the bot to display his own id using py
eg;

print(ctx.author.id)
print(bot.id)

How would i get the second line to work pithink

slate swan
#

im cat

maiden fable
slate swan
#

dammmnn

plush peak
#

I had a friend help me with a Discord bot that pulls a database of users via API and auto assigns a specific role as long as the user is found in that db.

Problem now, it also unassigns all roles before this happens and since we have CaptchaBot (which assigns a basic role after verification) it somehow can't assign the specific role to the user

User gets stuck in a loop of verifying since users without the basic role can't enter a channel except for #verify-here

compact ruin
#

sadboi Imagine getting a ping and seeing no message

compact ruin
#

Truly sadboi

compact ruin
#

Anyway anyone know how?
Like im making an economy bot and i cant get the bot to change his own data

plush peak
#

How do I change the role assignment from unassign all roles -> assign "premium" role to just add the "premium" role.

slate swan
#

I could just give you the code though

compact ruin
plush peak
#

Should I paste the code in here?

slate swan
maiden fable
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
compact ruin
#

Ty ty popCat

#

O wait wait wait wait

slate swan
#

same goes for id

#

!d discord.Member.bot

unkempt canyonBOT
#

property bot```
Equivalent to [`User.bot`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.bot "discord.User.bot")
junior verge
#

How do I name it instead of {user.mention} that it does not mention but just say for example: Daxles#1151

compact ruin
#

My common sense kicked in for another way

slate swan
plush peak
#

welp

slate swan
slate swan
slate swan
#

no pls

junior verge
slate swan
#

@slate swan

#

lmaoooo

plush peak
#

how does the !paste work. It just sent as a regular msg

slate swan
junior verge
#

Nooo

#

Not that

slate swan
slate swan
junior verge
slate swan
slate swan
#

{str(member)}

junior verge
slate swan
#

think

junior verge
compact ruin
junior verge
#

In a f string

slate swan
#

then im right

plush peak
maiden fable
cloud dawn
maiden fable
cloud dawn
maiden fable
#

yea

#

Anyways, discord issues are bad lol

#

Was not able to send messages or load chats

slim wagon
#

hey, my code in vscode is trying to run but it won't start... some minutes before it sais bot is ready as i programmed it but now it just won start...

maiden fable
#

Show

slim wagon
maiden fable
#

why u adding -u

slim wagon
#

it does that automatically

#

when i press the run button

maiden fable
#

Ah

#

Hmm what happens after that command is ran?

slim wagon
#

its supposed to say the bot is ready

#

but it just wont...

#

does this has anything to do with the fact that i killed the terminal before with ctrl + c?

maiden fable
#

Try restarting VSC

slim wagon
#

does it again

#

weird...

#

wait

#

what in the hell is that

maiden fable
#

lmao

#

idk

#

delete that ig

slim wagon
#

yeah just did it

#

maybe its just discord

maiden fable
#

?

slim wagon
#

it had some api problems like 10m ago

maiden fable
#

yea could be cz of that, tho i suspect it

slim wagon
#

hope so 😶

slate swan
#

jeez what was that api outage

final iron
#

I couldn't log in on phone

#

¯_(ツ)_/¯

slate swan
#

yeah

#

hide your token and dont change your bots presence on ready just use the kwarg

#

!d discord.ext.commands.Bot

unkempt canyonBOT
#

class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.

This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.

This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
slate swan
#

i sent the link on the status

plush peak
#

Wait, Discord just had a complete outage for me.

slate swan
#

yeah