Friday Discord Bot
Friday is an Artificial Intelligence like software that I am developing as a chatbot for Discord. The chatbot system works off of the API from OpenAI using the new ChatGPT model. Friday also comes with community moderation tools, music playback, chat-based games and more. The project is being made with Python 3.8 and Discord.py.
This project has a public Github repository available.
To talk with Friday in Discord you can mention the bot followed by your message. e.g: "@Friday hey, how are you?" and Friday will respond with something generated by the AI model. e.g: "I'm doing good, how about you?".
Below is a code snippet from the "ping" command that you can run with Friday by using !ping
or @Friday ping
.
from __future__ import annotations
from discord.ext import commands
from typing import TYPE_CHECKING
from functions import embed
if TYPE_CHECKING:
from functions import MyContext
from index import Friday
class Ping(commands.Cog):
"""Ping? Pong!"""
def __init__(self, bot: Friday):
self.bot: Friday = bot
def __repr__(self) -> str:
return f"<cogs.{self.__cog_name__} content=\"Pong\">"
@commands.hybrid_command(name="ping")
async def ping(self, ctx: MyContext):
"""Pong!"""
shard = ctx.guild and self.bot.get_shard(ctx.guild.shard_id)
latency = f"{shard.latency*1000:,.0f}" if shard is not None else f"{self.bot.latency*1000:,.0f}"
await ctx.send(embed=embed(title="Pong!", description=f"⏳ API is {latency}ms"))
async def setup(bot):
await bot.add_cog(Ping(bot))
Previous versions of this project were written in NodeJS which can be found on my Github repository and C# which was not set up with a repository.
These older versions of Friday even had and older logo, which is displayed below.