#discord-bots
1 messages · Page 595 of 1
.voice.channel
halp
url2 = info['formats'] [0] ['url'] KeyError: 'formats'
url2 = info['format'] [0] ['url']```
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
what do you need help with
help him
I don't know if people mentioned it but if you really want to define these commands in the class then try @commands.command()
hello, I made a "gui" for my bot and I faced off with this problem
RuntimeWarning: coroutine 'Messageable.send' was never awaited
users[int(index)].send(content=msg)
there is my code
If you have a bot that is say, more than 150 lines of code in the main file, is it recommended to start using classes?
Like, a single class for the bot. Maybe it's the right way, but I feel like it just adds another layer onto what you already have
.send needs to be awaited
await ...send(...)
use await 🤦♂️
ctx.voice_client.stop() AttributeError: 'NoneType' object has no attribute 'stop'
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
okay
Selfbots are not allowed
It isn't self bot lol
what's a selfbot?
what is self bot
do you mean cogs?
music bot?
https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
@desert halo@bronze pilot
Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found.
I got no idea what cogs are bro, only mechanical ones 😅
it's a bot gui are you blind
I think so
no
Clearly says it's a selfbot
event bot
it's bot account tf you saying
No
It attempts multiple bot tokens
It's a self-bot
I won't argue with you cuz it's stupid
idk if that makes it a selfbot but that seems unnecessarily dodgy
are you playing youtube music with the bot?
<@&831776746206265384> can you make them understand that this is a self-bot and therefore breaks rule 5, already tried but for some reason doesn't want to understand it
See bot=False and Connecting to account...
I wonder why the helpers role is non-pingable
what
I don't understand nothing
ctx.voice_client.stop() AttributeError: 'NoneType' object has no attribute 'stop'
show the code
ctx.voice_client.stop()
because that would be pinged like 10 times in a minute lol
That suggests to me that the context in which the command was invoked has nothing connected to the voice channel
yes
bruh
I'm actually interested, idk what this does
property voice_client: Optional[VoiceProtocol]```
A shortcut to [`Guild.voice_client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.voice_client "discord.Guild.voice_client"), if applicable.
It is still a thing.
Ahaha there you go
o
Deprecation... deprecation everywhere!
Only thing that got changed about this attribute
It's still a thing
oh sorry i confused it with voice_channel , they had something similar
ahhahahahhahhahhhahhahaha
how poor you are
I even imagine your "moral portrait"
how can i stop bot when read ctx.voice_client.stop() no working but in documentation i can't find
the bot doesn't connect to any voice channel in that guild
As was stated, this is a selfbot which is against discord's ToS so we can't help with this here. Please refrain from asking for help with ToS violating projects, as per our #rules
listen guys
hey
im getting this error(the admin command is in a cog found in cogs/admin.py)
import discord
from discord.ext import commands
class AdminCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def admin(self, ctx, argument):
embed=discord.Embed(title='Administrator Commands', description='All available admin commands', color=discord.Color.blue())
embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar_url)
embed.add_field(name='.ban', value='.ban [member]', inline=False)
embed.add_field(name='.kick', value='.kick [member]', inline=False)
embed.add_field(name='.mute', value='.mute [member] [time]', inline=False)
embed.add_field(name='.purge', value='.purge [amount]', inline=False)
await self.ctx.send(embed=embed)
def setup(bot):
bot.add_cog(AdminCog(bot))```
and heres the code
you didnt provide an argument while using the command
well, it suggests that you've invoked the command without argument
how do i do some argument
<prefix>admin argument
self.ctx.send........
it's just ctx.send
im doing .admin so i can get the mbed
essentially something like !admin argument_here
remove the argument from the function
with deleting the argument
Yeah, remove argument as an argument
ok

we're getting the best issues
I'm just here usually to see if there are some methods/properties that I've never seen before
well , they all are well documented in the docs
that is not a serious message
How u make a bot send random text?
If it's just any random text
sorry my english is very bad i didnt learn it i try my best
i.e. something that doesn't make any sense
Am not english myself mate
you can search up "password generator". That's the same concept
But if it has to make sense, like something with words
There are a lot of ways. If you need actual coherent sentences there's probably an API for that
You can import random
I swear there's a module for anything nowadays 😄
And do
You couldn't make coherent sentences using random.choice()
You can use random and have a list of verbs, nouns, adjectives etc. and define a valid sentence structure, and have a random number for indexing these lists
or random.choice(), that's just me forgetting about things
I use that tho, well there are probably other ways to do it
That's a lot more complicated than just using aiohttp
async def cuddle(ctx, member: discord.Member, *, reason=None):
await ctx.send(f"{member.nick} Du wirst von {ctx.author} Geknudellt || https://tenor.com/view/yoriko-frymiko-fryes-frymiko-hug-gif-22979062 || ")
``` how can i make that the bot send random link text?
I'm out for this one
uhm :/
wdym by random text from this?
?
It's a confusing question
Huh
ig he needs the bot to send random cuddle gifs everytime someone uses that
For that u should use a api or add many tenor cuddle gifs and use random.choice
I was thinking of the second option 🙂
But in the case where you have hundreds of cuddle gifs use an api
even 50 ig
yea that's also a point
There probably is a gif generator module somewhere for python. As I said earlier, I swear there's a module for everything
i am stuid ._.
async def cuddle(ctx, member: discord.Member, *, reason=None):
await ctx.send(f"{member.nick} Du wirst von {ctx.author} Geknudellt {random.choice}|| https://tenor.com/view/yoriko-frymiko-fryes-frymiko-hug-gif-22979062 |||| https://tenor.com/view/hug-comfort-cute-anime-friends-gif-22169252||")```
idk how to do it
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!d random.choice
random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError "IndexError").
async def cuddle(ctx, member: discord.Member, *, reason=None):
await ctx.send(random.choice((f"{member.nick} Du wirst von {ctx.author} Geknudellt || https://tenor.com/view/yoriko-frymiko-fryes-frymiko-hug-gif-22979062 ||"))f"{member.nick} Du wirst von {ctx.author} Geknudellt ||https://tenor.com/view/hug-comfort-cute-anime-friends-gif-22169252||")
``` so? ik i am stupid
read the doc above
how can I get message text content if message has image?
!d discord.Message.attachments , check if the length of the attachments list is more than 0
A list of attachments given to a message.
if not (more than 0):
return
#code```
It gives me only attachments but I need to get text from message too
read what i sent
Can just use this
if your_list:
to check if the list is not empty
Don't overwrite message
Store the content in another variable
Or if you only use it once, just use message.content when you need it
yeah but if they use py if not list: return it saves them from indenting the whole code again
Well maybe you just want to add attachment if needed, so returning is no an ideal solution
Just check if it's not empty and add the image into the embed, then do your stuff as usual
I need quik help
problem:
if i choose and it will buy only from mainshop
If i choose or it will buy only from other shop
What
or
and
When I run the following code, I get the error: Exception has occurred: TimeoutError
reactions = ["✅", "❌"]
message=discord.Embed(title="Flight Log Confirmation", description=f"This is the information on your flight for {country}" , color=0x2e6600)
message.set_author(name="ACRP Bot", icon_url="https://vignette.wikia.nocookie.net/acecombat/images/5/5d/Project_aces_logo.png/revision/latest?cb=20110612183934")
message.set_thumbnail(url="https://cdn.discordapp.com/attachments/738862227469238272/838477697206190120/BhqmWPt.png")
message.add_field(name="Aircraft Flown:", value=f"{aircraft}", inline=True)
message.add_field(name="Distance Flown:", value=f"{km}km", inline=True)
message.add_field(name="Money Gained:", value=f"{third}", inline=True)
message.set_footer(text="Please make sure that you round the distance down to the nearest 30 (Auto-Rounding WIP)")
msg = await ctx.send(embed=message)
for reaction in reactions:
await msg.add_reaction(reaction)
while True:
try:
reaction, user = await self.bot.wait_for("reaction_add", check=lambda reaction, user: user == ctx.author and reaction.emoji in reactions, timeout=20)
except asyncio.TimeoutError:
await ctx.send("Something went wrong, please retry.")
return
Pls help find Views in api ref
!d discord.ui.View
class discord.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
thank you!
the robot sends a link with an attachment, but I wanted it without the attachment... what do I do?
You probably want to add a / before {title} so that the url looks like
...ovh/v1/titlehere instead of ...ovh/v1titlehere
help
Each item in the list should have their own probability
So if you have 30 people who reacted, you should have a list containing 30 probabilities
Not just your 10 probabilities
ok but there is no way to remove that probability?
random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError "IndexError").
I did that first time but I want to not be the same winnner
It doesn't give always the same winner
oh alright
Ok lemme try
how do i make pages instead of being this
Paginator?
tf is that
!d discord.ext.commands.Bot.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
Click on reactions for next/previous page
Is there a way to get an invite that was used by a just joined member
The specified number of default values exceeds the specified maximum values
What does this error mean??
It appeared after I added 3 Option
Guys, why does my bot keep saying that it doesnt have the permission to kick members when it has 2 roles that can kick members?
Show the code
Sure
import discord
import random
client - discord.client()
@client.event
async def on_ready():
print('(0.user)'.format(client))
print('lol online')
print('---------------------')
print('hello pls work ')
coinflip = {'tr1ckshot', 'alex'}
@client.event
async def on_message(message):
if message.author.bot :
return
if message.content.startswith('-alex'):
await message.channel.send('alexs stock
k-6 - offers open
5t. - offers open
rw.- c/o 10€
kb.- offers open
(message.author)')
client.run(process.env.TOKEN) ```
Nice bot
I need the info
@brazen chasm ?
import discord
import random
client - discord.client()
@client.event
async def on_ready():
print('(0.user)'.format(client))
print('lol online')
print('---------------------')
print('hello pls work ')
coinflip = {'tr1ckshot', 'alex'}
@client.event
async def on_message(message):
if message.author.bot :
return
if message.content.startswith('-alex'):
await message.channel.send('alexs stock
k-6 - offers open
5t. - offers open
rw.- c/o 10€
kb.- offers open
(message.author)')
client.run(process.env.TOKEN) ```
Is that your bot?
I'm trying to make a different kind of bot
Post specific error message
good idea
How can I check if user in guild?
you check if user is an instance of discord.Member
ig

it you are taking the user as input, then you can typehint it
You might want to send your code for this
You can do just ```py
if guild.get_member(<id>):
That should work. Also, you don't need the id before the if statement
Oooo that's a really good point
This error looks unrelated to your question though
my ass

Thanks! I will try this
Wait a minute, id() is a builting function?
yep
!d id
id(object)```
Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same [`id()`](https://docs.python.org/3/library/functions.html#id "id") value.
**CPython implementation detail:** This is the address of the object in memory.
Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `builtins.id` with argument `id`.
!d discord.Guild
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.
!d discord.Guild.get_member
get_member(user_id, /)```
Returns a member with the given ID.
Oh thanks how useful
Can someone help? Idk why it’s saying this https://mystb.in/InvitedDisabilitiesLemon.python
Line 20 on your pastebin link here
I think you might have miswrote something
I didn't find get_member() in the docs, try Guild.get_user() if the first didn't work for you
?
???
Literaly, there is nothing to explain about that. It is a suggestion. Should the first work, dont bother with taking my suggestion
@On(mcbot,'chat')
async def onChat(this, user, ctx , *args):
print(f'{user}: {ctx}')
channel = bot.get_channel(901314284972310641)
await channel.send(f'{user}: {ctx}')```
im getting ``` RuntimeWarning: coroutine 'onChat' was never awaited del self.m[i]```
i need help
What library are you using?
well, it looks like the python function isn't being awaited
how do you await it
Because it's bridged from js to python, it's hard to tell how to fix it
someone knows?
where is that
show more traceback
oh wait got it
len(queue)[start:end]
len(queue) is a number
26[2] makes no sense
what?
how do I make a command only usable by 2 users
its my queue list
you used length
which returns how many items your list has
therefore it's a number
so u know how to fix it?
you put [start:end] outside of the len() function, by accident i imagine, so instead you want to be taking a slice of the array before it goes in, not the return value
maybe remove len(), I don't know what you want but it would remove the error
when im not useing len(queue) and use (queue) its eror agine
what kind of error
and why the brackets
what you're doing: len(a)[]
what you're trying to do: len(a[])
what is queue
its the player queue list
you may need to end up doing len(list(queue)[start:end])
assuming that queue can be made into a list, but if its a sequence it should
Sry for late reply,on 5th line its not -,its =
how do you make a command only used by two users
Error says all
You gave a wrong token
guys im working on my bot and right now i want to make it so if someone types .verify the bot will assign them a role called "Verified"
@bot.event
async def on_message(message):
verify_channel = bot.get_channel(909149225919582279)
verify_role = get(member.guild.roles, id='908901399780266025')
if message.content == '.verify' and message.channel == verify_channel:
await member.add_roles(message.author, verify_role)
await message.channel.send(f'{message.author}, thank you for verifying.')``` heres my code
Use commands
Not events to make commands
so would that make it so when someone joins i have to manually assign them a role
No
yo why wont my code run
It doesn't change anything to what tou have now
lemme send it 1 sec
from discord.ext import commands
import json
import os
import random
os.chdir("C:\\Users\\carli\\Desktop\\my bot\\economi.py")
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready
print("Ready")
@client.command
async def balance(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
wallet_amt = users[str(user.id)]["wallet"]
bank_amt =users[str(user.id)]["bank"]
em = discord.Embed(title = f"{ctx.author.name}'s Balance",colour = discord.Colour.red())
em.add_field(name = "Wallet Balance",value = wallet_amt)
em.add_field(name = "Bank Balance",value = bank_amt)
await ctx.send(embed = em)
@client.command()
async def beg(ctx):
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = random,randrange(101)
await ctx.send(f"Someone gave you {earnings} coins!")
users[str(user.id)]["wallet"] += earnings
with open ("mainbank.json" , "w") as f:
json.dump(users,f)
async def open_account(user):
with open("mainbank.json" , "r") as f:
users = json.load(f)
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 100
users[str(user.id)]["bank"] = 100
with open ("mainbank.json" , "w") as f:
json.dump(users,f)
return True
async def get_bank_data():
with open("mainbank.json" , "r") as f:
users = json.load(f)
return users
client.run("token")
And it's just .add_roles(role)
No need to give another argument
where do i put dat
oh nv
Don't copy paste it...
Change your code to just have a role argument
And IDs are integers, not strings
@bot.command()
async def on_message(message):
verify_channel = bot.get_channel(909149225919582279)
verify_role = get(member.guild.roles, id=908901399780266025)
if message.content == '.verify' and message.channel == verify_channel:
await member.add_roles(verify_role)
await message.channel.send(f'{message.author}, thank you for verifying.')```
hows that look
and it works
can someone help in #help-orange
oh it works so well
@commands.command()
async def purge(self, ctx, amount=150):
channel = ctx.message.channel
messages = []
async for message in bot.logs_from(channel, limit=int(amount) + 1):
messages.append(message)
await bot.delete_messages(messages)
await bot.delete_message(ctx.message)```
How to make the condition that if you specified not a category, but a text channel or a voice channel, then display an error
alright this is my purge command, how do i make it so i can specify a certain amount instead of it being hardcoded
It is already specified
Just execute !purge <amount>
When using the command on Discord
oh ok
it didnt work
File "/home/austin/Desktop/Phasmo/cogs/admin.py", line 81, in purge
async for message in bot.logs_from(channel, limit=int(amount) + 1):
NameError: name 'bot' is not defined
self.bot
You're in a cog
thx
File "/home/austin/Desktop/Phasmo/cogs/admin.py", line 81, in purge
async for message in self.bot.logs_from(channel, limit=int(amount) + 1):
AttributeError: 'Bot' object has no attribute 'logs_from'```
fuk
Pretty sure that's old copy pasted code
Use .purge method on a channel object
@slate swan if in doubt just put the object inside dir()
It will tell you all properties and methods
same error
Token isnt right
!d discord.TextChannel.purge
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Examples
Deleting bot’s messages...
There is an example
No, you wouldn't get the error otherwise...
One thing, is channel = ctx.message.channel necessary? I use ctx.channel.send() for sending messages, so I would think that channel = ctx.channel would give what they're looking for
Can just do ctx.send
import os
import discord
import random
client - discord.client()
@client.event
async def on_ready():
print('(0.user)'.format(client))
print('lol online')
print('---------------------')
print('hello pls work ')
coinflip = {'tr1ckshot', 'alex'}
@client.event
async def on_message(message):
if message.author.bot :
return
if message.content.startswith('-alex'):
await message.channel.send
('alexs stock
k-6 - offers open
5t. - offers open
rw.- c/o 10€
That sounds good, idk why they have another .send method for the channel
can i get some help
still, what I'm saying is I think ctx.channel is better than ctx.message.channel
Well there's no client.run in your code...
Not if you don't ask a question
i have
from discord.ext import commands
import json
import os
import random
os.chdir("C:\\Users\\carli\\Desktop\\my bot\\economi.py")
client = commands.Bot(command_prefix=".")
@client.event
async def on_ready
print("Ready")
@client.command
async def balance(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
wallet_amt = users[str(user.id)]["wallet"]
bank_amt =users[str(user.id)]["bank"]
em = discord.Embed(title = f"{ctx.author.name}'s Balance",colour = discord.Colour.red())
em.add_field(name = "Wallet Balance",value = wallet_amt)
em.add_field(name = "Bank Balance",value = bank_amt)
await ctx.send(embed = em)
@client.command()
async def beg(ctx):
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = random,randrange(101)
await ctx.send(f"Someone gave you {earnings} coins!")
users[str(user.id)]["wallet"] += earnings
with open ("mainbank.json" , "w") as f:
json.dump(users,f)
async def open_account(user):
with open("mainbank.json" , "r") as f:
users = json.load(f)
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 100
users[str(user.id)]["bank"] = 100
with open ("mainbank.json" , "w") as f:
json.dump(users,f)
return True
async def get_bank_data():
with open("mainbank.json" , "r") as f:
users = json.load(f)
return users
client.run("token")
why wont this run
You already created a help channel for it
Because you have "" around your token
Stay in there and don't copy paste code from internet
remove the quotation marks, you are passing in a string
It's just to hide the token...
How to make the condition that if the specified id is not a category then display an error
nope it wont run still
It's to prevent to send the actual token
I would have thought token is a variable, i wouldnt expect the actual token
and nobody answered
lmao gotem
Patience is part of your job
So stay in there and be patient
it got closed
like when i go to open the actual file to host it, it just closes instantly
Your functions should be defined before you use them
Open the file to host, hmmm
are you referring to a file to run your code, like a script?
!e
my_func()
def my_func():
print("This will show error as the function got defined after I used it")
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'my_func' is not defined
If it does that it suggests to me that all your code is doing is defining functions and not calling them, or you forgot to call an important function
This is your issue
Nothing more
Define your functions before you try to execute them
ye tbf you have your final function get_bank_data() called before it is defined, inside your first function
Although I'm confused as to why it isn't showing any errors and just closing instantly
Put get_bank_data above open_account and put both of the functions at the top of your file before the command balance
Even a bash script would output the error
love it when communications end without any notice
Also, do get_bank_data() and open_account() functions strictly need to be async functions?
How to make the condition that if the server already has a category with the same name, then do not create a new category?
@slate swan
Bro it says it all
Ik but it doesn’t make sense read code Above
It does tho
BRUH
Un send
That’s against tos
@slate swan right there
Self bot
I do
When you use bot type commands on your own account
Having self in your command doesn't mean its a self bot
how do I make a command only work if a user has a certain role
Get the role id
ok
I have that
if role == roleid:something like that ig
Not a good explanation but sm like that
Yea
If role isn’t (“id”)
Huh?
You also do if role isn’t bc then other roles can use command
Or just do
else:
await ctx.send("you do not have perms")
@slate swan see this channel is for helping with bot not making
@slate swan
I think you have to read the description of the channel
O lol
Close the message with') so it wont give you a eol error
Bet
@slate swan how do I make it embed
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
Ty
Np
@slate swan I wanna make a list like
User- price
User - price
But it’s not working it keeps giving errors
import os
import discord
import random
client - discord.client()
@client.event
async def on_ready():
print('(0.user)'.format(client))
print('lol online')
print('---------------------')
print('hello pls work ')
coinflip = {'tr1ckshot', 'alex'}
@client.event
async def on_message(message):
if message.author.bot :
return
if message.content.startswith('-alex'):
await message.channel.send
('alexs stock')
k-6 - offers open
5t. - offers open
rw.- c/o 10€ ')
client.run
How to make sure that if a category with the same name already exists, then do not create it again?
Highlight categoriechannel and it should outline then look through code for outline writing
That’s what I would do
Ok
!Codeblock
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.
I don't know how to code it
import discord
import random
client - discord.client()
@client.event
async def on_ready():
print('(0.user)'.format(client))
print('lol online')
print('---------------------')
print('hello pls work ')
coinflip = {'tr1ckshot', 'alex'}
@client.event
async def on_message(message):
if message.author.bot :
return
if message.content.startswith('-alex'):
await message.channel.send
('alexs stock')
k-6 - offers open
5t. - offers open
rw.- c/o 10€ ')
client.run```
@slate swan
There are QUITE a few of errors here
Honestly it's either you're trolling or you just don't pay attention when you type 😅
2
LOL
yeah that was my first thought when i saw line 5
Lots of errors
Ofc that’s how I work
I know just the fix
Add print(“hello world”)
There we go problem fixed
What do you want to achieve exactly
Well I was trying to make command but then I gave up and trolled w code
Yea

you need to use discord.ext.commands.Bot, discord.Client() doesn’t have any command decorators
Ok
!d discord.ext.commands.Bot
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.
look into the documentations
Ok thanks
@patent lark my plan is to make a command to show an embed message of stocks like
Stock - price
Stock - price
Ect but embedded
@slate swan https://vcokltfre.dev/
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
Pretty good tutorial to learn with
Ty
Yw
Oof
bot = commands.Bot(command_prefix="a!")
@bot.command(name="stocks")
async def embed(ctx):
embed = discord.Embed(title="stocks, url="https://cdn.discordapp.com/attachments/895176029537189909/909014424969441280/standard_6.gif", description="test", colour=#444f59)
await ctx.send(embed=embed)
bot.run```
How to make the condition that if the author has a role with an ID that is in the list, then display the answer?
do you have member intents enabled in the dev portal?
add intents=intents to your bot constructor (commands.bot(etcetc))
bots should not be given admin it's a security risk, just give it the perms it requires
that's not what I'm referring to anyway - in the dev portal there's a box to tick that you need to tick to get member intents
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
inside the bot constructor, it's shown here https://discordpy.readthedocs.io/en/stable/intents.html#what-intents-are-needed
you're missing a quotation mark after stocks
I fixed
if a syntax error is pointing at a bracket like that it's usually because you've missed something further up 🙂
I mean I doubt you need all those but yes that's 100% better than requestin Admin
But not related to the member intents thing
nextcord and d.py share the same syntax for the most part but you can check their server to be certain
nope
you need to do it in the code AND in the dev portal
the middle box there needs to be ticked on if you want to use member events
also it seems like you overwrite line 32 in line 36
Is that what shows when you can apply for verified bots?
can anyone help me
that looks good
then I assume it's because intents=intents isn't in the bot constructor, try adding that and reloading the bot.
e.g bot = commands.Bot(command_prefix=get_prefix, intents=intents)
import discord
import random
import aiohttp
from discord.ext import commands
bot = commands.Bot(command_prefix="/")
@bot.command()
async def dog(ctx):
async with aiohttp.ClientSession() as session:
request = await session.get('https://some-random-api.ml/img/dog')
dogjson = await request.json()
embed = discord.Embed(title="Doggo!", color=discord.Color.purple())
embed.set_image(url=dogjson['link'])
await ctx.send(embed=embed)
it donst work
you can apply when the bot hits 76 servers I think
discord will send you a special system dm thingie
Hmm kool
does it require face registration ?
can someone heklp
I believe you need a form of ID (e.g a passport) which presumably has your face on it
Yes you need to provide your personal info to them
does your on_ready event run?
like when i do /dog it wont send the photo
before it was working but i added more stuff so when i tested it it ddosnt work anymore
can i dm u full code
there
zoom out for indentation to work
Thats just a fraction
The whole thing is over 100 lines
But that fraction is basically what returns the error
specifically line 17
tabs
?
Do you know how old you have to be?
16?
@unreal cave are you using vscode?
yes
hm
16 if you don't accidentally use your parents id
@unreal cave what error does it produce?
and use pretty errors python -m pip install pretty_errors
@hardy yoke https://streamable.com/g9dydv it running and it running commands https://streamable.com/mlljde
Kk
k
one sec
dosnt work
show your imports
import discord from discord.ext import commands from googleapiclient.discovery import build from google.oauth2.credentials import Credentials from google.oauth2 import service_account import asyncio import math
The google stuff is for a spreadsheet
import reactions
same error
discord.py or nextcord @unreal cave
Thats an event
Its not an error with the reaction
like the reaction stuff works
its just that the timeout doesnt
@slash.slash(description="Displays the Latency and Uptime of the bot")
async def ping(ctx):
embed = discord.Embed(title=":ping_pong: Response Times :ping_pong:", color=discord.Colour.blue())
embed.add_field(name="API", value=f"`Loading...`")
embed.add_field(name="Websocket", value=f"`{int(client.latency * 1000)}ms`")
embed.add_field(name="Uptime", value=f"`{str(datetime.timedelta(seconds=int(round(time.time()-startTime))))}`")
time_before = time.time()
edit = await ctx.send(embed=embed, content=f"{ctx.author.mention}")
time_after = time.time()
difference = int((time_after - time_before) * 1000)
embed = discord.Embed(title=":ping_pong: Response Times :ping_pong:", color=discord.Colour.green())
embed.add_field(name="API", value=f"`{difference}ms`")
embed.add_field(name="Websocket", value=f"`{int(client.latency * 1000)}ms`")
embed.add_field(name="Uptime", value=f"`{str(datetime.timedelta(seconds=int(round(time.time()-startTime))))}`")
await edit.edit(embed=embed, content=f"{ctx.author.mention}")
``` this works as client.command but not as a slash command
any idea why?
anyone mind helping me
What do you need help with?
What are you using?
ok
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
thats my code and it works fine but
when i add this code
@bot.event
async def on_message(message):
guild = message.author.guild
if message.content.lower() == "+member":
role = discord.utils.get(guild.roles, name="member")
if role is not None: #
await message.author.add_roles(role)```
the code just dons't work
@bot.listen i think can solve the error
theres no error
its just lik dosnt do anything
@slate swan read this: #discord-bots message
@slate swan quick question
how would u add a .env file to replit
Try searching in the docs under the command it will say why the error occured
Under a command their will always be a list of errors and the reasons
How to create an environment file in REPL.it and use it in NodeJS
Add a comma after user_id for the placeholder
Idk if it works i use vs code
nvm i fixed it
Nice
Hm
Try removing the (,) and just put user_id
Oh or index it
By the column name
Ok then add it
And try
Idk I'm so used to postgres that I don't have to wrap it around tuples so it's even more easy
Just returns in a list
Is it bad that I implement self editing utilities in my discord bot so I can edit the bot through the bot?
Like
Other than the obvious if I make a mistake and save changes the bot will die and I'll have to edit it directly
I have a system where I edit by line, so I can display lines x to y then overwrite line z with such and such then restart and there's the patch done
That way I can host the bot remotely
You want a coding assistant ?
Wait do you want a bot that does a update with no downtime?
I am so confused
Self editing bot
Elaborate
It's only ctx.author.id
Even if it's inside a cog
You use self when it's only about commands.Bot
What
Wtf
Why did you do that
That's not even needed
What lib are you using
Yo, how would I checks for this?, I can't seem to find any way out of the 3 I tried for this.
Set arg a and b to None
Idk how to use that so why not ask in their support server?
I have.
And then I get a conversion error.
@kindred epoch, Nevermind, I get the same error, for a is a required argument that is missing
It's ignoring my if statements for some reason
You defined them as None
Yeah, I'm lost
a: int=None
Yo, thanks man!
Np
any docs for user latency?, in google they are only showing bot's latency not user
What to do when you get bombed?? 💀
Anybody got a good buttons tutorial for disnake
examples folder, docs
No
ok
User as in you?
memes = []
@commands.command(pass_context=True)
async def meme(self, ctx):
wait = await ctx.send(f":mag: Please hold on, searching ")
try:
reddit = praw.Reddit(client_id="",
client_secret="",
username="Username",
password="",
user_agent="UserAgent",
check_for_async=False)
if not memes:
subreddit = reddit.subreddit("meme")
meme = subreddit.top(limit=300)
for i in meme:
link = i.url
if len(link.split('.')[-1]) == 3:
memes.append(i)
send_meme = random.choice(memes)
memes.remove(send_meme)
embed = discord.Embed(title=send_meme.title, colour=0xffae00)
embed.set_image(url=send_meme.url)
embed.set_footer(text="Source: Reddit")
await wait.edit(content="", embed=embed)
except:
await wait.edit(content=":x: Something went wrong, cannot get meme ")```
What's wrong here??
how do you expect us to find whats wrong
By looking at the code
Simple
¯_(ツ)_/¯
lol well the except gets triggered every time
IDK why
Don't use bare excepts
try raising the exception
Ok lemme do that
Ignoring exception in command lockdown:
Traceback (most recent call last):
File "C:\Users\myname\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\myname\Desktop\montigraal\bot.py", line 488, in lockdown
await ctx.send(embed=e)
File "C:\Users\myname\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\abc.py", line 1065, in send
data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
File "C:\Users\myname\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.description: This field is required
hello
help
send code
@bot.command()
@commands.has_permissions(manage_channels = True)
async def lockdown(ctx, channel : discord.TextChannel=None):
await ctx.channel.set_permissions(ctx.guild.default_role,send_messages=False)
e=discord.Embed(descripion=f"✅ {channel.name} has been locked!")
await ctx.send(embed=e)
@bot.command()
@commands.has_permissions(manage_channels=True)
async def unlock(ctx, channel : discord.TextChannel=None):
await ctx.channel.set_permissions(ctx.guild.default_role,send_messages=False)
e=discord.Embed(description=f"✅ {channel.name} has been unlocked!")
await ctx.send(embed=e)
it says something about invalid body form
heyy
i need help with my bot
"discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions" im getting this error but i gave my bot admin role
send code
did u give admin perms while adding the bot?
@stark bobcat i sent my code
yeah i think so
i am not sure it should be working
import os
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = ">")
slur_words = ['cat']
@client.event
async def on_ready():
print('we have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
channels = client.get_channel(908607227361890314)
if any(word in message.content for word in slur_words):
await message.delete()
await message.channel.send(f"{message.author.mention} don't use slur words")
await message.author.send("please don't use slur words")
await channels.send(f"user {message.author.mention} has used slur word")
await client.process_commands(message)
@client.command(aliases = ['clear'])
@commands.has_permissions(manage_messages =True)
async def clear_func(ctx, amount=1):
print("it's working!!")
await ctx.channel.purge(limit = amount+1)
@client.command(aliases = ["mute"])
async def mute_func(ctx, member:discord.Member, reason= None ):
print("it's working")
muted_role = ctx.guild.get_role(908354074989195266)
await member.add_roles(muted_role)
my_secret = os.environ['token']
client.run(my_secret)
it says something about invalid body form
this one ?
yeah
add something so that the bot can edit the role for mute role to not talk
ok
god that wording came out so badly, omfg
Ignoring exception in command mute_func:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 35, in mute_func
await member.add_roles(muted_role)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/member.py", line 777, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 248, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
this is the error
either you, or the bot is missing perms
u have manage_messages perms right
Bot doesnt have permission to do what you want it to do
does the bot have manage roles perms
"descripion"
FUCK9DEFMKJBRASEBFHUJASBGFASIUGBASIKEHGASWRE
im blind as fuck
@slate swan did you try the command on yourself?
thats the problem
wait no
it can't add things to you because of role hiearchy
i used my alt
you sure?
maybe it's because the muted role is above the bots role
yep
Descripion?
just now tried it myself
There's a 't' missing.
i was blind
@slate swan
mhm
move the bot role above the muted role
just click one of the roles and you should be able to change the order of it
https://paste.pythondiscord.com/uvaterakoy.sql what is thhis error (mongodb)?
authentication failed
you entered the wrong username/password maybe
Btw if a bot tries to mute a role higher then their role it wont be able to due to the role being higher then the bots role in the role hierarchy
ohhh
Its like the social pyramid their just more powerful lmao
makes sense
Yeah
thanks
anyone know any good open-source discord bot ranking systems in python
Yw
so im using discord-components to make a calculator wit buttons. all the interaction stuff is inside a while loop, but when i click any of the buttons, it says "interaction failed" any idea why this happens?
uh
Show code
async def kick(ctx, member: discord.Member, reason):
if not ctx.message.author.guild_permissions.kick_members:
await ctx.reply("You do not have the permission to kick members!")
return
await member.kick(reason=reason)
try:
with open("configure.json", "r") as f:
data = json.load(f)
channel = data[str(ctx.guild.id)]["mod"]
embed = discord.Embed(title=f"Kicked {member.name}", description=f"Kicked by: {ctx.message.author.mention}", color=ctx.message.author.color)
embed.set_image(url=member.avatar_url)
modChannel = client.get_channel(int(channel))
await modChannel.send(content=None, embed=embed)
except:
await ctx.reply(f"Kicked :white_check_mark:")
how can i make a command pass even if the text is in caps like !HELP?
If your doing !hElp, !HELP etc and want the command to still run you can do;
bot = commands.Bot(command_prefix='!', case_insensitive=True)
There's a little performance loss while doing this tho ,-,
ok thank you
The role hierarchy of bot may be less than the member you try to kick
Are you sure the bot's top role is above the member's top role
it cant kick bots?
other bots*
Why not
it can kick a member without any roles on the members, but it doesnt kick a bot
even when the bot doesnt have any role
yes, they have no roles, my bot has two roles one with admin perms and other with moderator too
What's the exact error you get
403 (Missing permissions)
your bot and the bot you are trying to kick likely has the same role, or you are missing permissions to run the command?
the bot you are trying to kick should be on a lower role than your bot.
also when you called the .send() method on your modchannel, the content = None, embed = embed was unnecessary, the content is not a required parameter, it's a kwarg, doing await modchannel.send(embed = embed) would be just fine.
oh oh, thanx, also how do I fix NoneType when i try to .get_channel
using bot.get_channel() tries to grab the channel from the bots cache. if it returns NoneType, likely the channel either doesnt exist, or is it not loaded in the bots cache
make sure you pass the correct channel ID
I do pass the correct ID, but it just says None
or maybe try await ctx.guild.chunk() before you get the channel
ohh
!d discord.Guild.chunk
await chunk(*, cache=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Requests all members that belong to this guild. In order to use this, [`Intents.members()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") must be enabled.
This is a websocket operation and can be slow.
New in version 1.5.
thanxx
actually no.
this wouldnt help, because you are trying to get a channel, not users
its 1 AM and my brain is fried. forgive me

oh hi hunter
Hi
long time no see.
Same
import discord
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}
'.format(client))
2am for me lmao
im missng something
Wdym
if you're making a bot. dont use discord.Client()
^
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.
oh
would it make a difference tho
ty
it would.
She ain't making commands, is she?
she * ..
My bad
not yet. i assume this is a mistake that can be fixed early on
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.
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
dont watch that
Yea use that

?
kk
Bruh why does pip bugs out while installing with git ;-;
i literally wasted my 1 week watching yt videos
Most yt tutorials use outdated versions or client which isnt best for discord bots
this person is using replit
this person is using discord.Client()
i dont think they are a good reliability.
(assuming its from yt)
It is Free Code Camp haha
xd
replit suggests it automatically when u create a python repl lol
Lucas is the best, change my mind
so i should scratch what i alrdy did & do this
Yea
except the unban
LMAO True
Imagine making API Calls for getting the bans
First do you know the basics of python before jumping to dpy?
- you learn nothing from copying code.
- most of the yt tutorials are outdated and poorly written code
3.not reliable
i dont know anything 
dont jump into d.py
!resources is for u then (:
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Explore ig
you need
basic understanding of python syntax
basic understanding of Object Oriented Programming
basic understanding of Asynchronous Programming.
@slate swan
i havent got the patience to read it
then just click on Watch or Learn (:
?
Learn
Guides related to the Python Programming Language.
seems like your bot is also reacting to the message 🤣
this is so confusing 
It was a joke but okay
@maiden fable should i code on python or replit
Well, you can always open a help channel ( #❓|how-to-get-help ) and ask questions. You can ping me in one of them in case u need help
Replit also uses Python...
yea ik but
You mean local or replit?
idk 😭
You mean on replit or pythons idle?
Oof I guess just calm down and think from where you should start
BTW don't look into classes all of a sudden
You will want to leave Python
yuh
Start with functions
Ig python's idle is better for beginners
Yea it is
I prefer coding in VSCode (locally)
And is also laggy ^^^
And non reliable
hell yeah , the lines stay underlined for a long time
Vs code is better in my opinion
same
ok ok haha let's stop this. This belongs to #editors-ides
i tried sublime too , its lightweight but didnt really liked it
Yeah lmao
We were just appreciating how good vsc is😔
im eating tacos & salad rn
cool
Eat vegetables they make your brain go brrr
I recommend starting with:
functions
Loops
Classes
Dictionarys
Other stuff
Not Classes For A Beginner Pleaseeeeeeeeeee
visual studio code is simple??? 
They arent that bad😭
Ig🤷♂️
Coming from neovim that is laughable
bloat
If statements loops and functions are all good for beginners ngl
As a beginner you should probably learn primitive types then flow control
Gosh your vocabulary is so different to mine
How do you check one has voted for my bot or not in top.gg
?
??
???
????
?????
Use an api
why are you doing just except:
please dont do that, just doing that causes it to catch anything like even BaseException
I need help with an issue
Sounds great
sure
you haven't imported random
I was watching a video and the person did not import random
I know that it is the issue
maybe he did and you didn't see it
you can't use something from a module without importing it first
Where did I go wrong?
he didnt import "random"
doesnt matter, random isnt defined, import it?
I just dont know how
How can I get role id?
Is this a discord bot related issue?
Not related to discord bots, see #❓|how-to-get-help
discord.Role.id
already gey role with discord.get
Alright ty
.id ..
Then just .id on your variable
Not working
Neither is my mind reading today. Define 'not working'
\😦
Or don't, not my issue
Show me what "not working" means
Bruh ok
Any idea?
currently not on my main pc so cant show code atm
but theres no error in the terminal. only in discord
ig its something related to ratelimit
No, you would get a ratelimit error and not 'Interaction failed'
Without code we can't help you
alright i'll send the code when im on my other pc
Errors
There can't be no "errors" if it says interaction failed
i checked the terminal and there was nothing. i'll try running it again and then i'll tell you if theres any errors
Cool, but something might be blocking your errors from being raised. Do you have an error handler?
Do you have an error handler?
hi
can someone help me ?
i want to make a discord bot that shows online players in a minecraft server in its status
hello ?
You'd need to use an API/module for that
wdym by that? like pylance?
No, "on_command_error"
how do you host the minecraft server?
no, i dont
!pypi mcstatus
but i'll check if the handler for another command is interfering with this one
i actually don't i want it for my friend
Try raising the error by adding a try-except statement
thank you so much
can you explain more please ? im new in this
This
im not on my main pc cuz im playing minecraft for some time now. i'll send it in like 30 mins or smthng
Ah ok then
well if you use aternos to host, theres an api for it. then, you just have to get the amount of players online in the server and then return that value when the command is run
no i use VPS
not sure about other hosting sites though
Just use mcstatus
What winrar said
A VPS doesn't have an API if you don't make it by yourself.....
Do you even know what a VPS is?
as i said , i don't Host the minecraft server and i don't know much about it .
i just want to make this bot for my friends server
Just use mcstatus, you can get the statistics and information about any server based on the IP of the server
even aternos doesnt. i think a community member made it himself
slightly out of context, but do you need to install a plugin to use mcstatus?
Plugin??????
No
It's a library for Python....
how does it connect to the server though?
It doesn't.....................
then how does it get the status....
omfg
actually nvm i just read the docs

