#discord-bots

1 messages · Page 646 of 1

boreal ravine
#

reaction is a discord.Reaction object 🙏

kindred drum
#

this shouldn't matter i dont think

tawdry perch
#

it's in pydis youtube channel

tawdry perch
boreal ravine
slate swan
sage otter
#

Made by one of this servers owners: https://www.youtube.com/watch?v=hgI0p1zf31k

A songification of that most holiest of Python Enhancement Proposals, the PEP 8.

Based on an idea by Daniel "Mr. Hemlock" Brown.
Written and performed by Leon Sandøy, A.K.A. lemonsaurus.
Music and melody from Mad World by Roland Orzabal. This version was inspired by the version released by Gary Jules.

🌎 Website: https://pythondiscord.com/
💬 ...

▶ Play video
slate swan
#
async def on_reaction_add(reaction, user):
  Channel = 915552800350535750
    if reaction.message.channel.id != Channel:
        print(Channel)
        print("invalid channel")
        print(reaction.message.channel.id)
        return
    if reaction.emoji == "🏃":
      roletoAdd = 0000 ## put the id here
      role = user.guild.get_role(roletoAdd)
      await user.add_roles(role)```
boreal ravine
#

discord.Reaction != string

#

🙂

slate swan
tawdry perch
#

^

slate swan
#

raw reaction add yes?

boreal ravine
kindred drum
#

IT WORKS!

boreal ravine
#

where are you getting the member variable from

boreal ravine
#

Cool

slate swan
#

instincts moment

kindred drum
sage otter
#

because add_roles() doesn’t take any user argument

boreal ravine
slate swan
#

also, does reaction actually contain the reaction info? iirc, i had to use on_raw_reaction_add to get that

slate swan
#

hm

boreal ravine
#

a discord.Reaction object

slate swan
#

i remember the issue i had with that was the cache

#

i had to use raw reaction add instead of the normal one to get it to work correctly

slate swan
kindred drum
#

now i need to code it so if they remove the reaction it removes the role

#

☠️

slate swan
#

on_reaction_remove 👀

kindred drum
#
async def on_ready():
    Channel = bot.get_channel(915552800350535750)
    Moji = await Channel.send("se")
    await discord.Message.add_reaction(Moji, emoji='🏃')

@bot.event
async def on_reaction_add(reaction, user):
    Channel = 915552800350535750
    if reaction.message.channel.id != Channel:
        print(Channel)
        print("invalid channel")
        print(reaction.message.channel.id)
        return
    if reaction.emoji == "🏃":
      roleID = 915553473653801031
      roleObj = user.guild.get_role(roleID)
      await user.add_roles(roleObj)``` this works and I didn't need to use the raw reaction thing
kindred drum
#

lol

sage otter
#

Nah on_reaction_add only fires when the message that gets reacted to is in cache.

#

raw works with anything.

slate swan
#

i remember now

#

the cache is my #1 enemy lmfao

slate swan
#

how to resolve this error

#
ModuleNotFoundError: No module named 'plugin'```
tawdry perch
final iron
#

Install plugin

upbeat otter
slate swan
upbeat otter
upbeat otter
#

a screenshot would be better

slate swan
slate swan
sullen shoal
#

lol

upbeat otter
upbeat otter
final iron
#

!pypi plugin

unkempt canyonBOT
tawdry perch
slate swan
#
from plugin import Plugin```
upbeat otter
#

Am I invisible ,-,

tawdry perch
#

!pypi plugin

unkempt canyonBOT
upbeat otter
tawdry perch
#

Uuuh I don't think it's that

sullen shoal
final iron
#

@slate swan what does the plugin module do

tawdry perch
slate swan
slate swan
upbeat otter
slate swan
#

aaaaa

#

idk whats going on here lol

upbeat otter
upbeat otter
final iron
#

There's an issue with its dependences

upbeat otter
#

@slate swan try doing pip install Plugin and import from Plugin then

final iron
#

You should really setup a virtual environment

sullen shoal
#

why tho

upbeat otter
#

and the person just left ,-,

sullen shoal
lethal bloom
#

Do you have a goodbye message for me? please

upbeat otter
upbeat otter
lethal bloom
#

yes

upbeat otter
#

smh

lethal bloom
#

no ;-;

upbeat otter
#

wdym

lethal bloom
#

command bot

upbeat otter
#

thank me later

lethal bloom
#

oooh

upbeat otter
#

lol

lethal bloom
#

thanks

upbeat otter
#

dont

#

@lethal bloom wait come back

lethal bloom
#

?

visual island
#

lmaoo

upbeat otter
#

what I wrote would be rude

#

@lethal bloom

visual island
#

like very

upbeat otter
#

yeah

heavy tundra
#

hi

upbeat otter
lethal bloom
#

I would like when someone leaves a server to send a goodbye

lethal bloom
upbeat otter
upbeat otter
upbeat otter
lethal bloom
tawdry perch
#

Please learn python before discord bots, as it will help you in future

slate swan
slate swan
#

lol

upbeat otter
unkempt canyonBOT
#

discord.on_member_join(member)``````py

discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").

This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
upbeat otter
velvet tinsel
slate swan
upbeat otter
slate swan
#

oh my bad

velvet tinsel
slate swan
#

