Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Mention, 2 people messes up the bot, after some time the bot keeps repeating the same sentence over and over and i have to restart the app #3

Closed
ItzMeZip opened this issue May 26, 2022 · 2 comments

Comments

@ItzMeZip
Copy link

ItzMeZip commented May 26, 2022

is it possible to not mention the bot, instead you just chat on a specific channel and he will reply as soon as he detects a message. And also when 2 or more people chats. It messes up and the bot and says the same thing on a loop. It also repeats the same thing over and over after some time when talking to him. How do you fix this?

Can you kindly help me with this?

@ItzMeZip ItzMeZip changed the title Mention and slow response Mention, Slow response (takes 2 mentions for the bot to reply) May 26, 2022
@ItzMeZip ItzMeZip changed the title Mention, Slow response (takes 2 mentions for the bot to reply) Remove Mention, 2 people messes up the bot? May 26, 2022
@ItzMeZip ItzMeZip changed the title Remove Mention, 2 people messes up the bot? Remove Mention, 2 people messes up the bot, after some time the bot keeps repeating the same sentence over and over and i have to restart the app May 27, 2022
@eeetem
Copy link
Owner

eeetem commented May 29, 2022

#if message.author == client.user:
	#	return

	#ignore everything other that a specific channel
	if str(message.channel.name) != "bot-channel":
		return


	#keep track of conversations across channels and servers
	if message.channel.id in client.channel_dict:
		message_list = client.channel_dict[message.channel.id]
	else:
		message_list = []
		client.channel_dict[message.channel.id] = message_list


	client.last_sender = message.author

	if len(message.content) > 1:
		message_list.append(message)


	#if we remember too much of discord history then it'll consume too many tokens
	if len(message_list)>6:
		message_list.pop(0)
	

	await talk(message,message_list)

change the on_message function to this and it should always talk in 1 channel.

it does sometimes get stuck in a loop but if you send 6 messages without @ing the bot it'll have no memory of the loop and freshly restart.
you can aswell try increasing the temperature and presence penalty in the completion request to avoid loops but that might cause issues on its own

@ItzMeZip
Copy link
Author

thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants