#πŸ”’ why is my client still calling for chat messages from previous logins?

40 messages Β· Page 1 of 1 (latest)

gritty wolf
quartz inletBOT
#

@gritty wolf

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.

sour dagger
#

How are you running it?

#

You just showed your class definition

gritty wolf
#

clear displayed_messages at session start

gritty wolf
#

you can reinitialize ChatUI each session to clear messages

gritty wolf
#

im a self taught junior

sour dagger
#

Are you asking if you can re-initialize your ChatUI object inside your class definition?

#

o_O

gritty wolf
#

handle in main

gritty wolf
gritty wolf
gritty wolf
sour dagger
#

So you're not initializing anything in ui_chat.py. Nothing exists until you instantiate it in your main.py.

gritty wolf
#

well technically

#

its main -> ui_gameplay -> ui_chat

#

but yes

sour dagger
#

Then it becomes an object. (presumably - I haven't seen the driver code). Depending on how you're doing it you can keep destroying and instantiating new objects or maintain persistence but that's up to your design.

gritty wolf
#

i have a feeling ive errored somewhere because the messages clear correctly but then reprint

#

like its my fault

#

im calling the messages back

#

or

#

the messages are checked

sour dagger
#

For complex applications you should really plan out your design before implementing it.

gritty wolf
#

and not checked against a list that disallows duplicates or olds

sour dagger
#

Otherwise you end up backtracking and doing weird things to code around things you did previously.

gritty wolf
#

i wrote a design doc before starting

#

i have that thought in the back of my head something simple and stupid is reproducing these messages

#

check for duplicate message logic. small details matter

#

i need to unique the message id

#

i think ive solved it

#

before it was a counting set

#

disallow unique ids already seen

quartz inletBOT
#
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.

#

πŸ”’ why is my client still calling for chat messages from previous logins?