Giter Site home page Giter Site logo

palm-discord_bot's Introduction

PaLM-Discord-Bot

Google PaLM API in Discord.

Notice

Discord only can handle 2000 characters per message, so I manually set the PaLM can only outputting no more than 145 tokens. If your channel can handle 4000 or even more, make the output_token_limit= 145 in main.py value doubled or more.

Example:

Casual Chatting:
Casual Chatting

Coding:
Coding

Command

/palm to chat with PaLM.

Installation

Get your Discord API

  1. Go Discord Dev
  2. Go Application on the left part
  3. Go New Application, create a new Bot
  4. Go Bot on the left
  5. Click Add bot
  6. Turn on MESSAGE CONTENT INTENT
  7. Save Change
  8. View and save your API Key on the top of page View Token, or reset one if you don't remember
  9. Click OAuth2 on the left part
  10. Click on URL Generator
  11. Choose bot in SCOPES, Administrator in BOT PERMISSIONS
  12. Copy the link at bottom into your browser, add bot and authorize to you server.

Get your PaLM API

Go to MakerSuite, and create an API key for this application.

Deploy on your machine

  1. git clone this repository
  2. pip install discord google-generativeai
  3. cd PaLM-Discord-Bot
  4. notepad main.py
  5. replace with your Discord API Key and PaLM API Key at following lines:
    palm.configure(api_key = "PaLM_API_KEY")
    client.run("DISCORD_TOKEN")
  6. python main.py

Reference:

https://discordpy.readthedocs.io/en/stable/#getting-started

https://developers.generativeai.google/api/python/google/generativeai

palm-discord_bot's People

Contributors

mohamedosama12345 avatar

Watchers

 avatar

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.