#discord-bots

1 messages ยท Page 1141 of 1

heady sluice
#

bamboo

#

where the hell do you get bamboo

placid skiff
#

Well, I have beers

cloud dawn
cloud dawn
heady sluice
#

oh I can get that

slate swan
#

,

heady sluice
#

,

placid skiff
cloud dawn
slate swan
#

๐Ÿ‘€

slate swan
cloud dawn
#

,

placid skiff
#

uh.. uhm...

heady sluice
#

I shouldn't have deleted it mods are going to track it

cloud dawn
#

Mods in the deleted messages lemon_eyes

slate swan
#

!ot

unkempt canyonBOT
heady sluice
#

start in the init

cloud dawn
#

E

slate swan
#

โœ‹๏ธ

heady sluice
#

also start with await self.bot.wait_until_ready()

#

you see mods I'm helping, don't ban me

slate swan
#

They will give u role

#

Muted role

cloud dawn
slate swan
#

don't worry ๐Ÿ˜‰ if u get a chance to see my logs you'll be shocked

worthy wagon
#

No errors though

heady sluice
#

def init(... ):
...
task.start()

placid skiff
#

Well the curious thing is that panda said that thing and then ash disappeared for real
Do you have anything to tell us?

cloud dawn
#

How do you got ctx there tho?

cloud dawn
#

ngl i preferred the bottom.

placid skiff
slate swan
#

๐Ÿ˜ฑ

heady sluice
slate swan
#

Eat meh panda

heady sluice
worthy wagon
#

Deadass lost asf rn ngl

heady sluice
#

yes you can

#

it's all about runtime

cloud dawn
#

How do you get the ctx???? You pass ctx but what sorcery are you using to get it there??

slate swan
#

you shouldnt start it in the init.....

#

Ye

worthy wagon
heady sluice
slate swan
#

Use on ready

cloud dawn
#

Well since it is in a class you can.

slate swan
heady sluice
slate swan
#

djs is lovely staph

cloud dawn
#

Can agree.

heady sluice
#

y'all goofy af

slate swan
#

I like on ready

blissful lagoon
#

please don't use ableist language like that

slate swan
#

It's cool

heady sluice
#

NO

placid skiff
heady sluice
#

it's not

slate swan
#

Discord.js ew

heady sluice
placid skiff
slate swan
#

Go sleep everyone

#

even it's day

heady sluice
#

it's 5pm

cloud dawn
slate swan
#

wh

slate swan
#

yeah ppl sleep on afternoon

placid skiff
slate swan
#

I dont even sleep at night, I'm nocturnal

slate swan
#

๐Ÿ’€๐Ÿ’€๐Ÿ’€

heady sluice
slate swan
#

๐Ÿฆ‰

slate swan
#

It's 8:38 pm here

slate swan
heady sluice
#

you would've been a cool pokemon

placid skiff
#

i don't even sleep, too much time wasted ewwww

slate swan
cloud dawn
#

Utc is the best time zone

slate swan
#

if u don't sleep u will go in depres....

heady sluice
slate swan
#

Sleeping is not wasting time ๐Ÿ˜ก

heady sluice
#

it's time waste

placid skiff
#

Actually it is D_D

slate swan
#

U know how important is sleep

heady sluice
#

do some push ups

slate swan
#

Go search youtube

#

How would it be if u don't sleep

placid skiff
#

i sleep smth like from 3 to 4 h lmao

cloud dawn
#

Can confirm i sleep around 16/18 hours a day can recommend

slate swan
#

U will be lazy all day

heady sluice
placid skiff
#

i'm lazy cuz i'm a lazy person, otherwise i would not be a developer D_D

slate swan
#

oh u don't like coding

placid skiff
#

I like coding cuz i'm lazy lmao

#

it's all connected

slate swan
#

good

#

go play some outdoor games

cloud dawn
#

With whom, who plays outside lol

heady sluice
#

you don't have time for that

#

you sleep too much

cloud dawn
#

True and fod

slate swan
#

I bet u all have specs

cloud dawn
#

Don't forget the occasional *****

placid skiff
slate swan
#

๐Ÿ˜ณ

vocal snow
#

do you have member intents enabled?

slate swan
#

Maybe

#

Take good sleep

slate swan
cloud dawn
#

!d discord.Intents

unkempt canyonBOT
#

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

