R'ylah

ยท

The Great Overlord of Discord

R'ylah started as an idea and just blew up. I started wondering, "What if..." and just ran with it. He is the great overseer of our hideout. The Gatekeeper. Manager of the Airlock.

Simple Speech

R'ylah started off with !ping and the notorious pong! response (maybe Hello World!) is a better refrence? I don't know. From here I started making him respond to different commands and have simple responses. To do this I have to use the Discord.js library.

        if (message.content === '!ping') {
            const sentMessage = await message.channel.send('pong.');
            await message.react('๐Ÿ“') // Capture the bot's message
            await sentMessage.react('๐Ÿ“'); // React to its own "pong." message
        }
        // React to user message "pong"
        if (message.content.toLowerCase() === 'pong') {
            await message.react('๐Ÿ“');
        }

Here you see he responds to the users !ping with a pong and emoji reaction to both messages. | next you see if a user just says pong R'ylah will also post a reaction.

I started wondering what I could plug him into, what about weather? To grab weather we can use the https://openweathermap.org/ api to grab that information. | We want our users to be able to search for where they live so we can use this url |

UPDATE: I stopped using openweathermap.org it seems to not be as accurate. I switched to weather api instead.

http://api.weatherapi.com/v1/forecast.json?key=31f950dac7224106b8a140440251205&q=${encodeURIComponent(input)}&days=1&aqi=no&alerts=no

Weather in Discord