Skip to content

Latest commit

 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dispander (Discord Message URL Expander)

DiscordのメッセージURLを検知して展開する機能を追加する discord.py Bot拡張用ライブラリ

使い方

python3 -m pip install dispander

extensionとして使用する場合

load_extensionで読み込んでください

from discord.ext import commands

bot = commands.Bot(command_prefix='/')
bot.load_extension('dispander')
bot.run(token)

関数として使用する場合

on_message内のどこかで実行してください。

展開したメッセージを消去する機能を使用するにはon_reaction_addイベントもしくはon_raw_reaction_addイベントのどちらかでdelete_dispand関数を実行してください。 on_raw_reaction_addの場合はキーワード引数payloadにRawReactionActionEventを、on_reaction_addの場合はキーワード引数userにUser、reactionにReactionを指定して下さい。

消去の際のリアクションを変更したい場合は環境変数DELETE_REACTION_EMOJIに絵文字を設定してください。

import discord
from dispander import dispand, delete_dispand

client = discord.Client()

@client.event
async def on_message(message):
    if message.author.bot:
        return
    await dispand(message)


@client.event
async def on_raw_reaction_add(payload):
    await delete_dispand(client, payload=payload)


client.run(token)

About

Discord メッセージ URL 展開用 discord.py 拡張ライブラリ

Topics

Resources

Stars

28 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages