A bot for the CS@unimelb Discord server.

Overview

KittyBot - a sentient Discord bot!

Key Notes

  • An open-source, community-powered bot for the CS@unimelb Discord server.
  • This bot is made using Hikari & Lightbulb. These are two nice & simple Python libraries.
  • The docs for these two libraries are https://www.hikari-py.dev/hikari/ & https://hikari-lightbulb.readthedocs.io/en/latest/.
  • The following get-started guide is very nice if you want to quickly understand how these libraries work: https://neonjonn.readthedocs.io/en/latest/hikari-get-started/lightbulb.html
  • Pull requests are very much accepted (and encouraged!) if you want to add features to the bot & server :)
  • If you want to play around with it, you will need to use your own bot token. You could then invite your own bot (with the token you got) to your own personal server and play around with it there for testing (this is all in the above guide) :)
  • You can install the required dependencies (listed in requirements.txt) using the command pip install -r requirements.txt.
  • For readability purposes, if you want to add a function/command, please write it in a new python file placed in the extensions folder -- just like the userinfo and fortune commands are.
  • Important: If you want to develop/contribute/test/play-around, you will need to create a .env file and inside it add your bot token (as explained in the guide), and the 'default guild' IDs. It will need to be like: BOT_TOKEN = 123456 and DEFAULT_GUILDS = 123456,56789 (comma-seperated list). Specifying guild IDs in .env is not neccessary, and actually the act of specifying certain IDs to it (can be many guilds) means that slash commands will only be available in those guilds. The benefit of specifying default guilds is that the slash commands become available instantly in those servers, which is good for testing purposes. Note: 'guild' means Discord server.
  • So, to be clear, your .env file should be located in the top layer of the repository (same level as bot.py and requirements.txt) and could look like this:
BOT_TOKEN = 123456 # Your bot’s token from the Discord Developer Portal.
DEFAULT_GUILDS = 123456,56789 # The 'default guilds' -- these instantly load slash comamands. Can be empty.
FORTUNE_DIRECTORY=/usr/share/games/fortunes # Location of where fortunes is installed on your machine.
  • The +fortune command requires the fortunes package to be installed and pointed to by the FORTUNE_DIRECTORY variable in .env.
    • If you're on Linux you can install fortunes with sudo apt-get install -y fortune and in .env set FORTUNE_DIRECTORY=/usr/share/games/fortunes
    • If you're on macOS you can install fortunes with brew install fortune and in .env set FORTUNE_DIRECTORY=/usr/local/Cellar/fortune/9708/share/games/fortunes
    • I don't have Windows so if you develop on Windows you'll have to find how to download the fortunes package yourself. If you can't find it it's fine, it just means the +fortune command won't work during testing (but everything else should).
    • You may optionally white-list and black-list database files by setting FORTUNE_WHITELIST and/or FORTUNE_BLACKLIST to a space-separated list of database file names.
  • The bot is deployed on a cloud server (droplet on Digital Ocean) which runs Ubuntu 20.04.

Current Functionality

  • Automatically assigns the #NotALurker role to members who qualify for it (previously mods had to manually assign it).
  • Answers questions with a magic 8 ball response.
  • +ping command: Kitti returns to you a heartbeat latency message.
  • +numberadder command: Takes 2 numbers as input and returns the sum of them.
  • +fact command: Returns a random fact // common misconception.
  • +fortune command: Returns a random fortune. Beware!
  • +userinfo command: Returns an embed containing useful information of a specified member of the server. If no member is specified, it returns that of the user who issued the command.
  • All commands have a 10-second cooldown period (per user), and can also be called in slash command form.