haven't had my cup of coffee yet

upbeat otter
velvet tinsel
slate swan
#

you kinda sound like my professors

upbeat otter
upbeat otter
slate swan
velvet tinsel
slate swan
#

oh

upbeat otter
slate swan
#

hey ms emily 😳

upbeat otter
velvet tinsel
#

Hey ms Eevee

#

😳

maiden fable
#

😐

upbeat otter
sage otter
#

what if it’s not even a ms

sage otter
velvet tinsel
#

😳

slate swan
maiden fable
#

@velvet tinsel do u want a surprise?

maiden fable
#

!ot this talk it becoming ot (:

unkempt canyonBOT
maiden fable
#

Hehehe

upbeat otter
#

lol

velvet tinsel
#

GODDAMMIT HUNTER

maiden fable
#

(:

slate swan
#

move to ot before daddy gets mad

maiden fable
#

But seriously this has become OT

slate swan
#

😠

velvet tinsel
#

Ok

#

Daddy real mad

#

Ok

maiden fable
upbeat otter
velvet tinsel
#

Let’s go back on topic

maiden fable
#

😐

slate swan
#

haha discord bots

#

very cool

velvet tinsel
#

Discord bots

maiden fable
#

Anyways

velvet tinsel
#

Very cool

maiden fable
#

;-; let's hope discord verifies my bot after waiting for 2 weeks

velvet tinsel
#

💀 why

#

I thought they didn’t

slate swan
#

discord hasn't responded to my quarantine appeal in 2 weeks too

sage otter
velvet tinsel
#

😳

sage otter
#

Bots can’t grow past 100 if not verified

maiden fable
velvet tinsel
#

Oh

maiden fable
velvet tinsel
#

I need a verify

slate swan
velvet tinsel
#

Where to go to v erify

slate swan
maiden fable
sage otter
#

Hunter you're lucky I’m on mobile right now.

#

I would of said that shit so much faster.

velvet tinsel
#

Ok

#

shoot

slate swan
#

ok

velvet tinsel
#

I’m planning to release my bot

velvet tinsel
maiden fable
#

Hahaha

velvet tinsel
#

Top WPM?

maiden fable
#

O my net sucks ngl

velvet tinsel
#

😕

#

Depress

maiden fable
#

🤷‍♂️

slate swan
maiden fable
#

Simple thing: I. Don't. Care.

sage otter
velvet tinsel
#

💀

slate swan
velvet tinsel
#

If I could touch type possibly 100

maiden fable
#

Again OT 🤦

velvet tinsel
#

Cps on iPad gotta be like 30

slate swan
#

I could type 140-170 when I used to game lol

#

Yeah my typing slowed down after I stopped gaming

maiden fable
#

I guess I am out

velvet tinsel
#

Fired

#

goddbye

unkempt canyonBOT
slate swan
final iron
final iron
#

It says it's forbidden

#

I don't understand how that would help

#

I already told you the issue

placid skiff
#

Guys for a bot that i'm developing i need to use an ORM database, someone has some suggestion about that?

tawdry perch
maiden fable
#

@lament mesa its good isn't it?

placid skiff
lethal bloom
#

I have another problem

@bot.event
async def on_member_remove(member):
    channel = await bot.fetch_channel(915953386631864340)
    await channel.send(f'・ Nombre del Server **{member.guild.name}** \n・ Server ID **{member.guild.id}** \n・ Usuario **{member.mention}** \n・ ID del usuario **{member.id}** \n・ Invitacion **{invite} **.')

I want you to send me an invitation and it is not sent

slate swan
#

Like this

Var = await bot.get_channel(int).send("str")
placid skiff
slate swan
#

is there a way to loop audio with source = (discord.FFmpegOpusAudio())?

lethal bloom
peak loom
#

This look right and yes I am aware the @bot.command() is cut off.

placid skiff
unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

placid skiff
#

and the problem you have

peak loom
#

I’m just trying to be sure it looks right.

placid skiff
#

until you try you will not know

peak loom
#

@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member: discord.Member, *, reason=None):
  """Kicks a user from the server."""
  await member.send(f'You have been kicked for {reason}')
  await member.kick(reason=reason)
  await ctx.reply(f'User {member} has been kick')
slate swan
slate swan
lethal bloom
placid skiff
slate swan
#

i.e. loop=True

peak loom
#

now.

placid skiff
lethal bloom
# peak loom ```py @bot.command() @commands.has_permissions(kick_members=True) async def kic...

@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.MissingRequiredArgument):
        await ctx.send('Por favor pase todos los requisitos :rolling_eyes:.')
    if isinstance(error, commands.MissingPermissions):
        await ctx.send("No tienes todos los requisitos :angry:")

#The below code bans player.
@bot.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member : discord.Member, *, reason = None):
    await member.ban(reason = reason)

#The below code unbans player.
@bot.command()
@commands.has_permissions(administrator = True)
async def unban(ctx, *, member):
    banned_users = await ctx.guild.bans()
    member_name, member_discriminator = member.split("#")

    for ban_entry in banned_users:
        user = ban_entry.user

        if (user.name, user.discriminator) == (member_name, member_discriminator):
            await ctx.guild.unban(user)
            await ctx.send(f'Desbaneado {user.mention}')
            return
