#discord-bots
1 messages · Page 636 of 1
What python version are you running?
hi
Ok
why the rest of those in here,
dc-comp.
dc-inter.
py-slash
What’s the problem?
People who don't use full covered repo's need to do this.
I'm pretty sure they have conflicts among them
dislash.py too
Can you excuse me
They are not it's meant for this.
I don’t want to help people rn
uh
I’m a bit tired
Are those extensions or standalone lib
Extensions made for Discord.py
If you didn’t know, dpy 2.0 have buttons and interaction support, except for slash commands
And repo's like pycord, nextcord, and disnake covers them all
async def on_member_join(self, member: discord.Member):
channel = self.bot.get_channel(914211131290157220)
if not channel:
return
await channel.send(f"{member} has joined the server")```
Im trying to create a welcome command with this but it aint working can anyone help me?
That's in a cog?
Errr
!d discord.ext.commands.Cog.listener
classmethod listener(name=...)```
A decorator that marks a function as a listener.
This is the cog equivalent of [`Bot.listen()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.listen "discord.ext.commands.Bot.listen").
You need to use this instead of @bot.event
okk thx a lot
Ok
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
if channel := self.bot.get_channel(914211131290157220):
await channel.send(f"{member} has joined the server")
if that's in a cog... If it isn't, then remove self
It's in a cog, as it seems the method is inside a class
shouldnt that be:
@commands.Cog.listener()
Yeah
No idea
I don’t do cogs
it should be
ive tried this but it aint working
Literally saying do nothing
Show code
True i just copied their code and converted it to python
make sure you are indenting properly inside the Cog
ok
happens 
Walrus operator do be thicc
import random
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="rp ")
@bot.event
async def on_ready():
print('We have logged in as {0.user}'.format(bot))
@bot.command(name="hello")
async def hello_world(ctx: commands.Context):
await ctx.send('Good Morning ' + f'{ctx.author.mention}')
@bot.command(name="say")
async def type_smth(ctx, message):
await ctx.send(message)
@bot.command()
async def clear(ctx, amount):
await ctx.channel.purge(limit=int(amount)+1)
await ctx.send("I have cleared " + amount + " messages")
@bot.command(name="ping")
async def ping(ctx: commands.Context):
await ctx.send(f"Do your maths Homework! {round(bot.latency * 1000)}ms")
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
channel = self.bot.get_channel(914211131290157220)
if not channel:
return
await channel.send(f"{member} has joined the server! ")
bot.run(TOKEN)```
!code
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.
import discord
import random
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="rp ")
@bot.event
async def on_ready():
print('We have logged in as {0.user}'.format(bot))
@bot.command(name="hello")
async def hello_world(ctx: commands.Context):
await ctx.send('Good Morning ' + f'{ctx.author.mention}')
@bot.command(name="say")
async def type_smth(ctx, message):
await ctx.send(message)
@bot.command()
async def clear(ctx, amount):
await ctx.channel.purge(limit=int(amount)+1)
await ctx.send("I have cleared " + amount + " messages")
@bot.command(name="ping")
async def ping(ctx: commands.Context):
await ctx.send(f"Do your maths Homework! {round(bot.latency * 1000)}ms")
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
channel = self.bot.get_channel(914211131290157220)
if not channel:
return
await channel.send(f"{member} has joined the server! ")
bot.run(TOKEN)```
lmao, It's not inside a cog
class WelcomeSystem(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_member_join(self, member):
...code
@commands.command()
async def hello(self, ctx, member: discord.Member):
await ctx.send(f"Hello {member.mention}. Welcome to {ctx.guild.name}")
def setup(bot):
bot.add_cog(WelcomeSystem(bot))
Why are you using that self param.
can i bring it in by indenting?
See what Moros showed
That's how a cog works
saw it on the website you sent me today for the code
ok i'll check
Self only works in Cogs or classes. Its essentially the instance of that class.
they did it inside a cog, maybe you missed that part
I saw that but i kinda didn't understand the cog part
im gonna see that again and try to understand
I remember when i was first learning Cogs. I thought it was so difficult 😂
since when?
A Cogs Example for the rewrite version of - discord.py - bot_example.py
bruhh. Would have been helpful a year ago 😂
@arctic gyro check this out
yep alright
thx a lot fr the help
np
whats wrong with this command?
@bot.listen('on_message')
async def antilinks(ctx):
if "https://" in ctx.content.lower() and not ctx.author.guild_permissions.manage_messages:
await ctx.delete()
embed = discord.Embed(title=f"Unauthorised Link",
description=f" {ctx.author.mention} Your Message Has Been Deleted \nPlease Refrain From Sending `Links` In The Server",
color=discord.Colour.red())
embed.set_author(name=f'Message Sent By {ctx.author.name}', icon_url=ctx.author.avatar_url)
embed.set_thumbnail(url="https://cdn.discordapp.com/emojis/729251370590535770.png?v=1")
await ctx.channel.send(embed=embed)
it should delete link/message but it dont
how do i make it so commands can only be done by specific roles
No
The parameter should be named message for convenience
I think it should be a startswith
how do you make your bot say command not recognized
🤷♂️
or contains/includes
wdym. it worked before
Use a error handler
@reef shell do your thing
It will work, but do you know what's that parameter for?
Do the error handler
Here
u mean @command.error thing?
^
Is it supposed to be a startswith?
It's for discord.Message so the naming should make sense to it,
people use the name ctx usually for Context param.
What 
Guy needed error handler
ctx.delete to message.delete
??
it is
check the command...
@bot.listen('on_message')
async def antilinks(ctx):
if "https://" in ctx.content.lower() and not ctx.author.guild_permissions.manage_messages:
await ctx.delete()
embed = discord.Embed(title=f"Unauthorised Link",
description=f" {ctx.author.mention} Your Message Has Been Deleted \nPlease Refrain From Sending `Links` In The Server",
color=discord.Colour.red())
embed.set_author(name=f'Message Sent By {ctx.author.name}', icon_url=ctx.author.avatar_url)
embed.set_thumbnail(url="https://cdn.discordapp.com/emojis/729251370590535770.png?v=1")
await ctx.channel.send(embed=embed)
@bot.listen('on_message')
async def antilinks(message):
if "https://" in message.content.lower() and not message.author.guild_permissions.manage_messages:
await message.delete()
embed = discord.Embed(title=f"Unauthorised Link",
description=f" {message.author.mention} Your Message Has Been Deleted \nPlease Refrain From Sending `Links` In The Server",
color=discord.Colour.red())
embed.set_author(name=f'Message Sent By {message.author.name}', icon_url=message.author.avatar_url)
embed.set_thumbnail(url="https://cdn.discordapp.com/emojis/729251370590535770.png?v=1")
await message.channel.send(embed=embed)
Not just that part
I see eivl
umm.
did you not put that in as the parameter for the event?
can u try moving message.delete() to the end? Not sure if thats it
replace ctx with message
bruh
@thorn blade
did
Now do it again
I literally typed itfor you
oh damn
U need to replace ctx with message...
did
It should work now if u put message as the parameter instead of ctx
Now try to trigger the listener
by sending a message that contains 'htt...' or whatever you typed there
I'd use regex for that
im still having the same problem the whole day

I would not be surprised if it actually was, or it might be all in 1 line
im trying to but literally no one here could help me
3k lines put in 1 line
its not, im lame unfortunately 😂
ask away
https://stackoverflow.com/questions/70143860/nextcord-button-is-not-showing
Here ive even asked on stackoverflow and still no response lmao
Idk about how nexcord works with buttons and stuffs
sad
it appears you haven't passed in, interaction as an argument for the function...
Taking a look at nextcord documentation
The only thing given to a button's callback is interaction
how do i make this work (so the command only works if the user has the role)
@client.event
@discord.ext.commands.has_role('Staff')
async def on_message(message):
does check decorators work in events?
no i don't think so.
you would need to add a check within the event function
Sir, i highly doubt that the second deco. u are using is completely unnecessary
role = get_role here
if role in message.author.roles:
... do stuff
else:
... do other stuff
discord.ext.commands is the exact opposite of events
therefore no, decos don't work on events
meh dpy coder 😄
😳

well I mean they aren't opposites
but the decorators are all defined in the commands class
they just don't go together 😄
👍
not bashing here. But its never even been a thought for me to try something like that, tbh 😂
I think decos are specifically just for the main on_message event
in the source code
which launches all commands
ask blanket when he's here
haven't seen him in a while 
i haven't seen blanket in forever
hmm

or the other one there with the dog meme pfp
i forget their name but they were around with blanket. alec and toxicKidz
I don't even know toxicKidz
oop he was a project lead. idk if he still is.
either he has a nickname or he's just gone for a damn long time
hey i have a problem
yes
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
import json
cid = '
secret = '9'
auth_manager = SpotifyClientCredentials(client_id=cid, client_secret=secret)
sp = spotipy.Spotify(auth_manager=auth_manager)
username = "Zetona"
playlist = "spotify:playlist:3sQMXSZ9662KzJQJMVfWPI"
results = sp.user_playlist_tracks(username,playlist_id=playlist,)
tracks = results['items']
while results['next']:
results = sp.next(results)
tracks.extend(results['items'])
for item in tracks:
print(
item['track']['name'] + ' - ' +
item['track']['artists'][0]['name'] + ' - ' +
item['track']['album']['name'])```
this is my code
cuz its not discord.py
bruhh hide your credetionals next time
that too
no because music bots are against discord ToS
lmao i forgot
nononono not music bot
its python app i know that its against tos
you're downloading music from spotify, sharing information of it, and asking it in a non-related channel
BRUH you see anything saying download in the code ?
.
then what do it do
its not download and this code it not against tos of discord or spotify cuz spotify by them self have this shit public
it bring songs name from playlist \
you give the app url of your spotify playlist and it give you all the songs and artist and albums of the songs
you can check it by your self this is not against tos of discord or python or spotify
@agile ledge
how would i mention the author of the msg
you got it now ? check the code before talking
message.author.mention
Woah
well if i add ctx to it for example it doesnt work
bro you get the cog and then get the cog by the cog's name
😳
commands = i.get_commands()
no
Why would you add anything other then interaction when the docs say the callback only receives interaction????
the dude helped me so much
so my problem with this code the lst party the print it print all songs names in a list but when i try to save it in var it save only the last line of the songs
idk why
I was literally this close to deleting the help command 🤏
i is a cog object
i isn't a cog, its a string
why
Bot.cogs is a mapping [str, Cog]
i is the key and the value would be the Cog
I told lofi lemonade yesterday that they can just do for i in self.bot.cogs.values()
property cogs: Mapping[str, discord.ext.commands.cog.Cog]```
A read-only mapping of cog name to cog.
you could also use self.bot.cogs.keys() ?
No??
hm nice
That would be strings
so then i will be a cog object
and he can use i.get_commands?
Yes
get yourself a help channel or something
try to search a relating channel
i got one and i asked there and no replays i asked here cuz its not against tos and ppl here good with python too
i have this:
else:
user = message.author.mention
await message.channel.send(f'{user}You do not have permission to use this command!')
the bot does it but then starts pinging itself and saying it
anyone that knows spotipy would help you
Code:
import requests, discord
from discord.ext import commands
Result:
from discord.ext import commands
ImportError: cannot import name 'commands' from 'discord.ext' (unknown location)
nope it doesnt need ppl to know spotipy
the problem is the app print list but when i change it to var it doesnt come as a list only 1 line
so its not spotipy problem its common python problem
changing a list to a var
it print only 1 line doesnt print the list
wdym var 🥲
look
print(
item['track']['name'] + ' - ' +
item['track']['artists'][0]['name'] + ' - ' +
item['track']['album']['name'])```
when i run this it show this
when i change it to this
x=(
item['track']['name'] + ' - ' +
item['track']['artists'][0]['name'] + ' - ' +
item['track']['album']['name'])
print(x)```
it only show the last line like this
it only show this the last line of the print list
even if i remove ctx it doesnt work
maybe because you use a for loop
and you use it wrongly
Is interaction the only parameter for the callback
define a list before the for loop
and use append everytime
except of overriding the whole list
i think so idk ive not really studied the docs lmao
Show the function signature
i cant cuz the list comes after the loop finish
i tried this
x=None
for item in tracks:
x=(
item['track']['name'] + ' - ' +
item['track']['artists'][0]['name'] + ' - ' +
item['track']['album']['name'])
print(x)```
and didnt work
@slate swan :white_check_mark: Your eval job has completed with return code 0.
['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!']
that doesn't work of course
it replaces everything everytime
try the method I just sent
x=[]
and then use append() instead of assigning it a value
i get this error
AttributeError: 'str' object has no attribute 'append'\
when using this code
x=[]
for item in tracks:
x.append(item)
x=(
item['track']['name'] + ' - ' +
item['track']['artists'][0]['name'] + ' - ' +
item['track']['album']['name'])
print(x)```
hm?
oh
because you used x=()
which made it an str
replace item in your append() with all these stuff in x=()
so you append a string to your list
really nice
ty G
you're welcome
The message might not be cached
discord.on_message_edit(before, after)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.
If this occurs increase the [`max_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") parameter or use the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") event instead.
The following non-exhaustive cases trigger this event...
yeah, messages sent before the bot started aren't cached
yep
I'd use cogs if I was you
restarting the bot everytime is frustrating for me
👍
but
but i wanna change the color of the embed
corasponding
to the random thing it picked
lemme show you
No
Like
for coal i want red and for fave toy i want green
and im gonna be adding more
your are generating a random index for the list, but random.choice takes a list and chooses a random entry in that list.
how would i change that
just like
could i make a group of good answers and bad answers and just have a certain color for each group
that or you could make it a dict.
answers = [
{
"answer": "your-answer-string",
"color": color-code or string
}
]
but then
how would i put the answer in the embed
but wait
would that even work like i still want it to be random
access the 'answer' key of the returned dict from random.choice
and have a set of good and bad
good green bad red
is what im trying to do even possible lmao
answers = [
{
"answer": "You opened your present and got coal",
"color": redhexcodehere
}
]
answer = random.choice(answers)
embed = discord.Embed(
title="My Embed! WHOO!",
description=answer["answer"],
color=answer["color"]
)
Hmmm
so
wait lemme try to do this
uhhh
would it work the same way with a set of right answers
wdym?
like (group a "good answers" color=green)
(group b "bad answers" color=red)
random answer and if the answer was bad
red
What’s wrong?
nothing hes trying to help me
Ok
What do you need help with
ok so look ill try to explain it the best it can
i want a command like -present and when you do it itll have 2 groups like group a with good answers and a green colored embed and a group b with bad answers and a red colored embed
but i dont know if that would still do it
…
is there something needs to be import or?
If you want to make it conditional based on whether the answer is right or not, i would change the color portion of the dict to "type": "bad" or "type": "good" and make an if statement to check if type is good or bad and return the color.
Can’t you do random.choice with a list?
so would this work
i just know how i would add 2 diff groups to it
with certain colors
will this work for users who have a specific role to use this command:
@client.event
async def on_message(message):
role = 'Staff'
if role in message.author.roles:
... stuff
else:
... stuff
You can get the ID
wdym
error, code
if you need the full code let me know
@brittle ingot yes ik i didnt change it
i dont know why its saying that
becuase it still works
but it randomly stops working and says that sometimes then keeps working?
@ me please
Errr
lmao
He always those
Ok
Or maybe len - 1
Bro what?
@velvet tinsel len() is to get the length of something😭
@velvet tinsel
Error happens when your trying to index nothing
What are you trying to do?
Guys, so I have a Command which just Server Booster can use. And if a member tries to use the command he doenst has the role I want that a embed send
welp
@snipe.error
async def snipe_error(ctx, error "Dont have anything here"):
if isinstance(error, ):
its ok lol?
I know
is that right?
😭
thanks 😂
what
Just do:
if #has role:
#stuff
else:
#send a embed if not

bruh

😳
i mean it seems like it works

Thanks 😂
Why is it spamming tho
no no no that was me
He tested it😭
😭
I meant like not -1 len()-1
I don’t know
Never had an indexerror in about a month
😂🤷♂️
the discord crying emoji looks nothing like the one we use for laughing
Just do random.choice….
😭😂😭😂🤷♂️
to late it already works
!random.choice

What was he trying to do?
Nope 🤣
thats code from my 8ball command
Select a random entry from a list
!d random
Source code: Lib/random.py
This module implements pseudo-random number generators for various distributions.
For integers, there is uniform selection from a range. For sequences, there is uniform selection of a random element, a function to generate a random permutation of a list in-place, and a function for random sampling without replacement.
On the real line, there are functions to compute uniform, normal (Gaussian), lognormal, negative exponential, gamma, and beta distributions. For generating distributions of angles, the von Mises distribution is available.
I guess
Bruh😭 
random.choice() works fine
i already made the command 😭
then what do i do
We tried making it a list of dicts so he could determine the embed color based on response type: good or bad
global status
if message.content == "T!status":
await message.reply(embed=discord.Embed(description=f"Aktueller status `{exa.get_server(id=id).status}`"))
status=True
if message.author == client.user:
if status:
status=False
while True:
await asyncio.sleep(20)
await message.edit(embed=discord.Embed(description=f"Aktueller status `{exa.get_server(id=id).status}`"))``` idk why but when the bot recieves a message by itself even if status == False it will still start the infinite loop for the message and edit the embed property
I guess you can randint it and if it’s like a particular number then choose from a good list and if not then a bad list
🤷♂️
I would encourage you to learn about data types
Who me
Maybe
How do I put the has role?
author?
😭 bro why bully me 😭
ctx.author
I guess you can get the ID
hm
@velvet tinsel is this a list?
A = ("hi")
No
What is it?
It looks like a very badly written tuple
Tulle😭
Greatly*
💀
Can you index a tuple?
and i added another thing and now its saying the same thing LOL
I mean it also looks like a variable but at the same time it doesn’t
Wdym a variable?
It still don't work..
I mean it doesn’t look like one
@velvet tinsellol
But it also looks like one
@discord.ext.commands.has_role("Server Booster")
async def snipe(ctx):
if ctx.author.has_role:
channel = ctx.channel
try:
snipeEmbed = discord.Embed(title=f"Letzte gelöschte Nachricht in #{channel.name}",
description=snipe_message_content[channel.id])
snipeEmbed.set_footer(text=f"Gelöscht von {snipe_message_author[channel.id]}")
await ctx.send(embed=snipeEmbed)
except:
await ctx.send(f"Es gibt keine gelöschten Nachrichten in #{channel.name}")
else:
embed = discord.Embed(title="***Booster Command***", description="Du hast ein Booster Vorteil Entdeckt!",
colour=discord.Colour.red())
await ctx.send(embed=embed)
Its a var assigned to a tuple lmao
import random
choices = [ YOUR CHOICHES]
Just like the 8ball comand
!e @wild oak
import random
a = ("a","b")
print(random.choice(a))
@slate swan :white_check_mark: Your eval job has completed with return code 0.
b
Mobile isnt easy lol
Yah
bruh
I get it
Gimme a sec

Could you help me?
💀
Sure


this ma code, what did I do wrong?
I dont get errors, but its still says, "Role server booster is required
discord.ext.commands.errors.MissingRole: Role 'Server Booster' is required to run this command.
Do you have nitro?
You did has_role and then nothing else at least get an ID
did i do this right
I do
nvmd
Have you boosted the server?
Wdym?
I did.
Alr i see
and I also have the booster role
!d discord.ext.has_role
No documentation found for the requested symbol.
I don’t know
Wtf
OH
Bruh
😭 why use an f string without even use it
I can use it as booster, but I tried on a 2nd acc and the message didnt came
dude i said oh and went to fix it 😭
🤔
Should I explain?
Is your 2nd acc a booster?
No
Ok
i already did import random becuase of my rock paper scissors command
And I want if someone isnt booster, that a message sends
me?
Pls I don’t want to keep scrolling
why
No
ok
Omg all that yellow
lol
What have you been doing
No not at all

Did you check capitalisation?
Check docs i think theirs a built in decorator for premium users
Why can’t you just have an ID 😭
What is a capitalisation?
Never done it
Ok
I can’t find anything either
😭🤷♂️ well
@silk mauve just get the role and check a users role
I don’t even know if it exists or not anymore
Guys i need help in downloading Atom
ty
Yw
Yes it does😭
I forgor 💀

@sullen shoal in a part of my code i did
a = exec(something)
await ctx.send(a)
Never sends the results but shows in the terminal do you know why?
2 months
why does it keep saying this?
from discord.ext import commands
ImportError: cannot import name 'commands' from 'discord.ext' (unknown location)```
!e
a = exec(something)
await ctx.send(a)
@velvet tinsel :x: Your eval job has completed with return code 1.
001 | File "<string>", line 2
002 | SyntaxError: 'await' outside function
That was a example😭
It wont work ofc
Have you imported discord?
He got muted but i think its over
Why
Remember when their was a fight over what was a api
Yes
Well noobian got banned for insulting a mod and others and krypton got muted for 3 days cuz he wasnt being respectful
And mostly cause they were both hurting eachothers feelings which is against the rules
How can I use the wolfram API in order to make queries, namely the code to make a query
Not really related to the channels topic
Ig now but not really
:/ could you help lol
You'd have to read their documentation.
A quick google search would most likely reveal their documentation
Robin
You just said what I say to most people
In a nicer way
How did you do that?
Haha you'd be amazed how many issues would be solved by just putting in some time and reading the documentation
I say “google it” and people get annoyed at me
And call me “toxic”
And “read the docs”
People just have to learn,to use google before coming here
Still learning about dbs
!PEP8
PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.
More information:
• PEP 8 document
• Our PEP 8 song! :notes:
?
You need to give an URL to the person you help or use the build in commands from this server.
Welps code was not indented properly
Oh lmao
Still learning db and tuple
Tulle😭
screw you ipad
Im just learning about dbs
WHY does sqlite have tuples as their default return type
Almost the same as a list
actually, the reality is I can’t be bothered.
They have a well built row factory, might as well set that as the default?
!d tuple
class tuple([iterable])```
Tuples may be constructed in a number of ways:
• Using a pair of parentheses to denote the empty tuple: `()`
• Using a trailing comma for a singleton tuple: `a,` or `(a,)`
• Separating items with commas: `a, b, c` or `(a, b, c)`
• Using the [`tuple()`](https://docs.python.org/3/library/stdtypes.html#tuple "tuple") built-in: `tuple()` or `tuple(iterable)`...
Tuples are basically immutable lists
Tuples are dumb imo
Yes
They have their own strengths.
Tuples are so easy lol
I know the basics
Discord.py uses Tuple for permissions
in reality, I dont. I havent even looked anything up yet
(manage_messages, False)
Yeah lol just ask here and you will have people google it for you. Big brain.
Check w3 school and just read about the whole python tutorial it teaches you everything and datatypes ofc
If you wanna learn something interesting check out metaclasses
I havent even bothered googling it yet
Ima google it later
I'll bing it
Ill just safari it
I was the person who was called toxic because I told people to google stuff
Ill Firefox it
Ill print it
Ill just import google and search it via python it
😳
Interesting command
Ikr
tbf Discord should have made this lol
Bruhh A classes class 🤯
Minaberry did it so now we know
Yes
A better impl would be just to make a context menu command which users can right click and select bookmark
I called them out and my discord crashed 
I’m just finally mastering classes 🤣 over here thinking they’re the top dog of everything. Nope meta classes are
💀
Their on to you😳
They’re coming for you
Metaclasses have their moments, but most of the time you won't ever need them
Their 💀
shit gotta delete my browser history first
😳
😏 😳
I got banned from the discord py server
Hes got the pythonhub which shows raw bytes😉 😏 😳
same
I didn’t even last 3 hours
That takes effort since you can literally kick someone in the balls there for using repl.it
5 or 6 months ish
I was in like 2 hours and then got banned
Why?
😂 that’s a skill of mine
some stupid stuff tbh
Roasting the devs
funny thing was i was a regular too
I have a test account I can get across it
Disnake server is better

Let's not complain about other servers here and violating Discord ToS.
Their all cool people
Is that really against tos?
Ok
that can’t stop me, but who cares
Of course you are banned.
Im not
Me neither i never really talk there.
🤷♂️
Im not even in there
https://discord.com/guidelines, scroll down to 4.
Mods here dont like you either😭
Okie
Understandable
So it's not against ToS hmm
Its against the guidelines which are the rules that users should follow on the platform so
Whats even the difference of discords tos and dcg
It also doesn’t relate to discord bots directly
how do I change the custom status of a discord bot
not playing or something like that, just the custom status
!d discord.ext.commands.Bot.change_presence
await change_presence(*, activity=None, status=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Changes the client’s presence.
Example
```py
game = discord.Game("with the API")
await client.change_presence(status=discord.Status.idle, activity=game)
``` Changed in version 2.0: Removed the `afk` keyword-only parameter.
await change_presence(*, activity=None, status=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Changes the client’s presence.
Example
```py
game = discord.Game("with the API")
await client.change_presence(status=discord.Status.idle, activity=game)
``` Changed in version 2.0: Removed the `afk` keyword-only parameter.
Oh they have a part in the ToS saying you need to comply with community guidelines
So yes it is against ToS
Makes sense
Yep
So basically tos = dcg if you break one you break the other
@cloud dawn i looked, didnt help//
What exactly doesn't work? You can also provide your code so we can look at it.
ToS is legal stuff + community guidelines
Ah alr
i dont have one, i just need to know how to change the custom status
Then please read the message. We are not going to code it for you. The embed also has an example.
Discord bot's don't have access to custom statues
then why bother trying to help?
They cannot use them
yes they do, i seen bots do it..
No they don't
do you mean like Playing something?
Excuse me? But i can say for most people here than we want to help guide you fix it. And not spoon feed it to you.
Helping is different from spoon feeding
Guys please keep it civil
Then no, bots do not have custom statues. Period.
Unless you mean their about me section
which can be changed in the bot application dashboard
i am asking for help, not wanting to get spoon fed
Custom presences indeed they cannot do. They can have an About me or small status like @novel apex
Yep
When do they ever
How can you do that?
Okimii…did you add me as a friend?
No😳
The About me?
I messaged them like 10 days ago
Minutes
No the listening to dm reports status
Just go to the bot's application page, and just type it in
No not the about me
🤦♂️

Bruh
Using the Bot change_presence attibute.
Change_presence?

The status kwarg right?
Here is an exmaple.
Okimii
?
I thought you knew this…
Never done it before😭
Then we i misunderstood, were you able to solve the matter?
So the status kwarg?
Bro
cause the activity is playing
😭 I don’t want to be mean
But I have to say this
google it
Thats the playing thing bruh
Don’t you want the playing thing 
Discord.py has an enum for this class using the activity kwarg of change_presence
!d discord.ActivityType
class discord.ActivityType```
Specifies the type of [`Activity`](https://discordpy.readthedocs.io/en/master/api.html#discord.Activity "discord.Activity"). This is used to check how to interpret the activity itself.
!indention
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
@velvet tinsel i do know how to do the playing thing but not this🤦♂️
.bm
🤬 
!d discord.ActivityType
class discord.ActivityType```
Specifies the type of [`Activity`](https://discordpy.readthedocs.io/en/master/api.html#discord.Activity "discord.Activity"). This is used to check how to interpret the activity itself.
!d discord.Activity
class discord.Activity(**kwargs)```
Represents an activity in Discord.
This could be an activity such as streaming, playing, listening or watching.
For memory optimisation purposes, some activities are offered in slimmed down versions:
• [`Game`](https://discordpy.readthedocs.io/en/master/api.html#discord.Game "discord.Game")
• [`Streaming`](https://discordpy.readthedocs.io/en/master/api.html#discord.Streaming "discord.Streaming")

There is a listening one im sure of it
Ye
Ahhhh
There is like listening to Spotify
Yeah
🤷♂️ listening
Yes
!d discord.ActivityType.listening
A “Listening” activity type.
yeee click on the activity class.. i linked you about 3 mins ago aswell haha
No shit Sherlock 🤣
Very helpful
There is a custom activity
Disnake has it like this```py
disnake.Listening(name="yes")
!d discord.ActivityType.custom
A custom activity type.
.nm
.bm
The definitions 👌
.nm😭
.bm
Bro chill😳
🤬 🤬 🤬
Alright, Doc’s challenge. Pull up a thing you know isn’t used much and is underrated
@velvet tinsel not a good example
Bet
property me: discord.member.Member```
Similar to [`Client.user`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.user "discord.Client.user") except an instance of [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member"). This is essentially used to get the member version of yourself.
Makes sense
Idk even know whats a shard myself
https://discordpy.readthedocs.io/en/stable/api.html#shardinfo
I’ve literally seen people use guild.get_member to fetch their bot
A shard? So when your bot gets in over 1000 servers I believe, discord recommends you shard your bot. It’s essentially discord instantiating multiple instances of your bot iirc it’s 1000 servers per shard. I’m not totally clear on it myself as I’ve never made a public bot but I think it’s suppose to help balance the bot load and it’s impact on the platform.
!source
!d discord.MemberCacheFlags
class discord.MemberCacheFlags(**kwargs)```
Controls the library’s cache policy when it comes to members.
This allows for finer grained control over what members are cached. Note that the bot’s own member is always cached. This class is passed to the `member_cache_flags` parameter in [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").
Due to a quirk in how Discord works, in order to ensure proper cleanup of cache resources it is recommended to have [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") enabled. Otherwise the library cannot know when a member leaves a guild and is thus unable to cleanup after itself.
To construct an object you can pass keyword arguments denoting the flags to enable or disable.
The default value is all flags enabled.
New in version 1.5.
Oh I know right! I actually had the pleasure of using that for a commissioned economy bot. Essentially limiting the members cached to only those online currently, etc
.bm i see thx
chunk_guilds_at_startup is also very useful
Yes, it is. Especially for that eco bot. It was no where as big as this server but still around 50k members
Cache fills up quick
Yea I used chunk_on_startup for caching as well when I had a discord bot. I just didn't chunk on start and I would chunk when a guild becomes "active"
Later popping the guild out of the cache after it becomes inactive
Saved startup times by a lot
Smart
Due to it not populating dead guilds
So that basically just caches online members or a specific group of members?
So essentially it by default caches all members the bot can see iirc so if you change it (works just like intents declaration) you can specify what members you want
You guys are always teaching something new🙏
Yeah ik that,i see
Essentially discord in on_ready will send a populate cache response with a payload of all information the bot may need or is subscribed too. Which can take forever depending on the amount of guilds the bots in or members per guild etc.
Figured as much, just learned it myself tbh.
Mind asking how much time youve been programming?
3 minutes
A little over a year
Thats allot ngl
😂
Thats cool next month ill be celebrating 8months
If i did my math right
Yay!!
Very excited 
Tbf I got into programming because I refused to pay for premium bot services. Literally learned python off of discord.py
Im learning as same as you but just because i have a passion for programming and tech
Same, the extent of my knowledge was discord based programming so I ended up taking on a web server, and API project
Same
mee6 moment
Exactly mee6
Most people think im smart or experienced but really ive only been programming for 7 months but ive learn faster or more than others with more due to my passion
I started my endeavour 4 years ago
You just have to be willing to research. Luckily I always maintained discipline. Always made sure I listened to what looked like reputable sources and if I did end up following a tutorial I always checked the dates in correlation to the libs release dates. Most importantly prioritized docs over google
i'm quite a slow learner, at least it feels like, i've been programming for around about 2 years, and i still feel kinda stupid lmao
Same
Damn 😟 I’m sure there are longer but that’s the longest I’ve seen so far
danny
Do you have confidence issues?
Not really i think everybody feels as they dont know or feel slow but i think its just their so much stuff to learn you feel like a beginner mostly i feel that
Got ur DM, didn’t reply. What did you need? And yes I’ve made discord bots. You can check out my GitHub for some crappy examples 😄
0x42 bot is the one to rule them all
Shhhh
Is that urs?
@pliant gulch you can talk when you release lefi
😫
Lol
Still waiting
I just wanted to see your bot - i ask a lot of the people here if i can test their bots
When lefi comes out of alpha I'll be rewriting 0x42 with lefi
gives me like a ... skill evaluation to be blunt
I don’t have any public bots. They’re all private or commissioned
Love to see that ngl
whats your github?
It would pretty much look that same
Still would love to see that being written with lefi
I'll go all out then
There are more repos but theyre private including a python package 😮
Gotta finish documentation first and converters before I can actually get started though
lefi > disnake
One day😔
Actually I think that one is public
Ill be waiting
50% of the discord models are documented and we don't even have them all implemented I don't think
The rest is undocumented other than the internals of the wrapper
Just me?
I know sebkuip and another is working on a fork too. Idk it’s expected release though
His isn't a fork its from scratch
Yeah that’s what I meant
Al though I'm not very pleased looking through their codebase
I’ve been watching it, seems interesting
Right now its sorta a mess, I helped them a little bit
@brittle ingot lol
🤔
What is that?
Explain now😭
Your waiting until ready while in ready event?
your code
Which bot?
main.py line 60
@bot.event```
Oh yeah that bot is a mess
😭
um
Stop flexing gosh🤬
link it
We all know you got clean code🤬
A discord bot focused on clean code and utility. Using the discord.py library - GitHub - an-dyy/0x42: A discord bot focused on clean code and utility. Using the discord.py library
One star and two forks 🤩
@brittle ingot you're calling await load_blacklist() before you defined it
Note I have no clue what I’m doing so yolo
One fork was a troll, the other was from me forcing nova to make a PR
I’m pretty sure I doesn’t matter when it’s defined…
hi is there a way of using PyQt5 with discord.py? when i load client.run(token)
it freezes my window
Pull request
@pliant gulch nothing wrong, just a sin to make an unclosable bot
That bot is currently running soooooooo 😋
Oh😭
it is
I don't remember why I did the loader part like I did, but it isn't unclosable it just ignores the error
i have a private rep which is a gui for my bot
@near jackal https://stackoverflow.com/questions/61664473/use-control-panel-for-discord-bot-with-pyqt5
Open it, let’s roast you now 😜
oh mate
nice ill give it a try and let you know
ill show mine, you just have to promise to not look at the jsons and not look at the game.py
jesterbot is a discord-bot coded in discord.py with over 180 commands and 15 cogs. - GitHub - CaedenPH/JesterBot: jesterbot is a discord-bot coded in discord.py with over 180 commands and 15 cogs.
goes straight to it
bearing in mind most of this was made like 5-6 monthsa go
thnx
i made a github of it a couple weeks before i stopped development
np
Wtaf
?
I was just trying to scare caeden
I think he died😭
He did what😳
Oh nothing, the dicts directory is completely normal
dies
We all have that one thing. Or in my case many things
Yep
shows me some errors :S
