first switch to nextcord
This commit is contained in:
@@ -3,11 +3,13 @@ FROM python:latest
|
||||
RUN python -m pip install --upgrade pip
|
||||
|
||||
RUN pip install pandas
|
||||
RUN pip install discord.py
|
||||
# RUN pip install discord.py
|
||||
RUN pip install nltk
|
||||
RUN python -m nltk.downloader -d /usr/local/share/nltk_data all
|
||||
RUN pip install python-dotenv
|
||||
|
||||
RUN pip install nextcord
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./ ./
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
|
||||
import discord
|
||||
import nextcord as discord
|
||||
|
||||
|
||||
class Joke:
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import re
|
||||
|
||||
import discord
|
||||
# import stockquotes
|
||||
import nextcord as discord
|
||||
|
||||
from . import base, helpers
|
||||
|
||||
|
||||
# import stockquotes
|
||||
|
||||
|
||||
# TODO implement new jokes
|
||||
# - j'accuse
|
||||
# - egos
|
||||
|
||||
@@ -2,11 +2,10 @@ import logging
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import discord
|
||||
import nextcord as discord
|
||||
import pandas as pd
|
||||
from discord import RawReactionActionEvent
|
||||
|
||||
from . import data, jokes
|
||||
from . import jokes
|
||||
|
||||
LIL_STINKY_ID = 704043422276780072
|
||||
|
||||
@@ -69,7 +68,7 @@ class Kwaylon(discord.Client):
|
||||
LOGGER.info(f'{joke.__class__.__name__} detected: {message.content}, {m.group()}')
|
||||
await joke.respond(message, self, m)
|
||||
|
||||
async def handle_raw_reaction(self, payload: RawReactionActionEvent):
|
||||
async def handle_raw_reaction(self, payload: discord.RawReactionActionEvent):
|
||||
LOGGER.info(payload)
|
||||
guild = await self.fetch_guild(payload.guild_id)
|
||||
channel = await guild.fetch_channel(payload.channel_id)
|
||||
|
||||
4
main.py
4
main.py
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from discord import Message, RawReactionActionEvent
|
||||
import nextcord as discord
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from kwaylon import Kwaylon
|
||||
@@ -23,7 +23,7 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_message(message: Message):
|
||||
async def on_message(message: discord.Message):
|
||||
await client.handle_message(message)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
pandas
|
||||
discord.py
|
||||
# nextcord
|
||||
# discord.py
|
||||
nextcord
|
||||
nltk
|
||||
python-dotenv
|
||||
|
||||
|
||||
Reference in New Issue
Block a user