Similar to [`Permissions`](https://discordpy.readthedocs.io/en/latest/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/latest/api.html#discord.Client "discord.Client").

New in version 1.5.
slate swan
slate swan
slate swan
cloud dawn
#

Np you can ask anything here.

slate swan
slate swan
#

Good

slate swan
#

i cant handle it

cloud dawn
#

3th option matters the most anyways py_guido

slate swan
#

ok ill leave u guys continue

#

yeah underaged kid, must leave

cloud dawn
slate swan
#

bothways for me

cloud dawn
#

Like 1 glass enough?

slate swan
#

Enough ash

#

<@&831776746206265384> pls help so much ot

paper sluice
#

redbull ++

#

as soon as i come ๐Ÿ˜”

cloud dawn
#

๐Ÿ˜‚

slate swan
#

Sorry ryuga ๐Ÿ˜Š

cloud dawn
#

Mina is my dj today

slate swan
#

i havent slept for a day now im going crazyshipit

slate swan
#

thats not how you make application commands in discord.py, where did that code come from? because the docs don't refer to anything like Bot.slash_command

#

libraries like Disnake and Nextcord have that deco/method

#

I asked my friend and he just sent me that

paper sluice
slate swan
#

well then they sent you wrong code. I'll suggest to look into the docs yourself

cloud dawn
slate swan
paper sluice
slate swan
#

or luna

slate swan
paper sluice
cloud dawn
#

cheeki

slate swan
#

Luna is an underrated mod

#

Luna likes capybaras so i love her, Brad is a pretty cool mod and mina is the best admin besides capybara chrisjl๐Ÿ˜ณ

#

okimii likes capybaras but they don't like him

cloud dawn
#

mina is currently providing me music ๐Ÿ’

slate swan
#

anyways, bye before someone pings mod role for mo reason again

slate swan
shrewd apex
cloud dawn
slate swan
#

spootify

shrewd apex
#

oh yeah spotify has group stuff iirc

cloud dawn
#

yep lol

full valley
#

is there a benefit for making an asyncio.sleep task, rather than just having asyncio.sleep built into a command?

slate swan
#

wdym by asyncio.sleep task?...

#

i think he ment sleeping on a Task

cloud dawn
slate swan
#

Hello I created a cog but it is not working when I added it to the main.py

AdminCog = bot.get_cog(admin(bot))
AdminCommands = AdminCog.get_commands()
print([c.name for c in commands])
full valley
#

so like have rather than have a mute command have asyncio.sleep, have the mute command create_task which runs a function that has asyncio.sleep in it

#

if that makes sense

slate swan
#

how would that be different than asyncio.sleep in the main function itself

cloud dawn
#

Mute command with sleep ๐Ÿšถ

full valley
#

well I could cancel the tasks specifically

slate swan
#

it will be indeed useless because create_task won't wait for the function to fully execute before executing the next line.

full valley
slate swan
#

guys
s1 = await client.wait_for('message')
content = s1.content
num = int(content)

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ValueError: invalid literal for int() with base 10: ''

if i type number in message also this mistake

cloud dawn
full valley
slate swan
full valley
slate swan
#

@commands.command()
async def hello(self, ctx, *, member: discord.Member = None):
await ctx.send(f'Hello {member}!')

cloud dawn
vocal snow
#

I believe he's saying he's going to create_task a different coro which handles all the logic (including the sleep)

slate swan
#

This command wont work

slate swan
#

can someone help me out this code wont work whenever I type .hello

    @commands.command()
    async def hello(self, ctx, *, member: discord.Member = None):
        await ctx.send(f'Hello {member}!')
#

Im using a COG

#

Whenever I type .hello instead of saying "Hello SuperbadAK47"
it says "Hello None"

full valley
#

asyncio.create_task(timerfunction(arg)) sorta thing

slate swan
#

How do I do that?

#

.hello @slate swan

cloud dawn
slate swan
#

Oh

#

But the user is the person who calls the funciton

#

or the person who does .hello

vocal snow
# full valley correct

if you need to cancel them for some functionality then this makes sense, otherwise I can't see a reason to do so

cloud dawn
slate swan
#

How do I get that in the actual program tho

slate swan
#

wait

cloud dawn
slate swan
#

OHH

#

the command is wrong

cloud dawn
#

Well a small issue.

full valley
slate swan
#

what Im trying to make it do is say if I type .hello then it says Hello SuperbadAK47

vocal snow
slate swan
#

create_task will just execute the coro without waiting for a result....

cloud dawn
slate swan
#

!e ```py
import time, asyncio

async def foo():
time.sleep(5)
print("why no wait")

async def main():
asyncio.create_task(foo())
print("didn't wait")

asyncio.run(main())

unkempt canyonBOT
#

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

001 | didn't wait
002 | why no wait
slate swan
#

    @commands.command()
    async def hello(self, ctx,):
        await ctx.send(f'Hello {ctx.author.mention}!')
#

the line after create task got executed before the print in foo()

#

I don't see a point of using it then.

slate swan
#

unless that's what you want

full valley
#

not main, so thats not an issue

slate swan
#

if you' don't have anything else to do in main then whats the point of creating another task...

full valley
#

Im just thinking if I cancel the sleep if I want to remove the certain role of a user early until waiting for the task to end, I could cancel the task, and then remove the role straight away?

full valley
slate swan
#

makes sense, well yeah thats what you want then

full valley
#

alright cheers

pine marsh
#

Anyone wanna help? and not just send me a link do docs lol
Im trying to pull description and image from a embed and post them as a tweet via tweepy....

this is what im thinking ive tried a few things

@client.event
async def on_message(message):
    if message.author != client.user and str(message.channel.id) ==discord_channel_id1 :
        img = message.embeds[0].image.url
        embeds = message.embeds
        api.update_status(img, status=embeds)
        print('Tweet posted from channel 1')

I can get message content to post but i need embed description and image pulled...
heres what i have working for message content

    if message.author != client.user and str(message.channel.id) ==discord_channel_id2 :
        api.update_status(status=message.content)
        print('Tweet posted from channel 2')
slate swan
#

How do I use @commands.has_permissions inside a cog

pine marsh
slate swan
#

Also make sure you have message intents enabled or message.embeds will be empty

pine marsh
#

i havent used tweepy much, so trying to pull from a embed is different form making a embed...

i assume then

img = message.embeds[0].image.url
desc =  message.embeds[0].description 
api.update_status(img, status=desc)

or does tweepy need something like this (status=img, image=img)?

pine marsh
slate swan
#

I believe you need a local file to upload an image using tweepy

#
api.update_status(download(img), status=desc)
``` I would suggest making a function that downloads the image from the url which returns the image directory
pine marsh
#

so each image would have to be downloaded?
im lost here lol im not super expirnced but i have mutiple bots under my belt .... just never used tweepy like that so learning the docs

slate swan
#
import requests

def download(img):
  img_data = requests.get(img).content
  with open('download.png', 'wb') as handler:
      handler.write(img_data)
  return 'download.png'
slate swan
#

not too experienced in tweepy tho

#

can anyone help me with this?

pine marsh
swift pumice
#

i have a question

#
@bot.command()
async def mute(ctx, user: nextcord.Member, time : int):
    role1 = ctx.guild.get_role(985475444981764106)
    role2 = ctx.guild.get_role(985205310740389918)
    if ctx.author.guild_permissions.administrator == True:
        await user.remove_roles(role2)
        await user.add_roles(role1)
        await asyncio.sleep(time*3600)
        await ctx.send(f'{ctx.member.mention}is now muted')
        await user.remove_role(role1)
        await user.add_roles(role2)
    else:
        await ctx.send("you are not administrator noob.")``` why wont it add again the role? like the asyncio.sleep thing doesnt work correctly.
#

do you guys have an idea?

#

and nothing other is in the console

slate swan
#

Firstly, i would recommend puting the ctx.send before the asyncio.sleep otherwise it will wait until the time is over to send the message

swift pumice
#

oh

#

okay thanks

slate swan
#

Secondly, asyncio.sleep uses a second interval

swift pumice
#

what does that mean

slate swan
#

so you are waiting an hour

swift pumice
#

yes

#

i want that the mute command unmutes the user again. like !mute @swift pumice 1

#

that it mutes me for 1 hour

slate swan
#

and are you waiting the hour?

swift pumice
#

wdym

slate swan
#

Well you are sleeping for an hour

#

when you are running !mute @Elias(ping when reply pls) 1

#

so you would have to wait an hour

#

for it to unmute them

swift pumice
#

yes

#

i did

#

but it didnt unmute them

slate swan
#

seems a bit excessive waiting an hour

swift pumice
#

lmao

slate swan
#

user.remove_role(role1) that is your problem

swift pumice
#

wait why?

slate swan
#

user.remove_roles(role1) should be this

swift pumice
#

omg

slate swan
#

like the rest of your code

swift pumice
#

im frustrated rn

#

like fr

slate swan
#

does anyone know if the discord.commands module actually exists

swift pumice
#

i hate my self for that

slate swan
#

dw took me a while to figure that out myself lmao ๐Ÿ˜ญ

pine marsh
#

always the simplest thing when it takes hours

cloud dawn
slate swan
#

whats best discord py slash commands module

cloud dawn
slate swan
#

ok clear winner

slate swan
#

but then i get this

cloud dawn
slate swan
#

so it dosent exist

cloud dawn
slate swan
#

some guy was using that and now hes not responding to dms

slate swan
slate swan
#

which i won't recommend using, just stick to discord.py

slate swan
scenic stump
#

Hi suggest me a plugin for discord modals (inputbox)

slate swan
#

!d discord.ui.Modal

unkempt canyonBOT
#

class discord.ui.Modal(*, title=..., timeout=None, custom_id=...)```
Represents a UI modal.

This object must be inherited to create a modal popup window within discord.

New in version 2.0.

Examples...
scenic stump
#

ah ok thanks

#

e for slash command

#

e button

slate swan
#

Whatโ€™s a modal sped_pepe

heady sluice
#

it's a dir innit

slate swan
#

discord.py has all of them. you dont need any external plugins
just install the dev version from github

slate swan
heady sluice
#

not even without the typo

slate swan
slate swan
#

the bot this guy wrote uses pycord

slate swan
heady sluice
slate swan
#

how do i install it

slate swan
slate swan
slate swan
slate swan
heady sluice
#

!d discord.app_commands.command

unkempt canyonBOT
#

@discord.app_commands.command(*, name=..., description=..., nsfw=False, extras=...)```
Creates an application command from a regular function.
slate swan
#

pip install git+raptzzgithublink

scenic stump
#

ok and where I find the documentation for example

slate swan
#

!d discord

unkempt canyonBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

slate swan
#

docs link^, you can find example in the github repo

scenic stump
#

okay thanks

slate swan
#

from discord.ext import commands, tasks
ImportError: cannot import name 'commands' from 'discord.ext' (unknown location)

#

!d ImportError

unkempt canyonBOT
#

exception ImportError```
Raised when the [`import`](https://docs.python.org/3/reference/simple_stmts.html#import) statement has troubles trying to load a module. Also raised when the โ€œfrom listโ€ in `from ... import` has a name that cannot be found.

The `name` and `path` attributes can be set using keyword-only arguments to the constructor. When set they represent the name of the module that was attempted to be imported and the path to any file which triggered the exception, respectively.

Changed in version 3.3: Added the `name` and `path` attributes.
cloud dawn
#

Are you using py-cord?

slate swan
cloud dawn
#

Yeah they don't have the structure like that.

slate swan
#

i was testing something and i don't need it so im not sure how to remove it

#

any chance you could help me?

#

im trying to create a custom .help command but whenever I type it then it brings the built in help command. How do I overwrite it?

heady sluice
#

that's also a way to do it yeah

paper sluice
#

or while defining bot you can do bot = commands.Bot(<ur stuff>, help_command=None)

#

if you have a command for your help command, you can pass it directly there as well

#
@commands.command()
async def my_help(...):
    ...

bot = commands.Bot(..., help_command=my_help)
slate swan
paper sluice
dapper stirrup
#

I was reading this guide: https://guide.pycord.dev/interactions/ui-components/dropdowns/

Code:

import discord

bot = discord.Bot()

class MyView(discord.ui.View):
    @discord.ui.select( # the decorator that lets you specify the properties of the select menu
        placeholder = "Choose a Flavor!", # the placeholder text that will be displayed if nothing is selected
        min_values = 1, # the minimum number of values that must be selected by the users
        max_values = 1, # the maxmimum number of values that can be selected by the users
        options = [ # the list of options from which users can choose, a required field
            discord.SelectOption(
                label="Vanilla",
                description="Pick this if you like vanilla!"
            ),
            discord.SelectOption(
                label="Chocolate",
                description="Pick this if you like chocolate!"
            ),
            discord.SelectOption(
                label="Strawberry",
                description="Pick this if you like strawberry!"
            )
        ]
    )
    async def select_callback(self, select, interaction): # the function called when the user is done selecting options
        await interaction.response.send_message(f"Awesome! I like {select.values[0]} too!")

@bot.command()
async def flavor(ctx):
    await ctx.send("Choose a flavor!", view=MyView())

bot.run("TOKEN")```
But i have a error, AttributeError: module 'discord' has no attribute 'ui'

whats wrong?

Learn all about implementing Select Menus or Dropdowns in your Discord Bot with Pycord.

slate swan
#

install the new-er version

dapper stirrup
#

i will try

slate swan
#

pip install py-cord=2. something

#

cause the default one points to 1.7.3, weird stuff as always.

#

i don't get the point of the changes that pycord makes.

#

they are all useless!

dapper stirrup
#

stupid computer๐Ÿ˜Ž

#

idk actually

#

it doesnt work

#

i will look documentation๐Ÿ˜Ž

pliant pagoda
#

how would i go about making this:
prints a random number, makes a user input the number, gives a role to the user if the numbers correct?

#

if that makes sense๐Ÿ˜†

cloud dawn
#

!d random.randint

unkempt canyonBOT
#

random.randint(a, b)```
Return a random integer *N* such that `a <= N <= b`. Alias for `randrange(a, b+1)`.
cloud dawn
#

What have you got so far?

slate swan
winter gull
#

I have to make a progress bar sort of in an embed, any ideas on how to implement it?

vale sierra
#
embed.add_field(name="Utilisateurs :", value=f"{self.bot.guild.member_count:,}", inline=True) 

Error : AttributeError: 'Bot' object has no attribute 'guild'

Hello, i have this error when i try to make the bot show how many user the bot have. If you want the whole code : https://paste.pythondiscord.com/uyomeqisok
Thanks !

slate swan
#

!d discord.ext.commands.Bot.guilds

unkempt canyonBOT
vale sierra
slate swan
slate swan
#

!d discord.ext.commands.Bot.users returns the user objects of all the users bot can see

unkempt canyonBOT
paper sluice
slate swan
slate swan
slow fog
slate swan
#

is there a way to get old messages from a user longer than 2 weeks ago?

#
for guild in self.bot.guilds:
  print(f'{guild.name} = {guild.member_count} users')
print(len(self.bot.users))
#

are you happy now ๐Ÿ˜ญ

slate swan
slate swan
pliant gulch
#

You don't need to assign it to a variable if you just want it to print

pliant pagoda
# pliant pagoda how would i go about making this: prints a random number, makes a user input the...

regarding previous question, made adjustement so it now gives out a random number -

@bot.command()
async def verify(ctx):
    message = await ctx.send('React to verify!')
    await message.add_reaction('โœ…')

    def check(reaction, user):
        return reaction.emoji == 'โœ…' and reaction.message == message

    reaction, user = await bot.wait_for('reaction_add', timeout=30.0, check=check)
    await ctx.send(f"Please type the number {random.randint (10000,99999)}")

Now how do i go about taking the user input and determining whether its the right number or not?

pliant gulch
slate swan
#

i think everyone already knows that print doesnt return anything๐Ÿ—ฟ

#

and bro its a joke๐Ÿ˜”

slate swan
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.10)"). 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.10)") 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.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
pliant pagoda
#

sorry, still learning so please may you explain what this would be for? User input?

slate swan
#
msg = await client.wait_for('message', check=lambda message: message.author == ctx.author)
slate swan
slate swan
#

zeffo be like๐Ÿ’€

pliant pagoda
slate swan
pliant pagoda
#

i see

slate swan
#

and then sets the message as a variable

#
msg = await client.wait_for('message', check=lambda message: message.author == ctx.author && message.content == str(randomint))
``` in your case this would be useful
slate swan
#

This waits for a message that is by the command author and is the random int you generated

pliant pagoda
#

i see, thanks for being patient with me and I appreciate the help๐Ÿ™‚

torn sail
paper sluice
#

&& doesn't exist in python

torn sail
#

&& is c

pliant gulch
slate swan
slate swan
slate swan
#

Iโ€™ve been coding in different languages

torn sail
pliant pagoda
#

too skilled๐Ÿ˜†

slate swan
winter gull
pliant gulch
slate swan
slate swan
winter gull
#

what are the chances

slate swan
#

im pretty sure theres some pieces that you shouldnt show or something like that

#

any how you shouldnt show any piece of your token anyways

winter gull
#

๐Ÿ˜”

pliant gulch
#

You don't need to worry about the first two parts of your token, that'll be your discord ID, and your discord epoch

slate swan
pliant gulch
#

The last part is the actual authentication piece of the token that discord checks

winter gull
#

no-

slate swan
#

yeah no thank you

vale wing
#

Suscord

slate swan
winter gull
#

i guess the special character differentiate them

vale wing
#

As I read from wikipedia last part of token is a sort of hashsum

paper sluice
#

why does ... turn to .?

torn sail
#

after the second .

slate swan
#

let me leak my token๐Ÿ’€

vale wing
#

Fun fact is my id ends with 666 ๐Ÿ˜ณ

slate swan
slate swan
pliant gulch
pliant pagoda
#

struggling with an indentation error on that last line, would appreciate help again๐Ÿ˜†

bot.command()
async def verify(ctx):
    message = await ctx.send('React to verify!')
    await message.add_reaction('โœ…')

    def check(reaction, user):
        return reaction.emoji == 'โœ…' and reaction.message == message

    reaction, user = await bot.wait_for('reaction_add', timeout=30.0, check=check)
    await ctx.send(f"Please type the number '{random.randint (10000,99999)}'")
  msg = await client.wait_for('message', check=lambda message: message.author == ctx.author and message.content == str(randomint))
pliant gulch
vale wing
slate swan
paper sluice
#

you can, pyright is acting weird

slate swan
#

only tuples afaik

#

im pretty sure that was only for tuples

#

yeah you cant do that for lists

vale wing
#

The heck is that anyway

slate swan
#

Ellipsis

#

thats just showing the tuple can contain an unknow amount

vale wing
#

Ellipsis for me is 0

slate swan
#

ewww

#

in tuples if you have a certain amount you would need to typehint it with that amount, if it will be mutated or unknown just use ellipsis

#

imagine typehinting 100items

#

imagine not doing that

#

bro

shrewd apex
#

for list u need to use Union for multiple items Union or Optional iirc

slate swan
#

if you want multiple types you mean?

#

Union

shrewd apex
#

yep

slate swan
#

Optional*

slate swan
#
    @commands.slash_command(name='ban', description='Ban users')
    async def ban(self, ctx: disnake.ApplicationCommandInteraction , user: disnake.Member, *, reason):
        if ctx.permissions.ban_members  :
            await ctx.guild.ban(user, reason=reason)
            await ctx.send(f"{user} has been successfully banned.")
        else :
            embederror = disnake.Embed(title="Error", description=f"{ctx.author} You are not admin on this server")
            await ctx.send(embed=embederror)

Error - forbidden: 403 Forbidden (error code: 50013): Missing Permissions

slate swan
pliant gulch
#

It'll just be for arbitrary amounts

slate swan
#

or you can use | for typehints

slate swan
slate swan
slate swan
torn sail
slate swan
shrewd apex
slate swan
#

also, this wont work on guild owners

slate swan
shrewd apex
slate swan
#

role higher archy

slate swan
shrewd apex
#

bot overthrows the owner

slate swan
#

imagine having a 3.10 interpreter

#

you see me here running python 2๐Ÿ˜ณ

shrewd apex
slate swan
#

try python 1

shrewd apex
#

i didnt change since

slate swan
#

be a real programmer, use assembly

slate swan
pliant gulch
#

Just, future.annotations?

slate swan
#

depends

#

depends which version your package would support

slate swan
slate swan
#

who tf uses 3.7 in 2022

#

even replit uses 3.8.2

#

lmaooo

slate swan
#

ok

slate swan
#

ok

paper sluice
slate swan
#

ok

paper sluice
#

rust asm, les go

slate swan
#

py_print_impl hmmmmm

paper sluice
#

๐Ÿ˜ณ

slate swan
#

watch julia doing weird shit

#

"a"*"b" is "ab" ๐Ÿ˜”

#

like what

#

text multiplication

paper sluice
vocal snow
#

That is acceptable math notation

paper sluice
#

when do you encounter strings in math?

shrewd apex
#

so for julia we do string *= to add?

slate swan
#

if were going by math wouldnt that just multiply the length of the string?

pliant pagoda
#

struggling with an indentation error on that last line๐Ÿ˜† Any ideas?

bot.command()
async def verify(ctx):
    message = await ctx.send('React to verify!')
    await message.add_reaction('โœ…')

    def check(reaction, user):
        return reaction.emoji == 'โœ…' and reaction.message == message

    reaction, user = await bot.wait_for('reaction_add', timeout=30.0, check=check)
    await ctx.send(f"Please type the number '{random.randint (10000,99999)}'")
  msg = await client.wait_for('message', check=lambda message: message.author == ctx.author and message.content == str(randomint))
slate swan
slate swan
vale sierra
slate swan
slate swan
#

zeffo is so smart its crazy, he probably knows calculus๐Ÿคฏ

paper sluice
#

calculus isn't hard, geometry is ๐Ÿ˜”

slate swan
paper sluice
#

or i just dont like it and dont study

slate swan
slate swan
#

how is geometry hard bro its just some shapes๐Ÿ’€

vale sierra
slate swan
#

geometry is ezz๐Ÿ˜ผ

shrewd apex
paper sluice
vocal snow
slate swan
#

nova down bad bro

slate swan
slate swan
slate swan
paper sluice
vocal snow
slate swan
#

i havent token math in 3 years and now im going to 10th grade๐Ÿ˜”

slate swan
slate swan
#

rip my discord

#

@grim oar write a book bro

paper sluice
#

right ๐Ÿ’€

slate swan
#

right

#

i need sleep, i havent slept in like 25 hours๐Ÿ‘๏ธ๐Ÿ‘๏ธ

vocal snow
#

@slate swan why aren't u green

slate swan
#

because im white

#

i expected something else

paper sluice
#

woah..

slate swan
#

racially motivated ash

#

uncalled for

#

absolutely me, I dwell from the race of ghouls

#

or maybe

#

lemme escape before sparky pings mods

#

must be late there

#

๐ŸŽ  ๐Ÿ’จ

#

farting...?

grim oar
vocal snow
#

Lmaoo

slate swan
#

nova denying his love to zeffo now

grim oar
#

I am being defamed

slate swan
#

bro we all know you would do something like that

slate swan
grim oar
#

I have standards

slate swan
#

oh i bet๐Ÿ’€

vocal snow
shrewd apex
#

zeffo happens to meet em

grim oar
#

I always knew this server's bots had a screw loose

slate swan
#

nah i think its you bro

grim oar
#

No

shrewd apex
#

no need to be shy be bold ๐Ÿ‘€

slate swan
#

!rule 7

unkempt canyonBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

grim oar
#

Thanks brat

vocal snow
slate swan
#

ash mad she doesnt get any poems

vocal snow
#

Ahahah

shrewd apex
#

lmao

slate swan
#

zeffo has made me like 5 already

#

ok

grim oar
#

weird flex but ok

slate swan
#

die on okimii?

#

aww

#

that gave me a stroke, dont listen to me im more sleep drunk than any one here๐Ÿ˜ญ

grim oar
#

That shows dw

slate swan
#

ok

#

i need sleep like i need sarth, allot๐Ÿ˜ฉ

#

๐Ÿคจ

shrewd apex
#

rip pass then

#

alive is better

slate swan
#

guys stop simping over me. i dont wanna die later ;))

grim oar
slate swan
#

why do I see black spots in my eyes from the past hour or is it normal

#

thats your pupil bro

#

present in the eye.

shrewd apex
#

cataract my bad

vocal snow
#

Cats

slate swan
#

isnt cornea the clear top on top of the pupil

slate swan
slate swan
slate swan
shrewd apex
#

protects the eye

grim oar
#

That's like free ticket to vet my guy

slate swan
#

nvm

#

and bends the light rays

#

nova you should go to the vet

#

and not as an employee

shrewd apex
#

behind pupils

grim oar
#

Ok i will go as a customer

shrewd apex
#

lmao

slate swan
#

their owners do, so zeffo would pay

shrewd apex
#

๐Ÿ”ฅ

slate swan
shrewd apex
#

waiting for comeback

grim oar
#

Free service perhaps?

slate swan
#

couple

grim oar
#

Couple

slate swan
#

ok

shrewd apex
slate swan
#

why my bot no works

slate swan
#

nova like Albert Einstein said, time is irrelevant, but your all of my time๐Ÿ™

slate swan
grim oar
#

bro did the comedy

shrewd apex
#

it seems everyone has anime girl pfp now๐Ÿ‘€

shrewd apex
slate swan
#

guys this is a discord bots channel not a Optometrists center

grim oar
#

Yeah I am an e-girl uwu

shrewd apex
#

so it will bend towards normal

slate swan
#

Get back to discord bots spongey_sad

grim oar
slate swan
#

excuse

grim oar
#

If you know what I mean

slate swan
#

nova stop making an excuse to cover up that you cant read

shrewd apex
slate swan
#

why dont u

grim oar
slate swan
grim oar
#

It's midnight

slate swan
#

idc

grim oar
#

So rude

shrewd apex
#

f it's 12:29 need to go to sleep ;-;

#

gn

slate swan
paper sluice
#

gn

slate swan
grim oar
#

gasnight

slate swan
#

โค๏ธโ€๐Ÿ”ฅ

#

help :c

wicked atlas
#

๐Ÿ‘€

slate swan
#

it will fix your errors

paper sluice
grim oar
#

h*ta ong

slate swan
slate swan
#

thats your issue

slate swan
paper sluice
slate swan
slate swan
paper sluice
grim oar
slate swan
#

no

#

chalk board

slate swan
paper sluice
slate swan
#

tehe

slate swan
grim oar
#

can't expect much from houtou fanbase ong

slate swan
#

ok

slate swan
#

use ur memory

slate swan
#

i use rocks to carve on another rock

slate swan
slate swan
slate swan
#

sus

#

i love dwayne the rock johnson

wicked atlas
#

> Enters #discord-bots
> Literally talking about anything other than discord bots
> yert

slate swan
#

ok

slate swan
slate swan
slate swan
#

with me

#

but cant

pliant pagoda
slate swan
slate swan
#

you basically choked on water

#

๐Ÿ˜”

#

i got something to choke on

#

pathetic

#

bread

#

me

#

bread is better

#

bread > anything

#

bro thats illegal

#

๐Ÿคจ

#

ok

#

that came oit wrong nvm

#

lmaooo

#

fuck spotify

#

i hate it

slate swan
#

itunes exists

paper sluice
slate swan
paper sluice
slate swan
#

i just played a song and it played a completely song

wicked atlas
slate swan
#

use brave mehhh

slate swan
grim oar
#

use ublock bro

slate swan
#

spotify's ui for me is horrible its confusing and horrible, reason why i use youtubelemon_imp

slate swan
wicked atlas
#

it also appears that today, we have a new ot channel named discord-bots

slate swan
#

i have the poor dude laying their doing nothing

slate swan
slate swan
#

how do u get discord py 2.0

slate swan
paper sluice
slate swan
#

stop

slate swan
slate swan
grim oar
slate swan
slate swan
slate swan
slate swan
# grim oar What os is that
Collecting git+https://github.com/Rapptz/discord.py
  Cloning https://github.com/Rapptz/discord.py to c:\users\music\appdata\local\temp\pip-req-build-kira7cqx
  ERROR: Error [WinError 2] The system cannot find the file specified while executing command git version
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the 'C:\Users\music\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.```
slate swan
slate swan
grim oar
slate swan
grim oar
slate swan
#

if nova was a distro i would format my drive

slate swan
grim oar
slate swan
slate swan
slate swan
slate swan
#

youtube music???

#

youtube is understandable

slate swan
#

and so is spotify

slate swan
slate swan
grim oar
slate swan
grim oar
slate swan
pliant pagoda
slate swan
slate swan
slate swan
slate swan
slate swan
pliant pagoda
slate swan
#

only thing i hate about windows is not deleting every dir related to a package

grim oar
#

Not like I have phd in them but they are good imo.

paper sluice
slate swan
slate swan
#

bro what

slate swan
#

LOL

slate swan
#

smh

slate swan
slate swan
slate swan
paper sluice
grim oar
slate swan
paper sluice
#

you first

slate swan
#

like leave the server bro

#

snipping tool just fucking murdered my pc

#

what are you running 16mbs of ram?

paper sluice
grim oar
#

You are using xfce which is a desktop environment!!

paper sluice
slate swan
slate swan
paper sluice
#

oh wait, nvm

wicked atlas
slate swan
#

which im somehow able to use with a 3gb swap space

#

took me like fucking 5 minutes to take this screenshot and its irrelevant now

grim oar
slate swan
#

discord go brrrrrr

slate swan
paper sluice
#

4gbs with windows is painful, i had to use fedora and i knew 0 things about os so i didnt have the best of times

