class documentation

class SocialGraph:

View In Hierarchy

This class represents a social graph :nbPeople: the number of people in the social graph :nbMessage: the number of messages :tagMinValue: the minimum value of a tag :importanceDict: the importance dict :agreementDict: the agreement dict :taggedDict: the tagged dict :guildData: the guild data :nbMessage_at_time: the number of messages at time :importanceMaxValue: the maximum importance value :importanceInitValue: the initial importance value :interactions: the interactions

Method __init__ Constructor :param nbPeople: the number of people in the social graph :param nbMessage: the number of messages :param tagMinValue: the minimum value of a tag :param importanceDict: the importance dict :param agreementDict: the agreement dict :param taggedDict: the tagged dict :param guildData: the guild data :param nbMessage_at_time: the number of messages at time :param importanceMaxValue: the maximum importance value :param importanceInitValue: the initial importance value :param interactions: the interactions...
Method add_message_channel_queue Adds a message to the channel queue :param message: the message :return: None
Method add_user Adds a user to the social graph :param userId: the user to add :return: None
Method edge_colour Return the colour of the edge between user1 and user2 :param user1: the first user :param user2: the second user :return: the colour of the edge
Method edge_width Return the width of the edge between two users :param key: the first user :param member: the second user :return: the width of the edge
Method evaluate_agreement Evaluate the agreement of the message :param message_content: the content of message :return: 1 if positive, -1 if negative, 0 if neutral
Method evaluate_importance Evaluates the importance of a member :param authorId: the id of the author of the message :param memberId: the id of the member we want to evaluate the importance :param taggedMemberValues: a dict with the id of the members as keys and the value 1 as values :return: the importance of the member...
Method export_graph Exports the social graph to a PNG file :return: None
Method export_user_graph_all Exports the social graph of the server to a PNG file :param user: the user :return: None
Method export_user_graph_distance Export the graph of the user and the people he talked to in a file :param user: the user :param distance: the distance in the graph :return: None
Method fetch_probable_chatting_buddy Fetches the probable chatting buddy of the author of the message :param message: the message :return: a dict with the id of the probable chatting buddy as key and the probability as value
Method fetch_tagged_members Fetches the tagged members of the message :param message: the message :param repliedMessage: the replied message :return: a dict with the id of the tagged members as key and the value 1 as value
Method get_agreement Return the agreement between two users :param userId1: the first user :param userId2: the second user :return: the agreement between the two users
Method get_graph Gets the social graph :return: the social graph
Method get_nb_message Gets the number of messages :return: the number of messages
Method get_nb_people Gets the number of people in the social graph :return: the number of people in the social graph
Method get_sentiment Return the sentiment of the user :param userId: the user id :return: the sentiment of the user
Method get_user_importance Gets the importance of a user :param user: the user :return: the importance of the user
Async Method on_command_importance Triggered when a user wants to know the importance of another user :param message: the message :param user: the user :param bot: the bot :return: None
Async Method on_command_printall Triggered when a user wants to know the socialgraph :param message: the message :param bot: the bot :return: None
Async Method on_command_printuser_all Triggered when a user wants to know the socialgraph of a user :param message: the message :param user: the user :param bot: the bot :return: None
Async Method on_command_printuser_distance Triggered when a user wants to know the socialgraph of a user, up to a certain distance :param message: the message :param user: the user :param distance: the distance :param bot: the bot :return: None...
Async Method on_command_sentiment Triggered when a user wants to know the sentiment of a message :param message: the message :param bot: the bot :return: None
Method on_message On every new message, we determine who the author is talking to and update (the people they talk to) importance's :param message: the message :param repliedMessage: the message replied to :return: None...
Method power_law Computes the probability of a user to be the author of the next message :param message: the message :param channelQueue: the queue of the channel :return: a dict with the id of the user as key and the probability as value...
Method purge Purges the social graph :return: None
Method remove_user Removes a user from the social graph :param userId: the user to remove :return: None
Method set_nb_message Sets the number of messages :param nbMessage: the number of messages :return: None
Method to_json Returns the json of the social graph :return: the json of the social graph
Method update_agreement Update the agreement of the people the author talked to :param message: the message :param taggedMembersValues: the dict of the tagged members :return: None
Method update_importance Updates the importance of the members in the taggedMembersValues dict :param authorId: the id of the author of the message :param taggedMembersValues: a dict with the id of the members as keys and the value 1 as values :return: None...
Method vertex_colour Return the colours of the vertices :param users: the users :return: the colours of the vertices
Method vertex_size_user Return the size of the vertex for a user :param importanceValue: the importance of the user :return: the size of the vertex for a user
Method vertex_sizes Return the sizes of the vertices :param users: the users :return: the sizes of the vertices
Instance Variable agreementDict Undocumented
Instance Variable channelQueueDict Undocumented
Instance Variable guildData Undocumented
Instance Variable importanceDict Undocumented
Instance Variable importanceInitValue Undocumented
Instance Variable importanceMaxValue Undocumented
Instance Variable interactions Undocumented
Instance Variable nbMessage Undocumented
Instance Variable nbMessage_at_time Undocumented
Instance Variable taggedDict Undocumented
Instance Variable tagMinValue Undocumented
def __init__(self, nbPeople, nbMessage, tagMinValue, importanceDict, agreementDict, taggedDict, guildData, nbMessage_at_time, importanceMaxValue, importanceInitValue, interactions):

