#๐ rename bot
172 messages ยท Page 1 of 1 (latest)
@crystal citrus
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
@client.event
async def on_member_update(before, after):
if before.nick != after.nick:
await after.edit(nick = before.nick)```
bet
ima try
wait
@tidal stirrup
where do i put the
user ID
of the person
and the nickname i wanna use
like
Oh, I mean, in this function, it rename automatically everybody
can i get an example
with their previous nickname
sure
with a certain name
ngl im confused ๐ญ idk much python i just want a bot for a server rq
yeye
so like
if i name this 1 person in my server to "jackson"
if they ever try to change it
it will automatically go back to jackson
like they cant change it
@client.event
async def on_member_update(before, after):
user_id = #here your user
nickname = "the nickname to keep"
if after.id == user_id and before.nick != after.nick:
await after.edit(nick = nickname)```
you know that you can set this up with permissions?
nah i dont ๐ญ
ty ima try
it will be way more efficient
oh wait
1sec i think i fixed it
like
i paste my token
into the bot
and it closes
i checked and
its my
bots proper token
yeye i tried and it says there was no issue
but when i put my bots token it closes
ill try again with visual code
when i run it on idle
nothing happens
@tidal stirrup
what appears in terminal?
this wont work
why?
weird
ye idk its odd
Show code with bot token hidden
And also the traceback (and remove the token if it present on traceback)
We cannot magically debug for you
bet
?
import discord
import time
import random
import os
import time
from threading import *
client = discord.Client()
token = input("Token: ")
@client.event
async def on_member_update(before, after):
user_id = 1214626120259866685
nickname = "mini fokus"
if after.id == user_id and before.nick != after.nick:
await after.edit(nick = nickname)
@client.event
async def on_ready():
os.system("cls")
@client.event
async def on_ready():
os.system("cls")
print(f"hey {client.user.name}, auto reply is ready")
Hey @crystal citrus!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
You didn't run the bot
!paste or follow the instructions above
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
You didn't
it auto closes
and it also doesnt show a error
im also having the same issue
Where is client.run(token)
this is VCS
where do i pu thtis
The end of the file
Lmao
Think
How would the bot run if you didn't tell it to run
๐
like this :3?
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
nah i
got it to run
now
but it doesnt work
like it doesnt
change their name
It only change their name when the user change their nickname
if its " lol"
and i change it to " hello" it stays to "lol"
it doesnt change at all for me
wait
can i make it to where
import discord
import time
import random
import os
import time
from threading import *
client = discord.Client()
token = input("Token: ")
@client.event
async def on_member_update(before, after):
user_id = 1201138378326945943
nickname = "jackson"
if after.id == user_id and before.nick != after.nick:
await after.edit(nick = nickname)
@client.event
async def on_ready():
os.system("cls")
@client.event
async def on_ready():
os.system("cls")
print(f"hey {client.user.name}, auto change name is ready")
client.run(token)
Hey @median wraith!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
Use paste/backtick
so its like permanent
To send code
import discord
import time
import random
import os
import time
from threading import *
client = discord.Client()
token = input("Token: ")
@client.event
async def on_member_update(before, after):
user_id = 1214626120259866685
nickname = "mini fokus"
if after.id == user_id and before.nick != after.nick:
await after.edit(nick = nickname)
@client.event
async def on_ready():
os.system("cls")
@client.event
async def on_ready():
os.system("cls")
print(f"hey {client.user.name}, auto reply is ready")
client.run(token, bot=False)
I said, it only change when that user change their username
yeah but how do i make it to where it changes back no matter what
It do, but first, that user have to change their username
wdym ๐ญ like i want it to where like
i run the code
and it changes their
username
to what i wrote
So it is not how you do it
in the code
for example
i change someone named nicnkname in a server to " im not liked here" in
and they try to change it to there own username but it auto changes to " im not liked her"
and they cant change it back no matter what
You have to change their username in on_ready
we want this
yes
on_member_update only trigger when the attribute of member is modified (e.g. nickname on a guild)
I am not going to code the entire product for you
can u redo it for us
I will just guide you to do it
ngl if you cant code just say that
And please, don't have 2 people respond at the same time
Lmao
I don't have the responsibility to make a bot for you
prove that
Anyway bye, not helping now
:incoming_envelope: :ok_hand: applied timeout to @median wraith until <t:1711029665:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
This is not a Modmail thread.
BRO
Hey @crystal citrus it's just !close
Well, I'm being severely insulted for no reason
They've been banned.
ok, thx
I'm not sure what prompted that behaviour from them
maybe he/she just want me to code the whole thing for them, which is not what I responsible to do
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.