AI News Hub Logo

AI News Hub

Hermes agent: Connect to Discord

DEV Community
PhĂș

Introduction In last post, we already find out how to setup and connect Hermes Agent to Telegram. Today, we find out how to connect that to discord. First of all, you need to create bot in Discord. After that, you setup gateway to use this Discord bot. Then you start gateway. After that, you can chat with your agent through Discord. Go to this Discord developer portal with your account. Then go to applications on the left menu side bar. Then type your bot name. Click agree then click "Create" button. After that, you see it like this Then go to Bot item on the left. It has section call "Reset Token", click to this button to get Reset Token. Then you go to hermes, run command hermes gateway setup, then choose Discord. Next, it will ask for bot token, paste your Reset Token in here. Then go back to Discord Portal, we continue to setup bot. In left menu, choose OAuth2, scroll to bottom. Find and check Bot checkbox. Then it will show another section name "Bot Permissions", choose permission you want your bot to have. In here, I choose Send Message for Text Permission.Then choose copy Generated URL, then open new tab and paste it to url. Click continue. Then go back to hermes to finish setup gateway. It show you like this Then you choose what you need. In this case, I just let it Enable open access. Then we can start to talk with agent on this channel. This is an example. Since I use Minimax model so it can generate image as well. I ask it to create minimax gen image skill, then ask it to use that image to gen image for me. Quite nice. I notice that, even I do not ask it to create generate image skill, it will auto create if I ask it to generate image use Minimax. After many try, it start to automatically create skill for this repeated tasks. That's why it call that it is an agent that grow with you. Another part that it has memory so it can remember what you say. Another case that I want to generate music, then I ask my agent to do that. Just simple prompt like this. In the end, it can figure out and produce me this one. Quite chill. Another use case is that, I ask my agent and it answer me by using TTS. So instead of show me text, it generate that to audio and play that to answer. So I do not to read, only need to hear. To have this, you only need to choose TTS. In Discord, use this command /voice in channel you want it to answer you with audio. Then choose tts option. In my case, I choose to use Minimax TTS since I have subscription of it. However, I want to do this in another level that I can go to voice, then I can talk to it in realtime. First of all, you need to go back to OAuth2. Then check these item in Bot Permissions. Then copy Generated URL and paste to new tab again. Choose your channel so bot can join that channel. Next, you join to voice channel on the left, in this case, I join general channel. After you join, in channel, you type voice. Then choose channel and type your Voice channel name. Bot will join your voice channel. And now you can start to talk with it. This is my demo. It is super slow. However, at least, now I can talk to my bot directly. If change to use another TTS like like Elevenlabs, surely it will be much faster and more natural. However, to really answer in realtime, we need to have streaming which Hermes agent does not have currently. Maybe, I will try to implement that someday and show you. I already can do that with GPT realtime voice 2.0. However, to make it work in Hermes agent, need to have extra step. That's all for today. Hope you guys enjoy this article. Any question, please comment below. See you next time.