#๐Ÿ”’ rename bot

172 messages ยท Page 1 of 1 (latest)

crystal citrus
#

how do i make it to where my bot automatically renames someone something? for example, if i server nickname someone "percy" then everytime they change it or remove it, it automatically puts it back to percy instantly

hot iglooBOT
#

@crystal citrus

Python help channel opened

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.

tidal stirrup
crystal citrus
#

bet

#

ima try

#

wait

#

@tidal stirrup

#

where do i put the

#

user ID

#

of the person

#

and the nickname i wanna use

#

like

tidal stirrup
#

Oh, I mean, in this function, it rename automatically everybody

crystal citrus
#

can i get an example

tidal stirrup
#

with their previous nickname

crystal citrus
#

i wanted it to

#

do it to

#

1 person

tidal stirrup
#

sure

crystal citrus
#

with a certain name

tidal stirrup
#

oh ok

#

so you just add an if and check if member id is which you wanted

crystal citrus
#

ngl im confused ๐Ÿ˜ญ idk much python i just want a bot for a server rq

tidal stirrup
#

ok

#

so you want that 1 precise member always keeps the same nickname?

crystal citrus
#

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

tidal stirrup
#
@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)```
tidal stirrup
crystal citrus
tidal stirrup
crystal citrus
#

it

#

instantly closed

tidal stirrup
#

?

#

what did close?

crystal citrus
#

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

tidal stirrup
#

open it within an ide

#

like visual studio code

crystal citrus
#

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

tidal stirrup
#

what appears in terminal?

tidal stirrup
#

why?

crystal citrus
#

its so odd

tidal stirrup
#

weird

crystal citrus
#

ye idk its odd

solid garnet
#

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

crystal citrus
#

bet

solid garnet
#

?

crystal citrus
# solid garnet Show code with bot token hidden

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")

hot iglooBOT
#

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.
solid garnet
#

You didn't run the bot

crystal citrus
#

yeah nothing happens when i do it

#

ill show u

solid garnet
hot iglooBOT
#
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 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.

solid garnet
median wraith
#

and it also doesnt show a error

#

im also having the same issue

solid garnet
#

Because it reach the end of the code

#

So it auto close

crystal citrus
solid garnet
#

Where is client.run(token)

crystal citrus
#

this is VCS

median wraith
solid garnet
#

The end of the file

#

Lmao

#

Think

#

How would the bot run if you didn't tell it to run

#

๐Ÿ’€

crystal citrus
#

look

median wraith
#

like this :3?

solid garnet
#

Full code

#

!paste

hot iglooBOT
#
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 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.

median wraith
solid garnet
#

Put it on paste

#

I don't want to read an image

#

lmao

crystal citrus
#

nah i

#

got it to run

#

now

#

but it doesnt work

#

like it doesnt

#

change their name

solid garnet
#

It only change their name when the user change their nickname

median wraith
#

if its " lol"

and i change it to " hello" it stays to "lol"

crystal citrus
#

it doesnt change at all for me

crystal citrus
#

can i make it to where

median wraith
# solid garnet I don't want to read an image

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)

hot iglooBOT
#

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.
crystal citrus
#

it auto changes

#

every time

#

someone changes it

#

no matter what

solid garnet
#

Use paste/backtick

crystal citrus
#

so its like permanent

solid garnet
#

To send code

crystal citrus
#
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)
solid garnet
#

I said, it only change when that user change their username

crystal citrus
#

yeah but how do i make it to where it changes back no matter what

solid garnet
#

It do, but first, that user have to change their username

crystal citrus
#

wdym ๐Ÿ˜ญ like i want it to where like

#

i run the code

#

and it changes their

#

username

#

to what i wrote

solid garnet
#

So it is not how you do it

crystal citrus
#

in the code

median wraith
#

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"

crystal citrus
#

and they cant change it back no matter what

solid garnet
#

You have to change their username in on_ready

crystal citrus
#

yes

solid garnet
#

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

median wraith
#

can u redo it for us

solid garnet
#

I will just guide you to do it

median wraith
#

ngl if you cant code just say that

solid garnet
#

And please, don't have 2 people respond at the same time

solid garnet
#

I don't have the responsibility to make a bot for you

median wraith
solid garnet
#

I don't have to

#

I am only volunteering

median wraith
#

cause i said so

#

now do it

solid garnet
#

Anyway bye, not helping now

median wraith
#

u cant code

#

loser

hot iglooBOT
#

: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.

crystal citrus
#

.close

#

,close

#

idk how

#

to

#

close

#

?close

young oracleBOT
#

This is not a Modmail thread.

crystal citrus
#

BRO

dense vortex
#

Hey @crystal citrus it's just !close

solid garnet
#

Well, I'm being severely insulted for no reason

dense vortex
solid garnet
#

ok, thx

dense vortex
#

I'm not sure what prompted that behaviour from them

solid garnet
#

maybe he/she just want me to code the whole thing for them, which is not what I responsible to do

hot iglooBOT
#
Python help channel closed

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.