Constructor :param nbPeople: the number of people in the social graph :param nbMessage: the number of messages :param tagMinValue: the minimum value of a tag :param importanceDict: the importance dict :param agreementDict: the agreement dict :param taggedDict: the tagged dict :param guildData: the guild data :param nbMessage_at_time: the number of messages at time :param importanceMaxValue: the maximum importance value :param importanceInitValue: the initial importance value :param interactions: the interactions

Parameters
nbPeople:intUndocumented
nbMessage:intUndocumented
tagMinValue:floatUndocumented
importanceDict:dict[int, float]Undocumented
agreementDict:dictUndocumented
taggedDict:dict[int, list[float]]Undocumented
guildDataUndocumented
nbMessage_at_time:dict[int, int]Undocumented
importanceMaxValue:floatUndocumented
importanceInitValue:floatUndocumented
interactions:dict[int, dict[int, int]]Undocumented
@printExceptions
def add_message_channel_queue(self, message):

Adds a message to the channel queue :param message: the message :return: None

Parameters
message:discord.MessageUndocumented
@printExceptions
def add_user(self, userId):

Adds a user to the social graph :param userId: the user to add :return: None

Parameters
userId:intUndocumented
@printExceptions
def edge_colour(self, user1, user2):

Return the colour of the edge between user1 and user2 :param user1: the first user :param user2: the second user :return: the colour of the edge

Returns
strUndocumented
@printExceptions
def edge_width(self, key, member):

Return the width of the edge between two users :param key: the first user :param member: the second user :return: the width of the edge

Returns
floatUndocumented
@printExceptions
def evaluate_agreement(self, message_content):

Evaluate the agreement of the message :param message_content: the content of message :return: 1 if positive, -1 if negative, 0 if neutral

Returns
intUndocumented
@printExceptions
def evaluate_importance(self, authorId, memberId, taggedMemberValues):

Evaluates the importance of a member :param authorId: the id of the author of the message :param memberId: the id of the member we want to evaluate the importance :param taggedMemberValues: a dict with the id of the members as keys and the value 1 as values :return: the importance of the member

Parameters
authorId:intUndocumented
memberId:intUndocumented
taggedMemberValues:dict[int, float]Undocumented
Returns
floatUndocumented
@printExceptions
def export_graph(self):

Exports the social graph to a PNG file :return: None

@printExceptions
def export_user_graph_all(self, user):

Exports the social graph of the server to a PNG file :param user: the user :return: None

@printExceptions
def export_user_graph_distance(self, user, distance):

Export the graph of the user and the people he talked to in a file :param user: the user :param distance: the distance in the graph :return: None

@printExceptions
def fetch_probable_chatting_buddy(self, message):

Fetches the probable chatting buddy of the author of the message :param message: the message :return: a dict with the id of the probable chatting buddy as key and the probability as value

Parameters
message:discord.MessageUndocumented
Returns
dictUndocumented
@printExceptions
def fetch_tagged_members(self, message, repliedMessage):

Fetches the tagged members of the message :param message: the message :param repliedMessage: the replied message :return: a dict with the id of the tagged members as key and the value 1 as value

Parameters
message:discord.MessageUndocumented
repliedMessageUndocumented
Returns
dictUndocumented
@printExceptions
def get_agreement(self, userId1, userId2):

Return the agreement between two users :param userId1: the first user :param userId2: the second user :return: the agreement between the two users

