Giter Site home page Giter Site logo

m-davies / oghma Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 305 KB

Rules and references bot for discord d&d groups

License: MIT License

Python 99.16% Dockerfile 0.84%
bot discord discord-api discord-bot discord-py discordbot dnd dnd-tools dnd5e dnd5e-tools dungeons-and-dragons dungeons-and-dragons-online dungeonsanddragons open5e open5e-database python python-3 scryfall scryfall-api

oghma's People

Contributors

dependabot[bot] avatar m-davies avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

redeyed-vault

oghma's Issues

Allow bot to join voice chats and play cinematic music

Similar to what Rythm does, I'd like the ability for this bot to join a voice chat with a simple command and start playing cinematic music appropriate to the situation. I'm thinking something along the lines of:

  1. A new command (Maybe ?play dungeon | forest | city) that will force the bot to join the voice channel of the executer and play ambient music of the category specified
  2. Other music commands that will stop the music, skip the current song or kick the bot out of the voice chat

Improve the ?ping command

Right now, all the ping does is check if the bot is up. It would be nice if the command was updated to spit out diagnostic infomation and other useful stuff

Provide better error handling

Describe the bug
Currently, the on_command_error func doesn't work as intended as we can't send an error stream via an embed. We should recify this to send some sort of output to the user on discord that something has gone wrong

Add aliases to command output

We currently don't see any reference to our aliases in the bot output. When a user executes a command via an aliases, we should inform them that they have.

Change all txt files to markdown

Discord supports markdown highlighting for small file snippets. We should make use of it and use discord's markdown highlighting instead of the current boring txt

Add a feature that will return a list of results

Is your feature request related to a problem? Please describe.
Currently the bot will only return the first matching term and ignores the rest. While this is good for perf reasons, we could do better by adding a new query that will return a list of results and the user can then optimise their query to pick the one that suits it best

Describe the solution you'd like
A new query that will produce a list of results rather than the first one

Describe alternatives you've considered
Using ?searchdir which while useful, does not filter the results down enough (e.g. it won't help when you're trying to find out all the giants in the database)

Add a ?help command

Right now, all the commands have limited help text attached to them depending on how much info you offer to the command. However, a generalised help command would be a useful addition as I feel like every bot would need one. This command could offer stuff like:

  • The list of commands and examples of them executing
  • Where to open issues if things go wrong
  • Other info that's relevant to a ?help command

2nd Monster embed doesnt send

Example case ?searchdir monsters bule produces the following error

2020-06-05T21:01:44.222508+00:00 app[worker.1]: Traceback (most recent call last):
2020-06-05T21:01:44.222566+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 79, in wrapped
2020-06-05T21:01:44.222567+00:00 app[worker.1]: ret = await coro(*args, **kwargs)
2020-06-05T21:01:44.222597+00:00 app[worker.1]: File "bot.py", line 1336, in searchdir
2020-06-05T21:01:44.222597+00:00 app[worker.1]: await ctx.send(embed=response)
2020-06-05T21:01:44.222627+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/abc.py", line 823, in send
2020-06-05T21:01:44.222627+00:00 app[worker.1]: data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)
2020-06-05T21:01:44.222653+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/http.py", line 222, in request
2020-06-05T21:01:44.222654+00:00 app[worker.1]: raise HTTPException(r, data)
2020-06-05T21:01:44.222731+00:00 app[worker.1]: discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
2020-06-05T21:01:44.222731+00:00 app[worker.1]: In embed.fields.2.value: This field is required
2020-06-05T21:01:44.222779+00:00 app[worker.1]:
2020-06-05T21:01:44.222780+00:00 app[worker.1]: The above exception was the direct cause of the following exception:
2020-06-05T21:01:44.222781+00:00 app[worker.1]:
2020-06-05T21:01:44.222819+00:00 app[worker.1]: Traceback (most recent call last):
2020-06-05T21:01:44.222888+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 863, in invoke
2020-06-05T21:01:44.222889+00:00 app[worker.1]: await ctx.command.invoke(ctx)
2020-06-05T21:01:44.222923+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 728, in invoke
2020-06-05T21:01:44.222924+00:00 app[worker.1]: await injected(*ctx.args, **ctx.kwargs)
2020-06-05T21:01:44.222960+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 88, in wrapped
2020-06-05T21:01:44.222961+00:00 app[worker.1]: raise CommandInvokeError(exc) from exc
2020-06-05T21:01:44.223017+00:00 app[worker.1]: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
2020-06-05T21:01:44.223017+00:00 app[worker.1]: In embed.fields.2.value: This field is required

Missing logs

We do have some limited logging in place but it could be better, especially when an error has been thrown

BREAKING CHANGES - bot is currently down due to Discord and discord.py changes

Essentially the bot is down due to numerous reasons and I have either been too busy or too ignorant to realise that until now. Therefore, I will attempt to fix the issues and get it up and running again, using this issue to track progress.

Feel free to comment any advice or requests you have for the bot in the meantime, I imagine I'll get some ideas while I'm going through all the shiny new Discord API stuff anyways.

Add a dice roller

Will need to be flexible, use embeds and (if possible) have a history field that shows the most recent dice rolls

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.