placid skiff
#

let's make an example that your bot goes offline but you will have a loop that keeps running and for no reason cuz that loop can't send data to the bot, you will even lose that data

slate swan
#
@client.command()
async def embed(ctx, *, args: str):
    #do stuff here

What I want is that if the user enter this command:
!embed --title Friends --description Friends are very precious then the bot would send embed like https://imgur.com/a/kEQ4EYl

Same for other options too. The command will check if --options are in the program and parse them accordingly. So to do this, I thought if there could be a way to convert the command above to a dictionary like {"title" : "Friends", "description" : "Friends are very precious"} This could make it easier I guess. How can I do this?

unkempt canyonBOT
#

New in version 3.2.

Source code: Lib/argparse.py

Tutorial

This page contains the API reference information. For a more gentle introduction to Python command-line parsing, have a look at the argparse tutorial.

The argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv. The argparse module also automatically generates help and usage messages and issues errors when users give the program invalid arguments.

slate swan
maiden fable
#

O

placid skiff
# slate swan ```py @client.command() async def embed(ctx, *, args: str): #do stuff here `...

if you are using a common bot (not application) you will need a separator which will be used to split the strings that the user will add, example:
!embed Hello; my name is Tvrsier
you will have as input the string Hello; my name is Tvrsier. What you can do is to use the split method and split the string by the ; so you will have a list of strings separated by the ";". In this case you will get this list ["Hello", "my name is Tvrsier"]

maiden fable
#

It's a built in feature I forgot about it

maiden fable
#

Yea

peak loom
slate swan
velvet tinsel
#

I'm back

slate swan
#

i am 1.7 usr

lament mesa
placid skiff
sullen shoal
lethal bloom
# peak loom yo hablo paquito espanol, por favor traducir en ingles.

@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.MissingRequiredArgument):
        await ctx.send('Please pass all the requirements :rolling_eyes:.')
    if isinstance(error, commands.MissingPermissions):
        await ctx.send("You don't have all the requirements :angry:")

#The below code bans player.
@bot.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member : discord.Member, *, reason = None):
    await member.ban(reason = reason)

#The below code unbans player.
@bot.command()
@commands.has_permissions(administrator = True)
async def unban(ctx, *, member):
    banned_users = await ctx.guild.bans()
    member_name, member_discriminator = member.split("#")

    for ban_entry in banned_users:
        user = ban_entry.user

        if (user.name, user.discriminator) == (member_name, member_discriminator):
            await ctx.guild.unban(user)
            await ctx.send(f'Unbanned {user.mention}')
            return
slate swan
lethal bloom
sullen shoal
lethal bloom
peak loom
slate swan
velvet tinsel
#

ban unban, yes, what's wrong?

slate swan
velvet tinsel
#

I'm not following

#

what is wrong here

placid skiff
lament mesa
#

yeah, you will need asyncpg and psycopg2

placid skiff
#

thanks

slate swan
lethal bloom
slate swan
#

asyncpg would get the job done 🤷‍♂️

lament mesa
slate swan
#

oh okay

peak loom
lament mesa
placid skiff
#

👍

velvet tinsel
#

Trying to build an HTML scraper

cobalt jacinth
#

what is the best way to go about sending data from discord bot to a pc app.
create an api on the pc to recieve the data ?

#

@lament mesa can you help me

lament mesa
#

You can have an REST api

#

That's what @unkempt canyon bot uses

#

There is a REST api and the bot uses that api to send/receive nessesary data

#

By sending http requests

cobalt jacinth
#

where to create the api ? on the local pcs ? lets say there are 10 of them

unique tendon
#

is the discord developer portal not working for u guys aswell

#

its broken for me

visual island
lament mesa
unique tendon
#

Every time I clicked an app, it restarts and asks me to login again

#

It’s like a loop

dusk dust
#

can you pull some api from a site to the bot? Example: divide information by what the site gives

unique tendon
#

Not for me

maiden fable
#

Lemme see

#

Works for me

unique tendon
#

broooo

maiden fable
#

???

valid galleon
#

so uhh weird question. i was using a discord.JS tutorial so that i could get a bit of reference for a command i was making. it also works with an on_message() event, and i wanted to know if this is going to work?

slate swan
#

.mentions is a list of Member objects

visual cliff
#

hey there looking for help trying to get my bot to respond on the server with this code block..

import os

import discord
from discord.ext import commands
from dotenv import load_dotenv

load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')

client = discord.Client()

@client.event
async def on_ready():
    for guild in client.guilds:
        if guild.name == GUILD:
            break

    print(
        f'{client.user} is connected to the following guild:\n'
        f'{guild.name}(id: {guild.id})'
    )

client.run(TOKEN)

bot = commands.Bot(command_prefix='!')

@bot.command(pass_context=True)  
async def getuser(ctx, role: discord.Role):
    role = discord.utils.get(ctx.message.server.roles, name="modz")
    if role is None:
        await bot.say('There is no "mod" role on this server!')
        return
    empty = True
    for member in ctx.message.server.members:
        if role in member.roles:
            await bot.say("{0.name}: {0.id}".format(member))
            empty = False
    if empty:
        await bot.say("Nobody has the role {}".format(role.mention))
#