Parameters
userId1:intUndocumented
userId2:intUndocumented
Returns
floatUndocumented
@printExceptions
def get_graph(self):

Gets the social graph :return: the social graph

@printExceptions
def get_nb_message(self):

Gets the number of messages :return: the number of messages

Returns
intUndocumented
@printExceptions
def get_nb_people(self):

Gets the number of people in the social graph :return: the number of people in the social graph

Returns
intUndocumented
@printExceptions
def get_sentiment(self, userId):

Return the sentiment of the user :param userId: the user id :return: the sentiment of the user

@printExceptions
def get_user_importance(self, user):

Gets the importance of a user :param user: the user :return: the importance of the user

Parameters
user:discord.MemberUndocumented
Returns
floatUndocumented
async def on_command_importance(self, message, user, bot):

Triggered when a user wants to know the importance of another user :param message: the message :param user: the user :param bot: the bot :return: None

@printExceptions
async def on_command_printall(self, message, bot):

Triggered when a user wants to know the socialgraph :param message: the message :param bot: the bot :return: None

Parameters
message:discord.MessageUndocumented
botUndocumented
@printExceptions
async def on_command_printuser_all(self, message, user, bot):

Triggered when a user wants to know the socialgraph of a user :param message: the message :param user: the user :param bot: the bot :return: None

Parameters
message:discord.MessageUndocumented
userUndocumented
botUndocumented
async def on_command_printuser_distance(self, message, user, distance, bot):

Triggered when a user wants to know the socialgraph of a user, up to a certain distance :param message: the message :param user: the user :param distance: the distance :param bot: the bot :return: None

Parameters
message:discord.MessageUndocumented
userUndocumented
distanceUndocumented
botUndocumented
async def on_command_sentiment(self, message, user, bot):

Triggered when a user wants to know the sentiment of a message :param message: the message :param bot: the bot :return: None

Parameters
message:discord.MessageUndocumented
userUndocumented
botUndocumented
def on_message(self, message, repliedMessage):

On every new message, we determine who the author is talking to and update (the people they talk to) importance's :param message: the message :param repliedMessage: the message replied to :return: None

Parameters
message:discord.MessageUndocumented
repliedMessageUndocumented
@printExceptions
def power_law(self, message, channelQueue):

Computes the probability of a user to be the author of the next message :param message: the message :param channelQueue: the queue of the channel :return: a dict with the id of the user as key and the probability as value

Returns
dictUndocumented
def purge(self):

Purges the social graph :return: None

@printExceptions
def remove_user(self, userId):

Removes a user from the social graph :param userId: the user to remove :return: None

Parameters
userId:intUndocumented
@printExceptions
def set_nb_message(self, nbMessage):

Sets the number of messages :param nbMessage: the number of messages :return: None

Parameters
nbMessage:intUndocumented
def to_json(self):

Returns the json of the social graph :return: the json of the social graph

Returns
dictUndocumented
@printExceptions
def update_agreement(self, message, taggedMembersValues):

Update the agreement of the people the author talked to :param message: the message :param taggedMembersValues: the dict of the tagged members :return: None

Parameters
messageUndocumented
taggedMembersValues:dict[int, float]Undocumented
@printExceptions
def update_importance(self, authorId, taggedMembersValues):

Updates the importance of the members in the taggedMembersValues dict :param authorId: the id of the author of the message :param taggedMembersValues: a dict with the id of the members as keys and the value 1 as values :return: None

Parameters
authorId:intUndocumented
taggedMembersValues:dict[int, float]Undocumented
@printExceptions
def vertex_colour(self, users):

Return the colours of the vertices :param users: the users :return: the colours of the vertices

Returns
listUndocumented
@printExceptions
def vertex_size_user(self, importanceValue):

Return the size of the vertex for a user :param importanceValue: the importance of the user :return: the size of the vertex for a user

Returns
floatUndocumented
@printExceptions
def vertex_sizes(self, users):

Return the sizes of the vertices :param users: the users :return: the sizes of the vertices

agreementDict =

Undocumented

channelQueueDict =

Undocumented

guildData =

Undocumented

importanceDict =

Undocumented

importanceInitValue =

Undocumented

importanceMaxValue =

Undocumented

interactions =

Undocumented

nbMessage =

Undocumented

nbMessage_at_time =

Undocumented

taggedDict =

Undocumented

tagMinValue =

Undocumented