tight obsidian
#

hi

slate swan
#

๐Ÿ˜ณ

#

ah sh-

#

so you guys like discord bots?

slate swan
grim oar
#

I love discord bots

paper sluice
slate swan
#

theyre fun projects๐Ÿ™‚

#

ew

grim oar
#

How to make snake game

#

In bots

slate swan
slate swan
paper sluice
grim oar
#

is he gone yet

slate swan
#

yes

grim oar
#

Love discord api

slate swan
#

i added the reaction dw

#

WHY IS SPOTIFY ADDING TO MY PLAYLIST

#

FUCK YOUUUUU

#

chill harvs

paper sluice
#

why are you guys scared of mods pithink ? they are nice and kind people

slate swan
slate swan
slate swan
wicked atlas
slate swan
grim oar
#

!ot

unkempt canyonBOT
daring olive
#

hey all, let's bring it back to discord bots

grim oar
#

Yes

slate swan
#

.topic

lament depotBOT
#
**What feature would you be the most interested in making?**

Suggest more topics here!

slate swan
#

a server lock command maybe

#

cause i need one rn, am using evals to do that L

paper sluice
daring olive
#

if you are doing evals for that, you basically have your command mostly done no?

slate swan
#

are you literally not allowed to put what song you wanna listen too on spotify mobile