Further Ideas // Ways to Contribute

  • Resolve outstanding issues noted in Issues.
  • Perhaps a unimelb-handbook webscraping related command? The repo already uses a webscraper (BeautifulSoup) you could use!
  • Greeting new people when they join the server in #general.
  • Getting Kitti to reply to someone if they thank Kitti (e.g.: Thanks @Kitti! ... You're welcome @____ 🐱).
  • Add programming/CS related facts to the fact 'database'. The database is currently a list of strings whereby each string is a fact/common-misconception scraped from a Wikipedia page.
  • Implement some sort of natural language processing thing (neural network?) that does something to do with text analysis (e.g. off a message that someone sends). This is some next level stuff, but hey, if there's an interest then why not? 😃
  • Implement a creative command you have of your own!
Comments
  • Added New Emojicloud (V1)

    Added New Emojicloud (V1)

    New Fancy Emojicloud

    • Better looking Unicode Emojis
    • Custom Emojis (Animated too!)
    • Alex's version is still there at /wordcloud
    • Use /emojicloud to activate this

    Lightly Tested. I expect it to be imperfect but will get there in a few iterations and with feedback. Hopefully. 🤞

    output

    opened by dakshAg 4
  • Kitti does not allow duplicate Discord emoji with uppercase identifiers in duplicate message policing

    Kitti does not allow duplicate Discord emoji with uppercase identifiers in duplicate message policing

    Regex at https://github.com/olliequ/KittyBot/blob/ad1997a356ca170dc66e556132e7dd75d149b09d/extensions/duplicate_message_policing.py#L54 is deficient as it does not allow :Poggers: to be resubmitted since it foolishly specifies such capacity only for lower case names. Poggers starts with an uppercase letter (hereafter referred to as 'P').

    Critical?

    opened by a-lexer 3
  • Stable 8ball

    Stable 8ball

    This changes the behaviour of the magic eight ball to always respond to the same question with the same answer, based on a hash of the question text.

    Since this behaviour may or may not be actually desirable, feel free to reject this PR.

    opened by flukiluke 3
  • Dark Mode for Stats Graph, Advices, YoMama Jokes and (optional) Spam!

    Dark Mode for Stats Graph, Advices, YoMama Jokes and (optional) Spam!

    This is duckdivinity

    • Changed the colour combinations for the Stats graph to look beautiful and blend with Discord UI.
    • Added advice command using https://api.adviceslip.com/advice
    • Added yomama command that prints a Yo Mama joke from https://api.yomomma.info/
    • Added spam command to repeat the same message over and over again. This is highly controversial so feel free to remove this one.
    • My Code Editor re-formatted the code. 🤷🏻‍♂️

    Lightly tested.

    opened by dakshAg 2
  • Fortune sometimes prints with incorrect line breaks.

    Fortune sometimes prints with incorrect line breaks.

    What it should print like:

    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."

    What it currently sometimes prints like:

    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."

    Here is an actual example of the error from the server: https://imgur.com/a/yJ2YbgO

    Edit: Fortunes also sometimes print with 2 spaces between sentences. Obviously, there should only be 1 whitespace. Here's an example: https://imgur.com/a/yoO9FW1

    feature request 
    opened by olliequ 2
  • Custom Emoji Cache, now without Database

    Custom Emoji Cache, now without Database

    • Uses numerical id for the file name (inspired by Discord itself) so averted colon issue
    • Caches get more reliable
    • Lightly tested
    • Confidence Level 6/10
    opened by dakshAg 1
  • Pillow deprecation warning

    Pillow deprecation warning

    kitti[297]: W 2022-10-30 15:36:41,211 py.warnings: /usr/local/lib/python3.10/site-packages/wordcloud/wordcloud.py:499: DeprecationWarning: ROTATE_90 is deprecated and will be removed in Pillow 10 (2023-07-01). Use Transpose.ROTATE_90 instead.
    kitti[297]:   orientation = Image.ROTATE_90
    
    opened by flukiluke 1
  • db.cursor() recreated after a commit when the original one can be used

    db.cursor() recreated after a commit when the original one can be used

    I don't fully understand this, but here's the reference line of code:

    https://github.com/olliequ/KittyBot/blob/2671e0d7df9cb225b8905ccb57541e7bbeeb9a2a/extensions/deletes.py#L42

    opened by olliequ 1
  • failure to use raw ('r') strings for regex

    failure to use raw ('r') strings for regex

    https://github.com/olliequ/KittyBot/blob/e8edbf3e29781c080888a58ae2885d3aa64d93e3/extensions/duplicate_message_policing.py#L53

    This leads to the ugly necessity of having two backslashes \ when only one would be needed in a raw string. i.e. r"<a?:[a-z]+:\d+>"

    opened by a-lexer 1
  • For the unique message feature, Kitti doesn't allow the sending of custom emojis (when she should)

    For the unique message feature, Kitti doesn't allow the sending of custom emojis (when she should)

    This is because custom emojis are interpreted as a string encapsulated with <:>. A check could be made for these chars to allow the sending of emojis. Remember, any message with length <= 2 should be allowed, and a custom emoji should be treated as length 1.

    Unicode emojis don't have this issue as for some reason they aren't translated to this <:> structure. In the command line with bot.py running, if you print(message) where message is sending of a unicode emoji, it will actually print the singular emoji. Where if it's custom it'll be something like <:catswag:989147563854823444> which obviously has length greater than 2.

    Example:

    image

    bug 
    opened by olliequ 1
  • For the unique message feature, Kitti says some messages were first sent 52 years ago.

    For the unique message feature, Kitti says some messages were first sent 52 years ago.

    This is for messages that don't have timestamps for when they were first sent (this is because the timestamp first-sent addition was made at a later date). For null values the default time assigned is the UNIX timestamp epoch (January, 1970).

    One potential fix is a manual fix: every message in the db has a message ID that can be looked up to manually retrieve what date it was originally sent, and insert this into the db. You might be able to automate this manual process by iterating through the db checking for emojis with this 1970 timestamp?

    Here's an example:

    image

    bug 
    opened by olliequ 1
  • Transparent Background for Animated Emojis

    Transparent Background for Animated Emojis

    • New Download Method
    • New Pickup Lines API https://api.jcwyt.com/
    • New Breakup Lines too!
    • Lightly Tested
    • Need to delete gifs in assets for new ones to come
    • Hope it works 🤞
    opened by dakshAg 0
  • Feature request - calendar slash command that lists today's holidays, events, 'on this day', etc.

    Feature request - calendar slash command that lists today's holidays, events, 'on this day', etc.

    The 'calendar' app installed with many Linux distros (see screenshot) acts as inspiration.

    image

    Q: Why can't someone just type 'calendar' into their terminal? A: They might be on Windows, or on a phone, or otherwise disagree philosophically with anything originating from before the year 2000.

    feature request 
    opened by a-lexer 3
Owner
Ollie
Hey! I’m Ollie - a current graduate student at The University of Melbourne. I'm most interested in machine learning, web dev, and distributed systems :)
Ollie
A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes

A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes.

samet 4 Jul 23, 2022
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
A bot to get Statistics like the Playercount from your Minecraft-Server on your Discord-Server

Hey Thanks for reading me. Warning: My English is not the best I have programmed this bot to show me statistics about the player numbers and ping of m

spaffel 12 Sep 24, 2022
A Discord BOT that uses Google Sheets for storing the roles and permissions of a discord server.

Discord Role Manager Bot Role Manager is a discord BOT that utilizes Google Sheets for the organization of a server's hierarchy and permissions. Detai

Dion Rigatos 17 Oct 13, 2022
Discord bot for Ukrfans Discord server

Ukrfans Discord Bot Discord bot for Ukrfans Discord server. ?? Prerequisites Python ⚙️ Build & Run Create an .env file in the root directory and add t

null 3 Jun 24, 2022
Discord bot for name verifying. Created for TinkerHubGCEK discord server. Tinky is now deployed in heroku

Custom Discord bot This custom discord-python bot assigns roles to members joined at discord server. It looks and compares a list before verifying the

Edwin Jose George 2 Dec 16, 2021
Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected discord server via Nextcordbot API.

Steam-Workshop-Monitor Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected Discord channel via Nextcordbo

null 7 Nov 3, 2022
A discord bot written in discord.py to manage custom roles assigned to boosters of your server.

BBotty A discord bot written in discord.py to manage custom roles assigned to boosters of your server. v0.0.1-alpha released! This version is incomple

Oui002 1 Nov 27, 2021
The Python version of the official Discord bot for the Astura Studios Discord community server.

About Astura (Python version) is the official Discord bot for the Astura Studios Discord community server developed and maintained by Ascendus and the

Ascendus 1 Apr 21, 2022
A Discord chat bot for the Tardsquad guild (Discord name for server).

Tardsquad Discord Bot A Discord chat bot for the Tardsquad guild (Discord name for server). Resouces Discord Developer Portal A general tutorial for a

Tardsquad Quality Code Inc. 4 Jul 26, 2022
A self-bot for discord, written in Python, which will send you notifications to your desktop if it detects an intruder on your discord server

A self-bot for discord, written in Python, which will send you notifications to your desktop if it detects an intruder on your discord server

LevPrav 1 Jan 11, 2022
WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community

WallAlley.bot About WallAlley.bot is an open source and free to use financial discord bot originaly build for WallAlley server's community. All data a

Mohammad KHADDAN 1 Jan 22, 2022
It's a Discord bot to control your PC using your Discord Channel or using Reco: Discord PC Remote Controller App.

Reco PC Server Reco PC Server is a cross platform PC Controller Discord Bot which is a modified and improved version of Chimera for Reco-Discord PC Re

Arvinth Krishna 12 Aug 31, 2022
A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py)

Articuno (discord-interactions) A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py) Get started If you wa

Blue 8 Dec 26, 2022
Discord bot script for sending multiple media files to a discord channel according to discord limitations.

Discord Bulk Image Sending Bot Send bulk images to Discord channel. This is a bot script that will allow you to send multiple images to Discord channe

Nikola Arbov 1 Jan 13, 2022
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Jan 11, 2022
Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single bot.

Discord ToolBox Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single b

null 3 Aug 7, 2021
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
Image-Bot-Discord - This Is a discord bot that shows the specific image you search from Google

Advanced Discord.py Image Bot CREDITS Made by RLX and Mathiscool README by Milrato Installation Guide in .env Adjust the TOKEN python main.py to start

RLX 3 Jan 16, 2022