#discord-bots
1 messages · Page 525 of 1
why would you fetch anything
What about there are 5 people in the voice channel (the limit should be 6) and someone leaves (the voice limit should be 5)
So this won't work
bro what
Okay let me tell you my goal
use the on_voice_state_update event
I want to make an unlimited voice limit
Oh yeah that might work
whenever someone joins/leaves, set the limit to len(voice.members) + 1
Yep
That's easier, But the default limit should be 2
except when it's 0, set it to 2
How can I do that
simple if statement
if voice.members == 0:
limit = 2
limit = 2
else:
limit = len(voice.members) + 1```
LoL
Python is easy sometimes
I hope this works, Thanks man!
How to do this with await message.edit()?
hmm
wasn't await message.edit() can have only 1 arg?
Discord.py how to make bot wait for 10 reactionthen do stuff ?
Need some smart dude hand here
nope , you can have many
file = discord.File(f"{fileName}.png", filename=f"{fileName}.png")
embed = discord.Embed(title="Preview", color=0x5865f2)
embed.set_image(url=f"attachment://{fileName}.png")
await message.edit(content=f"Save code: `{base}:{eye}:{eyebrow}:{mouth}:{extra}`", file=file, embed=embed)
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: Object of type File is not JSON serializable
what
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
if not before.channel and after.channel and member.id == member:
print(f"{member} Joined")
elif before.channel and not after.channel and member.id == member:
print(f"{member} Left")
How do I make it so it gets the member id automatically?
So I don't set the member.id == 34578923458236452345
Just simply remove all and member.id == member
Thanks, And how do I tell it it joined that (voice channel)
You want to print what voice channel member left/joined ?
Need help
Help please
Anyone ?
Anyone smart enough to help me ?
If joined, use after.channel.name
If left, use before.channel.name
Thanks
No sorry
I am trying to use the on_command_completion event, such that it logs all of the commands that I run.
I have a command game and you can specify, for example random_number after it and it will start up the game. When the command shows up in the log, though, it only shows the game portion of the command, not the random_number portion/game selection part.
Here is my code: https://pastebin.com/RHhzTYrV
And a screenshot of the log message is below.
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.
print(f"{member} Left "(before.channel.name))
This doesn't work...
10 reacts on specific emoji or 10 emojis?
print(f"{member} Left {before.channel.name}")
np
[WARNING] Failed to overwrite commands in <Guild id=98765> due to 403 Forbidden (error code: 50001): Missing Access```
from discord.ext import commands
from dislash import slash_commands
from dislash.interactions import *
client = commands.Bot(command_prefix="!")
slash = slash_commands.SlashClient(client)
test_guilds = [12345, 98765]
@slash.command(
name="hello", # Defaults to function name
description="Says hello",
guild_ids=test_guilds # If not specified, the command is registered globally
# Global registration takes up to 1 hour
)
async def hello(inter):
await inter.reply("Hello!")
client.run("token")```
im need help
import discord
from discord.ext import commands
from discord.ext import tasks
from discord import Intents
import pytz
import datetime
import atexit
import asyncio
import sqlite3
import varsfile
#--------------------------------
trusted_users = varsfile.import_trusted()
token = varsfile.tokenload()
intents = Intents.default()
intents.members = True
client = commands.Bot(command_prefix='>', intents=intents)
@client.event()
async def on_ready():
print('bot online')
@client.event()
async def on_member_join(member):
saloon = client.get_channel(id=varsfile.newcomers_logs)
print(member)
client.run(token)```
getting error `TypeError: event() missing 1 required positional argument: 'coro'
PS D:\.personaldata\bots\TheBrotherhood> & "C:/Program Files/Python39/python.exe" d:/.personaldata/bots/TheBrotherhood/main.py
trustedusers.json LOADED
Token.txt LOADED
Traceback (most recent call last):
File "d:\.personaldata\bots\TheBrotherhood\main.py", line 24, in <module>
@client.event()
TypeError: event() missing 1 required positional argument: 'coro'`
(sorry for the huge block)
you should ask in dislash server, check your dm
any clues?
why the error it doesnt work
I tried using client.process_commands
all the errors with missing arguments are not working
no clues mate sry
remove () after @client.event
@client.event() to @client.event
oh i see
what does it change technically?
doe the () make it expect an argument?
Maybe add discord.ext.commands.MissingRequiredArgument
any error?
nope
commands.MissingRequiredArgument still works
@slate swan does ur command ur doing need args?
maybe ur doing the command with args (!poll 1 2 3) or the command doesnt have args (!poll)
this is the command
hm
Does the actually command work as it is supposed to
yes
did u do the command without the args
like only !poll
idk then
yeah did u try that
yes
did the error pop up if u did that?
What is ffmpeg in discord.py?
no
voice support I think
Nothing shows up in the terminal, right?
How does it work??
and with the other commands when are with missing arguments error the bot is not responding
Don't ask me I didn't make ffmpeg
😑
did anything show up in the console?
Anyone who can help me with ffmpeg in discord.py please
no
hm
@slate swan can u show me ur full command error
@poll.error
async def poll_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send(f"_ArgumentError: Specify me a content to poll❗_", delete_after=3)
Bruh you are taking the message as an argument and not entering it in the command?
hm
what
hes making a command error tho
y
Oooooooo
Try dumping the isinstance line so we can be sure that it is an issue with that line alone
Make it so temporarily any error defaults to the missing permissions one
Like this?
@poll.error
async def poll_error(ctx, error):
await ctx.send(f"_ArgumentError: Specify me a content to poll❗_", delete_after=3)
i think i fixed it
uh no
Hello my ping is 3985
And my bot is not responding
it works on 8 ball but not on the other commands
rip
Is it for my ping?
ig yes
It was responding good an hour ago
Ok thanks
problem with your host ig
np
I am testing on local
oh
Pydroid 3
idk
I code on phone
but is not respondingbc of the ping
So i use pydroid3
Hmm
Ok thanks
Have a good day
you 2

I need some quick help, how do i make my unmute role require the person u want to unmute to have the muted role?
bc now if he isnt muted, it just says unmuted
i want it to say user isnt muted
if muterole not in member.roles:
await ctx.send("This user is already unmuted.")
return
@slate swan ^
Get info for the role and store it in muterole
Yes
why spoonfeed
Check if the user has the role (muted) in the user's role and if he doesn't have the muted role make it say "he wasn't unmuted" or something
@bot.command(description="Unmutes a specific user.")
@commands.has_permissions(manage_messages=True)
async def unmute(ctx, member: discord.Member):
mutedRole = discord.utils.get(ctx.guild.roles, name="Muted")
if mutedRole not in member.roles:
embed = discord.Embed(
title = "Error",
description = (f"{member} isn't muted!"),
color = (0xe67e22)
)
await ctx.send(embed=embed)
elif mutedRole in member.roles:
await member.remove_roles(mutedRole)
await member.send(f" you have been unmuted in: - {ctx.guild.name}")
embed = discord.Embed(
title = "Unmuted",
description = f"**Succesfully unmuted {member.mention}!**",
color = (0xe67e22)
)
await ctx.send(embed=embed)
``` how do i fix it sending 3 embeds
use return
How to send multiple embed in the same message?
I think that's impossible.
!d discord.abc.Messageable.send
await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
bruh?
hi
how do i use on_timeout?
@commands.Cog.listener()
async def on_voice_state_update(self):
voice = self.client.get_channel(896396049151832165)
if len(voice.members) == 0:
limit = 2
voice.edit(user_limit=limit)
else:
limit2 = len(voice.members) + 1
voice.edit(user_limit=limit2)
Why this doesn't work?
I want this:
If 2 people are in voice = self.client.get_channel(896396049151832165) limit + 1
So the limit is 3
Its possible
are you getting any errors?
d:\Desktop\MaxTheBot\cogs\UnlimtedVoice.py:26: RuntimeWarning: coroutine 'VoiceChannel.edit' was never awaited
voice.edit(user_limit=limit2)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
d:\Desktop\MaxTheBot\cogs\UnlimtedVoice.py:23: RuntimeWarning: coroutine 'VoiceChannel.edit' was never awaited
voice.edit(user_limit=limit)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
you have to await those two voice.edit like await voice.edit(user_limit=limit)
oh
Traceback (most recent call last):
File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
TypeError: unlimted.on_voice_state_update() takes 1 positional argument but 4 were given
Ignoring exception in on_voice_state_update
Traceback (most recent call last):
File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
TypeError: unlimted.on_voice_state_update() takes 1 positional argument but 4 were given
Ignoring exception in on_voice_state_update
Traceback (most recent call last):
File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
TypeError: unlimted.on_voice_state_update() takes 1 positional argument but 4 were given
Ignoring exception in on_voice_state_update
Traceback (most recent call last):
File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
TypeError: unlimted.on_voice_state_update() takes 1 positional argument but 4 were given
Now this error
on_voice_state_update takes 3 arguments. member, before and after. Here you are only giving it self and not the other args
You have to add those
!d discord.on_voice_state_update
discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").
The following, but not limited to, examples illustrate when this event is called...
Urgh, I thought it was that easy
just wanted to link the same as i found it strange having nothing there other than a self haha :P
how to i convert this all roles mention
i mean i want to get all roles in that server and that all roles did mention also
Hi, I have a question about discord.py. How do I edit a message with a file instead of text?
i do like this ```py
total_roles = [ctx.guild.roles]
this code i get out put like this
i want to get only that roles mention
did anyone help me
[role.mention for role in ctx.guild.roles]```
!d send
With discord.py you are only able to edit a messages attachments with the master branch
lemme try
v1.7x has no attachments kwarg
Well pycord most likely forked and defaults to master branch, which is what I am using
Then inside of Message.edit it has an attachments kwarg, you pass in a list of new attachments
Ok, thanks for that!
attachment being discord.Attachment
Thanks
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host discord.com:443 ssl:default [getaddrinfo failed]```
Does anyone know what this means?
full traceback plese
my bot is not starting up, I regenerated the secret client code
ehm
hold on
just put your token into client.run('')
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
I did mate
then idk sry
you did bot.run('YOUR SUPER SECRET CODE THAT YOU SHOULDN'T SHOW DELETE THAT MESSAGE AND REGENRATE IT')
but you should put token there
this is toke @vestal owl
woops
omfg ubuntu's screenshots are so bright
I was using the wrong token lmfao
xd
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
np
NOTE: there is #bot-commands
thanks
can someone help me make my bot welcome people
!d discord.on_member_join
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
Bot flashcards_test is operational!
Ignoring exception in command changeto:
Traceback (most recent call last):
File "C:\Users\minua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\minua\Downloads\ex.py", line 33, in changeto
ctx = await bot.get_context(message)
File "C:\Users\minua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord\ext\commands\bot.py", line 847, in get_context
view = StringView(message.content)
AttributeError: 'Context' object has no attribute 'content'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\minua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\minua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord\ext\commands\core.py", line 855, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\minua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\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: AttributeError: 'Context' object has no attribute 'content'```
Im sorry, but this is being really strange
like.... WTF
!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.
@bot.command()
async def changeto(message):
ctx = await bot.get_context(message)
await ctx.send('Finished')```
@bot.command()
async def changeto(ctx):
await ctx.send('Finished')```
why message
like... ...
oh sorry
let me send the full code
@bot.command()
async def changeto(message):
ctx = await bot.get_context(message)
con = sqlite3.connect('lang_store.db')
cur = con.cursor()
auth = str(message.author)
auth = auth.split('#')
tb_n = auth[0]
create_table = f'''CREATE TABLE IF NOT EXISTS
{tb_n}(id INTEGER PRIMARY KEY AUTOINCREMENT, User TEXT, Language TEXT);'''
cur.execute(create_table)
lang = str(message.content)
user = f'{message.author}'
cur.execute(f'INSERT INTO {tb_n} VALUES (NULL, ?, ?)', (user, lang))
con.commit()
await ctx.send('Finished')```
I just find it easier like this
and I create the ctx object, but it doesnt work
just delete ctx = bot.get_context and change message to ctx
Then how do I get message.content
get the msg using its id and message.content
uh learn pyt.... okay, you should pass arg
wtf, if he really need message content he can get it by ctx.message.content
yeah I could do that
but he need arg
like changeto(ctx, *, lang):
yuh I just realised
and lang will be en or ch or something else
but there is also something else I could do
what
Is it possible to have one event call on multiple other functions?
wdymean?
give more details mate
you can call event as a function await event_name in that file
^
technically everything is possible if you try hard enough
can you send code + intentions?
Yes
aight we'll be right here
lol light mode
XD
absolute menace
-eyes
i see what you wanted to do
you should tru asyncing dms
its likely not the error in this case but you should consider it
Okay
no you should try removing dms function and doind await reportuser
also
ah was gonna say this
no need to define a function inside a funtion
Got ya
Also in case you do this in order to avoid a mess in your code, dm me i have a good advice
Okie
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
counter = 2
if len(after.channel.members) == 2 and after.channel.id == 896396049151832165:
counter += 1
await after.channel.edit(user_limit=counter)
elif len(after.channel.members) < counter and after.channel.id == 896396049151832165:
counter -= 1
await after.channel.edit(user_limit=counter)
elif len(before.channel.members) == 0 and before.channel.id == 896396049151832165:
await before.channel.edit(user_limit=2)
Why isn't this working?
I want this: If there are 68 members in voice the user limit should be always 1 more than the members
!p discord.member_role_add
Converting to "int" failed for parameter "pep_number".
!pep <pep_number>
Can also use: get_pep, p
Fetches information about a PEP and sends it to the channel.
Is this for me?
no
ok
any errors?
Sometimes and sometimes not
Traceback (most recent call last):
File "C:\Users\samjo\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "d:\Desktop\MaxTheBot\cogs\UnlimtedVoice.py", line 21, in on_voice_state_update
if len(after.channel.members) == 2 and after.channel.id == 896396049151832165:
AttributeError: 'NoneType' object has no attribute 'members'
okay, let someone more help you i don't want to work with voice states)
😢
any1?
How do I make the bot send the name of the permissions that a user has?
honestly
its kinda pointless
member.guild_permissions?
non send the name of the permits
if i understood, you want to increase the limit of the voice channel whenever someone joins?
is that it?
that wasn't for you
Yes
!d discord.Member.guild_permissions
property guild_permissions: discord.permissions.Permissions```
Returns the member’s guild permissions.
This only takes into consideration the guild permissions and not most of the implied permissions or any of the channel permission overwrites. For 100% accurate permission calculation, please use [`abc.GuildChannel.permissions_for()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel.permissions_for "discord.abc.GuildChannel.permissions_for").
This does take into consideration guild ownership and the administrator implication.
And if no one is in the voice it should be 2
And if someone leaves but there are still people
it lowers it
The user limit should lower by one
i see
Yes!
And I named the channel (Unlimted)
😄
hahahhaa
i would use a task instead of an event NGL
its slower but better
Yeah a task will check it
But the event happens instantly
mhm
So do you know how to do it with events
it would be a waste of resources to make a 0.5s task i agree with you
not really no
i don't think there even is a way to make such an event
I guess my ideas are big
I see xD
which is a good thing believe me
it's kinda off topic but i like to see young people learning useful stuff instead of watching tiktoks (if you are a young person that is, i also like to see older people learn such complex things)
there is a way believe me
but im too lazy to explain
hahha i see
Like..., Because I started coding python a month ago, And I never coded before tat, I don't know what to build, I just get these crazy ideas
i am good at planning the code but when it comes to actual typing im kinda bad
Yeah, I know what to do
But don't know how to perform it
Can you explain for the love of your pfp
me2 started with discord.py but im working with python almost 3 years
thats what you call a knowledge thirsty person. It's a quality that I respect
❤️
Let's not get too off topic
okayy.......
i will do some research
okay, but i didn't see 68 in your code
then how are you trying to do that?
I wanted to joke about number 69
so that was a joke?
Yeah sorry...
then do you have other goal?
I did that so you guys understand better
Yes!
explain it
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
counter = 2
if len(after.channel.members) == 2 and after.channel.id == 896396049151832165:
counter += 1
await after.channel.edit(user_limit=counter)
elif len(after.channel.members) < counter and after.channel.id == 896396049151832165:
counter -= 1
await after.channel.edit(user_limit=counter)
elif len(before.channel.members) == 0 and before.channel.id == 896396049151832165:
await before.channel.edit(user_limit=2)
not a code, explain like:
I want if a channel deletes then bot goes to audit logs, find who deleted it and send a log into log channel
They want the channel to have the limit of people always +1 to the number actually in it
it also raises and lowers accordingly
Okay so... The default user_limit should be 2, And if 2 people join the user limit changes to 3 and if 3 people join the user limit changes to 4, And so on and so fourth, And if one of them leave the user limit should be always 1 more than the members in voice
And this is my current code
glad you asked
xD
Does anyone havea good databasse for a discord bot
@slate swan are you owner?
nope
or smth
just a random user
Why is he asking you tho 😂
SQLite3
cuz he knows im smart asf
PostgreSQL, but SQLite3 is easier
gl
its gonna be so long and hard
It is a fun challenge
shall i send a happy PDF in your DMs?
Yes pls
So am I getting help?
yes i am writing an explain @slate swan
And I'm waiting 🙂 ❤️
🤣
chill
you're aiming too high even for us
(not like I am very good anyways)
can you help me please
ofc
send code
what
send the code
🤣 tf happened
hello
im facing a issue
with getting images off a website
its a 18+ issue/ website Xd
aight
Hey @misty stream!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
what how do i share the code
its likely not an issue from discord py
please dont share 18+ urls in the code
send everything in DM's
ill do
help for event on webhook create ;-;
@slate swan
first we define to much after.channel, so:
voice = after.channel
second i see that you do it only for channel with specific id, so:
if voice.id != 896396049151832165: return
third the channel can be none cause of it deleted or all member left, then:
if voice is None: return
next you need to check if there is amount of users in channel as it's limit, so:
if len(voice.members) == voice.user_limit:
counter += 1
next if there is less then 2 members in voice then set limit to 2:
elif len(voice.members) < 2:
counter = 2
and last if member left channel then do limit -1:
elif len(voice.members) < voice.user_limit:
counter -= 1
so we have:
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
counter = 2
voice = after.channel
if voice is None:
return
if voice.id != 896396049151832165:
return
if len(voice.members) == voice.user_limit:
counter += 1
elif len(voice.members) < 2:
counter = 2
elif len(voice.members) < voice.user_limit:
counter -= 1
else:
return
await voice.edit(user_limit=counter)```
finalllly
Thank you so much man!
@slate swan i forgot one thing in final code i edited
Thanks!
@slate swan@tough wagon nice you guys got it sorted out!
It's not working...
😂
omg what error?
No error
oh my f.... god
i just hate that stupid voices, always problems with them
It goes up to 3
isnt better to add this?
And never comes down to 2 again
can you get it to 4?
and then back to 3?
i see
eh that's possible only by mods but when there is same amount as user_limit it goes += 1 so that elif won't run
It locks at 3
did u change code? @slate swan
i have a tiny idea
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
counter = 2
voice = after.channel
if voice is None:
return
if voice.id != 896396049151832165:
return
if len(voice.members) < 2:
counter =2
elif len(voice.members) < voice.user_limit:
counter += 1
elif len(voice.members) > voice.user_limit:
counter -= 1
else:
return
await voice.edit(user_limit=counter)
its something i never used before
i think i messed up
wtf
How could I create a task that would loop every certain amount of time
not hard
you literally changed nothing
!d discord.ext.tasks.Loop
class discord.ext.tasks.Loop```
A background task helper that abstracts the loop and reconnection logic for you.
The main interface to create this is through [`loop()`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.loop "discord.ext.tasks.loop").
🤣
Wow thats extremely helpful ngl
Nothing is hard once u get the hang of it (:
ayup i agree
So what do I do?
Then make them understand instead of giving them answers like these (:
aight sec
Hey @slate swan what happened
Calm down
@slate swan sorry, maybe i could help you by joining that server and test your bot but i havent got more time
It's ok...
Just leave it...
@slate swan what is the issue?
@tasks.loop(seconds=120)
async def loop():
pass
loop.start()
@final iron

it will iterate every 2 minutes
It was just an example...
nvm 😢
docs examples are spoonfeed
Yeaaa
i agree
Radium just gave a small example lol
Give them the documentation link, they will learn more than from your copy pasta
I linked them to the docs
yes
but no
examples work very good for simple topics
its better to send detailed docs when it comes to complex stuff ofc
@slate swan i can help you tomorrow (7:00 AM at mine) if you want (it is 9 PM at mine)
Don't worry
ok
lol
we have same time xd
WoW yOu ArE sO gOoD aT tImEsTaMpS
noone cares
how can I deaf my bot on join a channel?
I did everything it says to do on this page and got the bot working with the docker-compose up command. It is getting the bot to work on my test server.. It says it's connected. https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
Now I just need to finish this tutorial, which is pretty great. https://vcokltfre.dev/
A guide to setting up and configuring Sir Lancebot.
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.

ok
It was worse than I thought, the things I had to do to get set up were pretty complicated. It's not very beginner-friendly.
ok
can someone help me make it so every role i create will be above a specific role?
Use Guild.change_voice_state() and the self_deaf kwarg
Hey everyone. I tried to create a Discord bot that can check lots of messages. Is there a way to use discord.Client function, like message.delete into on_message(self, message), into my thread ? I included the "message" variable into my thread
Thanks !
give more details
do you specifically want to delete certain messages?
AKA bad words for example?
When I receive a message, I create a new thread with the message inside. So after, I can check which message it is. For example, in the thread, I check if message.content contains bad words
And I want to delete the message if it's true
Ohh i see
Can I do it into my thread ?
yeah ofc
radium will help ig i will just say that you need 2.0v of dpy)
i forgot that threads became a thing for a splisecond ngl
do bots even have access to them?
right right
Yes, they have admin access
i will do some research, excuse me for a second
The bot is working to recognise banned words
Into the thread
So now I should delete the message
i see
NOTE: on_message works for threads too, your bot just need to be in it
message.delete() will do it mate
yeah just saw that info and it kinda relieved me
I have this return : RuntimeWarning: coroutine 'Message.delete' was never awaited
await message.delete()
NOTE: learn python
right right
sorry i forgot to specify u have to await
Oh wait you're smart !! Oh. SyntaxError: 'await' outside async function
also dont say these things not everyone likes that type of humour
OH wait, you're smarter!! You are doing that in def, not async def
So I should rename my thread function "def run" into "async def run" ?
yes!
Let's try so
and await it when calling
im... just... tire...d?
So when I'm doing "thread.start()"
class ThreadMsg(threading.Thread):
def __init__(self, msg):
threading.Thread.__init__(self)
self.msg = msg
async def run(self):
# test de la censure
temp = self.msg.content.lower()
if any(map(temp.__contains__, censure)):
print("Bad word detected")
await self.msg.delete()
It's not working D:
i feel you
async def on_message(self, message):
m = ThreadMsg(message)
m.start()
I'm a casu thread user
It's probably wrong
on my lang that sounds sooo weird
🤣🤣🤣
It's working well like I did
im.... still... noob...
I just need to know if I can use discord functions into a thread, that's all
you can
I honestly dont know
i never used threads they still dont exist for me
hey guys
I can see that Threads is supported in discord.py 2.0+ as you said
i need help
using discord.thread
I'm all ears
yes (there is only unreleased 2.0 no +)
But it's still in beta
someone how to do like if i say hello the bot will say hello and edit the message to hi
I'll try so
like edit message
yes
The bot can only edit it's own message
i know
!d discord.Message.edit
await edit(content=..., embed=..., embeds=..., attachments=..., suppress=..., delete_after=None, allowed_mentions=..., view=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the message.
The content must be able to be transformed into a string via `str(content)`.
Changed in version 1.3: The `suppress` keyword-only parameter was added.
oh okay
i mean the bot will do it
i misread sry
this is embed
yes
The bot will send hello and then edit it to hi after some time right?
i mean like if he say hello he will edit him self to hi
me?
yes
message.edit(content='hi')```?
like
will the bot say anything if you say hi?
@client.command()
async def poop(ctx):
await ctx.send(f's')
edit ctx.send(f's2')
They want the bot to reply with "hello" then edit it to "hi"
no
someone?
yes?
ok look
yes?
@tough wagon will make the code then I will explain how it works
ok
@client.command()
async def poop(ctx):
m = await ctx.send('s')
await m.edit(content='s2')```
Save the first ctx.send part in a variable then call .edit() on it to edit the message
yay the explain
m?
Lol bro
m is name of variable (message)
At least I don't do irrelevant spoonfeed
Assign the return value of ctx.send to a variable which is a message, then use the .edit method on that variable
neither do I anyways
Spoonfeeding clearly shows you can't help
oh thank you
I agree
Then why do you want to spoonfeed 🤡
i will tell you in DM's
How about no
And just say here
Because you clearly wanted to spoonfeed and therefore not help at all
i don't want to say anything but i will say:
That means that there is a REASON of that you don't help
I'm probably more helpful than you here
yes mate you're smart
ok bye
bye then
imagine fighting in a python server?
They said they will explain so
^^
let them be happy about themselves its okay
@calm vortex thought u were the server owner 😗
haHAA
i can't explain without an actual example
thats why i always carry a notebook an a pen/pencil
theres no need to be this mad about it@slate swan
ikr
it is anyways
And can you explain why you need to ping when you clearly have seen I've moved away 
@hasty iron agreed 888%
cuz im a kid with high ego
You're just bringing it back up again by doing so
drop it
Yeah already realized that
sorry its just my personality
if somebody is being annoying, report them to modmail or something
No thank you
i honestly think its better if i solve my problems myself
People can change their behavior and spoonfeeding issues by themselves without having a mod to intervene
stop
They were clearly intending to explain what the code does, it's their choice to send the code.
why we dont recommend spoonfeeding is they dont care about the explanation, they just copy paste the code.
Even if there was an explanation, people don't read it
poeple who dont read are people who dont care anyways
dude can you guys seriously drop it
You could have said you disapprove sending code along with explanation, but you attacked by saying anyone who sends code doesn't know how to help.
Aight
sir stop it
ok
I already said alright
i apreciate your understanding but its not worth it anymore
how the fuck has a fight broken out in the discordpy channel
sorry latency
stop word is like... 999999 ping
better not know
Hi, im trying to make the bot send two Embeds in the same message, but when i try it the terminal sen me this error :
'tuple' object has no attribute 'to_dict'
An i have this on my code
await ctx.send(embed=(EmbedPing, EmbedAnuncio))
I try it to make embed= EmbedPing + EmbedAnuncio but nothing
Anyone can help me?
You can't send multiple embeds in v1.7.3
Update to 2.0.0 or don't send multiple embeds in a single message
not embed, it is embeds
and not () it is []
?
embeds=... u mean?
!d discord.abc.Messageable.send
await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.

yea you need to update to 2.0
Missing the 's' though
lol...
why? the embed attr was in 1.0 ver, nothing new
to update
^
embeds (List[Embed]) –
A list of embeds to upload. Must be a maximum of 10.
New in version 2.0.
ohhh sry i didn't know i always thought it is in dpy XD
lol
Hello, I'm trying to create leveling system, but I'm not doing something right. Yes, I know JSON is bad, but I can't make it with an actual database. The problem is that when I level up (at the first message I send), it tells me that I leveled up to 0 level and I can't level up to level 1. I have an error. Please tell me what to do! This is the code: python @client.event async def on_message(message): with open('users.json','r',encoding='utf8') as f: user=json.load(f) try: with open('users.json','w',encoding='utf8') as f: user[str(message.author.id)]['xp']=user[str(message.author.id)]['xp']+1 lvl_start=user[str(message.author.id)]['level'] lvl_end=user[str(message.author.id)]['xp']**(1.5/4) if lvl_start <lvl_end: user[str(message.author.id)]['xp']= user[str(message.author.id)]['level']+1 lvl=user[str(message.author.id)]['level'] await message.channel.send(f"{message.author.mention} has leveled up to {lvl}!") json.dump(user,f,sort_keys=True,indent=4,ensure_ascii=False) return json.dump(user,f,sort_keys=True,indent=4,ensure_ascii=False) except: with open('users.json','w',encoding='utf8') as f: user={} user[str(message.author.id)]={} user[str(message.author.id)]['level']=0 user[str(message.author.id)]['xp']=0 json.dump(user,f,sort_keys=True,indent=4,ensure_ascii=False)
This is the error: raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@marsh depot what are you trying to send?
why cant you make it with a database?
My knowledge is pretty low, I'm new at coding and this sounded interesting so I gave it a try. This is where I went lol
using json as a database sounds intersesting? anyways, postgres/sql is a recommened db so might as well learn how to use those.
NoNoNoNo, 3 openings of json file in one event, super low speed, omfg
Been dealing with this error for a few days and I'm losing my mind.
@tasks.loop(seconds=10)
async def delete_keywords():
keywords = ['asd']
guild = bot.get_guild(891589851110051860)
db_func = discord.utils.get(guild.channels, name="general")
channel_id = db_func.id
db_user = bot.get_channel(channel_id)
messages = discord.utils.get(await db_user.history(limit=100).flatten())
for message in messages:
check = any(keywords in message.content for keywords in keywords)
if check == True:
msg_obj = await message.channel.fetch_message(message.id)
await msg_obj.delete()
delete_keywords.start()
The error I'm getting is in line 6, NoneType object has no attribute channels. Yes, I've checked - the guild ID is correct and the bot is in the guild I'm trying to get and yet it doesn't work. Please help.
no, creating the command sounds interesting
json is commonly used for static data since it doesnt fare as well as a database when filtering, searching and generally managing data. Also, it will become increasingly slower when doing dictionary lookups as your bot userbase grows
what should I do?
try await bot.fetch_guild maybe it's just not referenced
learn sql
:/
guild is none
I'm aware
I understand the error and have tried to fix it but I can't
use fetch_guild as @tough wagon said
ok lemme try
no dont
WhY
you have to add bot.wait_until_ready inside your task
you’re trying the get from cache before it’s filled
!d discord.Client.wait_until_ready
await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the client’s internal cache is all ready.
Send two embeds in the same message because the same embed have the 2000 characters limits and need more words. That i add another embed
ofc
oh yesss i always forgot about that ready problems
inside the task function right?
yes
at the end?
guess
I'd guess yeah
what
nope
one of the reasons why I love c#
one of the reasons why I hate c#
Unfortunately multiple embeds in a single message are treated as a single embed in terms of limits.
defining variables before using them is pretty neat though
How about using pagination ?
Well that's their point, using two embeds to get another embed to send the message they want
is there a way to cancel a command if something happens?
return
oh yeah lmao
if statement:
return```
i forgor 💀
yeah lmao
Yeah, but that doesn't work
Sending two separate embeds is a solution
guys how i can host my bot 24/7 free ?
You don't, all free hosting services are bad or very limited
Take a look at this
rdp ?
it's also possible to host a smallish bot on a raspberry pi
how
I just realised it works, embed limit including description and other things is 6000, two embeds in a single message with only their descriptions fully filled means 8192, so it can work if the second embed's description is sufficiently less.
hook a pi up to power and ethernet, send your bot code to it, run the file, sit back and enjoy
Please help, i want options and then a argument input, how can i do that?
That worked! Holy shit, thanks man
dont you already have that
nah thats not the thing i wanted
Isn't that what you asked for?
i don't inderstand
select menus would be better for that
you can put select menus in slash commands
nvm, idk how to do the options thing
Hello, can someone tell me what to do?python @client.event async def on_message(ctx,msg): user=msg.author mbed=discord.Embed(title=f"{msg.author} has been warned", description="**Reason:** Bad word usage", color=discord.Color.green()) ebed=discord.Embed(title=f"**You** have been warned from _**Icy Area**_", description="**Reason:** Bad word usage", color=discord.Color.green()) for word in words: if word in msg.content: await msg.delete() await client.process_commands(msg) await ctx.send(embed=mbed) await user.send(embed=ebed)
TypeError: on_message() missing 1 required positional argument: 'msg'```
Bandwidth usage is reduced, and I'd guess resources saved
on_message does not take ctx, it only takes message
The documentation explains how to use it. Make requests (POST, GET, PATCH, ...) to the API following their documentation.
How should I make it to send embeds then?
message.channel.send?
await message.channel.send
Exactly
There's a gateway topic in the docs
No problem :p
how i can host my bot for free 24/7 ?
heroku
@pliant nacelle
@pliant nacelle
how can I do a select menus with slash commands ;-;
The bare minimum would be sending a request to /gateway/bot with the proper Authorization headers. Then uses said url when connecting
free ?
You could use aiohttp to connect which I what I do in my discord API Wrapper
All free hosting services are bad or very limited
just give me a free please
!d aiohttp.ClientSession.ws_connect
coroutine async-with ws_connect(url, *, method='GET', protocols=(), timeout=10.0, receive_timeout=None, auth=None, autoclose=True, autoping=True, heartbeat=None, origin=None, ...)```
Create a websocket connection. Returns a [`ClientWebSocketResponse`](https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientWebSocketResponse "aiohttp.ClientWebSocketResponse") object.
Heroku
okey
Im using discord.py. What is a good db to learn and use and where can I learn it?
if your bot isn't huge, aiosqlite is a pretty good one
make sure whatever library you use is asynchronous
hello, Im running into an issue with my leaderboard command, its putting multiple lines as 1 person (as seen in the pic below).. here is the code for the command:
@client.command(aliases = ["lb"])
async def leaderboard(ctx, x=5):
users = await get_bank_data()
leader_board = {}
total = []
for user in users:
name = int(user)
total_amount = users[user]["wallet"]
leader_board[total_amount] = name
total.append(total_amount)
total = sorted(total,reverse=True)
em = discord.Embed(title = f"leaderboard: " , description = f"Top {x} credit leaderboard",color = discord.Color(0xfa43ee))
index = 1
for amt in total:
id_ = leader_board[amt]
member = client.get_user(id_)
name = member.name
em.add_field(name = f"{index}. {name}" , value = f"{amt}", inline = False)
if index == x:
break
else:
index += 1
await ctx.send(embed = em)
and my json file looks like this {"66008908772534677": {"wallet": 69, "bank": 4}}
Hence documentation
Its semi small atm. Only about 80 servers. However its a complete rewrite.
Whats the difference between sqlite3 and aiosqlite other than one being asynchronous and not?
You should not use Repl.it to host your bot.
While this may seem like a nice and free service, it has a lot more caveats than you might think, such as:
-
The machines are super underpowered.
-
- This means your bot will lag a lot as it gets bigger.
-
You need to run a webserver alongside your bot to prevent it from being shut off.
-
- This isn't a trivial task, and eats more of the machines power.
-
Repl.it uses an ephemeral file system.
-
- This means any file you saved via your bot will be overwritten when you next launch.
-
They use a shared IP for everything running on the service.
This one is important - if someone is running a user bot on their service and gets banned, everyone on that IP will be banned. Including you.
Please avoid using repl.it to host your bot. It's not worth the trouble.
Well since you've sent this I feel like we need to send the Heroku one too
You should not use Heroku to host your bot.
- Bots are not what the platform is designed for. Heroku is designed to provide web servers (like Django, Flask, etc). This is why they give you a domain name and open a port on their local emulator.
- Heroku's environment is heavily containerized, making it significantly underpowered for a standard use case.
- Heroku's environment is volatile. In order to handle the insane amount of users trying to use it for their own applications, Heroku will dispose your environment every time your application dies unless you pay.
- Heroku has minimal system dependency control. If any of your Python requirements need C bindings (such as PyNaCl binding to libsodium, or lxml binding to libxml), they are unlikely to function properly, if at all, in a native environment. As such, you often need to resort to adding third-party buildpacks to facilitate otherwise normal CPython extension functionality. (This is the reason why voice doesn't work natively on heroku.)
- Heroku only offers a limited amount of time on their free programme for your applications. If you exceed this limit, which you probably will, they'll shut down your application until your free credit resets.
Here we go
@pliant nacelle
import discord
import random
from discord.ext import commands
client = commands.Bot(command_prefix='*')
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle, activity=discord.Game('*help'))
print('We have logged in as {0.user}'.format(client))
@client.command()
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)
@client.command()
async def ban(ctx, member : discord.Member, *, reason=None):
await member.ban(reason=reason)
I got no errors, but it's not letting me kick the user
!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.
thanks bro
thanks tho
Make sure you read it
You need ctx
ctx.member.kick
mmmh no
yes
no
lol no
good name, i also pay
And it will kick the user
Thanks thanks :p
np
@slate swan dm your server bot
error 1: await guildchan.send(f"Bye bye **{guild.name}**.") AttributeError: 'NoneType' object has no attribute 'send'
error 2: File "D:\Discord Bot\GitHub\ecrpgbot1v2.0\cogs\owner.py", line 94, in leaveserver await newchan.send("Bye Bye nabs") File "C:\Users\Endomorph\AppData\Local\Programs\Python\Python39\lib\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\Endomorph\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py", line 248, in request raise Forbidden(r, data) discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
Guild might have no system channel
^^^
And therefore returns None
ye thats why i did the try thing
and here bot probably can't send a message in the system channel
lol
?
explain better lol
Bot sending 1 message all in once:
await ctx.send("a message all in once")

async def nicknamewhitelist(self, ctx):
data = db.find_one({ "guild_id": ctx.guild.id })['nicknamewhitelist']
embed=discord.Embed(title='Nickname Whitelsit', description=f"To add a role to the nickname whitelist, invoke `{ctx.prefix}nwl add @role`. To remove a role to the nickname whitelist, invoke `{ctx.prefix}nwl del @role`.\n")
for id in data:
role = self.client.get_role(id)
embed.description += f"{role} | {role.mention} [`{role.id}`]\n"
await ctx.send(embed=embed)```
`UnboundLocalError: local variable 'role' referenced before assignment`
You might want to indent the line in the for loop, and not outside
aight ill try
And get_role only exists on a Guild object
is this pymongo 👀
don't change presence in on_ready
would be nice if you named bot correctly
Can we customize the bot role (the self designated one) upon guild join?
and there's a syntax error in on_ready
Setting its colour etc
lol
Im having an issue with tasks.loop not working
Its just not looping
Nothing else is using an event loop
is there a way to check if a certain user name and discriminator is taken or not
Hey, can someone tell me why the welcome commands does not work now?
y
because you didn't provide any code or error
@client.event
async def on_member_join(member):
channel= client.get_channel(892136447535120385)
channel.send(f"{member.name} has joined")```
no error given
:/
did not work :/
i dont think its .name
it is
it's just he can't get the member's name
if he doesn't have intents enabled
intents
i have them enabled
intents=discord.Intents.all()
i think yes
Well you should be sure
what are some discord.py forks that you'd recommend?
what for
Heard about pycord, nothing else
So can't really recommend as it's the only one I've heard about
For updates I guess 
I'm just gonna wait for dpy
they can't just leave it like that
yep
there's no way
Probably going to wait a long time to be honest
I already moved library and language when the updates became so slow
So the cease of development doesn't really affect me
danny put way too much thought into his last announcement, I doubt he'd ever come back
who said it's gonna be danny
it does not work, i have enabled everything on my bot constructor or whatever you call it
Maybe not him but someone else, but I really doubt as nobody got really interested in it either way
And dashboard?
could you solve my math problem for me?
wdym dashboard? discord dev portal?
well in that case, aren't there already forks?
I'm not gonna say what the problem is
Yes
yes
i told you what is my problem
the bot does not work and it does not give any error
yes, but only for commands, not events
Yeah but what he means is the continuation of the discord.py library and not forks, but Danny offered people to continue the development of discord.py and everyone pretty much refused.
So I doubt discord.py itself will ever come back
it works for events too
disabled, tried, nothing shows
if you used the event
The error handler your talking about is only dispatched in commands when they errored
Event error are in on_error
yes
hm
exactly
well that's not really helpful then
Can you print dict(bot.intents)
Bot being your commands.Bot instance
wait where to print it?
on my on_ready thing?
event*
Sure, then send it here
nothing shows up :/
I'd suggest switching to Motor https://motor.readthedocs.io/
pymongo isn't async and will stall your bot whenever it does anything, which will become problematic as it grows
sorry, did not understand you
yeah, a lot of people have said that, its just idk if i want to learn another lib, i got pymongo good
i gave it administrator, what?
You probably messed up when passing intents to the constructor
its the same, but async and bad
Im having an issue with tasks.loop not looping. Nothing else is using an event loop and I wrote it properly
Administrator is a permission
Not a intent
?
pymongo is good if you arent using it in an asynchronous environment
motor's syntax is really similar to pymongo, just more awaits and some small differences
something to think over 🤷♂️
so how should i enable it?
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
if you want to be set you can do intents=discord.Intents.all()
hm, ill look into it. thanks
Its not doing anything. Not looping and not sending anything
oooooh, i forgot to add , intents=intents
yep, that's really frustrating in these situations
-_- tysm
- :/
the "no error" aswell
but it doesn't show any error
@tasks.loop(seconds=5)
async def test():
print("a")
Literally just an extremely simple program
that’s still not enough for us to do anything
As i've stated before it literally does nothing
Where are you starting the task
can you send your whole code
@final iron
Did you start the loop?
I keep getting this error in heroku but the bot runs fine when i run it on my computer
is it free