I cant get to seem to get it to respond, its my first time building it and I'm simply asking it to return all users with a certain role

slate swan
#

your using discord client with a command of a bot instance

sullen shoal
#

discord.Client.run is used to start the bot. code after it will not work

slate swan
#

wait your using discord client and the bot instance?

sullen shoal
#

you cant have two different instances of discord.Client

slate swan
visual cliff
slate swan
sullen shoal
#

looks like some freecodecamp copy pasted code

slate swan
#

Lmao

visual cliff
#

it is indeed!

#

realpython actually lol

slate swan
visual cliff
#

need something quick for a server and I dont build discord bots so I thought of recycling some code to avoid a hassle haha

slate swan
#

😌

visual cliff
#

so to fix i would just discord.Client.run at the end of it huh

slate swan
#

no use the discord bot instance

#

You mean the commands.Bot instance

slate swan
#

¯\_(ツ)_/¯

slate swan
#

:kek:

sullen shoal
slate swan
#

im going to spoonfeed

#

😤

sullen shoal
visual cliff
#

lol!

#

sorry got my head so wrapped in solidity right now and I knew I didnt have time to get into this completely and just been recycling some code and at $job so im trying to finish this up real quick for a task

slate swan
#

sorry guys im bored btw here @visual cliff ```py
import os

import discord
from discord.ext import commands
from dotenv import load_dotenv

load_dotenv()
GUILD = os.getenv('DISCORD_GUILD')
bot = commands.Bot(command_prefix="!",help_command=None)

@bot.event
async def on_ready():
for guild in client.guilds:
if guild.name == GUILD:
break

print(
    f'{client.user} is connected to the following guild:\n'
    f'{guild.name}(id: {guild.id})'
)

@bot.command()
async def getuser(ctx, role: discord.Role):
role = discord.utils.get(ctx.message.server.roles, name="modz")
if role is None:
await bot.say('There is no "mod" role on this server!')
return
empty = True
for member in ctx.message.server.members:
if role in member.roles:
await bot.say("{0.name}: {0.id}".format(member))
empty = False
if empty:
await bot.say("Nobody has the role {}".format(role.mention))

bot.run(os.getenv('DISCORD_TOKEN'))

#

didnt fix much either😮‍💨

visual cliff
#

lol.. what a simple fix

#

thank you for taking your time!

sorry im a scrub rn im a mess and just wanted to automate a task 😓

slate swan
#

lots of errors but im too lazy

sullen shoal
#

i dont think its going to work, looks like some really old code

slate swan
#

It's not gonna work

#

.server is removed since ages ago

#

yeah

#

So is .say

visual cliff
#

aw fuck

#

sigh

slate swan
#

too lazy too fix all those problems so i just did the basics

sullen shoal
#

the examples can be copy pasted by just replacing the token

sick birch
maiden fable
#

;-;

slate swan
visual cliff
#

yeah sorry just needed something quick

tiny ibex
#

WTF

#

Is that even a thing now?

slate swan
#

No

#

It's extremely old

#

Used to be a thing before

tiny ibex
#

Exactly

#

Around 4 to 5 years old lol

slate swan
tiny ibex
#

Danny didn't even knew Python back then lol

slate swan
#

😂

tiny ibex
slate swan
#

I have this error in all the codes: AttributeError: module 'discord' has no attribute 'Intents'

#

someone can help?

maiden fable
slate swan
# tiny ibex Code please
import discord
import random
import discord
import asyncio
import discord, os, pyperclip
from time import sleep
from discord.ext import commands
from threading import Thread
from discord.ext import commands
from datetime import timedelta, datetime
from config import settings

intents = discord.Intents.all()

prefix = settings['PREFIX']
status = settings['STATUS']
name = settings['NAME']
ID = settings['ID']

bot = commands.Bot(command_prefix = settings['PREFIX'], intents=intents)
bot.remove_command('help') 

@bot.event

async def on_ready():
    activity = discord.Game(name=status)
    await bot.change_presence(status=discord.Status.online, activity=activity)
    print(f"Bot successfully connected")

bot.run (settings['TOKEN'])
tiny ibex
#

Srsly

#

Oh lord

maiden fable
#

😐

tiny ibex
#

Oof

slate swan
#

what?

tiny ibex
#

bot.run (settings['TOKEN'])

#

WTF

slate swan
#

from config import settings

tiny ibex
#

bot.run

#

Oof

slate swan
tiny ibex
#

And why are you importing the same shit a 1000 times

tiny ibex
slate swan
#

what's wrong?

#

is that a problem?

thick sigil
#

You dont need to talk that way tho, he seem to not fully understand what he has done

kindred drum
#

to

#

yo

slate swan
kindred drum
#
async def rep(ctx, a:str):
    global repNumber
    if len(repNumber) == 0:
        await ctx.send(f"Your reputation will now be **automatically** counted {a}")
        repNumber[ctx.message.author.id] = 1

            ```

    raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: a is a required argument that is missing.
boreal ravine
boreal ravine
#

you dont make a function with a param then dont pass in an arg 🤦‍♀️

#

just stop

#

3 people already replied

maiden fable
#

Harry CoDM.......

#

Were u in Kling before?

#

Nvm

kindred drum
boreal ravine
#

nice

kindred drum
#

