Skip to content

Discord Bot Wrapper based on python (simpler)

Notifications You must be signed in to change notification settings

iFanpSGTS/DBW-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot api wrapper

This discord bot api wrapper is make using python

Module is used in this program

  • Module:
    • aiohttp
    • python-dateutil

Information

This discord bot api wrapper i make only can send msg, reply msg,edit msg,del msg but if u want to remake this can do what you want? you can!

Activate Intents

> Activate you're intents on discord developer portal like this image

Intents Activate

Quick Example

> Make a folder then put all this file's on your folder then import it as a module
import Your-folder-name
from your-folder-name import Intents

session = your-folder-name.Session({
    # You can take the discord bot token from here https://discord.com/developers/applications
    "TOKEN": "your token. Ex: 01282xidasdm-91mcoamp",
    "INTENTS": Intents.ALL # You can see the intent here base_dbw/intents.py. Check all the privileged gateaways here if the bot don't on or get intents error : https://discord.com/developers/applications/BotID/bot
})

async def on_ready():
    print(f"Bot Online: {session.client.username}")
    
async def on_message_start(msg):
    if msg.author.id == session.client.id:
        return
    if msg.content.startswith("!hi"):
        await msg.reply({"content":"!hi"})
        
#Setup event for on_message_start & on_ready & for start the session websocket
session.event("READY", on_ready) # "READY is event_name" "fn is you're function name "on_ready""
session.event("MESSAGE_CREATE", on_message_start)
session.start()

Reference

Credit

  • iFanpS

Releases

No releases published

Packages

No packages published

Languages