Giter Site home page Giter Site logo

Comments (3)

StefanoCastro avatar StefanoCastro commented on May 30, 2024

Oke I think I fixed it (or on my way to fix it)
Changed the platform to alpine and changed to apt-get commands to the proper apk / apk add commands needs for alpine.
Added RUN apk add py-pip and changed Google Chrome to Chromium

FROM --platform=linux/arm64 alpine

RUN apk update
RUN apk add wget
RUN apk add py-pip

# Install chrome
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apk add chromium

COPY ./bot .

# Install python packages
RUN pip install bs4
RUN pip install selenium
RUN pip install discord
RUN pip install pyyaml
RUN pip install webdriver-manager

USER root

# Run bot
CMD python discord_bot.py

from loot-bot.

StefanoCastro avatar StefanoCastro commented on May 30, 2024

Mmm, the bot runs, but it seems changing to chromium didn't do any good
Trying the !twitch commands throws some errors now:
( the command !epic works fine)

Loading prime gaming data
[WDM] - Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.96M/6.96M [00:00<00:00, 89.0MB/s]
2023-01-27 13:25:46 ERROR    discord.client Ignoring exception in on_message
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "//discord_bot.py", line 25, in on_message
    await get_twitch_data.handle_cmd(message=message, games=ALLOWED_GAMES, message_type=MSG_TYPE_TWITCH,
  File "/bot_modules/get_twitch_data.py", line 255, in handle_cmd
    data_json = fetch_data()
  File "/bot_modules/get_twitch_data.py", line 109, in fetch_data
    soup = get_html_data()
  File "/bot_modules/get_twitch_data.py", line 25, in get_html_data
    driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=options)
  File "/usr/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 80, in __init__
    super().__init__(
  File "/usr/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 101, in __init__
    self.service.start()
  File "/usr/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 88, in start
    self._start_process(self.path)
  File "/usr/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 195, in _start_process
    self.process = subprocess.Popen(
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/root/.wdm/drivers/chromedriver/linux64/109.0.5414/chromedriver'


from loot-bot.

riggerbh avatar riggerbh commented on May 30, 2024

The file "discord_bot.py" in the Folder "Loot-Bot-Main/bot"

I changed this (start line 55 at the bottom):

client = TwitchLootBot()
client.run(TOKEN)

To this:

intents = discord.Intents.default()
intents.message_content = True

client = TwitchLootBot(intents=intents)

client.run(TOKEN)

It's running for me. I had to set the Privileged Gateway Intents to "ON" in the Discord applications for the bot before I ran this.

from loot-bot.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.