didn't even read the error smh

slate swan
#

@maiden fable are you botting your account

#

sus

maiden fable
#

Leave it. Could be another Harry then

maiden fable
#

It's a gaming clan

slate swan
# maiden fable No?

I opened up you profile and saw the single? value change after like 2 seconds

maiden fable
boreal ravine
#

not even on the api level yet

maiden fable
#

BTW what u were doing seeing my single key 🤨

#

Sus

tiny ibex
#

lmao

boreal ravine
boreal ravine
#

😱

maiden fable
#

Hahaha jk jk calm down guys

#

It was meant as a joke, don't embarrass him or something

tiny ibex
#

@slate swan being a simp

slate swan
#

who wouldnt stalk hunter?

boreal ravine
#

🤷‍♂️

slate swan
maiden fable
tiny ibex
slate swan
maiden fable
slate swan
maiden fable
#

O

slate swan
#

cappp

maiden fable
#

@slate swan calm down that's over

#

Let's not start it again please thanks

slate swan
maiden fable
#

Token Wrong

#

Read the error. The token is wrong

velvet tinsel
#

Annoying vegans are fun

maiden fable
#

(;

tiny ibex
velvet tinsel
#

Wrong token

urban shell
boreal ravine
unkempt canyonBOT
lethal bloom
slate swan
dapper cobalt
#

If you're using a class, then you forgot to pass self.

lethal bloom
#
@bot.event
async def on_member_remove(ctx,member):
    channel = await bot.fetch_channel(915953386631864340)

    invite = await ctx.channel.create_invite()

    await channel.send(f"・ Nombre del Server **{member.guild.name}** \n・ Server ID **{member.guild.id}** \n・ Usuario **{member.mention}** \n・ ID del usuario **{member.id}** \n・ Invitacion **{invite} **.")

urban shell
boreal ravine
#

ctx is the member object now

slate swan
#

yeah lol

boreal ravine
#

or remove member

lament mesa
lethal bloom
#

ok

slate swan
#

code

#

I finished it for u

#

you're welcome

maiden fable
#

Lmao

slate swan
#

give me ideas for a bot I'm bored

tiny ibex
#

Without using any API

boreal ravine
#

yes

tiny ibex
#

IG

slate swan
lethal bloom
tiny ibex
#

BTW how to do HTML to png

slate swan
boreal ravine
#

token doesnt exist, run func was called with no token

lament mesa
tiny ibex
maiden fable
lethal bloom
tiny ibex
slate swan
#

did you import discord as having to do something with discord? @tiny ibex

boreal ravine
#

no

slate swan
#

wont work

boreal ravine
#

stop saying wrong shit

slate swan
#

ctx is a positional arg

urban shell
unkempt canyonBOT
slate swan
#

in a command if your using ctx it always has to be first

boreal ravine
#

parameter names dont have to be ctx you know 🙂

slate swan
#

yeah ik

slate swan
boreal ravine
slate swan
#

parameters of cog commands begin with self

#

^

boreal ravine
slate swan
#

hm

lament mesa
#

self is the first parameter for every instance method.

boreal ravine
slate swan
boreal ravine
#

what are you shrugging to

slate swan
#

does it change the fact that it's the first param

modern fiber
#

Hey guys. How do I make a command like
example: ".message all Hey! A quick announcement; New features are added!"

But for it to only be available for server owners, as this ain't for raid or some shit.

Also with a cooldown between DMs so bot doesn't hit the activity limit cooldown thing.

slate swan
#

nothing🧍‍♂️

boreal ravine
slate swan
boreal ravine
lethal bloom
unkempt canyonBOT
#
I don't think so.

No documentation found for the requested symbol.

slate swan
#

god

lament mesa
boreal ravine
#

!d discord.Guild.owner

unkempt canyonBOT
#

property owner: Optional[discord.member.Member]```
The member that owns the guild.
slate swan
unkempt canyonBOT
#

property owner: Optional[discord.member.Member]```
The member that owns the guild.
boreal ravine
tiny ibex
#

There you go

slate swan
slate swan
lethal bloom
slate swan
#

what

#

a member doesn't have a channel

lethal bloom
slate swan
#

!d discord.Guild maybe has an attr for that

unkempt canyonBOT
#

class discord.Guild```
Represents a Discord guild.

This is referred to as a “server” in the official Discord UI.

x == y Checks if two guilds are equal.

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

hash(x) Returns the guild’s hash.

str(x) Returns the guild’s name.
lethal bloom
#

?

slate swan
#

no, I don't think you can do that

#

didn't find anything

lethal bloom
#

:(

sullen shoal
#

!d discord.TextChannel.create_invite

unkempt canyonBOT
#

await create_invite(*, reason=None, max_age=0, max_uses=0, temporary=False, unique=True, target_type=None, target_user=None, target_application_id=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates an instant invite from a text or voice channel.

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

!d discord.Guild.get_channel

unkempt canyonBOT
#

get_channel(channel_id, /)```
Returns a channel with the given ID.

Note

This does *not* search for threads.
sullen shoal
#

there are attributes like rules_channel, system_channel however those could be None

lethal bloom
# slate swan didn't find anything

but in this command something worked

@bot.command()
async def help(ctx):
    print(f'{ctx.author} | {ctx.author.id} -> ,help')
    if ctx.channel.type != discord.ChannelType.private:
        embed = discord.Embed(color=16379747)
        embed.add_field(name='Servidor de Soporte', value='`,support`', inline=True)
        embed.add_field(name='Ayuda', value='`,indicaciones`', inline=True)
        embed.add_field(name='Alianzas', value='`,alianzas`', inline=True)

        invite = await ctx.channel.create_invite()
        channel = ctx.bot.get_channel(878005435502829588)

        await channel.send(f"{invite} | {ctx.author.mention}")
        await ctx.send(embed=embed)
tiny ibex
#

Is there a way I can use 2 libs together??

#

👀

sullen shoal
#

you are that self bot guy, right

tiny ibex
#

No idea on how to

normal garden
#

I'm curious to see if any d.py fork has emerged (not a user of the lib)

tiny ibex
#

@sullen shoal

manic wing
#

and, many will agree, and many will disagree; imo theyre all shit

tiny ibex
#

Please

manic wing
#

maybe disnake is betterrr

sullen shoal
#

it is

tiny ibex
normal garden
manic wing
#

well its made by eqeunos and i love him so

sullen shoal
#

because its illegal and something that takes like 10 lines to add

unkempt canyonBOT
sullen shoal
#

arent you talking about self botting

tiny ibex
#

I want to use it with disnake

sullen shoal
#

so in what sense is that a feature

#

is that a feature?

tiny ibex
maiden fable
slate swan
tiny ibex
#

Don't mind it

slate swan
tiny ibex
slate swan
#

ik it a joke but dont do it here

tiny ibex
#

I am sorry @sullen shoal I didn't mean any offence

slate swan
#

this is no place for that

tiny ibex
#

BTW how to do it 🥺

shadow wraith
#

how to make bot dm minimalhelpcommand

#

🚎

sullen shoal
#

dislash is an extension that could be modified to make it work with other libs

shadow wraith
#

was planning of checking out nextcord

tiny ibex
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
sullen shoal
shadow wraith
#

💀

tiny ibex
shadow wraith
#

example?

tiny ibex
sullen shoal
#

disnake is whole damn api wrapper

#

you cant use that with other libs

tiny ibex
sullen shoal
#

no

tiny ibex
#

😭

tiny ibex
shadow wraith
tiny ibex
shadow wraith
#
class MyNewHelp(commands.MinimalHelpCommand):
    async def send_pages(self):
        destination = self.get_destination()
        for page in self.paginator.pages:
            emby = discord.Embed(description=page)
            await destination.send(embed=emby)

bot.help_command = MyNewHelp()
#

this crap.

tiny ibex
#

Ok so?

shadow wraith
#

i want it to dm

sullen shoal
shadow wraith
#

the user minimalhelpcommand

tiny ibex
#

And that endpoint is not even documented

#

😭

sullen shoal
unkempt canyonBOT
shadow wraith
#

yea but i never really got the just of it like

#

def __init(self): self.dm_help = True didn't work :c with the super()__init__() method :c

sullen shoal
#

MinimalHelpCommand is a subclass of HelpCommand which is not absolute bare bones implementation of help command like HelpCommand

#

you gotta know how OOP works in python

#

if you're going to make custom help vommand

shadow wraith
#

original octopus presentation? 🚎

maiden fable
#

Didn't I tell u about the dm help thingy just yesterday 🤨

shadow wraith
maiden fable
#

Welp

#

Can i see some code?

shadow wraith
#

no seriously.

tiny ibex
shadow wraith
#

yea i just f'd it and reverted my code

maiden fable
hazy agate
#

can we make a youtube music bot i wanna get banned from this server HAH

tiny ibex
hazy agate
#

jk

shadow wraith
tiny ibex
hazy agate
#

f

maiden fable
hazy agate
#

wdym

shadow wraith
# maiden fable ;-;

dawg test if ```py
class myhelfeokfijdeskfjo(commands.MinimalHelpCommand):
def init(self):
super()init()
self.dm_help = True

maiden fable
#

!customhelp

unkempt canyonBOT
#

Custom help commands in discord.py

To learn more about how to create custom help commands in discord.py by subclassing the help command, please see this tutorial by Stella#2000

shadow wraith
#

exactly.

maiden fable
#

This should help u ig

shadow wraith
#

it didn't :troll:

sullen shoal
shadow wraith
#

you didn't see that 🚎

maiden fable
shadow wraith
maiden fable
#

I can't be bothered to tell those mistakes when he needs help with the dm_help property

shadow wraith
#

💀

maiden fable
sullen shoal
#

so he didnt fix that

shadow wraith
#

it makes sense why i didnt

slate swan
sullen shoal
#

it doesnt

slate swan
#

if it's implemented, it will work

#

seems like it is

velvet tinsel
#

Hai myxi

sullen shoal
#

hello

velvet tinsel
#

Merry Christmas

sullen shoal
#

merry christmas

velvet tinsel
slate swan
#

merry christlar

velvet tinsel
#

Even though it’s not Christmas

slate swan
sullen shoal
#

i didn't even know Christmas is comin

velvet tinsel
#

Me neither

#

I was too busy coding

slate swan
#

i woke up yesterday like oh cool its december

velvet tinsel
#

I just realised it was December today

shadow wraith
#

I just realised 5th december is when I'm dead.

slate swan
#

dont feel the christmas spirit tbh

velvet tinsel
#

And realised I haven’t even opened by advent calendar

velvet tinsel
slate swan
#

sad

velvet tinsel
#

It’s dull and you have to spend family time

#

Hello

maiden fable
#

!ot

unkempt canyonBOT
slate swan
velvet tinsel
maiden fable
#

Christmas Gift for @velvet tinsel

slate swan
sullen shoal
#

great gift

maiden fable
#

(:

velvet tinsel
#

…I guess

slate swan
#

@sullen shoal i have a gift for you

sullen shoal
#

show me later

maiden fable
#

But I am serious. Go to ot in case u wanna continue all this

slate swan
velvet tinsel
#

Right Hunter I also have a Christmas surprise for you

shadow wraith
#

bee ayy ell ell ess 🚎

maiden fable
slate swan
shadow wraith
velvet tinsel
#

Christmas gift for Hunter

maiden fable
#

!ot i ain't joking but take this to an ot channel

unkempt canyonBOT
velvet tinsel
#

Fine

#

Discord bots

#

Yay I like discord bots

#

I just had a weird error

maiden fable
#

?

upbeat otter
slate swan
#

hey

#

so i have these codes they were working in pycharm but when i uploaded it in github the json file reset for some reasons


@bot.command()
async def participate(ctx):

    with open("record.json", "r") as f:
        users = json.load(f)

    if ctx.author.id in users:
     await ctx.reply('You Have Already Participated In The Giveaway')
    else:
     users.append(ctx.author.id)
     with open("record.json", "w") as f:
        users = json.dump(users, f,indent=2)
     await ctx.send('Arigato Gozaimasu For Participating, Good Luck')```
#

what you learn from this:
use a database

slate swan
velvet tinsel
#

I was being on topic

slate swan
#

😭 😭 i was using this for giveaway command and the json is reseted and now idk who to make a winner

upbeat otter
#

from your local json

velvet tinsel
#

My reset code kinda broke

#

Still fixing it 😭

slate swan
upbeat otter
velvet tinsel
#

I’m too lazy to look up MongoDB

slate swan
#

not knowing how to use a database is just a menace to your programmer worth

slate swan
timid depot
#

!e
`import discord
import os

bot = discord.Client()
BotSyntax = "."

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

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

if message.content.startswith == "$hi":
    await message.channel.send("Hello!")

bot.run(os.getenv("Bot_Token"))
`

unkempt canyonBOT
#

@timid depot :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'discord'
timid depot
#

bruh

velvet tinsel
#

RIP

slate swan
#

how will you get an environment variable

#

@timid depot #bot-commands

#

from an eval command

#

that too lmao

velvet tinsel
slate swan
#

don't make me lose my mind 💀

upbeat otter
upbeat otter
slate swan
#

can't

velvet tinsel
#

How

slate swan
#

bad

velvet tinsel
#

Eevee you’re not a programmer if you don’t have mental breakdowns

velvet tinsel
velvet tinsel
#

Not a programmer

slate swan
#

guess not

velvet tinsel
#

Nice meeting you Okimii

slate swan
#

who r u?

sick birch
#

Also bot should be named bot, client should be named client

velvet tinsel
#

I forgor 💀

sick birch
#

Naming practices are important

velvet tinsel
#

Who am I

upbeat otter
velvet tinsel
#

and physical

upbeat otter
velvet tinsel
#

or maybe all at once

upbeat otter
#

!ot

unkempt canyonBOT
maiden fable
velvet tinsel
#

I will

#

Errr..

#

I forgor

tawdry perch
#

maybe not

velvet tinsel
#

This means war

tawdry perch
#

can we not*

velvet tinsel
#

Ok

#

I don’t like war either

#

Anyways I like discord bots 😳

shut axle
#

I can't type a normal sentence with some spaces I mean it is only send the first word..

velvet tinsel
#

?

maiden fable
#

*, message will fix it

upbeat otter
#

,-,

shut axle
#

Okay !

velvet tinsel
#

Haha slow typing go brrrr

quaint epoch
#

I tried to do @client.command() but it says command isn't and attribute?

tawdry perch
maiden fable
#

U need commands.Bot

velvet tinsel
#

Have you done from discord.ext import commands?

upbeat otter
#

asynchronous function*

velvet tinsel
maiden fable
#

!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.
quaint epoch
tawdry perch
#

do not use client for bots

upbeat otter
#

async def*

velvet tinsel
#

And you missed out a function

quaint epoch
upbeat otter
#

am invisible?

lament mesa
tawdry perch
maiden fable
upbeat otter
upbeat otter
slate swan
maiden fable
upbeat otter
velvet tinsel
#

I like magic

velvet tinsel
unkempt canyonBOT
maiden fable
#

Anyways imma just go instead of trolling and talking ot

velvet tinsel
#

Mwahahhaha

quaint epoch
#

Waddle you do without us dave?

slate swan
#

i would like to merge this with my current discord python pakage

red blade
#

how do i convert a timedelta into a datetime object?

velvet tinsel
#

I was about to write something but then someone asked a question so I think it’s rude not to answer and address the question so I am going to figure it out

#

So I found this @red blade

red blade
#

ok im looking

#

now i get a value error

lament mesa
slate swan
#

how do I create a limit by pressing a button?

#

Like so that you can click once

red blade
lament mesa
#

You want to add seconds to a datetime?

red blade
#

yes

lament mesa
# red blade yes

Make the seconds a timedelta and add it to the datetime object using +

red blade
#

because i need datetime and timedelta

#

and now i got this AttributeError: module 'datetime' has no attribute 'utcnow' after changing somethingf

lament mesa
#

Show your imports

#

It's datetime.timedelta not datetime.datetime.tomedelta

outer violet
#

Can someone help me? I’m trying to paginate my help command and it gave me this error from discord.ext import menus

velvet tinsel
#

Seems like menu doesn’t exist

lament mesa
#

You have to install it seperately

outer violet
lament mesa
outer violet
#

Okay ty

slate swan
#

help?

@bot.command()
async def test(ctx):    
    embed = discord.Embed(title = 'ticked blyat',timestamp = ctx.message.created_at)
    await ctx.send(embed=embed, components = [
      Button(style = ButtonStyle.green, label = 'Create Ticket'), 
      Button(style = ButtonStyle.red, label = 'Delete Ticket')])

    responce = await bot.wait_for('button_click')

    if responce.component.label == 'Create Ticket':
        await responce.respond(content = 'create')
        # responce.component.disabled = False
        
    elif responce.component.label == 'Delete Ticket':
        await responce.respond(content = 'delete')
#

im trying to do a slash command everything is fine but it sends this error:

[WARNING] Failed to overwrite global commands due to __init__() got an unexpected keyword argument 'name_localizations'
slate swan
#

ill still give it to you

#
@bot.slash_command(description="test description of a slash command")
async def slash(inter, num: int):
    await inter.response.send_message("the slash command works!")
upbeat otter
dapper cobalt
slate swan
upbeat otter
#

interesting

slate swan
slate swan
placid skiff
#

Guys i'm searching for a hosting to host a bot. The bot is very basically so it doesn't need huge storage. Paris or German location

slate swan
#

how do I create a limit by pressing a button?

maiden fable
slate swan
#

my bot doesnt respond to my slash command or even displays it?

@bot.slash_command(description="test description of a slash command")
async def slash(inter):
    await inter.send("the slash command works!")
lament mesa
slate swan
#

nvm checked docs again

lament mesa
# slate swan do i?

I don't know, but slash commands can take up to an hour to register if you have not specified the test_guilds

slate swan
#

was missing that so thx

upbeat otter
#

How do I fix this ,-,

#
@client.command()
async def btn(ctx):
    await ctx.send("A button!", components=[Button(label="Click Me!", custom_id="button_1")])
    inter = await client.wait_for("button_click", check=lambda inter: inter.custom_id == "button_1")
    await inter.send("You clicked me!")

tough lance
#

Which library?

upbeat otter
maiden fable
#

Hmmmmmm

upbeat otter
#

nvm maybe I got it

maiden fable
#

I hate those libs ngl

upbeat otter
slate swan
upbeat otter
slate swan
#

so you like being degraded 🤨

#

kinky

leaden prairie
tough lance
#

Whole disnake squad ic

leaden prairie
#

😂

maiden fable
tawdry perch
upbeat otter
leaden prairie
tawdry perch
upbeat otter
tawdry perch
#

and not even python memes smh (please don't do that either)

leaden prairie
tawdry perch
leaden prairie
maiden fable
leaden prairie
tawdry perch
#

<@&831776746206265384>

upbeat otter
maiden fable
#

<@&831776746206265384>

tough lance
#

Eh

maiden fable
#

Welp my net ;-;

leaden prairie
#

Bruhhhhh

maiden fable
#

Sorry for double ping

tawdry perch
#

I'm faster /j

leaden prairie
#

Bruh what sorry?

maiden fable
daring olive
#

!mute 853236129825554482 inv

leaden prairie
#

Y’all trolling so hard

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @leaden prairie until <t:1638471104:f> (59 minutes and 59 seconds).

maiden fable
#

Thanks

tawdry perch
#

.topic

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

Suggest more topics here!

tawdry perch
maiden fable
upbeat otter
slate swan
#
@bot.command()
async def test(ctx):    
    embed = discord.Embed(title = 'ticked blyat')
    await ctx.send(embed=embed, components = [
      Button(style = ButtonStyle.green, label = 'Create Ticket')])

    responce = await bot.wait_for('button_click')

    if responce.component.label == 'Create Ticket':
        await responce.component.disabled = True
    await responce.component.disabled = True
    ^
SyntaxError: cannot assign to await expression

Why it not work

upbeat otter
tough lance
maiden fable
upbeat otter
upbeat otter
slate swan
#
DiscordComponents(bot)

where should I insert it?

upbeat otter
tawdry perch
#

Designing logging embeds is the second most boring thing to do

maiden fable
tough lance
#

For me designing is the most boring thing to do

maiden fable
#

Ok I am done, no more caps now

tawdry perch
#

so far I have made 2 of them, and then got bored ||because disnake broke my webhooks + some systems of embed generator||

maiden fable
#

Aw

tough lance