grim oar
#

Why would you even use that thats an utter trash idea bro

paper sluice
#

ya, just copy paste and make it look pretty

grim oar
#

Yes

slate swan
#

you can lock the whole guild so your whole guild doesnt get ratelimited on a raid and so you can actually remove the raiders

#

Any ideas on what discord bot to code sped_pepe

slate swan
#

ok

pliant gulch
#

Render the game board using ansi

grim oar
#

Predicts if you die in 2048 or no

pliant gulch
#

2048 AI in discord bot

slate swan
#

run cyber punk on a discord bot

slate swan
paper sluice
#

oh, broadcast twitch stream

slate swan
#

Would cloud gaming run on a discord embed?

#

1 fps embed edit moment

#

Like audio playing through vc and embed with constantly changing screenshots

#

do it

grim oar
#

Gaming

slate swan
#

no

#

edit message ratelimits is 5/1s iirc

grim oar
#

Both will be out of sync

#

message and audio

slate swan
slate swan
hardy yoke
#

5 edits per second

grim oar
#

yes sync audio

slate swan
#

and its a dynamic ratelimit

#

Whatโ€™s the limit of messages per sec or is it the same

#

iirc its the same idk

grim oar
#

5 fps per second, still faster than okimii's brain

pliant gulch
slate swan
slate swan
#

Spotify is telling me to join the navy

#

do it

#

Iโ€™m listening to tally hall, does it really think I could hold a gun

grim oar
#

Hold my

slate swan
paper sluice
slate swan
paper sluice
#

i knew it

slate swan
#

3 ads in a row

#

an ad on spotify told me to buy a house, now i live with sarth๐Ÿ˜…

unkempt canyonBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

slate swan
#

ash jealous

#

๐Ÿ˜ฉ

#

no thanks

#

ko

paper sluice
#

aight adios, imma make micro-optimizations ๐Ÿ‘‹

slate swan
#

Good luck ig

#

๐Ÿคž

flat solstice
#

When I'm adding buttons when sub classing discord.ui.View can I do this? py class PersistentView(View): def __init__(self): super().__init__(timeout=None) # Add the base dropdown to the view self.add_item(AlphaDropdown()) for link in links.links: self.add_item(Button(link.label, link.url)) or do I need to do this? ```py
class PersistentView(discord.ui.View):
def init(self):
super().init(timeout=None)

@discord.ui.button(label='Green', style=discord.ButtonStyle.green, custom_id='persistent_view:green')
async def green(self, interaction: discord.Interaction, button: discord.ui.Button):
    await interaction.response.send_message('This is green.', ephemeral=True)```
flat solstice
#

okay thank you ๐Ÿ‘ (sidenote I've got so used to using MS Teams I keep doing ( not : to bring my the quick emoji menu annoyedbird )

pliant pagoda
# slate swan probably

most works, but when i enter the code i am not given an output. Any idea?

@bot.command()
async def verify(ctx):
    message = await ctx.send('React to recieve your code!')
    await message.add_reaction('โœ…')

    def check(reaction, user):
        return reaction.emoji == 'โœ…' and reaction.message == message

    reaction, user = await bot.wait_for('reaction_add', timeout=30.0, check=check)
    await ctx.send(f"Please enter your code below. Your code: '{random.randint (10000,99999)}'")
    message = await bot.wait_for('message', check=lambda message: message.author == ctx.author and message.content == str(random.randint)) 
    await ctx.send(f'Verified {user.mention}')
swift pumice
#
async def mute(ctx, user: nextcord.Member, time : int):
    role1 = ctx.guild.get_role(985475444981764106)
    role2 = ctx.guild.get_role(985205310740389918)
    #print(ctx.guild.me.top_role > ctx.author.top_role)
    print(ctx.guild.me.top_role > user.top_role)
    if ctx.author.guild_permissions.administrator == True:
        await user.remove_roles(role2)
        await user.add_roles(role1)
        await ctx.send(f'{ctx.member.mention}is now muted')
        await asyncio.sleep(time*60)
        await user.remove_roles(role1)
        await user.add_roles(role2)
    else:
        await ctx.send("you are not administrator noob.")``` hi guys do you guys know why this isnt working? what  i mean by that that it stops working after the 2nd await, like it doesnt send the message nor removes the role
slate swan
slate swan
#

is it possible to check user's role in specific server?

#

!d discord.Guild.get_member

unkempt canyonBOT
#

get_member(user_id, /)```
Returns a member with the given ID.

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

!d discord.Member.roles

unkempt canyonBOT
#

property roles```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [โ€˜@everyone](mailto:'%40everyone)โ€™ role.

These roles are sorted by their position in the role hierarchy.
slate swan
#

if thats what you want by checking a users role in a specific guild

slate swan
#
options=[create_option(name="humour", description="ur name", required=True, option_type=3)])``` how do i do multiple of these
#

how to do it?

#

u cant

#

i dont think

slate swan
#
options=[create_option(name="humour", description="ur name", required=True, option_type=3)])``` how do i do multiple of these
pliant pagoda
#

still struggling with role adding, so would this work?

#test
@bot.command()
async def test(ctx):
  guild.get_role(993231458846122014)
  bot.add_roles(993231458846122014)

(and if not would appreciate if you pointed out what im doing wrong)

slate swan
#

๐Ÿ—ฟ selfbot?

#

discord.errors.HTTPException: 405 Method Not Allowed (error code: 0): 405: Method Not Allowed
the endpoint you're using is not allowed by discord for your token

pastel solar
#

I've just created it, maybe I forgot to add something in the developer portal?

slate swan
#

did you invite the bot with application commands scope?

pastel solar
# slate swan did you invite the bot with application commands scope?

I've managed to fix it, but now I have this error:

Ignoring exception in on_connect Traceback (most recent call last): File "C:\Users\renzo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 352, in _run_event await coro(*args, **kwargs) File "C:\Users\renzo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 793, in on_connect await self.register_commands() File "C:\Users\renzo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 338, in register_commands to_update = update_guild_commands[guild_id] KeyError: 995046874396512297

slate swan
#

what library is this? seem like pycord

#

is it?

pastel solar
slate swan
#

yeah, when did you update it for the last time?

pliant pagoda
#

any ideas if this is right? still struggling with a role command๐Ÿ˜ฉ

#test
@bot.command()
async def test(message):
    user = message.author
    role1 = guild.get_role(993231458846122014)
    user.add_roles(role1)
pastel solar
slate swan
#

idk i never use pycord

pastel solar
slate swan
#

well, i agree that it seems easier,
but as you can see the library tens to act weird often

#

is that all the code you have rn>

pliant pagoda
slate swan
#

if yes, i'd suggest using disnake which has an easy syntax

slate swan
pliant pagoda
#

sorry, i don't understand exactly. what do you mean?

slate swan