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 39
39
Thread ,
40
40
VoiceChannel ,
41
41
)
42
+ from ..commands import ApplicationContext
42
43
from ..enums import ChannelType
43
44
from ..enums import Enum as DiscordEnum
44
45
from ..enums import SlashCommandOptionType
45
46
from ..utils import MISSING , basic_autocomplete
46
47
47
48
if TYPE_CHECKING :
48
- from ..commands import ApplicationContext
49
49
from ..ext .commands import Converter
50
50
from ..member import Member
51
51
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