Giter VIP home page Giter VIP logo

uwsgamedevbot's Introduction

Bjarne

Bjarne is a Discord server bot built for and maintained by the UWS Game Dev Society.

It is written in Python using discord.py, a wrapper for the Discord API.

It is currently hosted on the Heroku cloud platform.

Requirements

Contributors

Contributing

If you are a member of the society and wish to add features, enhancements, or fix bugs, your contribution is welcome!

Feel free to choose an item on the Issues page section that you would like to work on. Already implemented features are listed below.

To get started you should get the example running from the discord.py repo and check out the documentation there. For a more in-depth tutorial there is a really handy Discord server with guides for basic operations.

For developing the bot you should create your own bot and run it in your own private server to test out your functions so we can avoid a lot of bother with security tokens and the Bjarne bot being hosted in a cloud server. Once you are happy you can submit a pull request and it can be added to Bjarne.

If you have any questions for making a contribution, or a code related question, feel free to send a message in the #bjarne-dev channel on the society server.

Installation

Fork this repo and clone your fork to get it onto your computer. Make sure you have git installed before you do this.

git clone https://github.com/<YOUR_GITHUB_USERNAME>/uwsgamedevbot.git

Install any dependencies you may need:

pip install -r requirements.txt

Set up your environment:

  1. Create a new file in the root of the repo directory called .env
    1. If you struggle doing this on Windows, you can just open a text editor window and do Save As..., then save it into the root of your project folder with the name .env.
  2. Paste the following text into that file, then save it:
VERSION=0.5

# Replace this with your development bot token from https://discord.com/developers/applications
BOT_TOKEN=

GIPHY_TOKEN=DJMTKL6KeslYSHAY0S0ts7psxsUixP0S
WOLFRAM_TOKEN=42XXHU-YEK7852REU

Some 3rd-Party tokens have been provided for the sake of ease. They are working, but please don't abuse them. In production, different tokens will be used.

  1. (Recommended) Create a development server on Discord for local testing purposes.
  2. Create a developer application on the Discord Applications page.
  3. Convert it into a BOT by clicking the very obvious button that appears on the following page.
  4. Navigate to the OAuth2 tab on the left sidebar
    1. Scroll down and check the bot entry in the SCOPES section.
    2. Follow the link that is generated in the text field below and invite the bot into the server you created in step 1.
    3. The bot will appear as offline, which is fine, since we haven't started the application yet!
  5. Navigate to the Bot tab on the left sidebar.
    1. Copy the Bot Token and paste it into the BOT_TOKEN entry from the .env file you created earlier.
  6. Now you can run python main.py and the bot should be up and running. Feel free to make any changes to the code and restart the bot to see the effects. Once you are satisfied with your changes, push it to your fork, and create a pull request!

Features

  • Automatic new member welcome message.
  • !say - make Bjarne repeat a message.
  • !bjarnequote - Display a quote from Bjarne Stroupstrup, creator of C++.
  • !random - Random number generator.
  • !dice - Roll a 6 sided dice.
  • !math - Math operations.
  • !quote - Quote users in the channel, picks a random message they have sent.
  • Post an "Unlimited Power" Palaptine meme when anyone mentions the word "power" - currently disabled.
  • !weather - current weather conditions for a specified location.
  • !forecast - 5 day weather forecast for a specified location.
  • !poll - Start a question with options users can vote on.
  • !roles - Display a list of roles users can add to their accounts.
  • !urban - Search for an Urban Dictionary definition.
  • !report - Anonymously report user to society committee.
  • !hangman - Play an interactive game of Hangman.
  • !define - Get a dictionary definition of a specified word.
  • !translate - Translate a message between specified languages.
  • !crypto - Get cryptocurrency prices.

Changelog

  • 0.5 - in development.
    • !define - Get a dictionary definition of a specified word.
    • !translate - Translate a message between specified languages.
    • !crypto - Get cryptocurrency prices.
  • 0.4
    • !xckd - Get a random XCKD comic.
    • !eightball - Get some classic 8-ball wisdom.
    • !wiki - Get the first few sentences of a Wikipedia page.
    • !roles - Revamp roles command to be more intuitive.
    • !hangman - Play an interactive game of Hangman.
  • 0.3
    • !roles - Users can add non-functional roles to their own accounts, e.g. "2nd Year" or "Graduate".
    • !urban - Search for an Urban Dictionary definition.
    • !report - Anonymously report user to society committee.
  • 0.2
    • !random - Random number generator.
    • !dice - Roll a 6 sided dice.
    • !math - some basic math functions.
    • !quote - quote a random message from a user in the channel.
    • Palpatine "power" meme.
    • !weather - current weather conditions for a specified location.
    • !forecast - 5 day weather forecast for a specified location.
    • !poll - Start a question with options users can vote on.
  • 0.1
    • Automatic new member welcome message.
    • !say - Make Bjarne repeat a message.
    • !bjarnequote - Display a quote from Bjarne Stroupstrup, creator of C++.

uwsgamedevbot's People

Contributors

codetechninja avatar martygrant avatar medallyon avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uwsgamedevbot's Issues

Reminder

Tell the bot to remind you of something at a specified time and date. Bjarne will then @ you, giving you a notification on discord with your chosen message.

Server stats

Write a '!stats' function that will show various server information such as when the server was created, how many members of each role and offline/online, number of channels, number of messages. Can be further developed to get stats of individual members.

Translate messages

Translate a message into a particular language using some translation API, probably Google.

"!translate good morning -japanese" or something along these lines.

Add and remove multiple roles

Using the !role command to add a role to a user profile, allow the user to add or remove more than one role at a time. The API function add and remove also takes a struct of roles so the functionality would be facilitated well. E.g:

!role 1st year | computer games development

The and operator could be of any style, comma separated, |, and, &...

Voting

Implement some kind of voting functionality so a user can propose a poll of some kind, e.g:

!poll What is your favourite programming language?
!vote c++

Hangman

Implement a hangman word-guess game the server can play together.

Crytocurrency prices

Get current crypto prices from some data feed to display the values of popular cryptocurrencies.

Look up dictionary definitions

Allow a user to look up a dictionary definition, e.g:

!define computer

Return the search query's definition and possibly other info like an example.

Search Wikipedia

Search for a topic from Wikipedia. Return a brief summary and the page URL.

Allow users to set roles

Let users set their roles, so they can update it when they change years or graduate so admins don't need to bother doing it. So when a user joins they can do e.g. "!role 1st year" and then a year later do "!role 2nd year".

Look up a thesaurus

Allow users to look up a thesaurus and get similar words to the search query.

Setup CI

Setup a continuous integration system which will help check new commits build properly and make it easier for other people to deploy changes to the live system.

Automatically add the hidden token section if not replaced at the end of a local edit.

Convert between units

Convert different units, e.g feet to meters, celsius to fahrenheit, currency (including crypto?).

Stock prices

Get a stock price from some data source by suppling the company ticker or name).

Weather

Write a "!weather" command with optional location parameter which will get some weather data.

Quote user messages

Quote a random message from a user, using:

!quote

It should pull a random message from the specified user and output it, if no user is specified it will get a quote from the user executing the command.

Latex Renderer

Take latex style input and spit it back out as a rendered equation.

Report a user to admin/society committee

Allow a user to send a private message to Bjarne to highlight any rule violations made by another user. Bjarne should then send a message to admins/committee members.

Example:

!report username

Needs a way for attaching the "violation" made.

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.