class SocialGraph:
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 |
Adds a message to the channel queue :param message: the message :return: None |
Method | add |
Adds a user to the social graph :param userId: the user to add :return: None |
Method | edge |
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 |
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 |
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 |
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 |
Exports the social graph to a PNG file :return: None |
Method | export |
Exports the social graph of the server to a PNG file :param user: the user :return: None |
Method | export |
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 |
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 |
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 |
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 |
Gets the social graph :return: the social graph |
Method | get |
Gets the number of messages :return: the number of messages |
Method | get |
Gets the number of people in the social graph :return: the number of people in the social graph |
Method | get |
Return the sentiment of the user :param userId: the user id :return: the sentiment of the user |
Method | get |
Gets the importance of a user :param user: the user :return: the importance of the user |
Async Method | on |
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 |
Triggered when a user wants to know the socialgraph :param message: the message :param bot: the bot :return: None |
Async Method | on |
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 |
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 |
Triggered when a user wants to know the sentiment of a message :param message: the message :param bot: the bot :return: None |
Method | on |
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 |
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 |
Removes a user from the social graph :param userId: the user to remove :return: None |
Method | set |
Sets the number of messages :param nbMessage: the number of messages :return: None |
Method | to |
Returns the json of the social graph :return: the json of the social graph |
Method | update |
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 |
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 |
Return the colours of the vertices :param users: the users :return: the colours of the vertices |
Method | vertex |
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 |
Return the sizes of the vertices :param users: the users :return: the sizes of the vertices |
Instance Variable | agreement |
Undocumented |
Instance Variable | channel |
Undocumented |
Instance Variable | guild |
Undocumented |
Instance Variable | importance |
Undocumented |
Instance Variable | importance |
Undocumented |
Instance Variable | importance |
Undocumented |
Instance Variable | interactions |
Undocumented |
Instance Variable | nb |
Undocumented |
Instance Variable | nb |
Undocumented |
Instance Variable | tagged |
Undocumented |
Instance Variable | tag |
Undocumented |
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 | |
nbint | Undocumented |
nbint | Undocumented |
tagfloat | Undocumented |
importancedict[ | Undocumented |
agreementdict | Undocumented |
taggeddict[ | Undocumented |
guild | Undocumented |
nbdict[ | Undocumented |
importancefloat | Undocumented |
importancefloat | Undocumented |
interactions:dict[ | Undocumented |
Adds a message to the channel queue :param message: the message :return: None
Parameters | |
message:discord.Message | Undocumented |
Adds a user to the social graph :param userId: the user to add :return: None
Parameters | |
userint | Undocumented |
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 | |
str | Undocumented |
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 | |
float | Undocumented |
Evaluate the agreement of the message :param message_content: the content of message :return: 1 if positive, -1 if negative, 0 if neutral
Returns | |
int | Undocumented |
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 | |
authorint | Undocumented |
memberint | Undocumented |
taggeddict[ | Undocumented |
Returns | |
float | Undocumented |
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
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.Message | Undocumented |
Returns | |
dict | Undocumented |
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.Message | Undocumented |
replied | Undocumented |
Returns | |
dict | Undocumented |
Return the agreement between two users :param userId1: the first user :param userId2: the second user :return: the agreement between the two users
Parameters | |
userint | Undocumented |
userint | Undocumented |
Returns | |
float | Undocumented |
Gets the number of people in the social graph :return: the number of people in the social graph
Returns | |
int | Undocumented |
Gets the importance of a user :param user: the user :return: the importance of the user
Parameters | |
user:discord.Member | Undocumented |
Returns | |
float | Undocumented |
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
Triggered when a user wants to know the socialgraph :param message: the message :param bot: the bot :return: None
Parameters | |
message:discord.Message | Undocumented |
bot | Undocumented |
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.Message | Undocumented |
user | Undocumented |
bot | Undocumented |
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.Message | Undocumented |
user | Undocumented |
distance | Undocumented |
bot | Undocumented |
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.Message | Undocumented |
user | Undocumented |
bot | Undocumented |
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.Message | Undocumented |
replied | Undocumented |
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 | |
dict | Undocumented |
Removes a user from the social graph :param userId: the user to remove :return: None
Parameters | |
userint | Undocumented |
Sets the number of messages :param nbMessage: the number of messages :return: None
Parameters | |
nbint | Undocumented |
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 | |
message | Undocumented |
taggeddict[ | Undocumented |
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 | |
authorint | Undocumented |
taggeddict[ | Undocumented |
Return the colours of the vertices :param users: the users :return: the colours of the vertices
Returns | |
list | Undocumented |
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 | |
float | Undocumented |