Giter Site home page Giter Site logo

simple-pyirc's Introduction

Simple IRC Client

This repository contains the source code for a simple IRC client implemented in Python using the urwid library for the user interface. It's designed to connect to an IRC server, join channels, send messages, and handle real-time updates.

Features

  • Connect to an IRC server
  • Register with a nickname
  • Join and leave channels
  • Send and receive messages
  • Handle private messages
  • Dynamically update user lists for channels
  • Customizable through command line arguments

Project Structure

  • irc_client.py: Contains the core IRC client logic.
  • main.py: The entry point of the application, handling user interface setup and main event loop.
  • Makefile: Provides commands to start the client and run tests.
  • requirements.txt: Lists dependencies for the project.

Installation

Before running the IRC client, you must install the necessary dependencies. This project uses urwid for the GUI elements, and pytest for running tests.

pip install -r requirements.txt

Running with make

To start the IRC client, use the following make command:

make start-client

This command will prompt you to enter the necessary details such as server host, port, userinfo, nickname, and default channel through command line arguments.

Running from Python

The application accepts several command line arguments to configure the IRC client:

  • --host: IRC server hostname
  • --port: IRC server port
  • --userinfo: User info for IRC registration
  • --nickname: Nickname for the IRC session
  • --default-channel: Default channel to join

Example:

python irc_app.py --host irc.example.com --port 6667 --userinfo "Python IRC Client" --nickname mynickname --default-channel #general

IRC Commands

Once connected, you can interact with the IRC server and other users through various commands typed into the client:

  • /join [channel]: Joins the specified channel if it exists. Example: /join #help
  • /switch [channel]: Switches your current view to another channel you have joined. Example: /switch #general
  • /whisp [username] [message]: Sends a private message to the specified user. Example: /whisp John Hello, John!

These commands are input directly into the client's message field and processed upon pressing 'enter'. Errors or feedback are displayed within the chat interface.

Testing

To run the unit tests for the IRC client, execute:

make test

This will run tests defined in the tests/ directory using pytest.

Logging

Logs for the application are written to irc.log in the root directory, providing detailed output of operations and any errors encountered.

simple-pyirc's People

Contributors

soulofset avatar wulfts avatar

Watchers

 avatar

simple-pyirc's Issues

Handle User Registration and Nickname Management

Task Description:

  • Implement user registration process including nickname and user info setup.
  • Handle nickname collisions or errors gracefully.

Acceptance Criteria:

  • User can register with a nickname and user info.
  • Appropriate error handling for nickname collisions or registration errors.

Implement Messaging Capabilities

Task Description:

  • Enable users to send and receive channel messages.
  • Allow users to send private messages to other users.

Acceptance Criteria:

  • Functional channel messaging.
  • Ability to send and receive private messages.

Enhance Error Handling and User Feedback

Task Description:

  • Implement comprehensive error handling across the client.
  • Provide informative feedback for user actions.
  • Implement logging for debugging and error tracking purposes.

Acceptance Criteria:

  • User actions that result in errors are gracefully handled and reported.
  • Logs are generated for actions, especially those that result in errors.

Enable Users to Join and Leave Channels

Task Description:

  • Allow users to join and leave IRC channels.
  • Facilitate user participation in group chats within channels.

Acceptance Criteria:

  • Users can join and leave channels as desired.
  • Users can participate in channel conversations.

Establish and Disconnect from IRC Server

Task Description:

  • Implement socket connection to IRC server.
  • Ensure the client can successfully connect to and disconnect from the server.

Acceptance Criteria:

  • Successful connection to an IRC server.
  • Clean disconnection process without leaving hanging sessions.

Develop CLI Interface for Client Interaction

Task Description:

  • Create a simple command-line interface (CLI) for interacting with the IRC client.
  • Ensure usability and accessibility of the CLI.

Acceptance Criteria:

  • A working CLI that allows for easy interaction with the IRC client.
  • Commands for all basic functionalities are implemented and documented.

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.