mercm8 / chat-llama-discord-bot

A Discord Bot for chatting with LLaMA, Vicuna, Alpaca, or any other LLM supported by text-generation-webui or llama.cpp.
https://discord.gg/TcRGDV754Y
MIT License
16 stars 4 forks source link

emoji detection doesn't work #5

Closed Garry-Marshall closed 1 year ago

Garry-Marshall commented 1 year ago

I used the text-clean package to filter out emojis. There's probably more elegant solutions, maybe there's a built in function in the Discord api you could use.

from cleantext import clean

 if self.ignore_parenthesis and \
       (message.content.startswith('(') and message.content.endswith(')') \
       or \
       #(message.content.startswith(':') and message.content.endswith(':'))):
       clean(message.content, no_emoji=True) == ""):
       """ if someone is simply using an :emoji: or (speaking like this) """
       return False
mercm8 commented 1 year ago

yep, looks like it should be <:emoji:> not :emoji:.

There's a built in one too, but gonna change it to this for now (and totally fix it later for sure)

edit: actually I might just use the built in one later, because I want the bot to learn about custom server emojis eventually.