#discord-bots
1 messages · Page 1032 of 1
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.
'''py
print("hello world")
'''
backticks
i feel like making a minecraft python hehehe
but not discord bot more like a real game with wasd those
which course should i take
....?
remove the escape \ characters
@loud junco refer to #game-development from now on
this is off-topic
ok thanksss
hi lets play minecraft dm me for server ip
@slate swan help 😔
@lightbulb.option(..., type=hikari.GuildTextChannel)
why doesnt the type show the autocomplete for channels
!ot @nimble plume
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
if you're not here to help/ask for help, refrain from using the channel
ok
cooldown
🤣 whats these 2 kids doing here
do u play minecraft
no for sure
nobody asked you
!rule 7 i did earlier, now, go to an ot channel
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
ok
wow
ok
how can i connect my keyboard and mouse with discord bot so i can play minecraft from discord
like move forward button
https://paste.nextcord.dev/?id=1651903518843765
when someone manually types ,help <cog> it works fine but when someone selects it from dropdown the dropdown gets removed and nothing else happens
doesnt even send cog help
bro
yes bro
this is like the day the world ends
walking front for 5 steps u need to do
w enter w enter w enter w enter w enter
ya
ye it will be cool
i want that
Meh i thought i came to wrong server
bruh
quit it you two
LOL 2 wrong people came in the wrong server
^
ok
this is minecraft-bots
🤦 this is not how things work my friend
ok help me
?
im not ur friend
not talking to u
u pinged me
im talking to him
ye same wrong reply
can you both stop?
not talking to you
she's not helping me
whats the issue?
i stopped lol
not u
me and newbie
im finding source on that
U CANT
how can i connect my keyboard and mouse with discord bot so i can play minecraft from discord
i mean he probably can..
discord bot doesnt have crosshair tracker
:/
u cant move ur mouse to make the head move
i dont want that just key strokes
you can use pyautogui to send the input signals through buttons or something
pyautogui.press("w")
sort of, you might want to adjust the timing to move, say, 1 block per stroke
i have 64 gb ram
i've seen people run NES emulators using discord buttons
no problem
whats nes
wait so i go #game-development ?
no
asking nyx
u mean consoles
...
i'm talking specifically about the NES
1 day rockets will be controled from discord buttons
it will also be the rocket that lands on ur rooftop
but #game-development is really ded
Minecraft gives you everything in-built support for everything and I see no reason to do away with minecraft like that
its fun
nobody asked
dont give me badwishes
just telling u
its not fun, you'll probably experience laggy inputs and lagging clients
why
bruh i mean
the rocket lands on ur rooftop so that rocket is urs
ya thats what im trying to say since the beginning
because you are connecting a third party software to an official client
my house will melt due to high tempreture
its going to be lagging
lmao
that's not the real reason
nobody tells u to use hydrogen+oxygen
it's just gonna be laggy because of discord api limitations
the code itself is already making it 💥
oh u launched electric rockets
you can only update an embed with an image so fast
I mean, just get it, I'm too lazy to explain it all and that person's not gonna stop at all even if I explain
LOL
it's a troll, can't take it too seriously
ashley gonna gives up
indeed
😳
always
||never gonna give you up||
@novel apex is always there, but i won't bother with it
same, ignorance was always an option
thats weird, lemme check
😦
sad newbie noises
thanks, and then I have another issue after this one too 😔
:/ ok byebye
;?
hikari.TextableGuildChannel
how can i get guild from guild name if bot is in the guild
ah I see, thanks
and and what does .filter do in ...fetch_messages(channel.id).filter(lambda message: ...)
!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.
after i make the minecraft python i will show u all :D(more like showing buggy project)
can you not spam random commands?
yes we will play together
lol
dude🤦
its similar to python's filter function
i only spam once
!d filter
filter(function, iterable)```
Construct an iterator from those elements of *iterable* for which *function* returns true. *iterable* may be either a sequence, a container which supports iteration, or an iterator. If *function* is `None`, the identity function is assumed, that is, all elements of *iterable* that are false are removed.
Note that `filter(function, iterable)` is equivalent to the generator expression `(item for item in iterable if function(item))` if function is not `None` and `(item for item in iterable if item)` if function is `None`.
See [`itertools.filterfalse()`](https://docs.python.org/3/library/itertools.html#itertools.filterfalse "itertools.filterfalse") for the complementary function that returns elements of *iterable* for which *function* returns false.
byebye
bye :<
going to sleep
hm i see, so
.filter(lambda message: message.author.id == member.id)
would be valid, right?
yeah, sure
hm i see, imma try it again, it raises an error for some reason
Snowflake object has no attribute 'id'
may i see more code
just a min
im sure you are using a for loop on a Mapping
nvm it worked for no reason now
never 😔
member = ctx._options.get("member") or ctx.author if isinstance(ctx.author, hikari.Member) else _guild.get_member(ctx.author.id) or await mod.bot.rest.fetch_member(ctx.guild_id, ctx.author.id)
am I weird to do this or is it normal 😔
hikari syntax is hard
its not hard, its easy
its more of a one-liner and may seem hard
ye 1 liner
its confusing
i mean
does hikari not have commands?
it just gets the member argument from a slash command and if the member argument is not given, it then defaults to the message author and if the message author is an instance of a User object, it gets the Member object and if the member is not found in the cache, it fetches the member from the api
it does
👍
ohh .. 👍
😂thats overkill
ctx.options.member or ctx.member
happy mothers day
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
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.
async def status_task():
while True:
await client.change_presence(activity=discord.Game('WARTUNG'), status=discord.Status.online)
that's not gonna do it for ya
you could use @tasks.loop() to make a task and make it wait for like 30 seconds so @tasks.loop(seconds=30)
your code would look something like
@client.event
async def on_ready():
print("Ich bin nun Online")
@tasks.loop()
async def status_task(seconds=30):
await client.change_presence(activity=discord.Game('WARTUNG'), status=discord.Status.online)
status_task.start()
Why is this bot not running? Please help i sit here for hours finding ut
but its the right one
This Error, AttributeError: 'NoneType' object has no attribute 'change_presence'
how to create channel by interacting to button
how to make change language command?
client is None, you should probably wait for the bot to log in before you start the loop. Add a await client.wait_until_ready() before your await client.change_presence() (on a side note, please don't change presences every 30 seconds or so, it can become very spammy for the API really quickly)
ready*
:p
can you send me pls the code in the line?
!d discord.ext.commands.Bot.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...
that is so
its kinda crazy how fast my bot connects to the gateway compared to dpy
dpy takes like a solid second while mine just almost connects instantly
not on disconnect because i never close the ws and i leave the connection to get zombified😭
which version of python is good? i use 3.10.4
Are you looking at discord.py's on_connect or on_ready
none im just going my personal experience
im not sure if they do something to wait for the cache to be ready and then connect
probably not idk
If you compare start times you need to compare it to discord.py's on_connect
Since the underlying is READY, whereas on_ready isn't actually READY it's an asyncio.Event waiting for cache to be populated
is that a user bot...?
It's a discord bot?
!d discord.Interaction.guild
property guild```
The guild the interaction was sent from.
Does anyone know how I could create an invite tracker bot?
I have no clue how I can keep track on invites.
!d discord.ClientUser
class discord.ClientUser```
Represents your Discord user...
u need to call discord.ClientUser
how
discord.ClientUser()
No 😔
This won't work, plus bot's can't even have friends
This just isn't possible with the API

'
oh ok
didn't help
how to add bank balance? I don't know mongoDB very well
pls^^
https://paste.pythondiscord.com/fajugorato
That's all the code, but why don't you get a welcome message when a user joins?
just a notice that you left your channel id on the script that could be used to spam that channel using a spammer script
Can someone tell me why I'm receiving this error?
Guys I need help
I'm making a Discord Bot which sends messages to multiple servers, in some of them there is slowmode enabled. At first the bot sent messages to all servers but second time there was slowmode enabled and it waited for slowmode to end. I wanna make it ignore the channel where slowmode timeout is going on and my bot shouldn't have to wait for it....any help would be appreciated
Bot accounts don't have friends, so you can't access that data even if you access the property correctly and we don't help with self-bots here
it's not a self bot
Then like I said, it's pointless to access that property
What are you trying to do?
Your friends? Yeah a bot account can't view your friends
on the docs say that it only works on non-bot accounts
make a selfbot then
but it isn't allowed according to Discord ToS
That's what I said above
okay but why doesn't the code work?
You need to enable member intents
How can i let it check if the mentioned user is in the file and if yes it sends the reason?
try this
file_lines = file.readlines()
for line in files_lines:
if line.find(member.mention):
await ctx.send(line)
If I get 0 errors and the code doesn't work, do I maybe have to install something else?
!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 Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, 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.
yeah, enable them in the dev portal too (as told in the embed)
oh and
remove client = discord.Client()
it worked or not?
and rename all the clients to bots
Didnt work
But why did client go 4 days ago and now only bot is going?
bruh
how to specify the amount the user has\
I used client days ago and the bot was good too, but now I use the same code but I had to turn the client into a bot
...
because you used bot instead of client somewhere?
Καλησπέρα σας.
!rule 4 please
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
nope haha
how to specify the amount the user has?
that can be the only reason.
specify what amount?
which the user has (money)
i think have figured the issue
with open("[FILE NAME]", "r") as file:
file_lines = file.readlines()
for line in file_lines:
if member.mention in line:
print(line)
where are you storing the value? in a JSON, db, custom member attributes, local variable?
db
Yup that worked! Thanks alot
np : )
not really sure what you mean by 'how to specify the amount the user has'... Access your database, add/get the amount of money the user has and send it??
One more question;
If the user has more warns it sends them in two separate messages
How could i make it so its in just one message but in separate lines?
instead of sending the warns from your for loop, add them to (maybe) a list, and then send the whole list (1 message)
yeah that what was i thinking but sending into a single message isn't going to make hard to read
you can join the whole list with str.join() 🤷
how to make a live timer in embed ?
could you elaborate?
or maybe create the list with all the warnings and then get only the warnings and put in front of the message
use a linux timestamp
!d discord.utils.format_dt
discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") for presentation within Discord.
This allows for a locale-independent way of presenting data using Discord specific Markdown...
you mean unix right?

how can u make a channel with permissions for specific roles?
on the guild use the create_role
there you can give the permissions and the specific role
yea my bad
oh my bad that is just wrong
not like that, i mean create a channel whith setup permissions like view_channel and so
try using then the set_permissions
ok
!d discord.Guild.create_text_channel takes permissions / overwrites args
await create_text_channel(name, *, reason=None, category=None, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=..., default_auto_archive_duration=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel "discord.TextChannel") for the guild.
Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission
to create the channel...
the overwrites key-word-argument
thx
Hi, I bought a bot and i can't start it, I get this error:
python3 main.py
/Moderation/main.py:12: MessageContentPrefixWarning: Message Content intent is not enabled and a prefix is configured. This may cause limited functionality for prefix commands. If you want prefix commands, pass an intents object with message_content set to True. If you don't need any prefix functionality, consider using InteractionBot instead. Alternatively, set prefix to disnake.ext.commands.when_mentioned to silence this warning.
bot = commands.Bot(case_insensitive=True, command_prefix='!', intents=intents)
the error is what it says
Hi
Hi
heya guys is it possible to have a discord bot inside a class?
yes it is
alr, any examples?
well i don't have any examples to show but i know it is possible to make it
I wanna make
my bot sends a message in slowmode enabled channel in a loop
but the next time it's sending the message it should tell me that there is slowmode of x minutes is enabled
any help would be appreciated
yes ofc the bot object is literally a class
everything in python is a class/object
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, *, help_command=<default-help-command>, tree_cls=<class 'discord.app_commands.tree.CommandTree'>, description=None, intents, **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...
How can I fix when someone uses a button the bot sends the command again?
tried this lol?
Ping me if you can help me pls
await interaction.response.send_message(f"{async def mine}")
mine()
Like this?
await interaction.response.send_message(mine())
how can i delete something in a txt file with aiofiles?
What do u want
how to make like ctx.send("") pick random number
like pick random number of 1990 to 2010
So when you click the button below a message the bot sends that embed message from another command like when you have an embed for a fish command and you press Fish again the embeds sends again in the chat
!e
import random
print(random.randint(1990, 2010))
@slate swan :white_check_mark: Your eval job has completed with return code 0.
2002
like ctx.send
when someone join in server
bot ping him and
bot pick random number of 1990 to 2010
hello
can anyone send to me a tutorial how to add 2 languages (for example: Polish and English) to python. You know... The command determines which language
!d discord.Interaction
class discord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
discord.Interaction.locale (if you're using app commands) ^
someone have fivem status bot to give me?
whats that
application command localisation
.
they literally gave you the answer...?
wdym?
How can I fix this error?
......we dont give bots here
dont use that library
upgrade to discord.py 2.0
ok 👍
i just do pip install discord.py right?
and it should upgrade it
or pip install discord.py==2.0.0
pip install -U git+https://github.com/Rapptz/discord.py
ok
and you need to have git installed
yeah
i got that
now im getting this error
well, you need to use the in-built methods and syntax of the discord.py library, discord_slash is of no use now
alright
thats on dc.py documentation
Here's a few examples -
https://gist.github.com/AbstractUmbra/a9c188797ae194e592efe05fa129c57f
ok
thanks ❤️
and heres's all the documentation (for slash commands) you'll ever need - https://discordpy.readthedocs.io/en/latest/search.html?q=app_commands#
ok
what would a basic discord.py "/ping" command look like?
Hi
and how can I uninstall it?
use the on_message event and simply use the add_reaction method on the Message object
''' JUST AN EXAMPLE '''
@Bot.listen("on_message")
async def reactor(message: discord.Message):
if message.channel.id == ...:
await message.add_reaction(...)
!d discord.Message.add_reaction
await add_reaction(emoji, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Adds a reaction to the message.
The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji")...
can I add like 2 reactions?
How do i load cogs in 2.0
Not with one emoji
same as 1.0
cog loading is async now
I need two emojis for it to add
hello
so would u mind helping me
ok
setup_hook
hi, when I get:
<p>The owner of this website (discord.com) has banned you temporarily from accessing this website.</p>
on the bot-startup (something to do with cloudfare), how long is the ban for?
No
I mean, instead of doing stuff like bot.add_cog(...), you do await bot.add_cog, and your setup(...) function has to be async too. Basically just make everything async
?
👍 👎 🚩
use start()
i have this now how do i load it
Like this? @slate swan
sure
seperate
yes
you can use a new event called setup_hook and load them there:
@bot.event
async def setup_hook():
await bot.load_extension(...)
thanks
add_reaction(emoji1)
add_reaction(emoji2)
...
lmao
can you do that
?
....?
?
thanks a lot
asking because i have seen a lot of setup _hook that are different
how so?
well, you can have various stuff in setup_hooks
from discord.ext import commands, tasks
class spooky(commands.Bot):
def init(self):
super().init(command_prefix='$')
self.initial_extensions = [
'cogs.moderation',
'cogs.utility',
'cogs.fun',
]
async def setup_hook(self):
self.background_task.start()
self.session = aiohttp.ClientSession()
for ext in self.initial_extensions:
await self.load_extension(ext)
async def close(self):
await super().close()
await self.session.close()
bot = spooky()
bot.run('token')
like that
It’s an event?
yes
yes it is
preferred
yeah rhat
you can do anything you'd want in setup_hook 🤷
Subclassing
i didn't know
both ways work
Thanks tho
np
excepting making api calls using the client app
await bot.change_presence(...) smh 😔
async def setup_hook(self):
await self.change_presence(...)
this looks uwuer
how would i make a list of specific options using slash as shown here:
Hi ! I have a bot made on another account, is there any way i can set myself as the owner in the code and use @is_owner commands ?
!d discord.ext.commands.hybrid_command
@discord.ext.commands.hybrid_command(name=..., **attrs)```
A decorator that transforms a function into a [`HybridCommand`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.HybridCommand "discord.ext.commands.HybridCommand").
A hybrid command is one that functions both as a regular [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")
and one that is also a [`app_commands.Command`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.app_commands.Command "discord.app_commands.Command")...
use typing.Literal. e.g:
import typing
@commands.command()
async def foo(self, ctx: commands.Context, options: typing.Literal["Option 1", "Option 2", "Option 3"]):
...
when creating your bot instance, you can set a owner_id kwarg which takes an int (your ID)
will it work with slash commands?
u mean in the bot = commands.Bot thing ?
oh, yeah, maybe I used the wrong deco, not sure what lib you're using 🤷
yes
none yet
any library you know would be sufficient
i think there's one in discord_components, let me check
doesn't get any simpler than this
@commands.hybrid_command()
async def ping(self, ctx):
await ctx.send("pong")
I'd strongly suggest using discord.py
2.0?
yep
im keeping away from that, i have rewrite all my code if i wanted to do that
😬 _ _
my whole code revolves around libraries which aren't supported
how do you make bots edit their own posts?
msg: discord.Message = await ctx.send(...)
await msg.edit(...) # this only takes key-word arguments
got an error for ctx what should i do?
I got this on hand
if message.content == "Test!":
ctx = await message.reply("Processing!")
await ctx.edit("Test Successful!")
but it gives out an error for to many arguments
msg = await message.reply
then await msg.edit
yes
thanks Asher
np
thoughts on slash commands?
@client.command()
async def test(ctx)
await ctx.send("Test succesful")
Basic one
If you want it to edit
don't use bot.remove command help
instead edit it using commands.HelpCommand
wdym?
@client.command()
async def test(ctx, pass_context=True)
message = await ctx.send("Processing")
asyncio.sleep(5)
await message.edit(content="Test successful")
client is defined as
client = commands.Bot(command_prefix = "!")
bot.remove help command is not a legit way of doing that it's shown wrong in yt tutorials
u shouldn't use sleep in asynchronous codes
it puts the whole bot to sleep that means bot won't work for 5 secs in all servers
instead use
await asyncio.sleep(5)
do I have to import something to edit posts
Fixed
cant edit for some reason
but here
@client.command()
async def test(ctx, pass_context=True)
message = await ctx.send("Processing")
asyncio.sleep(5)
await message.edit(content="Test successful")
@client.command(brief="Ping", help="The time it takes for a small data set to be transmitted from your device to a server on the Internet and back to your device again.")
async def ping(ctx):
await ctx.send(f'`Pong! {round(client.latency*1000)}ms`')
await asyncio.sleep()
all async stuff need to be awaited
yep sorry, missed it
no slash only takes slash no custom prefix
Why do you have pass_context
I'm assuming that's totally not related to the outdated d.py yt tutorials from 2018
There is no decorator named hybrid command
how can i fix that
1 - I'd suggest you avoid those third party libs for forms and just use discord Modals which are much much easier to use
2 - you have ctx.send(form) ur sending the object to discord
ctx.send(form) sends the the question, and once theres an answer, the next question until it's done
what would u recommend I use to make a form like that?
i'm using logging, and why does it log like websock connecting and etc when i run the file
can anyone help with setting command languages?
using psql, how could i check if a key is in the db or not. My idea is on startup, it checks if every guild has its data in the db, it chekcs if the guild id is in the db, if not, it will insert the data. How could i make the bot chwck if the guild id is in the db or not?
Why? You can put multiple questions into one modal
Next time please ask in #databases but it is
SELECT EXISTS(SELECT 1 FROM guilds WHERE id = ...)```
how can i do a form like that without using that lib
And yeah you can make guild id UNIQUE and do something like
INSERT INTO guilds (...) VALUES (...) ON CONFLICT DO NOTHING```
how i can use the timestamp?
!d datetime.datetime.timestamp if this is what you mean
datetime.timestamp()```
Return POSIX timestamp corresponding to the [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") instance. The return value is a [`float`](https://docs.python.org/3/library/functions.html#float "float") similar to that returned by [`time.time()`](https://docs.python.org/3/library/time.html#time.time "time.time").
Naive [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") instances are assumed to represent local time and this method relies on the platform C `mktime()` function to perform the conversion. Since [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") supports wider range of values than `mktime()` on many platforms, this method may raise [`OverflowError`](https://docs.python.org/3/library/exceptions.html#OverflowError "OverflowError") for times far in the past or far in the future.
For aware [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") instances, the return value is computed as:
```py
(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
``` New in version 3.3.
Changed in version 3.6: The [`timestamp()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp "datetime.datetime.timestamp") method uses the [`fold`](https://docs.python.org/3/library/datetime.html#datetime.datetime.fold "datetime.datetime.fold") attribute to disambiguate the times during a repeated interval.
How can I put this into a discord bot?
so that it sends in chat
like so that it asks for rating, name and vouch in chat
and sends it to the webhook
or just to a channel
Hey guys, so I have this little problem that it's adding both Verified and Unverified role in my server, so can I make a command something like "if member.has role1 remove role2" if you get me?
just make it so that when verified role get's added, the unverified one get's removed
send the code to add the role
It's the like Bloxlink or something, but I can't find who's adding the unverified role at start
delete the unverified role
put the unverified roles permissions for the @ everyone role
then once the verified role get's added, the user will have perms of verified role
how do I make sticky messages with bot in a certain channel?
How can i make it send it into a channel named "logs" and if theres no channel named like that create one?
<@&831776746206265384>
if only there was a maintained API of scam domains
Lol
await get channel
await channel.send(embed=embed)
and define logging channel
How do I delete the command if I enter the command and then an embed comes?
I believe there is a repository constantly being updated with these links
Not directly an API
Pretty slow sometimes
Oh?
hm
It's pretty random
3-5s is still better than a minute waiting for mods tbh
Though it really shouldnt be taking that long
Yeah true true
How much time does my application has to respond?
for an interaction, 3 seconds
You can defer if you need longer
how can I do that?
!d discord.ext.commands.Context.defer
await defer(*, ephemeral=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Defers the interaction based contexts.
This is typically used when the interaction is acknowledged
and a secondary action will be done later.
If this isn’t an interaction based context then it does nothing.
You use that method on a context object, then you get 15 minutes to reply I believe
thanks!
Hi ! I want to make my bot unban deleted users (what's the point in having them banned). Is there any on_user_delete event ?
Like if they delete their account?
hmm
maybe you could make your bot check for deleted users every once in a while and unban them
good idea
How can I remove the #xxxx in a username when sending a message?
so like print(f"Message: {message} by {}".format(ctx.message.author))
ok
i am not sure
leme check
nice
worked
why are u using str.format on fstring 
dont question my brain
i think its author.name or something
🤣
yes it is
btw thats invalid syntax :p
@slate swan sorry for bothering you but after the calling defer(), how do I delete the "thinking" message
i would recommend using
print(f"Message: {message.content} \nBy: {message.author.name}")
k
You then need to .edit_original_message() I believe
Then put your message in there, for example your success message
Instead of sending another message I can just edit the "thinking" one?
Yeah bascially
Thanks, it worked

And slash commands look beautiful ngl
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
What is a violation?
I just don't know what exactly I can break
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)
But what about JuniperBot and Vexera, they also have music
@client.command()
async def vouch(ctx, *, rating, vouch):
embed = discord.Embed(
title = "New vouch",
description = f"{rating}/10 - {vouch}",
color = 0,
timestamp = ctx.message.created_at
)
embed.set_footer(text='Vouch by {}'.format(ctx.message.author.name))
channel = client.get_channel(972852585314787388)
await channel.send(embed=embed)
await ctx.send(embed = discord.Embed(title="Vouch sent!", description="Your vouch has been sent successfully!"), delete_after=60.0)
How can I get the rating to get detected as a number from 1 to 10?
We're talking about you asking for help, not bots doing it. As I said, we don't help for these type of questions, you've got to do your own research.
Okay, thanks
The developers of these bots are most likely well aware that their bot is against YouTube's Terms of Services.
Well first you don't need *, rating, vouch but rating, *, vouch, then you can type hint rating to an integer. Which results to
rating: int, *, vouch):
Then you can check if the rating is between 0 and 10 using normal comparetors.
ok
let me give it a shot
My bot kicks the user if hes under 10 days old but doesnt send the message?
i also tried await chat.send
on_join() is not an event I recognize before, which library is this?
worked
but you can still vote above 10
Well then that library is kinda weird, why does it have message and member as args 🤔 system welcome message?
Yup lol, that's what I am being suspicious of
I mean it worked? I think i dont have a lib for that?
99% sure you do
100%*
You don't use an existing library?
it cant be this is everything i have imported
Imagine him writing whole new wrapper 😩
You're most likely using the event incorrectly if it's a well known library
Well discord is external library
!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") join or leaves 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.
You've used pip to be able to use discord, hence it's the library you're using
What's interesting though is that
My bot kicks the user if hes under 10 days old but doesnt send the message?
Yes
I don't believe your bot even kicks the user
Very interesting
i know
you didnt specified the var channel
above
so it doesnt know where to send the message
You can't just add any parameter in an event
Events have specific parameters which must not be changed.
what is the chat, created, now and delta
async def on_channel_message(self, message):
async with self.bot.db.execute("SELECT ...") as cursor:
result = await cursor.fetchone()
if not result:
return
else:
await message.delete()
This is for like an autodelete for a guild channel, if there is a record in the database table with a channel from the guild, it deletes the message otherwise it returns. What is the best approach to this? I know this isn't currently efficient
An on_member_join event only uses member so you can't add message and use that one. You need to use what you've already defined, chat
I would implement sort of cache
write under delta channel = bot.get_channel("Your channel id")
IDs are not strings
Without quotes
I have sort of that thing in my rules autocompletion https://github.com/Exenifix/AIAS/blob/master/utils/autocomplete.py
so change it to message.chat.send
Again
You can't add message in the parameters list.
It must be removed and only use chat.send.
he has it
Again.
Example?
Right above
Events have pre-defined parameters which must not be changed
Ah okay thanks
So you will only have member as function parameter as this is the only one it takes, and message will be gone, hence you can't use it at all.
You can't do
async def on_member_join(member, guild, channel): # And more
It must be and stay like
async def on_member_join(member):
Just like the documentation says https://discordpy.readthedocs.io/en/master/api.html#discord.on_member_join
imagine... 😔
how would I go about making the command output go to a channel first & add ✅ and ❎ reactions to the message, and if anyone checks the ✅ it get's sent to another channel otherwise it get's deleted if ❎ is reacted
Inb4 bot.dispatch("join", message, member)
You can use add_reaction (https://discordpy.readthedocs.io/en/stable/api.html?highlight=add_reaction#discord.Message.add_reaction) on a message object to add a reaction. Then you can use wait_for() and wait for a user reaction add.
wait?
from discord.ext import commands
ImportError: cannot import name commands from discord.ext (unknown location)
Wouldn't it be wait_for
How would I make the bot do something once one of the two are reacted?
By using the second part of my message
ok
ima give that a shot
!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...
There is an example there I believe
Oh yeah! That reminds me, what do you guys think of using async iterators for wait_for()?
async for message in bot.wait_for('message'):
...
For more advanced checks you could put them in the body of the loop
I believe wait_for only waits for the first dispatched event now - maybe if that's changed it would make sense
Just don't really see a use case right now where you would need to wait for multiple dispatched events within a timespan.
Yeah, well it's the same as ```python
while True:
message = await bot.wait_for('message')
I have definitely seen code where you use a loop like this
How to load a cog only for one server? Like;
-antibots on
Loads cog only for this server
-antibots off
Unloads cog from this server
how would i add 2 reactions
I've thought of something like this too, but wait_for just doesn't sit right with me. It should be for an example, ```py
async for event in Bot.messages:
...
Twice your add_reaction code
await reaction.add("👍", "👎")
ok
That's a good idea, and something like "limit" kwarg could be added to wait for certain amount of certain events
^
Just make this
async def add_reactions(self: discord.Message, *reactions: str | discord.Emoji):
for r in reactions:
await self.add_reaction(r)
discord.Message.add_reactions = add_reactions # idk if you can extend a module like this, never tried```
Oh yeah it would be due for a renaming. I like subscribe()
Can you import just discord
I suspect it's not installed at all
Subscribe is nice, but maybe it's just me, but subscribe makes me think of EVENT => CALLBACK, whereas there is no callback really here. You're just polling the events
Ah, good point. Technically it could be implemented by the user with s counter, but I can imagine some uses for it
async for event in Bot.messages.filter(...):
...
``` 😳
async for message in bot.messages.stream(): ...
Actually this makes it seem like it grabs from cache tbh
Yea stream makes total sense here
Like HTTP streams kinda
I felt like there's something wrong with putting the counter into the check but idk now
@commands.command(name="rate")
async def rate(self,ctx,member: discord.Member=None, rating=None):
if member == None:
member = ctx.author
membermention = member.mention
with open('starcount.json', 'r') as starcount:
starcount = json.load(starcount)
if str(member.id) not in starcount:
starcount[int(member.id)] = rating
await ctx.send(f"(DEBUG) {membermention} added to starcount database, stars set to {rating}")
oldstarcount = starcount[str(member.id)]
newstarcount = oldstarcount + rating
print(newstarcount)
starcount[int(member.id)] = newstarcount
with open("starcount.json", "w") as f:
json.dump(starcount, f)
await ctx.send(f'OLD: {oldstarcount} NEW: {newstarcount} ADDITION: {rating}')
how do i make this so it adds 5 to the number instead of adding 5 to the end
e.g rn if its set to 0 and rating = 5, it'll show as 05
and so on and so forth, adding the number to the end rather than the total
True, it's like a synonym for listen() but as long as it isnt the same 😅. If you think about it, Discord is using pub-sub so subscribe() does make sense in that light
Cast it to string and concatenate
what does that mean
!e
num1 = 0
num2 = 5
print(str(num1) + str(num2))```
@vale wing :white_check_mark: Your eval job has completed with return code 0.
05
So many things wrong but why?
it is
i want it to just show up as 5 though
yes but why? It should unload it
This thing makes no sense: if extensions is on, load it; if it's not — unload it. It should be vise versa
so if i start at 0 then do;
-rate @slate swan 5, it goes to 5
then if i do:
-rate @slate swan 2, it goes to 7
No it's right but he is doing bool(str)
And yeah that's not how you disable commands
Oh hold up
Yeah, since that's what I would assume client.messages be. Even with the added .stream().
So he will always pass on even when saying off.
You can also say cheese-sticks and it will turn on.
Unless he doesn't parse anything
Those kwargs are not really working that way , when ur using the command it only reads the on kwarg thus triggering the on condition
Hmmm, I guess it mostly depends on the background knowledge here, when I think of stream I think of HTTP streams. Others may see it differently but usually rule of thumb, people will assume an async iter won't return from cache as that's mostly atomic operations
If he doesn't parse anything it won't work at all tho
Cause both are ifs
Why not make it like enable/disable or setstate or smth why the heck that construction
@slate swan
from typing import Union
@bot.command(name="antialts")
async def anti_alts(ctx, arg: Union[str, None] = None):
if not arg and arg in ["on", "off"]:
return await ctx.send("Pass either on/off")
if arg == "on":
bot.load_extension("antialts")
else:
bot.unload_extension("antialts")
You can typehint with bool
Well he isn't passing true or false.
Not likely.
You need 3.10 or do this
from typing import Union
arg: Union[type1, type2]```
And don't copypaste code for god's sake
You would need to track their status
With the @tasks.loop and a database
classmethod datetime.now(tz=None)```
Return the current local date and time.
If optional argument *tz* is `None` or not specified, this is like [`today()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.today "datetime.datetime.today"), but, if possible, supplies more precision than can be gotten from going through a [`time.time()`](https://docs.python.org/3/library/time.html#time.time "time.time") timestamp (for example, this may be possible on platforms supplying the C `gettimeofday()` function).
If *tz* is not `None`, it must be an instance of a [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "datetime.tzinfo") subclass, and the current date and time are converted to *tz*’s time zone.
This function is preferred over [`today()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.today "datetime.datetime.today") and [`utcnow()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow "datetime.datetime.utcnow").
I have once wrote that kind of bot but it was based on pickle files so yeah it's gone now
It's relatively easy to implement tho
You don't need a database, but you do need to track their online status. I don't really recommend doing this since it's unreliable.
how do i timeout?
You don't check every minute, you just use the event on_presence_update
Yeah but not knowing what changed when the bot went offline cannot be tracked.
So unreliable result.
So someone will get stored once the bot is certain it's right else the bots function is kind of useless.
Well with the minute-by-minute tracker it is more reliable but more expensive as well and totally unsuitable for large amount of guilds
Well why do you need an on minute tracker if you can just calculate it when someone requests it?
Less heavy and avoiding a lot of unnecessary loops.
If someone were to request it you can just get the current time and the subtract the stored time from it making it even second accurate.
How can I use hikari's webhooks?
How does the bot verification process work? What happens if you get rejected? Can you apply again? All the info and threads I see online have very different answers. Some say if you get denied its permanent, some say you can reapply a few weeks later, and some even say if you get flagged for inorganic growth you get raised to 250 server limit. I am having trouble finding the most up to date FACTS.
how can i do if the embed has more than 5 fields it makes a pagination?
so i have a list i loop through till it reaches it end and every loop i add a field
async def on_message(message):
if message.content == "testcmd":
if message.author.id == 966318461582213121:
channel = bot.get_channel(chn)
await message.channel.send(msg)
print(f"{Fore.LIGHTBLUE_EX} {msg} | {channel.name} | {message.guild.name}")
else:
print("your not alx you cant do this")``` so i wanna send message to channel ids in txt like so: ```chn = open("channels.txt").read().strip()``` and it wont send message
this is basic command but im super tired and lazy
does anyone know if discord has a streaming time limit? I have a bot streaming 24/7 and wondering if that will get flagged or hit a cap
no
I'm getting 'ERROR:discord_webhook.webhook:[1/1] Webhook status code 400: {"embeds": ["0"]}' even tho the discord embed is valid
no limit
nice
send ur code
nope as long as it doesnt spam you will need to host on vps to make 24/7 though
it's a private bot on my personal discord
definitely breaking some other rules though
from discord_webhook import DiscordEmbed, DiscordWebhook
webhook = DiscordWebhook(url="MY HOOK")
embed = DiscordEmbed(title="Error", description="'CONNECTION ABORTED', connection error (squish)",color='ff8a00')
webhook.add_embed(embed)
webhook.execute()
and i get
[1/1] Webhook status code 400: {"embeds": ["0"]}
and i don't see the webhook
ok
do you know why?
are you trying to run that as a discord bot command?
or just in python
@commands.command(name="rate")
async def rate(self,ctx,member: discord.Member=None, rating=None):
if member == None:
member = ctx.author
if not isinstance(rating, int):
await ctx.send(f'Needs to be a number.')
return
why is this sending Needs to be a number. when I type 5?
@slate swan
No its a discord webhook bro
from discord_webhook import DiscordEmbed, DiscordWebhook
webhook = Webhook.from_url('ur url here', adapter=RequestsWebhookAdapter())
embed = discord.Embed(title="whatever", description="whatever")
webhook.send(embed=embed)
try using this then
im trying to send a embed to a webhook
input_date = [int(item) for item in input_date.split('-')]```
Error:
```ValueError: invalid literal for int() with base 10: '08 22:02:33.839007'```
Typehint rating to int
how can I get a command to be activated/triggered by a webhook?
@commands.command(name="rate")
async def rate(self,ctx,member: discord.Member=None, rating=None):#: Optional[int] = None):
if member == None:
member = ctx.author
#if not isinstance(rating, int):
# await ctx.send(f'Needs to be a number.')
# return
if rating == '1':
ratingfinal = '1'
elif rating == '2':
ratingfinal = '2'
elif rating == '3':
ratingfinal = '3'
elif rating == '4':
ratingfinal = '4'
elif rating == '5':
ratingfinal = '5'
else:
ctx.send("Please choose a number 1-5")
print(ratingfinal)
print(ratingfinal)
UnboundLocalError: local variable 'ratingfinal' referenced before assignment
how?
Well I'd make an enormous guess and say that all your conditionals were false and it defaulted to the else block
And you did not define ratingfinal in your else block
So python didn't like that
oh yeah
any1
im so dumb, ty
np
how could i add muted role to the loser? (look near member.add_roles section)
errors like this
guys do discord bots receive discord webhooks? Meaning can the bot read the content of the message sent by a webhook? thanks in advance
How would I fix this error
Yes, if the bot is given access to the channel where the webhook sent a message, they can see it
thanks man 🙂
!d discord.Message.webhook_id specifically to check if the message was sent by a webhook, if it's None then it's a regular user
If this message was sent by a webhook, then this is the webhook ID’s that sent this
message.
Then just get the content via Message.content
I think ctx.message.author.name doesnt exist.
pls
it does...
it worked before lol
property name```
Equivalent to [`User.name`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.name "discord.User.name")
lol

what?
and so how would i fix that?
@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 | AttributeError: 'NoneType' object has no attribute 'strip'
since the NoneType class doesnt have that attr it would raise an attribute error
0k
remember None is an instance of the NoneType class hence why the NoneType object doesnt have such an attr!
pls
can bots create generate links to messages? like this; #381965515721146390 message
!d discord.Message.jump_url If you have the discord.Message instance, you can use the jump_url attribute
property jump_url```
Returns a URL that allows the client to jump to this message.
ty
Could someone help me with loading cogs using discord.py 2.0?
how to make it so that when a command is used it is written to json (discord.py)? pls help me...
what do you mean by "spam a discord bot"
Per our #rules , we don't help with projects that could be considered malicious - that includes spam bots
oh
await self.start(*args, **kwargs)
TypeError: Client.start() got an unexpected keyword argument 'bot'
uhhh, im not in a cog using self and I never wrote the word client in the code
🤔
Per our rules , we don't help with projects that could be considered malicious - that includes spam bots
We cant help you here
And also you shouldn't do those kind of things
Raiding will cause the python snake to bite you
self probably refers to the client
can you send the full code?
yes
import discord
from discord.ext import commands
import json
intents = discord.Intents.default()
intents.members = True
bot = discord.Bot()
@bot.event
async def on_message(message):
if message.author != bot.user:
if message.channel.id == 972996659749466143: #APEUSDT-30m
data = json.loads(message.content)
suggestion_channel = bot.get_channel(972525892079349830)
await suggestion_channel.send(f'#{data["symbol"]} (ByBit)\n#{data["side"]}\nPrecio: {data["order_price"]}\nTake Profits: {data["tps"]}\nStop Loss: {data["sl"]}\nRiskReward: {data["rr"]}')
if message.channel.id == 972996698173505587: #LUNAUSDT-1h
data = json.loads(message.content)
suggestion_channel = bot.get_channel(972908552920379422)
await suggestion_channel.send(f'#{data["symbol"]} (ByBit)\n#{data["side"]}\nPrecio: {data["order_price"]}\nTake Profits: {data["tps"]}\nStop Loss: {data["sl"]}\nRiskReward: {data["rr"]}')
if message.channel.id == 972996713306533988: #BTCUSDT-4h
data = json.loads(message.content)
suggestion_channel = bot.get_channel(972525759430291499)
await suggestion_channel.send(f'#{data["symbol"]} (ByBit)\n#{data["side"]}\nPrecio: {data["order_price"]}\nTake Profits: {data["tps"]}\nStop Loss: {data["sl"]}\nRiskReward: {data["rr"]}')
if message.channel.id == 972996726841565184: #LINKUSDT-1d
data = json.loads(message.content)
suggestion_channel = bot.get_channel(972980874649952256)
await suggestion_channel.send(f'#{data["symbol"]} (ByBit)\n#{data["side"]}\nPrecio: {data["order_price"]}\nTake Profits: {data["tps"]}\nStop Loss: {data["sl"]}\nRiskReward: {data["rr"]}')
bot.run("token here", bot = True, reconnect = True)
want me to upload it in a python paste website?
This could benifit from a database
You should pass intents into Bot()
Learn from something that's not TOS-violating
discord.intents.bot? 🤣
Bot(intents=...)
bot = discord.Bot(intents=your intents)
The intents you stored in the variable intents
So, Bot(intents=intents) in your case
bot = discord.Bot(intents=intents)
Nice
then same story:
await self.start(*args, **kwargs)
TypeError: Client.start() got an unexpected keyword argument 'bot'
Bot is not an argument of Bot.run
I mean think abt it, if it's discord.Bot why would you need to put bot=True
Just remove the bot argument and ur bot should run
you were right
I retreat to play watch dogs now
I dont understand though why that caused the error
I mean I get it was already defined
but whats the problem of defining it again

You had 2 errors. The one causing the traceback was cuz you gave bot.run() an argument it doesn't take
No hay problema
ISO… wait for it…. A discord bot developer
starrounded = round(starcalculation * 2) / 2
print(starrounded)
profilembed = embed=discord.Embed(title=f"{member} | {final_pronouns}", description=f"{final_description}", color=0xFF69B4)
embed.set_thumbnail(url=(pfp))
embed.set_author(name="Profile", icon_url=guildicon)
embed.set_footer(text=f"Based on {oldstarsubmissions} reviews")
if starrounded == '1':
starroundedfinal = 'https://i.gyazo.com/2e011d87b0193074e131cea7e43c9a05.png'
elif starrounded == '1.5':
starroundedfinal = 'https://i.gyazo.com/e649df7987d3c131e510d9ae4c919f2d.png'
elif starrounded == '2':
starroundedfinal = 'https://i.gyazo.com/fabcf4ff15203b5261252df4ce8bd0fd.png'
elif starrounded == '2.5':
starroundedfinal = 'https://i.gyazo.com/03d2648145defb9dc3a1b255b67e7dd4.png'
elif starrounded == '3':
starroundedfinal = 'https://i.gyazo.com/73058cee6dae1edb85bba4d061b0b44f.png'
elif starrounded == '3.5':
starroundedfinal = 'https://i.gyazo.com/0bfa6ddb9207ed2a91514a09aaf1258d.png'
elif starrounded == '4':
starroundedfinal = 'https://i.gyazo.com/b2365bd9ad6fa613d577fbbad0c3c4f2.png'
elif starrounded == '4.5':
starroundedfinal = 'https://i.gyazo.com/c12bae2a8c8288643779cae9201e5ffb.png'
elif starrounded == '5':
starroundedfinal = 'https://i.gyazo.com/467f07a1e7e8430b4033679c374694b1.png'
else:
print("somehow theres an error")
return
embed.set_image(url=starroundedfinal)```
gives me
```py
1.0
somehow theres an error
the 1.0 is print starrounded
you do know youre comparing a float with a string right?
By putting things between ' ' you are making a string
correct me if im wrong cause im pretty new
but shouldn't this fix it?
starrounded2 = round(starcalculation * 2) / 2
starrounded = str(starrounded2)
print(starrounded)
if you want to make it a string sure
i tried that and it's still not fitting in and giving me the somehow theres an error
then all the if/elif statements were false
@slate swan It is against the rules of this server to help with such code. And please don't try to circumvent to rules by asking people in DMs. Thanks.
wait what?
ffs it needed me to put 1.0 instead of 1, ty
why would i ask someone for code when i can make it myself? i kinda feel like im being falsely accused?
it might be a wrong @, happened to me earlier
@visual yarrow ?
yeah im so confused right now
help with such code
well i didnt know my bad
Please see this message @slate swan
phew😮💨
I should sleep lol.
you should😭
what ;-;
oh 💀
im a innocent person i swear
lmao
oops.
someone did something wrong
or maybe you got your bot verified?
it kinda seems like it
yep forgot that github keeps older versions and i maid my repo public
AHHHHH
naw havent requested it yet
its my 8th time
im currently suffering from trying to upload my code using mgit and it not working
dang😭
currently getting
error failed to push some refs to 'https://github.com/davids-tips/WhiskeyBotMain.git'
How do I make my bot have mobile status?
they cant have it
I've seen some java bots have it before
iirc they mutate the api which is against tos
ah I see
Actually, it is allowed
is it?
But it's pretty much unsupported
oh
You can ask in the offical API server as well, they will say yes
i believe you chill🗿
you gotta do some sketchy stuff to be able to have it though, so I wouldn't recommend it
You literally change one property inside your inner payload for IDENTIFY
i was gonna ask which but i shouldnt and dang its that easy
precisely lmao
Why would you need to do sketchy stuff to do that??
will anyone help me code a discord bot im new to this stuff?
!e ```py
import ctypes
ctypes.py_object.from_address(id(True)+tuple.itemsize).value=type("",(),{"repr":lambda*:"True"})
this, sketchy = 0, 1
print(this is not sketchy)
@pliant gulch :white_check_mark: Your eval job has completed with return code 0.
True
pov: you dont touch grass
and you really needed to use the import keyword
just use the dunder to make yourself look cooler😎
I learned today how to overwrite the memory 😎 wanted to show off but I did an oopsie here
that is so cool but at the same time scary(for your health)
embed=discord.Embed(title=f"**Post Removal**", description=f"**Discord User**: {membermention} | {member} ", color=0xFF0000)
embed.set_thumbnail(url=(pfp))
embed.add_field(name="**Removal Reason**:", value="hi", inline=False)
embed.set_footer(text="Roleplay Hub⠀⠀⠀Developed by r0yal#9604")
with open("removal.stonks","r") as f:
removalchannel = int(f.read())
f.close()
channel3 = self.bot.get_channel(removalchannel)
ratestaffmsg = await channel3.send(f"{membermention}\n@here\n[#649402476285394944](/guild/267624335836053506/channel/649402476285394944/)\n[#649402513388470272](/guild/267624335836053506/channel/649402513388470272/)\n[#649402550537158696](/guild/267624335836053506/channel/649402550537158696/)", embed=embed)
await ctx.send("sent")
await ratestaffmsg.add_reaction('\U0001F4CB')
def check(reaction, user):
return not user.bot and str(reaction.emoji) == '\U0001F4CB'
try:
reaction = await self.bot.wait_for('reaction_add', timeout=180.0, check=check)
await channel3.send("confirmed")
await ratestaffmsg.clear_reactions()
except asyncio.TimeoutError:
await message.clear_reactions()
await ctx.send(f'no reaction in 180s (DEBUG).')
return
how do i make it so this doesn't affect every pending message with an active emoji when one is clicked and ONLY affects the message the emoji is attached to?
e.g clicking the emoji on the bottom one fulfills the code for both instead of just the bottom one
This feature is only for verified bots ? or normal bots too?
It's for every bot
every bot
Ohk
github itself scans for the tokens and sends the alert to discords server and the server revokes it. they likely scan common places aswell
hmm
guys whats the pip command to install this discord version? 2.0.0b1
you're gonna have to clone the source github repo and run the installer
File "c:\Users\thoma\OneDrive\Desktop\discord server bot\Bot2.py", line 1, in <module>
import discord
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\__init__.py", line 25, in <module>
from .client import Client
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 53, in <module>
from .webhook import Webhook
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\webhook\__init__.py", line 12, in <module>
from .async_ import *
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\webhook\async_.py", line 52, in <module>
from ..channel import PartialMessageable
ImportError: cannot import name 'PartialMessageable' from 'discord.channel' (C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\channel.py)```
pip install git+https://github.com/Rapptz/discord.py
to install latest from github
Traceback (most recent call last):
File "C:\Users\raimy\AppData\Local\Programs\Python\Python310\lib\site-packages\jishaku\features\python.py", line 156, in jsk_python
async for send, result in AsyncSender(executor): # type: ignore
File "C:\Users\raimy\AppData\Local\Programs\Python\Python310\lib\site-packages\jishaku\functools.py", line 125, in _internal
value = await base.asend(self.send_value)
File "C:\Users\raimy\AppData\Local\Programs\Python\Python310\lib\site-packages\jishaku\repl\compilation.py", line 154, in traverse
async for send, result in AsyncSender(func_g(*self.args)): # type: ignore
File "C:\Users\raimy\AppData\Local\Programs\Python\Python310\lib\site-packages\jishaku\functools.py", line 125, in _internal
value = await base.asend(self.send_value)
File "<repl>", line 5, in _repl_coroutine
await paginator.start()
File "C:\Users\raimy\Desktop\Reddi-bot\bot\paginator.py", line 48, in start
self.message = await self.ctx.send(embed=self.items[self.index])
File "C:\Users\raimy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\context.py", line 700, in send
return await super().send(
File "C:\Users\raimy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\abc.py", line 1521, in send
with handle_message_parameters(
AttributeError: 'str' object has no attribute 'to_dict'
raimy
File "c:\Users\thoma\OneDrive\Desktop\discord server bot\Bot2.py", line 7, in <module>
from discord_components import *
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord_components\__init__.py", line 1, in <module>
from .client import *
File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord_components\client.py", line 3, in <module>
from discord import (
ImportError: cannot import name 'Client' from 'discord' (unknown location)```
Yeah
# CURRENCY ATTEMPT!
import pickle
data_filename = "data.pickle"
class Data():
def __init__(self, wallet, bank, shovel):
self.wallet = wallet
self.bank = bank
self.shovel = shovel
#Commands
blah blah blah
#Functions
def load_data():
if os.path.isfile(data_filename):
with open(data_filename, "rb") as file:
return pickle.load(file)
else:
return dict()
def load_member_data(member_ID):
data = load_data()
if member_ID not in data:
return Data(0, 0)
return data[member_ID]
def save_member_data(member_ID, member_data):
data = load_data()
data[member_ID] = member_data
with open(data_filename, "wb") as file:
pickle.dump(data, file)
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
client.load_extension(f'cogs.{filename[:-3]}')```
if i want to add shovel, how would i go about doing that because it isnt working
Doesn't embed the only thing to have the to_dict method
idk
!d discord.Embed.to_dict
to_dict()```
Converts this embed object into a dict.
.
You're welcome raimy
Shovel?
at the top
the other 2, bank and wallet, work but im tried to add shovel but its saying data has no attribute shovel
show error
.
try changing the self.shovel to self.Shovel
didnt work
what's member_data
show the member_data object
the members data
Yes but what is it
and 


