Coder Social home page Coder Social logo

linkbot's Introduction

LinkBot

LinkBot is a general-purpose Discord bot. He is written in Python, using discord.py-rewrite API wrapper (documentation).

Some Main Features

  • Per-server ๐Ÿ‘‘ Admins to restrict sensitive commands.
  • Per-server ๐ŸŽ‚ Birthday tracking. LinkBot will remind a channel of your birthday when it comes around.
  • Per-server ๐Ÿ’ฌ Quote tracking to store all of your friends' embarassing, disappointing, out-of-context quotes.
  • Per-server ๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ Topic system that enables users to subscribe to topics they like. You can ping topics with a command when you want to post relevant information.
  • A ๐Ÿ“† reminder system that will DM you when the time comes.
  • Youtube ๐ŸŽฅ video and Google ๐Ÿ–ผ๏ธ image first-result search embedding.
  • Automatic ๐Ÿ‘ช role-setting for new users in your server.
  • And more!

Getting Started

  1. pip requirements
    Download the dependencies using pip: pip install -r requirements.txt
  2. Discord API Application and Bot Account
    You can get both of these at the Discord Developer portal here.
  3. Neo4j Database
    You will need the community server version of Neo4j for the database. You can find it here
  4. Configuration file
    If you run the program once, a config file will automatically be generated for you. From here, you can read through the file and fill in the required information. It has lots of comments ๐Ÿ˜„

Optionally, you will also need:

  • a Google API key (for image and YouTube searches)
  • a Google Custom Search (also required for image search)
  • a Riot Games API key (for League of Legends game lookup)

If these are not included, the functionality will be automatically disabled.

Commands

LinkBot works like most other discord bots: by reacting to user commands. The prefix for commands is stored in the config file, and when LinkBot receives a command in a server that has the prefix attached, or through a direct message with/without the prefix, the associated command function for that command will be run.

Adding Commands

  • Create a script for your command at ./linkbot/commands/<yourcommand>.py.
  • Import the helper file: from linkbot.utils.cmd_utils import *.
  • Create a function for your command: async def <yourcommand>():.
  • Decorate your function with @command() and fill out the required parameters.
  • Write your script, using any of the helper functions and decorators that are included from the helper file.
  • Possibly add functionality to the main bot files ./linkbot/* that is required for your command.
  • That's it!
    • From here, your command should be callable by addressing the bot using the prefix specified in your config.
    • Your command should also be available via the help command.

linkbot's People

Contributors

schmidtster avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

rjynn schmidtster

linkbot's Issues

@ mention all users in a voice channel

Grant the ability to @-mention a voice channel with the power of the bot boi !

Provide a command, '@', which can be used to mention voice channels.
Syntax will be as such:
link.@ voice channel
(the space is significant, because otherwise we're just mentioning a user)

The voice channel will be searched for using fuzzy search, and the bot will reply with a mention for each user in the channel at that time, along with a short message indicating that the voice channel was mentioned.

Currently, there are no plans to support any further features of the '@' command.

Topics

Create topics that users can subscribe to. Users which are subscribed to topics may be pinged when someone wishes to share relevant information about the topic.

  • This enhancement requires the completion of #1
  • Implement commands for creating and removing topics:
    topic create <topic> and topic remove <topic>
    Topics will be on a per-server basis.
    They will be linked to servers in the database with the -[:HAS_TOPIC]-> relationship.
  • Implement a command for subscribing and unsubscribing to topics:
    topic subscribe <topic> and topic unsubscribe <topic>
    Subscriptions in the database will link Members with Topics using the -[:SUBSCRIBED_TO]-> relationship.
  • Implement a command for pinging subscribed members of a topic: topic ping <topic>
    This will prompt the bot to send a message containing ONLY mentions of the subscribed members.
  • Test:
  1. Creation and deletion
    1. Create a topic
    2. Create an already existing topic
    3. Delete an existing topic
    4. Delete a non-existent topic
    5. Delete a topic that has subscribers
  2. Subscriptions
    1. Subscribe to a topic
    2. Subscribe to a non-existent topic
    3. Subscribe to a topic that you are already subscribed to
    4. Unsubscribe from a topic that you are subscribed to
    5. Unsubscribe from a non-existent topic
    6. Unsubscribe from a topic that you are not subscribed to
    7. Subscribe to a topic that was recently deleted
    8. Unsubscribe from a subscribed topic that was recently deleted
  3. Pings
    1. Ping a topic with no subscribers
    2. Ping a non-existent topic
    3. Ping a topic after subscribing
    4. Ping a topic after unsubscribing

Neo4j Integration

Swap the database from Postgres to Neo4j.

  • Setup Neo4j database
  • Test connectivity using test queries
  • Convert all database sql queries into neo4j cypher queries
  • Test all converted queries thoroughly

Because of the difference in implementation, there will need to be changes to the way that a couple commands work.

  • Update and test cmdban
  • Update and test quote
  • suggest is being revamped (#3), so an update of this command database-wise is not necessary

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.