Git Product home page Git Product logo

discordsearchbot's Introduction

DiscordSearchBot

OpenSource DiscordBot

Get the bot on your server: https://discordapp.com/api/oauth2/authorize?client_id=677860409146867733&permissions=88128&scope=bot

Please fork for contribution

Install

Raw

  1. git clone https://github.com/YourUserName/DiscordSearchBot
  2. cd DiscordSearchBot
  3. pipenv install (install pipenv with pip install pipenv)
  4. run the programm with pipenv run python run.py (Configure the settings with environment variables (infos in the ressources/config.py oder docker-compose.yml))

Or use Docker

Set the DISCORD_BOT_TOKEN and GOOGLE_API_TOKEN in the docker-compose.yml

Do not upload your customized docker-compose file to github

  1. docker-compose pull
  2. docker-compose build
  3. docker-compose up -d

Tokens and configuration

MySQL or MariaDB

Please set following mysql environment variables:

  1. DB_HOST
  2. DB_PORT
  3. DB_USER
  4. DB_PASSWORD
  5. DB_NAME

Api and bot tokens

  1. GOOGLE_API_TOKEN (get your api key here: https://developers.google.com/custom-search/v1/overview)
  2. BOT_TOKEN (get your bot token here: https://discordapp.com/developers)
And your Google CX keys

Google CX is a customized search. You can create this keys here: https://cse.google.com/cse/all (sometimes you can get an error 500). In this console you can configure the search_query (say google on what websites google search. for example: *.stackoverflow.com).

Other environment variables

LOG_GUILD = The guild id of your log server

LOG_CHANNEL = The id of the log channel (The channel must be on the LOG_GUILD)

You can set the LOG_GUILD and LOG_CHANNEL to null or dont set this environments to disable the log feature

Contribution

If you would like to contribute to our open source project, use this checklist step by step:

  1. fork our project
  2. Develop your changes
  3. test it
  4. if you are ready, push it to development on your fork
  5. create pull request from your fork (development branch) to our project (development branch). Please describe your changes in the merge request to make it easier for us to check your code. When your code is okay, we merge your pull request.

Please come to our discord server so we can ask you questions, if we have questions.

Social Media

We have a own discord server: https://discord.gg/2p8uvTD (please join us and help us :D)

discordsearchbot's People

Contributors

adridevelopsthings avatar dependabot[bot] avatar thecataliastnt2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

feuerstern314

discordsearchbot's Issues

add README.md

Aussagekräftige Readme samt installationsanleitung

Vorbereitung für OpenSource

Author signature self or reaction

Man soll in der Autorsignatur sehen, ob der jenige eine Google Reaction getätigt hat oder ob er selbst den Befehl ausgeführt hat.

Statistics

Wie viel Anfragen an dem Tag schon
Auf wie vielen Servern usw

Und Überlegung Bans serverweit oder global?

Wolfram Alpha Support

Add support for Wolfram Alpha either with just sending a link to the answer of a question or embed, depending on the lenght of the answer

Auto response for VT-x questions on Morpheus' server

Is your feature request related to a problem? Please describe.
Es geht bestimmt vielen Leuten auf den Sack, dass immer wieder Fragen über die Installation von Kali fragen, vor allem weil das eigentlich immer die selbe Frage ist.

Describe the solution you'd like
Der Bot soll in jeder neuen Nachricht, welche in #hacking gefragt/gesagt wird, nach den Wörtern
"VT-x"/"Virtualisierung" + "Virtualbox" oder "Installation" + "Kali" oder sowas ähnliches suchen.
Beinhaltet eine Nachricht diese Wörter, so wird automatisch eine die Antwort geschickt.

Describe alternatives you've considered
Der Bot könnte als Alternative immer den gidf Link als Antwort schicken. (ist eventuell ein bisschen Provozierend, aber egal xD)

Additional context
I use Arch btw.

0 Ergebnisse gefunden autor

Auch wenn keine Ergebnisse gefunden werden, sollte in der Nachricht erklärt sein, wer dannach gesucht hat.

Footer mit Versionsinfo

Describe the solution you'd like
Im Footer von den Ergebnissen die aktuelle Version des Bots anzeigen, z.B. so:
Bot by AdriBloober Version 1.2

Left part cuted

Describe the bug
The left part of the search query is partially cut off.
To Reproduce
Steps to reproduce the behavior:

  1. type "enable VT-x"
  2. react with google emoji
  3. Look to search query

Environment
Self hosted? - no

settings in db übertragen und setup/config einführen

Jeder Server muss eine eigene Config in der DB besitzen in der folgendes gespeichert wird:

  • guild_id
  • prefix
  • admin_roles
  • denied users

Diese können von den Admins der Server geändert werden.
Jeder mit administrator permission ist auch ohne Eintrag in admin_roles Administrator.

In an imgfy search the text is cut off

Describe the bug
In an imgfy search the text is cut off

To Reproduce
Steps to reproduce the behavior:
§lmgtfy Open a File in Java

Expected behavior
A clear and concise description of what you expected to happen.
Bot generates URL for just open
https://lmgtfy.com/?q=Open
DeepinBildschirmfoto_Bereich auswählen_20200507235405

Screenshots
If applicable, add screenshots to help explain your problem.

Environment
Not self hostet
Additional context
No additional context

Command not found abfangen

Is your feature request related to a problem? Please describe.
<class 'discord.ext.commands.errors.CommandInvokeError'> versteht man nicht

Describe the solution you'd like
<class 'discord.ext.commands.errors.CommandInvokeError'> abfangen, und durch sinnigere Fehlermeldung ersetzen, ev. mit dem eingegebenen Command als Zusatzinfo

README bzgl Logs anpassen

Es sind 2 neue ENV Variablen durch den Log hinzugekommen, die in der README.md nicht aufgeführt sind!

Delete function

I would like to have a function to delete the bot search answer. So if the person who requested the search reacts with e.g. :no_entry_sign: the answer of the bot will be deleted to avoid spam and to make the channel a bit more orderly, e.g. if the result doesn't fit, you can simply delete it.

Edit: I think :wastebasket: 🗑️ is a better icon.

Status des Botes soll Serveranzahl anzeigen

Im Status des Botes soll die Anzahl an Servern stehen, auf dem der Bot aktiv ist.

Sobald er auf einem neuen Server joint, soll eine Log Benachrichtigung ausgegebene werden

Global ban

AdriBloober und TNT können global banen
-> Sie sind auf jedem Server gebant und können nur durch AdriBloober und TNT wieder entsperrt werden

LET ME GOOGLE THAT FOR YOU IS BROKEN

Trying to use let me google that for you is broken and only searches the first word

To Reproduce
§lmgtfy Open a File in JAva

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
grafik

:x: reaction

Wenn ein Administrator auf die Nachricht des Botes (reaction & command) mit ❌ reagiert, soll der Author gebant werden und die Nachricht des Botes durch die Nachricht "❌ Dieser Inhalt wurde entfernt ❌" ersetzt werden.

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.