File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 3939 Thread ,
4040 VoiceChannel ,
4141)
42+ from ..commands import ApplicationContext
4243from ..enums import ChannelType
4344from ..enums import Enum as DiscordEnum
4445from ..enums import SlashCommandOptionType
4546from ..utils import MISSING , basic_autocomplete
4647
4748if TYPE_CHECKING :
48- from ..commands import ApplicationContext
4949 from ..ext .commands import Converter
5050 from ..member import Member
5151 from ..message import Attachment
Original file line number Diff line number Diff line change 1+ import logging
2+ import os
3+
4+ from dotenv import load_dotenv
5+
6+ import discord
7+ from discord .ext import bridge
8+
9+ logging .basicConfig (level = logging .INFO )
10+
11+ load_dotenv ()
12+ TOKEN = os .getenv ("TOKEN" )
13+
14+ bot = bridge .Bot (intents = discord .Intents .all ())
15+
16+
17+ @bot .event
18+ async def on_ready ():
19+ print (f"We have logged in as { bot .user } " )
20+
21+
22+ class MyCog (discord .Cog ):
23+ @bridge .bridge_command (name = "test" , description = "Hello World" )
24+ async def test_cmd (
25+ self , ctx : bridge .BridgeExtContext | bridge .BridgeApplicationContext , param : str
26+ ):
27+ await ctx .respond ("Hello" )
28+
29+
30+ bot .add_cog (MyCog ())
31+ bot .run (TOKEN )
You can’t perform that action at this time.
0 commit comments